public class VirtualVersionServiceExtension extends SpringBeanExtension<VersionServiceExtension,VersionServiceTrait> implements VersionServiceExtension
Modifier and Type | Class and Description |
---|---|
class |
VirtualVersionServiceExtension.VirtualVersionHistory |
VERSION_STORE_PROTOCOL
Constructor and Description |
---|
VirtualVersionServiceExtension() |
Modifier and Type | Method and Description |
---|---|
Collection<Version> |
createVersion(Collection<org.alfresco.service.cmr.repository.NodeRef> nodeRefs,
Map<String,Serializable> versionProperties)
Creates new versions based on the list of node references provided.
|
Version |
createVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<String,Serializable> versionProperties)
Creates a new version based on the referenced node.
|
Collection<Version> |
createVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<String,Serializable> versionProperties,
boolean versionChildren)
Creates a new version based on the referenced node.
|
void |
deleteVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Version version)
Delete a specific version associated with a node reference.
|
void |
deleteVersionHistory(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Delete the version history associated with a node reference.
|
void |
ensureVersioningEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> versionProperties)
Ensures that a node has the versionable aspect applied to it, and has
at least an initial entry in the version store.
|
Version |
getCurrentVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Gets the version object for the current version of the node reference passed.
|
VersionHistory |
getVersionHistory(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Gets the version history information for a node.
|
org.alfresco.service.cmr.repository.StoreRef |
getVersionStoreReference()
Gets the reference to the version store
|
boolean |
isAVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Is the nodeRef a version node?
|
boolean |
isVersioned(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Is the nodeRef versioned?
|
void |
registerVersionLabelPolicy(org.alfresco.service.namespace.QName typeQName,
VersionServicePolicies.CalculateVersionLabelPolicy policy)
Register a version label policy
|
org.alfresco.service.cmr.repository.NodeRef |
restore(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName)
By default a deep restore is performed.
|
org.alfresco.service.cmr.repository.NodeRef |
restore(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
boolean deep)
Restores a node not currently present in the store, but that has a version
history.
|
void |
revert(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Revert the state of the node to the current version.
|
void |
revert(org.alfresco.service.cmr.repository.NodeRef nodeRef,
boolean deep)
Revert the state of the node to the current version.
|
void |
revert(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Version version)
Revert the state of the node to the specified version.
|
void |
revert(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Version version,
boolean deep)
Revert the state of the node to the specified version.
|
void |
setSmartStore(VirtualStore smartStore) |
register, setExtensionPoint
acceptsTrait, acceptsTraitClass, getTrait
public void setSmartStore(VirtualStore smartStore)
public org.alfresco.service.cmr.repository.StoreRef getVersionStoreReference()
VersionService
getVersionStoreReference
in interface VersionService
public boolean isAVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef)
VersionService
isAVersion
in interface VersionService
public boolean isVersioned(org.alfresco.service.cmr.repository.NodeRef nodeRef)
VersionService
isVersioned
in interface VersionService
public Version createVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<String,Serializable> versionProperties) throws ReservedVersionNameException, AspectMissingException
VersionService
If the node has not previously been versioned then a version history and initial version will be created.
If the node referenced does not or can not have the version aspect applied to it then an exception will be raised.
The version properties are stored as version meta-data against the newly created version.
createVersion
in interface VersionService
nodeRef
- a node referenceversionProperties
- the version properties that are stored with the newly created
version, or null if there are no relevant propertiesReservedVersionNameException
- thrown if a reserved property name is used int he version properties
providedAspectMissingException
- thrown if the version aspect is missingpublic Collection<Version> createVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<String,Serializable> versionProperties, boolean versionChildren) throws ReservedVersionNameException, AspectMissingException
VersionService
If the node has not previously been versioned then a version history and initial version will be created.
If the node referenced does not or can not have the version aspect applied to it then an exception will be raised.
The version properties are stored as version meta-data against the newly created version.
createVersion
in interface VersionService
nodeRef
- a node referenceversionProperties
- the version properties that are stored with the newly created
versionversionChildren
- if true then the children of the referenced node are also
versioned, false otherwiseReservedVersionNameException
- thrown if a reserved property name is used int he version properties
providedAspectMissingException
- thrown if the version aspect is missingpublic Collection<Version> createVersion(Collection<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, Map<String,Serializable> versionProperties) throws ReservedVersionNameException, AspectMissingException
VersionService
createVersion
in interface VersionService
nodeRefs
- a list of node referencesversionProperties
- version property valuesReservedVersionNameException
- thrown if a reserved property name is used in the version properties
providedAspectMissingException
- thrown if the version aspect is missingpublic VersionHistory getVersionHistory(org.alfresco.service.cmr.repository.NodeRef nodeRef) throws AspectMissingException
VersionService
If the node has not been versioned then null is returned.
If the node referenced does not or can not have the version aspect applied to it then an exception will be raised.
getVersionHistory
in interface VersionService
nodeRef
- a node referenceAspectMissingException
- thrown if the version aspect is missingpublic Version getCurrentVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef)
VersionService
Returns null
if the node is not versionable or has not been versioned.
getCurrentVersion
in interface VersionService
nodeRef
- the node reference of the 'live' nodepublic void revert(org.alfresco.service.cmr.repository.NodeRef nodeRef)
VersionService
The node reference will be reverted to the current version.
A deep revert will be performed.
revert
in interface VersionService
nodeRef
- the node referenceVersionService.revert(NodeRef, Version, boolean)
public void revert(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean deep)
VersionService
The node will be reverted to the current version.
revert
in interface VersionService
nodeRef
- the node referencedeep
- true if a deep revert is to be performed, false otherwiseVersionService.revert(NodeRef, Version, boolean)
public void revert(org.alfresco.service.cmr.repository.NodeRef nodeRef, Version version)
VersionService
A deep revert will take place by default.
revert
in interface VersionService
nodeRef
- the node referenceversion
- the version to revert toVersionService.revert(NodeRef, Version, boolean)
public void revert(org.alfresco.service.cmr.repository.NodeRef nodeRef, Version version, boolean deep)
VersionService
Any changes made to the node will be lost and the state of the node will reflect that of the version specified.
The version label property on the node reference will remain unchanged.
If the node is further versioned then the new version will be created at the head of the version history graph. A branch will not be created.
If a deep revert is to be performed then any child nodes that are no longer present will be deep restored (if appropriate) otherwise child associations to deleted, versioned nodes will not be restored.
revert
in interface VersionService
nodeRef
- the node referenceversion
- the version to revert todeep
- true is a deep revert is to be performed, false otherwise.public org.alfresco.service.cmr.repository.NodeRef restore(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
VersionService
restore
in interface VersionService
nodeRef
- the node reference to a node that no longer exists in the storeparentNodeRef
- the new parent of the restored nodeassocTypeQName
- the assoc type qnameassocQName
- the assoc qnameVersionService.restore(NodeRef, NodeRef, QName, QName, boolean)
public org.alfresco.service.cmr.repository.NodeRef restore(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, boolean deep)
VersionService
The restored node will be at the head (most resent version).
Restoration will fail if there is no version history for the specified node id in the specified store.
If the node already exists in the store then an exception will be raised.
Once the node is restored it is reverted to the head version in the appropriate version history tree. If deep is set to true then this will be a deep revert, false otherwise.
restore
in interface VersionService
nodeRef
- the node reference to a node that no longer exists in
the storeparentNodeRef
- the new parent of the restored nodeassocTypeQName
- the assoc type qnameassocQName
- the assoc qnamedeep
- true is a deep revert should be performed once the node has been
restored, false otherwisepublic void deleteVersionHistory(org.alfresco.service.cmr.repository.NodeRef nodeRef) throws AspectMissingException
VersionService
This operation is permanent, all versions in the version history are deleted and cannot be retrieved.
The current version label for the node reference is reset and any subsequent versions of the node will result in a new version history being created.
deleteVersionHistory
in interface VersionService
nodeRef
- the node referenceAspectMissingException
- thrown if the version aspect is missingpublic void deleteVersion(org.alfresco.service.cmr.repository.NodeRef nodeRef, Version version)
VersionService
This operation is permanent, the specific version in the version history is deleted and cannot be retrieved.
If this is the last version, then the current version label for the node reference is reset and any subsequent versions of the node will result in a new version history being created.
deleteVersion
in interface VersionService
nodeRef
- the node referenceversion
- the version to deletepublic void ensureVersioningEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName,Serializable> versionProperties)
VersionService
ensureVersioningEnabled
in interface VersionService
nodeRef
- the node referenceversionProperties
- the version properties to apply if versioning
isn't currently enabled for the nodepublic void registerVersionLabelPolicy(org.alfresco.service.namespace.QName typeQName, VersionServicePolicies.CalculateVersionLabelPolicy policy)
VersionService
registerVersionLabelPolicy
in interface VersionService
typeQName
- the QName of the type to registerpolicy
- the policy to register for the specified typeCopyright © 2005–2017 Alfresco Software. All rights reserved.