@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()
VersionedActions
This 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
VersionedActions
getVersionList
in interface VersionedActions
PageSelections
ClientException
public void retrieveVersions() throws ClientException
VersionedActions
retrieveVersions
in interface VersionedActions
ClientException
public String restoreToVersion(VersionModel selectedVersion) throws ClientException
restoreToVersion
in interface VersionedActions
ClientException
public String restoreToVersion() throws ClientException
VersionedActions
VersionedActions.getSelectedVersionId()
.restoreToVersion
in interface VersionedActions
ClientException
- if cannot fetch the versionpublic String viewArchivedVersion(VersionModel selectedVersion) throws ClientException
VersionedActions
viewArchivedVersion
in interface VersionedActions
ClientException
public String viewArchivedVersion() throws ClientException
VersionedActions
VersionedActions.getSelectedVersionId()
.viewArchivedVersion
in interface VersionedActions
ClientException
- if cannot fetch the versionpublic boolean getCanRestore() throws ClientException
VersionedActions
getCanRestore
in interface VersionedActions
ClientException
public String getCheckedOut() throws ClientException
getCheckedOut
in interface VersionedActions
ClientException
public void setCheckedOut(String checkedOut)
VersionedActions
setCheckedOut
in interface VersionedActions
public String checkOut() throws ClientException
checkOut
in interface VersionedActions
ClientException
public String checkIn() throws ClientException
checkIn
in interface VersionedActions
ClientException
public DocumentModel getSourceDocument() throws ClientException
getSourceDocument
in interface VersionedActions
ClientException
public DocumentModel getSourceDocument(DocumentModel document) throws ClientException
getSourceDocument
in interface VersionedActions
ClientException
public boolean canRemoveArchivedVersion(VersionModel selectedVersion)
VersionedActions
canRemoveArchivedVersion
in interface VersionedActions
public boolean getCanRemoveSelectedArchivedVersions() throws ClientException
VersionedActions
getCanRemoveSelectedArchivedVersions
in interface VersionedActions
ClientException
- if at least one of the selected versions cannot be retrieved from the repositorypublic String removeArchivedVersion(VersionModel selectedVersion) throws ClientException
VersionedActions
removeArchivedVersion
in interface VersionedActions
selectedVersion
- the version model to removeClientException
public String removeSelectedArchivedVersions() throws ClientException
VersionedActions
removeSelectedArchivedVersions
in interface VersionedActions
ClientException
public String getSelectedVersionId()
VersionedActions
getSelectedVersionId
in interface VersionedActions
public void setSelectedVersionId(String selectedVersionId)
VersionedActions
setSelectedVersionId
in interface VersionedActions
Copyright © 2015 Nuxeo SA. All rights reserved.