Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.portal.tools.content.controls
Interface ContentWorkflowControl

    @ControlInterface
    public interface ContentWorkflowControl

Control to represent interface to workflow methods in content mgmt system.

Method Summary
`Workflow` | `addWorkflow(ContentContext context, String repositoryName, String name, String comment, byte[] data)` Add a new workflow document to the system.
`SortableFilterablePagedResult<Workflow>` | `getAllAssociableWorkflows(ContentContext context, String repositoryName, int pageSize)` Returns all the workflows in the specified repository [Including the Default Workflow document] to which the user has can_associate capability.
`Workflow[]` | `getAllWorkflows(ContentContext context, String repositoryName)` Returns all the workflows in the specified repository [Including the Default Lifecycle document] Please note that these workflow documents are lightweight objects and do not contain the actual workflow data.
`SortableFilterablePagedResult<Workflow>` | `getAllWorkflows(ContentContext context, String repositoryName, int pageSize)` Returns all the workflows in the specified repository [Including the Default Lifecycle document] Please note that these workflow documents are lightweight objects and do not contain the actual workflow data.
`Workflow` | `getDefaultWorkflow(ContentContext context, String repositoryName)` Returns the default workflow for the given repository.
`Node[]` | `getNodesForWorkflow(ContentContext context, ID workflowId)` Returns the Nodes associated with the given workflow.
`SortableFilterablePagedResult<Node>` | `getNodesForWorkflow(ContentContext context, ID workflowId, int pageSize)` Returns the Nodes associated with the given workflow.
`List<String>` | `getStatusOptions(Node node, Version version, ContentContext contentContext)` Gets a list of valid workflow statuses that the given node version can transition to, considering the current workflow status
`Map<Integer,String>` | `getStatusOptionsMap(Node node, Version version, ContentContext contentContext)` Gets a list of valid workflow statuses (with corresponding int value) that the given node version can transition to, considering the current workflow status
`byte[]` | `getStream(ContentContext context, ID workflowId)` Allow users to download the byte[] representing the document of the workflow.
`ObjectClass[]` | `getTypesForWorkflow(ContentContext context, ID workflowId)` Returns the Types associated with the given workflow.
`SortableFilterablePagedResult<ObjectClass>` | `getTypesForWorkflow(ContentContext context, ID workflowId, int pageSize)` Returns the Types associated with the given workflow.
`Workflow` | `getWorkflow(ContentContext context, ID id)` Return a specific workflow document with the given id
`Workflow` | `getWorkflow(ContentContext context, String repositoryName, String name)` Return a specific workflow document with the given name
`Workflow` | `getWorkflowForNode(ContentContext context, ID nodeId)` Returns the workflow document associated with the node.
`Workflow` | `getWorkflowForType(ContentContext context, ID typeId)` Get the workflow for the type.
`Workflow` | `getWorkflowOrDefaultWorkflowForNode(ContentContext contentContext, Node node)` Returns the workflow document associated with the node.
`boolean` | `hasAssociateCapability(ContentContext context, String repositoryName, Workflow workflow)` Check to see if the given workflow has CAN_ASSOCIATE capability for it to be associated with a node for the current user.
`boolean` | `hasCreateCapability(ContentContext context, String repositoryName, Workflow workflow)` Check to see if the given workflow hasCreateCapability
`boolean` | `hasDeleteCapability(ContentContext context, String repositoryName, Workflow workflow)` Check to see if the given workflow hasDeleteCapability for the current user.
`boolean` | `hasUpdateCapability(ContentContext context, String repositoryName, Workflow workflow)` Check to see if the given workflow hasUpdateCapability for the current user.
`boolean` | `hasViewCapability(ContentContext context, String repositoryName, Workflow workflow)` Check to see if the given workflow hasViewCapability for the current user.
`void` | `remove(ContentContext context, ID id)` Delete the specified workflow document from the system.
`void` | `save(ContentContext context, ID id, byte[] data)` Updates the workflow document data.
`void` | `save(ContentContext context, ID id, String name, String comment)` Update the workflow document meta-data.
`void` | `setDefaultWorkflow(ContentContext context, String repositoryName, byte[] data)` Sets a default workflow for the repository
`void` | `setNodeWorkflow(ContentContext context, ID nodeId, ID workflowId)` Sets the specific workflow document to the given node.
`void` | `setTypeWorkflow(ContentContext context, ID typeId, ID workflowId)` Sets the specific workflow document to the given type.

Method Detail

### addWorkflow

    Workflow addWorkflow(ContentContext context,
                         String repositoryName,
                         String name,
                         String comment,
                         byte[] data)
                         throws WorkflowExistsException,
                                DefaultWorkflowException,
                                RepositoryException

  Add a new workflow document to the system. A user will need create capabilities to create a new workflow.

  Parameters
    `context` - The ContentContext object
    `name` - Name of the workflow
    `comment` - The comment associated with the workflow.
    `data` - Byte Array of the file representing workflow data.
  Throws
    `WorkflowExistsException` - If the workflow with the specified name already exists.
    `DefaultWorkflowException` - If user tried to add a default workflow in the system.
    `RepositoryException` - If the workflow was not added due to other problem.

### remove

    void remove(ContentContext context,
                ID id)
                throws DefaultWorkflowException,
                       WorkflowInUseException,
                       RepositoryException

  Delete the specified workflow document from the system. This operation will be disallowed if user does not have delete privileges on the workflow.

  Parameters
    `context` - The ContentContext object
    `id` - The ID associated with the workflow object
  Throws
    `DefaultWorkflowException` - If user tried to delete the default workflow.
    `WorkflowInUseException` - If the user tried to delete a workflow which was in use.
    `RepositoryException` - If the workflow was not deleted due to some other problem.

### getAllWorkflows

    Workflow[] getAllWorkflows(ContentContext context,
                               String repositoryName)
                               throws RepositoryException

  Returns all the workflows in the specified repository [Including the Default Lifecycle document] Please note that these workflow documents are lightweight objects and do not contain the actual workflow data. The workflow document is lazily loaded on demand from the spi. This method will only return workflows to which the user has view capabilities.

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository.
  Throws
    `RepositoryException` - If workflows cannot be retrieved due to some other issue.

### getAllWorkflows

    SortableFilterablePagedResult<Workflow> getAllWorkflows(ContentContext context,
                                                            String repositoryName,
                                                            int pageSize)
                                                            throws RepositoryException

  Returns all the workflows in the specified repository [Including the Default Lifecycle document] Please note that these workflow documents are lightweight objects and do not contain the actual workflow data. The workflow document is lazily loaded on demand from the spi. This method will only return workflows to which the user has view capabilities.

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository.
    `pageSize` - the number of items per page in the PagedResult
  Returns
    A PagedResult of all the workflows in the repository
  Throws
    `RepositoryException` - If there is another exception in the repository.

### getAllAssociableWorkflows

    SortableFilterablePagedResult<Workflow> getAllAssociableWorkflows(ContentContext context,
                                                                      String repositoryName,
                                                                      int pageSize)
                                                                      throws RepositoryException

  Returns all the workflows in the specified repository [Including the Default Workflow document] to which the user has can_associate capability. Please note that these workflow documents are lightweight objects and do not contain the actual workflow data, until explicitly asked for.

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository.
    `pageSize` - the number of items per page in the PagedResult
  Returns
    A PagedResult of all associable workflows in the repository
  Throws
    `RepositoryException` - If workflows cannot be retrieved due to some other issue.

### getWorkflow

    Workflow getWorkflow(ContentContext context,
                         ID id)
                         throws NoSuchWorkflowException,
                                RepositoryException

  Return a specific workflow document with the given id

  Parameters
    `context` - The ContentContext object
    `id` - The ID of the workflow
  Returns
    The Workflow representing the workflow document.
  Throws
    `NoSuchWorkflowException` - If the workflow document does not exist.
    `RepositoryException` - If some other error happens.

### getWorkflow

    Workflow getWorkflow(ContentContext context,
                         String repositoryName,
                         String name)
                         throws NoSuchWorkflowException,
                                RepositoryException

  Return a specific workflow document with the given name

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository
    `name` - The name of the workflow
  Returns
    The Workflow representing the workflow document.
  Throws
    `NoSuchWorkflowException` - If the workflow document does not exist.
    `RepositoryException` - If some other error happens.

### getDefaultWorkflow

    Workflow getDefaultWorkflow(ContentContext context,
                                String repositoryName)
                                throws RepositoryException

  Returns the default workflow for the given repository. Every repository has one default workflow associated with it.

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository
  Returns
    The Workflow representing the workflow documemnt.
  Throws
    `RepositoryException` - If there is another exception in the repository.

### setDefaultWorkflow

    void setDefaultWorkflow(ContentContext context,
                            String repositoryName,
                            byte[] data)
                            throws RepositoryException

  Sets a default workflow for the repository

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository
    `data` - The data for the workflow xml document. The document should conform to the workflow schema
  Throws
    `RepositoryException`

### save

    void save(ContentContext context,
              ID id,
              String name,
              String comment)
              throws RepositoryException

  Update the workflow document meta-data. This operation will not succeed if user tries to update default workflow meta-data. Also the operation might fail if the user tried to update the name of the workflow to a workflow which already exists in the system.

  Parameters
    `context` - The ContentContext object
    `id` - The id of the workflow
    `name` - The new name of the workflow
    `comment` - The new comment for the workflow.
  Throws
    `RepositoryException` - If the the update of the metadata fails for some reason

### save

    void save(ContentContext context,
              ID id,
              byte[] data)
              throws RepositoryException

  Updates the workflow document data. This operation will disallow updating Default LifeCycle's meta-data

  Parameters
    `context` - The ContentContext object
    `id` - The ID of the workflow
    `data` - The data associated with the workflow
  Throws
    `RepositoryException` - If the update of the workflow does not work, or if the workflow is in use by another node in the system.

### setNodeWorkflow

    void setNodeWorkflow(ContentContext context,
                         ID nodeId,
                         ID workflowId)
                         throws RepositoryException

  Sets the specific workflow document to the given node. This allows all further operations like checkIn/checkOut to follow the workflow specified in the workflow document.

  Parameters
    `context` - The ContentContext object
    `nodeId` - The NodeId
    `workflowId` - The workflowId. The UID in the ID can be set to null to remove the workflow from the node.
  Throws
    `RepositoryException` - If the operation fails for some reason. This can also be thrown if a node already has a workflow associated with it.

### setTypeWorkflow

    void setTypeWorkflow(ContentContext context,
                         ID typeId,
                         ID workflowId)
                         throws RepositoryException

  Sets the specific workflow document to the given type. This allows all further operations like checkIn/checkOut for all instances of that type to follow the specified workflow.

  Parameters
    `context` - The ContentContext object
    `typeId` - The Type ID
    `workflowId` - The workflowId. The UID in the ID can be set to null to remove the workflow from the type.
  Throws
    `RepositoryException` - If the operation fails for some reason.

### getWorkflowForNode

    Workflow getWorkflowForNode(ContentContext context,
                                ID nodeId)
                                throws AuthorizationException,
                                       RepositoryException

  Returns the workflow document associated with the node. The order of precedence by which a workflow document is returned is as follows : a) If a workflow document is explicitly set on that node, it is returned. b) If no workflow document is set on that node, the workflow document associated with the type of the node is returned. c) If node has no type associated with it, or there is no workflow set on the type the system walks up the hierarchy to see if there is any parent node in the hierarchy which has a workflow set and returns that.

  Parameters
    `context` - The ContentContext object
    `nodeId` - The node ID object.
  Returns
    The workflowObject for that node. If the node has no workflow object associated with it, it should return null. This will indicate the system to use the default workflow for that node when the node has been checked out.
  Throws
    `RepositoryException` - if the operation does not succeed.
    `AuthorizationException`

### getWorkflowForType

    Workflow getWorkflowForType(ContentContext context,
                                ID typeId)
                                throws AuthorizationException,
                                       RepositoryException

  Get the workflow for the type.

  Parameters
    `context` - The ContentContext object
    `typeId` - The type ID object.
  Returns
    The workflow associated with the type. Will return null if type has no workflow associated with it.
  Throws
    `AuthorizationException`
    `RepositoryException`

### getNodesForWorkflow

    Node[] getNodesForWorkflow(ContentContext context,
                               ID workflowId)
                               throws RepositoryException

  Returns the Nodes associated with the given workflow. Will not return any nodes the user does not have view privileges on. This will also not return the nodes on which the workflow is inherited but will only return the nodes on which the workflow is explicitly set.

  Parameters
    `context` - The ContentContext object
    `workflowId` - The Workflow ID object
  Returns
    An Array of Nodes representing the workflow.
  Throws
    `RepositoryException` - If the opoeration does not succeed.

### getNodesForWorkflow

    SortableFilterablePagedResult<Node> getNodesForWorkflow(ContentContext context,
                                                            ID workflowId,
                                                            int pageSize)
                                                            throws RepositoryException

  Returns the Nodes associated with the given workflow. Will not return any nodes the user does not have view privileges on. This will also not return the nodes on which the workflow is inherited but will only return the nodes on which the workflow is explicitly set.

  Parameters
    `context` - The ContentContext object
    `workflowId` - The Workflow ID object
    `pageSize` - number of items per page in the PagedResult
  Returns
    A PagedResult of all the nodes for the workflow
  Throws
    `RepositoryException`

### getTypesForWorkflow

    ObjectClass[] getTypesForWorkflow(ContentContext context,
                                      ID workflowId)
                                      throws RepositoryException

  Returns the Types associated with the given workflow. Will not return any types the user does not have view privileges on. This will also not return the types on which the workflow is inherited but will only return the types on which the workflow is explicitly set.

  Parameters
    `context` - The ContentContext object
    `workflowId` - The Workflow ID object
  Returns
    An Array of Types representing the workflow.
  Throws
    `RepositoryException` - If the opoeration does not succeed.

### getTypesForWorkflow

    SortableFilterablePagedResult<ObjectClass> getTypesForWorkflow(ContentContext context,
                                                                   ID workflowId,
                                                                   int pageSize)
                                                                   throws RepositoryException

  Returns the Types associated with the given workflow. Will not return any types the user does not have view privileges on. This will also not return the types on which the workflow is inherited but will only return the types on which the workflow is explicitly set.

  Parameters
    `context` - The ContentContext object
    `workflowId` - The Workflow ID object
    `pageSize` - number of items per page in the PagedResult
  Returns
    A PagedResult of all the types for the workflow
  Throws
    `RepositoryException`

### getStream

    byte[] getStream(ContentContext context,
                     ID workflowId)
                     throws RepositoryException

  Allow users to download the byte[] representing the document of the workflow.

  Parameters
    `context` -
    `workflowId` -
  Returns
    the byte[] representing the document of the workflow
  Throws
    `RepositoryException`

### hasCreateCapability

    boolean hasCreateCapability(ContentContext context,
                                String repositoryName,
                                Workflow workflow)
                                throws AuthorizationException

  Check to see if the given workflow hasCreateCapability

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository.
    `workflow` - The workflow. Null checks at the root
  Returns
    true or false depending on whether the workflow has the capability or not.
  Throws
    `AuthorizationException`

### hasDeleteCapability

    boolean hasDeleteCapability(ContentContext context,
                                String repositoryName,
                                Workflow workflow)
                                throws AuthorizationException

  Check to see if the given workflow hasDeleteCapability for the current user.

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the reposihey btory.
    `workflow` - The workflow. Null checks at the root
  Returns
    true or false depending on whether the workflow has the capability or not.
  Throws
    `AuthorizationException`

### hasViewCapability

    boolean hasViewCapability(ContentContext context,
                              String repositoryName,
                              Workflow workflow)
                              throws AuthorizationException

  Check to see if the given workflow hasViewCapability for the current user.

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository.
    `workflow` - The workflow. Null checks at the root
  Returns
    true or false depending on whether the workflow has the capability or not.
  Throws
    `AuthorizationException`

### hasUpdateCapability

    boolean hasUpdateCapability(ContentContext context,
                                String repositoryName,
                                Workflow workflow)
                                throws AuthorizationException

  Check to see if the given workflow hasUpdateCapability for the current user.

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository.
    `workflow` - The workflow. Null checks at the root
  Returns
    true or false depending on whether the workflow has the capability or not.
  Throws
    `AuthorizationException`

### hasAssociateCapability

    boolean hasAssociateCapability(ContentContext context,
                                   String repositoryName,
                                   Workflow workflow)
                                   throws AuthorizationException

  Check to see if the given workflow has CAN_ASSOCIATE capability for it to be associated with a node for the current user.

  Parameters
    `context` - The ContentContext object
    `repositoryName` - The name of the repository.
    `workflow` - The workflow. Null checks at the root
  Returns
    true or false depending on whether the workflow has the capability or not.
  Throws
    `AuthorizationException`

### getStatusOptions

    List<String> getStatusOptions(Node node,
                                  Version version,
                                  ContentContext contentContext)
                                  throws RepositoryException

  Gets a list of valid workflow statuses that the given node version can transition to, considering the current workflow status

  Parameters
    `node` -
    `version` -
    `contentContext` -
  Throws
    `RepositoryException`

### getStatusOptionsMap

    Map<Integer,String> getStatusOptionsMap(Node node,
                                            Version version,
                                            ContentContext contentContext)
                                            throws RepositoryException

  Gets a list of valid workflow statuses (with corresponding int value) that the given node version can transition to, considering the current workflow status

  Parameters
    `node` -
    `version` -
    `contentContext` -
  Throws
    `RepositoryException`

### getWorkflowOrDefaultWorkflowForNode

    Workflow getWorkflowOrDefaultWorkflowForNode(ContentContext contentContext,
                                                 Node node)
                                                 throws RepositoryException

  Returns the workflow document associated with the node. The order of precedence by which a workflow document is returned is as follows : a) If a workflow document is explicitly set on that node, it is returned. b) If no workflow document is set on that node, the workflow document associated with the type of the node is returned. c) If node has no type associated with it, or there is no workflow set on the type the system walks up the hierarchy to see if there is any parent node in the hierarchy which has a workflow set and returns that. If there is no workflow associated with the node according to the algorithm given above then the default workflow for the repository is returned.

  Parameters
    `contentContext` -
    `node` -
  Returns
    the workflow document associated with the node or the default workflow for the repository
  Throws
    `RepositoryException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.