Class RecordableVersionServiceImpl
java.lang.Object
org.alfresco.repo.version.common.AbstractVersionServiceImpl
org.alfresco.repo.version.VersionServiceImpl
org.alfresco.repo.version.Version2ServiceImpl
org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionServiceImpl
- All Implemented Interfaces:
RecordableVersionModel,RecordableVersionService,Version2Model,VersionBaseModel,VersionModel,VersionService,Extensible
public class RecordableVersionServiceImpl
extends Version2ServiceImpl
implements RecordableVersionModel, RecordableVersionService
Recordable version service implementation
- Since:
- 2.3
- Author:
- Roy Wetherall
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringkey used to indicate a recordable versionprotected static final Stringprotected static final Stringversion record propertyFields inherited from class org.alfresco.repo.version.VersionServiceImpl
dbNodeService, MSGID_ERR_NO_BRANCHES, MSGID_ERR_NOT_FOUND, MSGID_ERR_ONE_PRECEEDING, MSGID_ERR_RESTORE_EXISTS, MSGID_ERR_RESTORE_NO_VERSION, MSGID_ERR_REVERT_MISMATCH, policyBehaviourFilter, searcher, versionComparatorDescFields inherited from class org.alfresco.repo.version.common.AbstractVersionServiceImpl
dictionaryService, nodeService, policyComponentFields inherited from interface org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionModel
ASPECT_RECORDED_VERSION, ASPECT_VERSION_RECORD, ASPECT_VERSIONABLE, PROP_DESTROYED, PROP_FILE_PLAN, PROP_FROZEN_OWNER, PROP_RECORD_NODE_REF, PROP_RECORDABLE_VERSION_POLICY, PROP_VERSION_DESCRIPTION, PROP_VERSION_LABEL, PROP_VERSIONED_NODEREF, RMV_PREFIX, RMV_URIFields inherited from interface org.alfresco.repo.version.Version2Model
ASPECT_LOCALNAME_VERSION, ASPECT_VERSION, ASPECT_VERSION_STORE_ROOT, ASSOC_ROOT_VERSION, ASSOC_SUCCESSOR, CHILD_QNAME_VERSION_HISTORIES, CHILD_QNAME_VERSIONED_ASSOCS, CHILD_QNAME_VERSIONS, NAMESPACE_URI, PROP_ASSOC_DBID, PROP_FROZEN_ACCESSED, PROP_FROZEN_CREATED, PROP_FROZEN_CREATOR, PROP_FROZEN_MODIFIED, PROP_FROZEN_MODIFIER, PROP_FROZEN_NODE_DBID, PROP_FROZEN_NODE_REF, PROP_METADATA_PREFIX, PROP_QNAME_ASSOC_DBID, PROP_QNAME_FROZEN_ACCESSED, PROP_QNAME_FROZEN_CREATED, PROP_QNAME_FROZEN_CREATOR, PROP_QNAME_FROZEN_MODIFIED, PROP_QNAME_FROZEN_MODIFIER, PROP_QNAME_FROZEN_NODE_DBID, PROP_QNAME_FROZEN_NODE_REF, PROP_QNAME_TRANSLATION_VERSIONS, PROP_QNAME_VERSION_DESCRIPTION, PROP_QNAME_VERSION_LABEL, PROP_QNAME_VERSION_NUMBER, PROP_QNAME_VERSIONED_NODE_ID, PROP_VERSION_DESCRIPTION, PROP_VERSION_TYPE, STORE_ID, TYPE_QNAME_VERSION_HISTORY, TYPE_QNAME_VERSIONED_ASSOCFields inherited from interface org.alfresco.repo.version.VersionBaseModel
ASPECT_LOCALNAME_VERSION_STORE_ROOT, ASSOC_LOCALNAME_ROOT_VERSION, CHILD_VERSION_HISTORIES, CHILD_VERSIONED_ASSOCS, CHILD_VERSIONS, PROP_CREATED_DATE, PROP_CREATOR, PROP_DESCRIPTION, PROP_TRANSLATION_VERSIONS, PROP_VERSION_DESCRIPTION, PROP_VERSION_LABEL, PROP_VERSION_NUMBER, PROP_VERSION_TYPE, PROP_VERSIONED_NODE_ID, STORE_PROTOCOL, TYPE_VERSION_HISTORY, TYPE_VERSIONED_ASSOCFields inherited from interface org.alfresco.repo.version.VersionModel
ASPECT_VERSION_STORE_ROOT, ASSOC_ROOT_VERSION, ASSOC_SUCCESSOR, CHILD_QNAME_VERSION_HISTORIES, CHILD_QNAME_VERSION_META_DATA, CHILD_QNAME_VERSIONED_ASSOCS, CHILD_QNAME_VERSIONED_ATTRIBUTES, CHILD_QNAME_VERSIONED_CHILD_ASSOCS, CHILD_QNAME_VERSIONS, CHILD_VERSION_META_DATA, CHILD_VERSIONED_ATTRIBUTES, CHILD_VERSIONED_CHILD_ASSOCS, NAMESPACE_URI, PROP_ASSOC_QNAME, PROP_ASSOC_TYPE_QNAME, PROP_FROZEN_ASPECTS, PROP_FROZEN_NODE_ID, PROP_FROZEN_NODE_STORE_ID, PROP_FROZEN_NODE_STORE_PROTOCOL, PROP_FROZEN_NODE_TYPE, PROP_IS_MULTI_VALUE, PROP_IS_PRIMARY, PROP_META_DATA_NAME, PROP_META_DATA_VALUE, PROP_MULTI_VALUE, PROP_NTH_SIBLING, PROP_QNAME, PROP_QNAME_ASSOC_QNAME, PROP_QNAME_ASSOC_TYPE_QNAME, PROP_QNAME_FROZEN_ASPECTS, PROP_QNAME_FROZEN_NODE_ID, PROP_QNAME_FROZEN_NODE_STORE_ID, PROP_QNAME_FROZEN_NODE_STORE_PROTOCOL, PROP_QNAME_FROZEN_NODE_TYPE, PROP_QNAME_IS_MULTI_VALUE, PROP_QNAME_IS_PRIMARY, PROP_QNAME_META_DATA_NAME, PROP_QNAME_META_DATA_VALUE, PROP_QNAME_MULTI_VALUE, PROP_QNAME_NTH_SIBLING, PROP_QNAME_QNAME, PROP_QNAME_TRANSLATION_VERSIONS, PROP_QNAME_VALUE, PROP_QNAME_VERSION_LABEL, PROP_QNAME_VERSION_NUMBER, PROP_QNAME_VERSIONED_NODE_ID, PROP_VALUE, STORE_ID, TYPE_QNAME_VERSION, TYPE_QNAME_VERSION_HISTORY, TYPE_QNAME_VERSION_META_DATA_VALUE, TYPE_QNAME_VERSIONED_ASSOC, TYPE_QNAME_VERSIONED_CHILD_ASSOC, TYPE_QNAME_VERSIONED_PROPERTY, TYPE_VERSION, TYPE_VERSION_META_DATA_VALUE, TYPE_VERSIONED_CHILD_ASSOC, TYPE_VERSIONED_PROPERTYFields inherited from interface org.alfresco.service.cmr.version.VersionService
VERSION_STORE_PROTOCOL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertNodeRef(NodeRef nodeRef) Convert the incomming node ref (with the version store protocol specified) to the internal representation with the workspace protocol.convertStoreRef(StoreRef storeRef) Create Version Store Refprotected NodeRefcreateNewRecordedVersion(QName sourceTypeRef, NodeRef versionHistoryRef, Map<QName, Serializable> standardVersionProperties, Map<String, Serializable> versionProperties, int versionNumber, PolicyScope nodeDetails) Creates a new recorded versionprotected NodeRefcreateNewVersion(QName sourceTypeRef, NodeRef versionHistoryRef, Map<QName, Serializable> standardVersionProperties, Map<String, Serializable> versionProperties, int versionNumber, PolicyScope nodeDetails) createRecordFromLatestVersion(NodeRef filePlan, NodeRef nodeRef) Creates a record from the latest frozen version, marking it as recorded.createRecordFromLatestVersion(NodeRef filePlan, NodeRef nodeRef, boolean isEnableAutoVersionOnRecordCreation) Creates a record from the latest version, marking it as recorded.voidcreateSnapshotVersion(NodeRef nodeRef) Create a snapshot version of current nodeprotected VersioncreateVersion(NodeRef nodeRef, Map<String, Serializable> origVersionProperties, int versionNumber) voiddestroyRecordedVersion(Version version) Marks a recorded version as destroyed.getRecordedVersion(NodeRef versionRecord) Gets the version that relates to the version recordprotected VersiongetVersion(NodeRef versionRef) getVersionRecord(Version version) If the version is a recorded version, gets the related version record.booleanisCurrentVersionDirty(NodeRef nodeRef) Check if current version of the node is modified compared with versioned versionbooleanisCurrentVersionRecorded(NodeRef nodeRef) Indicates whether the current version of a node is recorded or not.booleanFlag that indicate to create new version on record creation if current node is modifiedbooleanisRecordedVersion(Version version) Indicates whether a version is recorded or not.booleanisRecordedVersionDestroyed(Version version) Indicates whether a record version is destroyed or not.voidvoidsetAuthenticationUtil(AuthenticationUtil authenticationUtil) voidsetCmObjectType(CmObjectType cmObjectType) voidsetEnableAutoVersionOnRecordCreation(boolean isEnableAutoVersionOnRecordCreation) voidsetExtendedPermissionService(ExtendedPermissionService extendedPermissionService) voidsetExtendedSecurityService(ExtendedSecurityService extendedSecurityService) voidsetFilePlanService(FilePlanService filePlanService) voidsetModelSecurityService(ModelSecurityService modelSecurityService) voidsetRecordService(RecordService recordService) voidsetRelationshipService(RelationshipService relationshipService) Methods inherited from class org.alfresco.repo.version.Version2ServiceImpl
buildVersionHistory, createVersion, createVersion, createVersionHistory, deleteVersion, deleteVersionHistory, getAllVersions, getCurrentVersion, getStandardVersionProperties, getTrait, getVersionHistory, getVersionHistoryNodeRef, getVersionStoreReference, initialise, isAVersion, isUseVersionAssocIndex, isVersioned, restore, restore, revert, revert, revert, setPermissionService, setUseVersionAssocIndexMethods inherited from class org.alfresco.repo.version.VersionServiceImpl
createVersion, defaultOnCreateVersion, ensureVersioningEnabled, getRootNode, getVersionMetaData, registerVersionLabelPolicy, setDbNodeService, setPolicyBehaviourFilter, setSearcher, setVersionComparatorClassMethods inherited from class org.alfresco.repo.version.common.AbstractVersionServiceImpl
getRevertAspectAction, getRevertAssocAction, invokeAfterCreateVersion, invokeAfterVersionRevert, invokeBeforeCreateVersion, invokeCalculateVersionLabel, invokeOnCreateVersion, setDictionaryService, setNodeService, setPolicyComponentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.service.cmr.version.VersionService
createVersion, ensureVersioningEnabled, registerVersionLabelPolicy
-
Field Details
-
KEY_RECORDABLE_VERSION
key used to indicate a recordable version- See Also:
-
KEY_FILE_PLAN
- See Also:
-
PROP_VERSION_RECORD
version record property- See Also:
-
PROP_RECORDED_VERSION_DESTROYED
- See Also:
-
-
Constructor Details
-
RecordableVersionServiceImpl
public RecordableVersionServiceImpl()
-
-
Method Details
-
setFilePlanService
- Parameters:
filePlanService- file plan service
-
setAuthenticationUtil
- Parameters:
authenticationUtil- authentication util helper
-
setRelationshipService
- Parameters:
relationshipService- relationship service
-
setRecordService
- Parameters:
recordService- record service
-
setModelSecurityService
- Parameters:
modelSecurityService- model security service
-
setCmObjectType
- Parameters:
cmObjectType- the cmObjectType to set
-
setExtendedPermissionService
- Parameters:
extendedPermissionService- extended permission service
-
setExtendedSecurityService
- Parameters:
extendedSecurityService- extended security service
-
setEnableAutoVersionOnRecordCreation
public void setEnableAutoVersionOnRecordCreation(boolean isEnableAutoVersionOnRecordCreation) - Parameters:
isEnableAutoVersionOnRecordCreation-
-
isEnableAutoVersionOnRecordCreation
public boolean isEnableAutoVersionOnRecordCreation()Description copied from interface:RecordableVersionServiceFlag that indicate to create new version on record creation if current node is modified- Specified by:
isEnableAutoVersionOnRecordCreationin interfaceRecordableVersionService- Returns:
- boolean true to auto-version on record creation, false to use latest versioned version
-
createVersion
protected Version createVersion(NodeRef nodeRef, Map<String, Serializable> origVersionProperties, int versionNumber) throws ReservedVersionNameException- Overrides:
createVersionin classVersion2ServiceImpl- Throws:
ReservedVersionNameException- See Also:
-
createNewVersion
protected NodeRef createNewVersion(QName sourceTypeRef, NodeRef versionHistoryRef, Map<QName, Serializable> standardVersionProperties, Map<String, Serializable> versionProperties, int versionNumber, PolicyScope nodeDetails) -
createNewRecordedVersion
protected NodeRef createNewRecordedVersion(QName sourceTypeRef, NodeRef versionHistoryRef, Map<QName, Serializable> standardVersionProperties, Map<String, Serializable> versionProperties, int versionNumber, PolicyScope nodeDetails) Creates a new recorded version- Parameters:
sourceTypeRef- source type nameversionHistoryRef- version history referencestandardVersionProperties- standard version propertiesversionProperties- version propertiesversionNumber- version numbernodeDetails- policy scope- Returns:
NodeRefrecord version
-
getRecordedVersion
Description copied from interface:RecordableVersionServiceGets the version that relates to the version record- Specified by:
getRecordedVersionin interfaceRecordableVersionService- Parameters:
versionRecord- version record node reference- Returns:
- Version version or null if not found
- See Also:
-
getVersion
- Overrides:
getVersionin classVersion2ServiceImpl- See Also:
-
revert
- Specified by:
revertin interfaceVersionService- Overrides:
revertin classVersion2ServiceImpl- See Also:
-
isCurrentVersionRecorded
Description copied from interface:RecordableVersionServiceIndicates whether the current version of a node is recorded or not.Returns false if not versionable or no version.
- Specified by:
isCurrentVersionRecordedin interfaceRecordableVersionService- Parameters:
nodeRef- node reference- Returns:
- boolean true if latest version recorded, false otherwise
- See Also:
-
isRecordedVersion
Description copied from interface:RecordableVersionServiceIndicates whether a version is recorded or not.- Specified by:
isRecordedVersionin interfaceRecordableVersionService- Parameters:
version- version- Returns:
- boolean true if recorded version, false otherwise
- See Also:
-
getVersionRecord
Description copied from interface:RecordableVersionServiceIf the version is a recorded version, gets the related version record.- Specified by:
getVersionRecordin interfaceRecordableVersionService- Parameters:
version- version- Returns:
- NodeRef node reference of version record
- See Also:
-
convertStoreRef
Create Version Store Ref- Parameters:
storeRef- store ref- Returns:
- store ref for version store
-
convertNodeRef
Convert the incomming node ref (with the version store protocol specified) to the internal representation with the workspace protocol.- Parameters:
nodeRef- the incomming verison protocol node reference- Returns:
- the internal version node reference
-
createRecordFromLatestVersion
public NodeRef createRecordFromLatestVersion(NodeRef filePlan, NodeRef nodeRef, boolean isEnableAutoVersionOnRecordCreation) Description copied from interface:RecordableVersionServiceCreates a record from the latest version, marking it as recorded.Does not create a record if the node is not versionable or the latest version is already recorded.
- Specified by:
createRecordFromLatestVersionin interfaceRecordableVersionService- Parameters:
filePlan- parent node referencenodeRef- node referenceisEnableAutoVersionOnRecordCreation- true, create new record version from latest version, false creates a record from the latest frozen version- Returns:
- NodeRef node reference to the created record.
- See Also:
-
createRecordFromLatestVersion
Description copied from interface:RecordableVersionServiceCreates a record from the latest frozen version, marking it as recorded.Does not create a record if the node is not versionable or the latest version is already recorded.
- Specified by:
createRecordFromLatestVersionin interfaceRecordableVersionServicenodeRef- node reference- Returns:
- NodeRef node reference to the created record.
- See Also:
-
isRecordedVersionDestroyed
Description copied from interface:RecordableVersionServiceIndicates whether a record version is destroyed or not.- Specified by:
isRecordedVersionDestroyedin interfaceRecordableVersionService- Parameters:
version- version- Returns:
- boolean true if destroyed, false otherwise
- See Also:
-
destroyRecordedVersion
Description copied from interface:RecordableVersionServiceMarks a recorded version as destroyed.Note this method does not destroy the associated record, instead it marks the version as destroyed.
- Specified by:
destroyRecordedVersionin interfaceRecordableVersionService- Parameters:
version- version- See Also:
-
isCurrentVersionDirty
Check if current version of the node is modified compared with versioned version- Parameters:
nodeRef- internal node reference- Returns:
- boolean true if nodeRef is modified, otherwise false
-
createSnapshotVersion
Description copied from interface:RecordableVersionServiceCreate a snapshot version of current node- Specified by:
createSnapshotVersionin interfaceRecordableVersionService- Parameters:
nodeRef- node reference- See Also:
-