@Name(value="versionedActions") @Scope(value=CONVERSATION) @Install(precedence=10) public class VersionedActionsBean extends Object implements VersionedActions, Serializable
| Constructor and Description |
|---|
VersionedActionsBean() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRemoveArchivedVersion(VersionModel selectedVersion)
Check if a version can be removed.
|
String |
checkIn()
Checks the selected document in, with the selected version.
|
String |
checkOut()
Checks the document out.
|
boolean |
getCanRemoveSelectedArchivedVersions()
Check if the currently selected versions can be removed.
|
boolean |
getCanRestore()
Security check to enable or disable the restore button.
|
String |
getCheckedOut()
Tells if the current selected document is checked out or not.
|
String |
getSelectedVersionId()
Gets currently selected version id.
|
DocumentModel |
getSourceDocument() |
DocumentModel |
getSourceDocument(DocumentModel document) |
PageSelections<VersionModel> |
getVersionList()
Factory accessor for currentDocument versionList.
|
void |
initialize() |
String |
removeArchivedVersion(VersionModel selectedVersion)
Remove an archived version.
|
String |
removeSelectedArchivedVersions()
Remove currently selected archived versions.
|
void |
resetVersions()
When the user selects/changes other documents then we nullify the list of versions associated with the document
so that the factory method gets called when the list is used.
|
String |
restoreToVersion()
Restores the version which id is returned by
VersionedActions.getSelectedVersionId(). |
String |
restoreToVersion(VersionModel selectedVersion)
Restores the document to the selected version.
|
void |
retrieveVersions()
Retrieves the versions for the current document.
|
void |
setCheckedOut(String checkedOut)
Changes the checked-out string.
|
void |
setSelectedVersionId(String selectedVersionId)
Sets currently selected version id.
|
String |
viewArchivedVersion()
Navigates to the version which id is returned by
VersionedActions.getSelectedVersionId(). |
String |
viewArchivedVersion(VersionModel selectedVersion)
View an older version of the document.
|
@Create public void initialize()
initialize in interface VersionedActions@Observer(value={"documentSelectionChanged","documentChanged","documentSubmitedForPublication","documentPublished"},
create=false)
@BypassInterceptors
public void resetVersions()
VersionedActionsThis way we achieve lazy loading of data from backend - only when its needed and not loading it when the event is fired.
resetVersions in interface VersionedActions@Factory(value="versionList",
scope=EVENT)
public PageSelections<VersionModel> getVersionList()
throws ClientException
VersionedActionsgetVersionList in interface VersionedActionsPageSelectionsClientExceptionpublic void retrieveVersions()
throws ClientException
VersionedActionsretrieveVersions in interface VersionedActionsClientExceptionpublic String restoreToVersion(VersionModel selectedVersion) throws ClientException
restoreToVersion in interface VersionedActionsClientExceptionpublic String restoreToVersion() throws ClientException
VersionedActionsVersionedActions.getSelectedVersionId().restoreToVersion in interface VersionedActionsClientException - if cannot fetch the versionpublic String viewArchivedVersion(VersionModel selectedVersion) throws ClientException
VersionedActionsviewArchivedVersion in interface VersionedActionsClientExceptionpublic String viewArchivedVersion() throws ClientException
VersionedActionsVersionedActions.getSelectedVersionId().viewArchivedVersion in interface VersionedActionsClientException - if cannot fetch the versionpublic boolean getCanRestore()
throws ClientException
VersionedActionsgetCanRestore in interface VersionedActionsClientExceptionpublic String getCheckedOut() throws ClientException
getCheckedOut in interface VersionedActionsClientExceptionpublic void setCheckedOut(String checkedOut)
VersionedActionssetCheckedOut in interface VersionedActionspublic String checkOut() throws ClientException
checkOut in interface VersionedActionsClientExceptionpublic String checkIn() throws ClientException
checkIn in interface VersionedActionsClientExceptionpublic DocumentModel getSourceDocument() throws ClientException
getSourceDocument in interface VersionedActionsClientExceptionpublic DocumentModel getSourceDocument(DocumentModel document) throws ClientException
getSourceDocument in interface VersionedActionsClientExceptionpublic boolean canRemoveArchivedVersion(VersionModel selectedVersion)
VersionedActionscanRemoveArchivedVersion in interface VersionedActionspublic boolean getCanRemoveSelectedArchivedVersions()
throws ClientException
VersionedActionsgetCanRemoveSelectedArchivedVersions in interface VersionedActionsClientException - if at least one of the selected versions cannot be retrieved from the repositorypublic String removeArchivedVersion(VersionModel selectedVersion) throws ClientException
VersionedActionsremoveArchivedVersion in interface VersionedActionsselectedVersion - the version model to removeClientExceptionpublic String removeSelectedArchivedVersions() throws ClientException
VersionedActionsremoveSelectedArchivedVersions in interface VersionedActionsClientExceptionpublic String getSelectedVersionId()
VersionedActionsgetSelectedVersionId in interface VersionedActionspublic void setSelectedVersionId(String selectedVersionId)
VersionedActionssetSelectedVersionId in interface VersionedActionsCopyright © 2015 Nuxeo SA. All rights reserved.