Interface WorkflowPackageManager


  • @ProviderType
    public interface WorkflowPackageManager
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      com.day.cq.wcm.api.Page create​(org.apache.sling.api.resource.ResourceResolver resourceResolver, String name, String... paths)
      Creates a Workflow Package for the provided paths.
      com.day.cq.wcm.api.Page create​(org.apache.sling.api.resource.ResourceResolver resourceResolver, String bucketSegment, String name, String... paths)
      Creates a Workflow Package for the provided paths.
      void delete​(org.apache.sling.api.resource.ResourceResolver resourceResolver, String workflowPackagePath)
      Deletes the specified Workflow Package.
      List<String> getPaths​(org.apache.sling.api.resource.ResourceResolver resourceResolver, String workflowPackagePath)
      Gets the payload paths in the Workflow Package.
      List<String> getPaths​(org.apache.sling.api.resource.ResourceResolver resourceResolver, String workflowPackagePath, String[] nodeTypes)
      Gets the payload paths in the Workflow Package.
      boolean isWorkflowPackage​(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)
      Checks if the resource at the specified path is a Workflow Package Page.
    • Method Detail

      • create

        com.day.cq.wcm.api.Page create​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                       String bucketSegment,
                                       String name,
                                       String... paths)
                                throws com.day.cq.wcm.api.WCMException,
                                       javax.jcr.RepositoryException
        Creates a Workflow Package for the provided paths. The Workflow Page will include the provided paths and any jcr:content sub-structure. Stores all workflow packages under /etc/workflow/packages/{bucketSegment}
        Parameters:
        resourceResolver - the resource resolver used to create the package
        bucketSegment - a path segment used to organize workflow packages
        name - the name of the package
        paths - the paths to include
        Returns:
        the Page representing the Workflow Page
        Throws:
        com.day.cq.wcm.api.WCMException
        javax.jcr.RepositoryException
      • create

        com.day.cq.wcm.api.Page create​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                       String name,
                                       String... paths)
                                throws com.day.cq.wcm.api.WCMException,
                                       javax.jcr.RepositoryException
        Creates a Workflow Package for the provided paths. The Workflow Page will include the provided paths and any jcr:content sub-structure. Stores all workflow packages under /etc/workflow/packages
        Parameters:
        resourceResolver - the resource resolver used to create the package
        name - the name of the package
        paths - the paths to include
        Returns:
        the Page representing the Workflow Page
        Throws:
        com.day.cq.wcm.api.WCMException
        javax.jcr.RepositoryException
      • getPaths

        List<String> getPaths​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                              String workflowPackagePath)
                       throws javax.jcr.RepositoryException
        Gets the payload paths in the Workflow Package. This method will always return a List. - If the path does not resolve to a resource > an empty list - If the path does not resolve to a Workflow Package > a List of one item; the param path - If the path does resolve to a Workflow Package > a List of all resources in the Workflow Package but not the WF Package itself.
        Parameters:
        resourceResolver - The resource resolver to access the Workflow Package
        workflowPackagePath - the absolute path to the Workflow Package
        Returns:
        a list of paths contained in the Workflow Package
        Throws:
        javax.jcr.RepositoryException
      • getPaths

        List<String> getPaths​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                              String workflowPackagePath,
                              String[] nodeTypes)
                       throws javax.jcr.RepositoryException
        Gets the payload paths in the Workflow Package. This method will always return a List. - If the path does not resolve to a resource > an empty list - If the path does not resolve to a Workflow Package > a List of one item; the param path - If the path does resolve to a Workflow Package > a List of all resources in the Workflow Package but not the WF Package itself.
        Parameters:
        resourceResolver - The resource resolver to access the Workflow Package
        workflowPackagePath - the absolute path to the Workflow Package
        nodeTypes - the allowed node types to include in the Workflow Package
        Returns:
        a list of paths contained in the Workflow Package
        Throws:
        javax.jcr.RepositoryException
      • delete

        void delete​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                    String workflowPackagePath)
             throws javax.jcr.RepositoryException
        Deletes the specified Workflow Package.
        Parameters:
        resourceResolver - The resource resolver to access the Workflow Package
        workflowPackagePath - the absolute path to the Workflow Package to delete
        Throws:
        javax.jcr.RepositoryException
      • isWorkflowPackage

        boolean isWorkflowPackage​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                  String path)
        Checks if the resource at the specified path is a Workflow Package Page.
        Parameters:
        resourceResolver - The resource resolver to access the Workflow Package candidate
        path - The path to the candidate Workflow Package
        Returns:
        true if the path points to a Workflow Package Page