public class AlfrescoVersionsServiceHandler extends Object implements VersionsServiceHandler
Modifier and Type | Field and Description |
---|---|
protected FileFolderService |
fileFolderService |
protected static org.apache.commons.logging.Log |
logger |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService |
protected VtiPathHelper |
pathHelper |
protected TransactionService |
transactionService |
protected VersionService |
versionService |
Constructor and Description |
---|
AlfrescoVersionsServiceHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertDocument(FileInfo documentFileInfo)
Asserts file info for existent document
|
List<DocumentVersionBean> |
deleteAllVersions(String fileName)
Do a "SharePoint Delete All Versions", which isn't the same
as a normal Alfresco delete version history
|
List<DocumentVersionBean> |
deleteVersion(String fileName,
String fileVersion)
Deletes the specified file version
|
protected DocumentVersionBean |
getDocumentVersionInfo(FileInfo documentFileInfo)
Get document version bean for document without version history
|
protected DocumentVersionBean |
getDocumentVersionInfo(Version version,
String id)
Get document version bean by version
|
protected List<DocumentVersionBean> |
getVersions(FileInfo documentFileInfo)
Returns DocumentVersionBean list for file info
|
List<DocumentVersionBean> |
getVersions(String fileName)
Returns information about the versions of the specified file
|
boolean |
isVersionable(String fileName)
Is the specified file name a versioned file?
|
String |
makeCurrentVersionURL(String host,
String context,
String dws,
String fileName) |
String |
makeDocumentDetailsURL(String host,
String context,
String dws,
String fileName) |
String |
makeVersionURL(String host,
String context,
String dws,
DocumentVersionBean version) |
List<DocumentVersionBean> |
restoreVersion(String fileName,
String fileVersion)
Restores the specified file version
|
void |
setFileFolderService(FileFolderService fileFolderService)
Set file folder service
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set node service
|
void |
setPathHelper(VtiPathHelper pathHelper)
Set path helper
|
void |
setTransactionService(TransactionService transactionService)
Set transaction service
|
void |
setVersionService(VersionService versionService)
Set version service
|
protected static org.apache.commons.logging.Log logger
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected FileFolderService fileFolderService
protected VersionService versionService
protected TransactionService transactionService
protected VtiPathHelper pathHelper
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the node service to set (NodeService
)public void setFileFolderService(FileFolderService fileFolderService)
fileFolderService
- the file-folder service to set (FileFolderService
)public void setVersionService(VersionService versionService)
versionService
- the version service to set (VersionService
)public void setTransactionService(TransactionService transactionService)
transactionService
- the transaction service to set (TransactionService
)public void setPathHelper(VtiPathHelper pathHelper)
pathHelper
- the path helper to set (VtiPathHelper
)public List<DocumentVersionBean> getVersions(String fileName) throws FileNotFoundException
VersionsServiceHandler
getVersions
in interface VersionsServiceHandler
fileName
- A string that contains the site-relative URL of the file in the form Folder_Name/File_NameFileNotFoundException
VersionsServiceHandler.getVersions(java.lang.String)
public List<DocumentVersionBean> restoreVersion(String fileName, String fileVersion)
VersionsServiceHandler
restoreVersion
in interface VersionsServiceHandler
fileName
- site relative url to the filefileVersion
- file version to restoreVersionsServiceHandler.restoreVersion(java.lang.String, java.lang.String)
public List<DocumentVersionBean> deleteVersion(String fileName, String fileVersion) throws FileNotFoundException, VersionDoesNotExistException
VersionsServiceHandler
deleteVersion
in interface VersionsServiceHandler
fileName
- site relative url to the filefileVersion
- file version to restoreFileNotFoundException
VersionDoesNotExistException
VersionsServiceHandler.deleteVersion(java.lang.String, java.lang.String)
public List<DocumentVersionBean> deleteAllVersions(String fileName) throws FileNotFoundException
deleteAllVersions
in interface VersionsServiceHandler
FileNotFoundException
VersionsServiceHandler.deleteAllVersions(java.lang.String)
protected void assertDocument(FileInfo documentFileInfo)
documentFileInfo
- document file info (FileInfo
)protected List<DocumentVersionBean> getVersions(FileInfo documentFileInfo)
documentFileInfo
- file info (FileInfo
)protected DocumentVersionBean getDocumentVersionInfo(Version version, String id)
version
- version (Version
)id
- the file idprotected DocumentVersionBean getDocumentVersionInfo(FileInfo documentFileInfo)
documentFileInfo
- document file info (FileInfo
)public boolean isVersionable(String fileName)
VersionsServiceHandler
isVersionable
in interface VersionsServiceHandler
public String makeCurrentVersionURL(String host, String context, String dws, String fileName)
makeCurrentVersionURL
in interface VersionsServiceHandler
public String makeVersionURL(String host, String context, String dws, DocumentVersionBean version)
makeVersionURL
in interface VersionsServiceHandler
public String makeDocumentDetailsURL(String host, String context, String dws, String fileName)
makeDocumentDetailsURL
in interface VersionsServiceHandler
Copyright © 2005–2017 Alfresco Software. All rights reserved.