Class BeCPGCopyPolicy

All Implemented Interfaces:
org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy, org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy, org.alfresco.repo.policy.ClassPolicy, org.alfresco.repo.policy.Policy

public class BeCPGCopyPolicy extends AbstractBeCPGPolicy implements org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy

BeCPGCopyPolicy class.

Author:
matthieu
  • Field Details

    • COPY_SUFFIX

      private static final String COPY_SUFFIX
      Constant COPY_SUFFIX="|copy"
      See Also:
    • BRANCH_SUFFIX

      private static final String BRANCH_SUFFIX
      Constant BRANCH_SUFFIX="|branch"
      See Also:
    • BRANCH_ONLY_SUFFIX

      private static final String BRANCH_ONLY_SUFFIX
      Constant BRANCH_ONLY_SUFFIX="|branchOnly"
      See Also:
    • logger

      private static final org.slf4j.Logger logger
      Constant logger
    • copyPlugins

      private BeCPGCopyPlugin[] copyPlugins
    • systemConfigurationService

      private SystemConfigurationService systemConfigurationService
    • entityDictionaryService

      private EntityDictionaryService entityDictionaryService
    • entityService

      private EntityService entityService
    • namespaceService

      private org.alfresco.service.namespace.NamespaceService namespaceService
    • associationService

      private AssociationService associationService
  • Constructor Details

    • BeCPGCopyPolicy

      public BeCPGCopyPolicy()
  • Method Details

    • setCopyPlugins

      public void setCopyPlugins(BeCPGCopyPlugin[] copyPlugins)

      Setter for the field copyPlugins.

      Parameters:
      copyPlugins - an array of BeCPGCopyPlugin objects
    • setSystemConfigurationService

      public void setSystemConfigurationService(SystemConfigurationService systemConfigurationService)

      Setter for the field systemConfigurationService.

      Parameters:
      systemConfigurationService - a SystemConfigurationService object
    • setEntityDictionaryService

      public void setEntityDictionaryService(EntityDictionaryService entityDictionaryService)

      Setter for the field entityDictionaryService.

      Parameters:
      entityDictionaryService - a EntityDictionaryService object
    • setEntityService

      public void setEntityService(EntityService entityService)

      Setter for the field entityService.

      Parameters:
      entityService - a EntityService object
    • setNamespaceService

      public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)

      Setter for the field namespaceService.

      Parameters:
      namespaceService - a NamespaceService object
    • setAssociationService

      public void setAssociationService(AssociationService associationService)

      Setter for the field associationService.

      Parameters:
      associationService - a AssociationService object
    • typesToReset

      private List<String> typesToReset()

      typesToReset.

      Returns:
      a List object
    • propertiesToReset

      private List<String> propertiesToReset()

      propertiesToReset.

      Returns:
      a List object
    • doInit

      public void doInit()

      doInit.

      Specified by:
      doInit in class AbstractBeCPGPolicy
    • getCopyCallback

      public org.alfresco.repo.copy.CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, org.alfresco.repo.copy.CopyDetails copyDetails)
      Specified by:
      getCopyCallback in interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy
      Overrides:
      getCopyCallback in class AbstractBeCPGPolicy
    • onCopyComplete

      public void onCopyComplete(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetNodeRef, boolean copyToNewNode, Map<org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.cmr.repository.NodeRef> copyMap)
      Specified by:
      onCopyComplete in interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy
      Overrides:
      onCopyComplete in class AbstractBeCPGPolicy
    • shouldCopyFromPlugins

      private boolean shouldCopyFromPlugins(String typeToReset, org.alfresco.repo.copy.CopyDetails copyDetails)

      shouldCopyFromPlugins.

      Parameters:
      typeToReset - a String object
      copyDetails - a CopyDetails object
      Returns:
      a boolean
    • shouldCopy

      private boolean shouldCopy(String typeToReset, String nodeRefType, org.alfresco.repo.copy.CopyDetails copyDetails)

      shouldCopy.

      Parameters:
      typeToReset - a String object
      nodeRefType - a String object
      copyDetails - a CopyDetails object
      Returns:
      a boolean
    • handleResetProperty

      private void handleResetProperty(BeCPGCopyPolicy.CopyContext context, String propertyToReset)

      handleResetProperty.

      Parameters:
      context - a BeCPGCopyPolicy.CopyContext object
      propertyToReset - a String object
    • extractPropertyName

      private String extractPropertyName(String propertyToReset, BeCPGCopyPolicy.CopyContext context)

      extractPropertyName.

      Parameters:
      propertyToReset - a String object
      context - a BeCPGCopyPolicy.CopyContext object
      Returns:
      a String object