Class AbstractCopyBehaviourCallback

    • Constructor Detail

      • AbstractCopyBehaviourCallback

        public AbstractCopyBehaviourCallback()
    • Method Detail

      • throwExceptionForUnexpectedBehaviour

        protected void throwExceptionForUnexpectedBehaviour​(CopyDetails copyDetails,
                                                            java.lang.String... otherDetails)
        Throws:
        java.lang.IllegalStateException - always
      • recordNodeRefsForRepointing

        public void recordNodeRefsForRepointing​(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
                                                java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> properties,
                                                org.alfresco.service.namespace.QName propertyQName)
        Helper method to transactionally record NodeRef properties so that they can later be fixed up to point to the relative, after-copy locations.

        When the copy has been completed, the second stage of the process can be applied.

        Parameters:
        sourceNodeRef - the node that is being copied
        properties - the node properties being copied
        propertyQName - the qualified name of the property to check
        See Also:
        repointNodeRefs(NodeRef, NodeRef, QName, Map, NodeService)
      • repointNodeRefs

        public void repointNodeRefs​(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
                                    org.alfresco.service.cmr.repository.NodeRef targetNodeRef,
                                    org.alfresco.service.namespace.QName propertyQName,
                                    java.util.Map<org.alfresco.service.cmr.repository.NodeRef,​org.alfresco.service.cmr.repository.NodeRef> copyMap,
                                    org.alfresco.service.cmr.repository.NodeService nodeService)
        The second stage of the NodeRef repointing. Call this method to have any NodeRef properties readjusted to reflect the copied node hierarchy. Only use this method if it a requirement for the particular type or aspect that you are coding for.
        Parameters:
        sourceNodeRef - the source node
        propertyQName - the target node i.e. the copy of the source node
        copyMap - the full hierarchy copy map of source to copies
        See Also:
        recordNodeRefsForRepointing(NodeRef, Map, QName)
      • isTopLevelCanBeRenamed

        public boolean isTopLevelCanBeRenamed​(org.alfresco.service.namespace.QName classQName,
                                              CopyDetails copyDetails)
        By default it is forbidden for top-level nodes to be renamed
        Specified by:
        isTopLevelCanBeRenamed in interface CopyBehaviourCallback
        Parameters:
        classQName - the name of the class that this is being invoked for
        copyDetails - the source node's copy details for quick reference
        Returns:
        true if the top-level node with type or aspect can be renamed during copy.