Class PackageManager


  • public class PackageManager
    extends java.lang.Object
    This helper class is used to manage a workflow package. The manager is a stateful object which accumulates all the changes to be made to the package (such as adding and removing package items). These changes are then applied to the package when either the create() or update() method is called.
    Since:
    3.4
    Author:
    Nick Smith
    • Constructor Summary

      Constructors 
      Constructor Description
      PackageManager​(WorkflowService workflowService, org.alfresco.service.cmr.repository.NodeService nodeService, BehaviourFilter behaviourFilter, org.apache.commons.logging.Log logger)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addItem​(java.lang.String itemStr)  
      void addItem​(org.alfresco.service.cmr.repository.NodeRef item)  
      void addItems​(java.lang.String items)
      Takes a comma-separated list of NodeRef ids and adds the specified NodeRefs to the package.
      void addItems​(java.util.List<org.alfresco.service.cmr.repository.NodeRef> items)  
      void addItemsAsStrings​(java.util.List<java.lang.String> itemStrs)  
      org.alfresco.service.cmr.repository.NodeRef create​(org.alfresco.service.cmr.repository.NodeRef container)
      Creates a new Workflow package using the specified container.
      void removeItem​(java.lang.String itemStr)  
      void removeItem​(org.alfresco.service.cmr.repository.NodeRef item)  
      void removeItems​(java.lang.String items)
      Takes a comma-separated list of NodeRef ids and adds the specified NodeRefs to the package.
      void removeItems​(java.util.List<org.alfresco.service.cmr.repository.NodeRef> items)  
      void removeItemsAsStrings​(java.util.List<java.lang.String> itemStrs)  
      void update​(org.alfresco.service.cmr.repository.NodeRef packageRef)
      Applies the specified modifications to the package.
      • Methods inherited from class java.lang.Object

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

      • PackageManager

        public PackageManager​(WorkflowService workflowService,
                              org.alfresco.service.cmr.repository.NodeService nodeService,
                              BehaviourFilter behaviourFilter,
                              org.apache.commons.logging.Log logger)
    • Method Detail

      • addItems

        public void addItems​(java.util.List<org.alfresco.service.cmr.repository.NodeRef> items)
      • addItems

        public void addItems​(java.lang.String items)
        Takes a comma-separated list of NodeRef ids and adds the specified NodeRefs to the package.
        Parameters:
        items - String
      • addItemsAsStrings

        public void addItemsAsStrings​(java.util.List<java.lang.String> itemStrs)
      • addItem

        public void addItem​(org.alfresco.service.cmr.repository.NodeRef item)
      • addItem

        public void addItem​(java.lang.String itemStr)
      • removeItems

        public void removeItems​(java.util.List<org.alfresco.service.cmr.repository.NodeRef> items)
      • removeItems

        public void removeItems​(java.lang.String items)
        Takes a comma-separated list of NodeRef ids and adds the specified NodeRefs to the package.
        Parameters:
        items - String
      • removeItemsAsStrings

        public void removeItemsAsStrings​(java.util.List<java.lang.String> itemStrs)
      • removeItem

        public void removeItem​(org.alfresco.service.cmr.repository.NodeRef item)
      • removeItem

        public void removeItem​(java.lang.String itemStr)
      • create

        public org.alfresco.service.cmr.repository.NodeRef create​(org.alfresco.service.cmr.repository.NodeRef container)
                                                           throws WorkflowException
        Creates a new Workflow package using the specified container. If the container is null then a new container node is created. Applies the specified updates to the package after it is created.
        Parameters:
        container - NodeRef
        Returns:
        the package NodeRef.
        Throws:
        WorkflowException - if the specified container is already package.
      • update

        public void update​(org.alfresco.service.cmr.repository.NodeRef packageRef)
        Applies the specified modifications to the package.
        Parameters:
        packageRef - NodeRef