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
Fields Modifier and Type Field Description static String
KEY_FILE_PLAN
static String
KEY_RECORDABLE_VERSION
key used to indicate a recordable versionprotected static String
PROP_RECORDED_VERSION_DESTROYED
protected static String
PROP_VERSION_RECORD
version record property-
Fields 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, versionComparatorDesc
-
Fields inherited from class org.alfresco.repo.version.common.AbstractVersionServiceImpl
dictionaryService, nodeService, policyComponent
-
Fields 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_URI
-
Fields 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_ASSOC
-
Fields 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_ASSOC
-
Fields 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_PROPERTY
-
Fields inherited from interface org.alfresco.service.cmr.version.VersionService
VERSION_STORE_PROTOCOL
-
-
Constructor Summary
Constructors Constructor Description RecordableVersionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeRef
convertNodeRef(NodeRef nodeRef)
Convert the incomming node ref (with the version store protocol specified) to the internal representation with the workspace protocol.StoreRef
convertStoreRef(StoreRef storeRef)
Create Version Store Refprotected NodeRef
createNewRecordedVersion(QName sourceTypeRef, NodeRef versionHistoryRef, Map<QName,Serializable> standardVersionProperties, Map<String,Serializable> versionProperties, int versionNumber, PolicyScope nodeDetails)
Creates a new recorded versionprotected NodeRef
createNewVersion(QName sourceTypeRef, NodeRef versionHistoryRef, Map<QName,Serializable> standardVersionProperties, Map<String,Serializable> versionProperties, int versionNumber, PolicyScope nodeDetails)
NodeRef
createRecordFromLatestVersion(NodeRef filePlan, NodeRef nodeRef)
Creates a record from the latest frozen version, marking it as recorded.NodeRef
createRecordFromLatestVersion(NodeRef filePlan, NodeRef nodeRef, boolean isEnableAutoVersionOnRecordCreation)
Creates a record from the latest version, marking it as recorded.void
createSnapshotVersion(NodeRef nodeRef)
Create a snapshot version of current nodeprotected Version
createVersion(NodeRef nodeRef, Map<String,Serializable> origVersionProperties, int versionNumber)
void
destroyRecordedVersion(Version version)
Marks a recorded version as destroyed.Version
getRecordedVersion(NodeRef versionRecord)
Gets the version that relates to the version recordprotected Version
getVersion(NodeRef versionRef)
NodeRef
getVersionRecord(Version version)
If the version is a recorded version, gets the related version record.boolean
isCurrentVersionDirty(NodeRef nodeRef)
Check if current version of the node is modified compared with versioned versionboolean
isCurrentVersionRecorded(NodeRef nodeRef)
Indicates whether the current version of a node is recorded or not.boolean
isEnableAutoVersionOnRecordCreation()
Flag that indicate to create new version on record creation if current node is modifiedboolean
isRecordedVersion(Version version)
Indicates whether a version is recorded or not.boolean
isRecordedVersionDestroyed(Version version)
Indicates whether a record version is destroyed or not.void
revert(NodeRef nodeRef, Version version, boolean deep)
void
setAuthenticationUtil(AuthenticationUtil authenticationUtil)
void
setCmObjectType(CmObjectType cmObjectType)
void
setEnableAutoVersionOnRecordCreation(boolean isEnableAutoVersionOnRecordCreation)
void
setExtendedPermissionService(ExtendedPermissionService extendedPermissionService)
void
setExtendedSecurityService(ExtendedSecurityService extendedSecurityService)
void
setFilePlanService(FilePlanService filePlanService)
void
setModelSecurityService(ModelSecurityService modelSecurityService)
void
setRecordService(RecordService recordService)
void
setRelationshipService(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, setUseVersionAssocIndex
-
Methods inherited from class org.alfresco.repo.version.VersionServiceImpl
createVersion, defaultOnCreateVersion, ensureVersioningEnabled, getRootNode, getVersionMetaData, registerVersionLabelPolicy, setDbNodeService, setPolicyBehaviourFilter, setSearcher, setVersionComparatorClass
-
Methods inherited from class org.alfresco.repo.version.common.AbstractVersionServiceImpl
getRevertAspectAction, getRevertAssocAction, invokeAfterCreateVersion, invokeAfterVersionRevert, invokeBeforeCreateVersion, invokeCalculateVersionLabel, invokeOnCreateVersion, setDictionaryService, setNodeService, setPolicyComponent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.service.cmr.version.VersionService
createVersion, ensureVersioningEnabled, registerVersionLabelPolicy
-
-
-
-
Field Detail
-
KEY_RECORDABLE_VERSION
public static final String KEY_RECORDABLE_VERSION
key used to indicate a recordable version- See Also:
- Constant Field Values
-
KEY_FILE_PLAN
public static final String KEY_FILE_PLAN
- See Also:
- Constant Field Values
-
PROP_VERSION_RECORD
protected static final String PROP_VERSION_RECORD
version record property- See Also:
- Constant Field Values
-
PROP_RECORDED_VERSION_DESTROYED
protected static final String PROP_RECORDED_VERSION_DESTROYED
- See Also:
- Constant Field Values
-
-
Method Detail
-
setFilePlanService
public void setFilePlanService(FilePlanService filePlanService)
- Parameters:
filePlanService
- file plan service
-
setAuthenticationUtil
public void setAuthenticationUtil(AuthenticationUtil authenticationUtil)
- Parameters:
authenticationUtil
- authentication util helper
-
setRelationshipService
public void setRelationshipService(RelationshipService relationshipService)
- Parameters:
relationshipService
- relationship service
-
setRecordService
public void setRecordService(RecordService recordService)
- Parameters:
recordService
- record service
-
setModelSecurityService
public void setModelSecurityService(ModelSecurityService modelSecurityService)
- Parameters:
modelSecurityService
- model security service
-
setCmObjectType
public void setCmObjectType(CmObjectType cmObjectType)
- Parameters:
cmObjectType
- the cmObjectType to set
-
setExtendedPermissionService
public void setExtendedPermissionService(ExtendedPermissionService extendedPermissionService)
- Parameters:
extendedPermissionService
- extended permission service
-
setExtendedSecurityService
public void setExtendedSecurityService(ExtendedSecurityService extendedSecurityService)
- Parameters:
extendedSecurityService
- extended security service
-
setEnableAutoVersionOnRecordCreation
public void setEnableAutoVersionOnRecordCreation(boolean isEnableAutoVersionOnRecordCreation)
- Parameters:
isEnableAutoVersionOnRecordCreation
-
-
isEnableAutoVersionOnRecordCreation
public boolean isEnableAutoVersionOnRecordCreation()
Description copied from interface:RecordableVersionService
Flag that indicate to create new version on record creation if current node is modified- Specified by:
isEnableAutoVersionOnRecordCreation
in 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:
createVersion
in classVersion2ServiceImpl
- Throws:
ReservedVersionNameException
- See Also:
Version2ServiceImpl.createVersion(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, int)
-
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:
NodeRef
record version
-
getRecordedVersion
public Version getRecordedVersion(NodeRef versionRecord)
Description copied from interface:RecordableVersionService
Gets the version that relates to the version record- Specified by:
getRecordedVersion
in interfaceRecordableVersionService
- Parameters:
versionRecord
- version record node reference- Returns:
- Version version or null if not found
- See Also:
RecordableVersionService.getRecordedVersion(org.alfresco.service.cmr.repository.NodeRef)
-
getVersion
protected Version getVersion(NodeRef versionRef)
- Overrides:
getVersion
in classVersion2ServiceImpl
- See Also:
Version2ServiceImpl.getVersion(org.alfresco.service.cmr.repository.NodeRef)
-
revert
public void revert(NodeRef nodeRef, Version version, boolean deep)
- Specified by:
revert
in interfaceVersionService
- Overrides:
revert
in classVersion2ServiceImpl
- See Also:
Version2ServiceImpl.revert(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.version.Version, boolean)
-
isCurrentVersionRecorded
public boolean isCurrentVersionRecorded(NodeRef nodeRef)
Description copied from interface:RecordableVersionService
Indicates whether the current version of a node is recorded or not.Returns false if not versionable or no version.
- Specified by:
isCurrentVersionRecorded
in interfaceRecordableVersionService
- Parameters:
nodeRef
- node reference- Returns:
- boolean true if latest version recorded, false otherwise
- See Also:
RecordableVersionService.isCurrentVersionRecorded(NodeRef)
-
isRecordedVersion
public boolean isRecordedVersion(Version version)
Description copied from interface:RecordableVersionService
Indicates whether a version is recorded or not.- Specified by:
isRecordedVersion
in interfaceRecordableVersionService
- Parameters:
version
- version- Returns:
- boolean true if recorded version, false otherwise
- See Also:
RecordableVersionService.isRecordedVersion(org.alfresco.service.cmr.version.Version)
-
getVersionRecord
public NodeRef getVersionRecord(Version version)
Description copied from interface:RecordableVersionService
If the version is a recorded version, gets the related version record.- Specified by:
getVersionRecord
in interfaceRecordableVersionService
- Parameters:
version
- version- Returns:
- NodeRef node reference of version record
- See Also:
RecordableVersionService.getVersionRecord(org.alfresco.service.cmr.version.Version)
-
convertStoreRef
public StoreRef convertStoreRef(StoreRef storeRef)
Create Version Store Ref- Parameters:
storeRef
- store ref- Returns:
- store ref for version store
-
convertNodeRef
public NodeRef convertNodeRef(NodeRef nodeRef)
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:RecordableVersionService
Creates 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:
createRecordFromLatestVersion
in 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:
RecordableVersionService.createRecordFromLatestVersion(NodeRef, NodeRef, boolean autoVersion)
-
createRecordFromLatestVersion
public NodeRef createRecordFromLatestVersion(NodeRef filePlan, NodeRef nodeRef)
Description copied from interface:RecordableVersionService
Creates 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:
createRecordFromLatestVersion
in interfaceRecordableVersionService
nodeRef
- node reference- Returns:
- NodeRef node reference to the created record.
- See Also:
RecordableVersionService.createRecordFromLatestVersion(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
-
isRecordedVersionDestroyed
public boolean isRecordedVersionDestroyed(Version version)
Description copied from interface:RecordableVersionService
Indicates whether a record version is destroyed or not.- Specified by:
isRecordedVersionDestroyed
in interfaceRecordableVersionService
- Parameters:
version
- version- Returns:
- boolean true if destroyed, false otherwise
- See Also:
RecordableVersionService.isRecordedVersionDestroyed(org.alfresco.service.cmr.version.Version)
-
destroyRecordedVersion
public void destroyRecordedVersion(Version version)
Description copied from interface:RecordableVersionService
Marks a recorded version as destroyed.Note this method does not destroy the associated record, instead it marks the version as destroyed.
- Specified by:
destroyRecordedVersion
in interfaceRecordableVersionService
- Parameters:
version
- version- See Also:
RecordableVersionService.destroyRecordedVersion(org.alfresco.service.cmr.version.Version)
-
isCurrentVersionDirty
public boolean isCurrentVersionDirty(NodeRef nodeRef)
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
public void createSnapshotVersion(NodeRef nodeRef)
Description copied from interface:RecordableVersionService
Create a snapshot version of current node- Specified by:
createSnapshotVersion
in interfaceRecordableVersionService
- Parameters:
nodeRef
- node reference- See Also:
RecordableVersionService.createSnapshotVersion(NodeRef)
-
-