public class CopyServiceImpl extends AbstractBaseCopyService implements CopyService
AbstractBaseCopyService.AssociationCopyInfo
CopyService.CopyInfo
Constructor and Description |
---|
CopyServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
beforeDeleteOriginalAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
Callback behaviour for the 'original' assoc ('copiedfrom' aspect).
|
void |
copy(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef targetNodeRef)
Copies the state of one node on top of another.
|
org.alfresco.service.cmr.repository.NodeRef |
copy(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef targetParentNodeRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName)
By default children of the source node are not copied.
|
org.alfresco.service.cmr.repository.NodeRef |
copy(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef targetParentRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
boolean copyChildren)
Creates a copy of the given node.
|
org.alfresco.service.cmr.repository.NodeRef |
copyAndRename(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef destinationParent,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
boolean copyChildren) |
CopyBehaviourCallback |
getCallbackForCopiedFromAspect(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
Callback behaviour retrieval for the 'copiedfrom' aspect.
|
CopyBehaviourCallback |
getCallbackForFolderType(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
Callback behaviour retrieval for
ContentModel.TYPE_FOLDER aspect. |
CopyBehaviourCallback |
getCallbackForOwnableAspect(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
Callback behaviour retrieval for the 'ownable' aspect.
|
List<org.alfresco.service.cmr.repository.NodeRef> |
getCopies(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Gets all the copies of a given node that have been made using this service.
|
org.alfresco.query.PagingResults<CopyService.CopyInfo> |
getCopies(org.alfresco.service.cmr.repository.NodeRef originalNodeRef,
org.alfresco.service.cmr.repository.NodeRef copyParentNodeRef,
org.alfresco.query.PagingRequest pagingRequest)
Get the copies of a given node
|
org.alfresco.query.PagingResults<CopyService.CopyInfo> |
getCopies(org.alfresco.service.cmr.repository.NodeRef originalNodeRef,
org.alfresco.query.PagingRequest pagingRequest)
Get the copies of a given node
|
org.alfresco.service.cmr.repository.NodeRef |
getOriginal(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the original for a given copied node
|
String |
getTopLevelNodeNewName(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef targetParentRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName)
Determines if top-level node name will be changed during copy according to policies.
|
void |
init()
Initialise method
|
void |
setBehaviourFilter(BehaviourFilter behaviourFilter) |
void |
setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<CopyService.CopyInfo>> cannedQueryRegistry) |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) |
void |
setInternalNodeService(org.alfresco.service.cmr.repository.NodeService internalNodeService) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService) |
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setPublicServiceAccessService(PublicServiceAccessService publicServiceAccessService) |
void |
setRuleService(RuleService ruleService) |
getAssociationCopyInfo, getSystemNamespaces, setSystemNamespaces
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the node servicepublic void setInternalNodeService(org.alfresco.service.cmr.repository.NodeService internalNodeService)
internalNodeService
- the internal node servicepublic void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<CopyService.CopyInfo>> cannedQueryRegistry)
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService
- the dictionary servicepublic void setPolicyComponent(PolicyComponent policyComponent)
policyComponent
- the policy componentpublic void setBehaviourFilter(BehaviourFilter behaviourFilter)
behaviourFilter
- used to disable specific behaviours while doing background taskspublic void setRuleService(RuleService ruleService)
ruleService
- the rule servicepublic void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
permissionService
- the permissionService to setpublic void setPublicServiceAccessService(PublicServiceAccessService publicServiceAccessService)
publicServiceAccessService
- the publicServiceAccessService to setpublic void init()
public org.alfresco.service.cmr.repository.NodeRef copy(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetParentRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, boolean copyChildren)
CopyService
If the new node resides in a different workspace the new node will have the same id.
NOTE: It is up to the client code to set the name of the newly created node.
Use the node service
and catch the
DuplicateChildNodeNameException
If the new node resides in the same workspace then the new node will have the Copy aspect applied to it which will reference the original node.
The aspects applied to source node will also be applied to destination node and all the property value will be duplicated accordingly. This is with the exception of the aspects that have been marked as having 'Non-Transferable State'. In this case the aspect will be applied to the copy, but the properties will take on the default values.
Child associations are copied onto the destination node. If the child of copied association is not present in the destination workspace the child association is not copied. This is unless is has been specified that the children of the source node should also be copied.
Target associations are copied to the destination node. If the target of the association is not present in the destination workspace then the association is not copied.
Source association are not copied.
NOTE: The top-level node has it's cm:name property removed for
associations that do not allow duplicately named children in order
to prevent any chance of a duplicate name clash. Reassign the
cm:name property and catch the DuplicateChildNodeNameException
.
copy
in interface CopyService
sourceNodeRef
- the node reference used as the source of the copytargetParentRef
- the intended parent of the new nodeassocTypeQName
- the type of the new child assocassocQName
- the qualified name of the child association from the
parent to the new nodecopyChildren
- indicates that the children of the node should also be copiedpublic org.alfresco.service.cmr.repository.NodeRef copyAndRename(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destinationParent, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, boolean copyChildren)
copyAndRename
in interface CopyService
sourceNodeRef
- the node reference used as the source of the copydestinationParent
- the intended parent of the new nodeassocTypeQName
- the type of the new child assocassocQName
- the qualified name of the child association from the
parent to the new nodecopyChildren
- indicates that the children of the node should also be copiedEnsures the copy name is the same as the origional or is renamed to prevent duplicate names.
public org.alfresco.service.cmr.repository.NodeRef copy(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetParentNodeRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
copy
in interface CopyService
sourceNodeRef
- the node reference used as the source of the copytargetParentNodeRef
- the intended parent of the new nodeassocTypeQName
- the type of the new child assocassocQName
- the qualified name of the child association from the
parent to the new nodeCopyService.copy(NodeRef, NodeRef, QName, QName, boolean)
public void copy(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetNodeRef)
The state of destination node is overlayed with the state of the source node. Any conflicts are resolved by setting the state to that of the source node.
If data (for example an association) does not exist on the source node, but does exist on the destination node this data is NOT deleted from the destination node.
Child associations and target associations are updated on the destination based on the current state of the source node.
If the node that either a child or target association points to on the source node is not present in the destinations workspace then the association is not updated to the destination node.
All aspects found on the source node are applied to the destination node where missing. The properties of the aspects are updated accordingly except in the case where the aspect has been marked as having 'Non-Transferable State'. In this case aspect properties will take on the values already assigned to them in the destination node. Defer to the standard implementation with copyChildren set to false
copy
in interface CopyService
sourceNodeRef
- the source node referencetargetNodeRef
- the destination node referencepublic org.alfresco.service.cmr.repository.NodeRef getOriginal(org.alfresco.service.cmr.repository.NodeRef nodeRef)
CopyService
getOriginal
in interface CopyService
nodeRef
- the copied node referencepublic List<org.alfresco.service.cmr.repository.NodeRef> getCopies(org.alfresco.service.cmr.repository.NodeRef nodeRef)
CopyService
getCopies
in interface CopyService
nodeRef
- the original node referencepublic org.alfresco.query.PagingResults<CopyService.CopyInfo> getCopies(org.alfresco.service.cmr.repository.NodeRef originalNodeRef, org.alfresco.query.PagingRequest pagingRequest)
CopyService
getCopies
in interface CopyService
originalNodeRef
- the original node referencepagingRequest
- page request detailspublic org.alfresco.query.PagingResults<CopyService.CopyInfo> getCopies(org.alfresco.service.cmr.repository.NodeRef originalNodeRef, org.alfresco.service.cmr.repository.NodeRef copyParentNodeRef, org.alfresco.query.PagingRequest pagingRequest)
CopyService
getCopies
in interface CopyService
originalNodeRef
- the original node referencecopyParentNodeRef
- only find copies that are homed in this nodepagingRequest
- page request detailspublic void beforeDeleteOriginalAssociation(org.alfresco.service.cmr.repository.AssociationRef nodeAssocRef)
public CopyBehaviourCallback getCallbackForCopiedFromAspect(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
DoNothingCopyBehaviourCallback
alwayspublic CopyBehaviourCallback getCallbackForFolderType(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
ContentModel.TYPE_FOLDER
aspect.public CopyBehaviourCallback getCallbackForOwnableAspect(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
DoNothingCopyBehaviourCallback
alwayspublic String getTopLevelNodeNewName(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetParentRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
getTopLevelNodeNewName
in interface CopyService
sourceNodeRef
- the node reference used as the source of the copytargetParentRef
- the intended parent of the new nodeassocTypeQName
- the type of the new child assocassocQName
- the qualified name of the child association from the
parent to the new nodeCopyright © 2005–2017 Alfresco Software. All rights reserved.