Class PackageManager

java.lang.Object
org.alfresco.repo.workflow.PackageManager

public class PackageManager extends 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 Details

  • Method Details

    • addItems

      public void addItems(List<NodeRef> items)
    • addItems

      public void addItems(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(List<String> itemStrs)
    • addItem

      public void addItem(NodeRef item)
    • addItem

      public void addItem(String itemStr)
    • removeItems

      public void removeItems(List<NodeRef> items)
    • removeItems

      public void removeItems(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(List<String> itemStrs)
    • removeItem

      public void removeItem(NodeRef item)
    • removeItem

      public void removeItem(String itemStr)
    • create

      public NodeRef create(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(NodeRef packageRef)
      Applies the specified modifications to the package.
      Parameters:
      packageRef - NodeRef