Class AbstractBaseCopyService

  • Direct Known Subclasses:
    CopyServiceImpl, FileFolderServiceImpl

    public class AbstractBaseCopyService
    extends java.lang.Object
    This is a base class for all the copy services. Introduces general methods for collecting all the properties, which are required to perform a copying
    Since:
    4.1.5
    Author:
    Dmitry Velichkevich
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AbstractBaseCopyService.AssociationCopyInfo
      Simple container for storing data required to copy a node, including the parent association that will be copied along with the new path part of the association that will be created by the copy.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected AbstractBaseCopyService.AssociationCopyInfo getAssociationCopyInfo​(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef sourceParentRef, java.lang.String newName, boolean nameChanged)
      Calculates QName type of target association, which will be created after copying
      java.util.List<java.lang.String> getSystemNamespaces()  
      void setSystemNamespaces​(java.util.List<java.lang.String> systemNamespaces)
      Set the namespaces that should be treated as 'system' namespaces.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractBaseCopyService

        public AbstractBaseCopyService()
    • Method Detail

      • setSystemNamespaces

        public void setSystemNamespaces​(java.util.List<java.lang.String> systemNamespaces)
        Set the namespaces that should be treated as 'system' namespaces.

        When files or folders are renamed, the association path (QName) is normally modified to follow the name of the node. If, however, the namespace of the patch QName is in this list, the association path is left alone. This allows parts of the application to use well-known paths even if the end-user is able to modify the objects cm:name value.

        Parameters:
        systemNamespaces - a list of system namespaces
      • getSystemNamespaces

        public java.util.List<java.lang.String> getSystemNamespaces()
      • getAssociationCopyInfo

        protected AbstractBaseCopyService.AssociationCopyInfo getAssociationCopyInfo​(org.alfresco.service.cmr.repository.NodeService nodeService,
                                                                                     org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
                                                                                     org.alfresco.service.cmr.repository.NodeRef sourceParentRef,
                                                                                     java.lang.String newName,
                                                                                     boolean nameChanged)
        Calculates QName type of target association, which will be created after copying
        Parameters:
        sourceNodeRef - the node that will be copied (never null)
        sourceParentRef - the parent of the node being copied (may be null)
        newName - the planned new name of the node
        nameChanged - true if the name of the node is being changed
        Returns:
        Returns the path part for a new association and the effective primary parent association that was used