@Name(value="versionedActions") @Scope(value=CONVERSATION) @Install(precedence=10) public class VersionedActionsBean extends Object implements VersionedActions, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected String |
checkedOut |
protected CoreSession |
documentManager |
protected DocumentsListsManager |
documentsListsManager |
protected DocumentVersioning |
documentVersioning |
protected org.jboss.seam.faces.FacesMessages |
facesMessages |
protected NavigationContext |
navigationContext |
protected ResourcesAccessor |
resourcesAccessor |
protected String |
selectedVersionId |
protected org.jboss.seam.contexts.Context |
sessionContext |
protected PageSelections<VersionModel> |
versionModelList |
| 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() |
protected boolean |
isVersionSelected(VersionModel versionModel)
Checks if the
versionModel is selected. |
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.
|
@In(create=true) protected transient NavigationContext navigationContext
@In(create=true,
required=false)
protected transient DocumentsListsManager documentsListsManager
@In(create=true,
required=false)
protected transient CoreSession documentManager
@In(create=true,
required=false)
protected transient org.jboss.seam.faces.FacesMessages facesMessages
@In(create=true,
required=false)
protected transient ResourcesAccessor resourcesAccessor
@In protected transient org.jboss.seam.contexts.Context sessionContext
@In(create=true) protected transient DocumentVersioning documentVersioning
protected transient PageSelections<VersionModel> versionModelList
protected String selectedVersionId
protected String checkedOut
public VersionedActionsBean()
@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()
VersionedActionsgetVersionList in interface VersionedActionsPageSelectionspublic void retrieveVersions()
VersionedActionsretrieveVersions in interface VersionedActionsprotected boolean isVersionSelected(VersionModel versionModel)
versionModel is selected.versionModel - the version modelpublic String restoreToVersion(VersionModel selectedVersion)
restoreToVersion in interface VersionedActionspublic String restoreToVersion()
VersionedActionsVersionedActions.getSelectedVersionId().restoreToVersion in interface VersionedActionspublic String viewArchivedVersion(VersionModel selectedVersion)
VersionedActionsviewArchivedVersion in interface VersionedActionspublic String viewArchivedVersion()
VersionedActionsVersionedActions.getSelectedVersionId().viewArchivedVersion in interface VersionedActionspublic boolean getCanRestore()
VersionedActionsgetCanRestore in interface VersionedActionspublic String getCheckedOut()
getCheckedOut in interface VersionedActionspublic void setCheckedOut(String checkedOut)
VersionedActionssetCheckedOut in interface VersionedActionspublic String checkOut()
checkOut in interface VersionedActionspublic String checkIn()
checkIn in interface VersionedActionspublic DocumentModel getSourceDocument()
getSourceDocument in interface VersionedActionspublic DocumentModel getSourceDocument(DocumentModel document)
getSourceDocument in interface VersionedActionspublic boolean canRemoveArchivedVersion(VersionModel selectedVersion)
VersionedActionscanRemoveArchivedVersion in interface VersionedActionspublic boolean getCanRemoveSelectedArchivedVersions()
VersionedActionsgetCanRemoveSelectedArchivedVersions in interface VersionedActionspublic String removeArchivedVersion(VersionModel selectedVersion)
VersionedActionsremoveArchivedVersion in interface VersionedActionsselectedVersion - the version model to removepublic String removeSelectedArchivedVersions()
VersionedActionsremoveSelectedArchivedVersions in interface VersionedActionspublic String getSelectedVersionId()
VersionedActionsgetSelectedVersionId in interface VersionedActionspublic void setSelectedVersionId(String selectedVersionId)
VersionedActionssetSelectedVersionId in interface VersionedActionsCopyright © 2018 Nuxeo. All rights reserved.