|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.copy.CopyServiceImpl
public class CopyServiceImpl
Node operations service implmentation.
| Constructor Summary | |
|---|---|
CopyServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
copy(NodeRef sourceNodeRef,
NodeRef destinationNodeRef)
Copies the state of one node on top of another. |
NodeRef |
copy(NodeRef sourceNodeRef,
NodeRef destinationParent,
QName destinationAssocTypeQName,
QName destinationQName)
Defer to the standard implementation with copyChildren set to false |
NodeRef |
copy(NodeRef sourceNodeRef,
NodeRef destinationParentRef,
QName destinationAssocTypeQName,
QName destinationQName,
boolean copyChildren)
Creates a copy of the given node. |
NodeRef |
copyAndRename(NodeRef sourceNodeRef,
NodeRef destinationParent,
QName destinationAssocTypeQName,
QName destinationQName,
boolean copyChildren)
|
void |
copyAspectOnCopy(QName classRef,
NodeRef sourceNodeRef,
StoreRef destinationStoreRef,
boolean copyToNewNode,
PolicyScope copyDetails)
OnCopy behaviour registered for the copy aspect. |
java.util.List |
getCopies(NodeRef nodeRef)
Gets all the copies of a given node that have been made using this service. |
void |
init()
Initialise method |
void |
onCopyAuthor(QName classRef,
NodeRef sourceNodeRef,
StoreRef destinationStoreRef,
boolean copyToNewNode,
PolicyScope copyDetails)
|
void |
onCopyComplete(QName classRef,
NodeRef sourceNodeRef,
NodeRef destinationRef,
boolean copyToNew,
java.util.Map copyMap)
|
void |
onCopyOwnable(QName classRef,
NodeRef sourceNodeRef,
StoreRef destinationStoreRef,
boolean copyToNewNode,
PolicyScope copyDetails)
|
void |
setAuthenticationService(AuthenticationService authenticationService)
Sets the authentication service |
void |
setDictionaryService(DictionaryService dictionaryService)
Sets the dictionary service |
void |
setInternalNodeService(NodeService internalNodeService)
Sets the internal node service |
void |
setNodeService(NodeService nodeService)
Set the node service |
void |
setPermissionService(PermissionService permissionService)
Set the permission service |
void |
setPolicyComponent(PolicyComponent policyComponent)
Sets the policy component |
void |
setRuleService(RuleService ruleService)
Set the rule service |
void |
setSearchService(SearchService searchService)
Sets the search service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CopyServiceImpl()
| Method Detail |
|---|
public void setNodeService(NodeService nodeService)
nodeService - the node servicepublic void setInternalNodeService(NodeService internalNodeService)
internalNodeService - the internal node servicepublic void setDictionaryService(DictionaryService dictionaryService)
dictionaryService - the dictionary servicepublic void setPolicyComponent(PolicyComponent policyComponent)
policyComponent - the policy componentpublic void setSearchService(SearchService searchService)
searchService - the search servicepublic void setRuleService(RuleService ruleService)
ruleService - the rule servicepublic void setPermissionService(PermissionService permissionService)
permissionService - the permission servicepublic void setAuthenticationService(AuthenticationService authenticationService)
authenticationService - the authentication servicepublic void init()
public NodeRef copy(NodeRef sourceNodeRef,
NodeRef destinationParentRef,
QName destinationAssocTypeQName,
QName destinationQName,
boolean copyChildren)
CopyServiceIf 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 CopyServicesourceNodeRef - the node reference used as the source of the copydestinationParentRef - the intended parent of the new nodedestinationAssocTypeQName - the type of the new child assocdestinationQName - the qualified name of the child association from the
parent to the new nodecopyChildren - indicates that the children of the node should also be copied
public NodeRef copyAndRename(NodeRef sourceNodeRef,
NodeRef destinationParent,
QName destinationAssocTypeQName,
QName destinationQName,
boolean copyChildren)
copyAndRename in interface CopyServicesourceNodeRef - the node reference used as the source of the copydestinationParent - the intended parent of the new nodedestinationAssocTypeQName - the type of the new child assocdestinationQName - the qualified name of the child association from the
parent to the new nodecopyChildren - indicates that the children of the node should also be copied
Ensures the copy name is the same as the origional or is renamed to prevent duplicate names.
public NodeRef copy(NodeRef sourceNodeRef,
NodeRef destinationParent,
QName destinationAssocTypeQName,
QName destinationQName)
copy in interface CopyServicesourceNodeRef - the node reference used as the source of the copydestinationParent - the intended parent of the new nodedestinationAssocTypeQName - the type of the new child assocdestinationQName - the qualified name of the child association from the
parent to the new node
CopyService.copy(NodeRef, NodeRef, QName, QName, boolean)
public void copy(NodeRef sourceNodeRef,
NodeRef destinationNodeRef)
CopyServiceThe 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.
copy in interface CopyServicesourceNodeRef - the source node referencedestinationNodeRef - the destination node reference
public void copyAspectOnCopy(QName classRef,
NodeRef sourceNodeRef,
StoreRef destinationStoreRef,
boolean copyToNewNode,
PolicyScope copyDetails)
Doing nothing in this behaviour ensures that the copy aspect found on the source node does not get copied onto the destination node.
sourceClassRef - the source class referencesourceNodeRef - the source node referencecopyDetails - the copy details
public void onCopyOwnable(QName classRef,
NodeRef sourceNodeRef,
StoreRef destinationStoreRef,
boolean copyToNewNode,
PolicyScope copyDetails)
public void onCopyAuthor(QName classRef,
NodeRef sourceNodeRef,
StoreRef destinationStoreRef,
boolean copyToNewNode,
PolicyScope copyDetails)
public void onCopyComplete(QName classRef,
NodeRef sourceNodeRef,
NodeRef destinationRef,
boolean copyToNew,
java.util.Map copyMap)
public java.util.List getCopies(NodeRef nodeRef)
CopyService
getCopies in interface CopyServicenodeRef - the original node reference
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||