org.apache.lenya.cms.workflow
Class WorkflowUtil

java.lang.Object
  extended by org.apache.lenya.cms.workflow.WorkflowUtil

public class WorkflowUtil
extends java.lang.Object

Utility class for workflow tasks.

Version:
$Id:$

Constructor Summary
WorkflowUtil()
           
 
Method Summary
static boolean canInvoke(org.apache.avalon.framework.service.ServiceManager manager, Session session, org.apache.avalon.framework.logger.Logger logger, DocumentSet documents, java.lang.String event)
          Checks if an event can be invoked on all documents in a set.
static boolean canInvoke(org.apache.avalon.framework.service.ServiceManager manager, Session session, org.apache.avalon.framework.logger.Logger logger, Document document, java.lang.String event)
          Checks if an event can be invoked on a document.
static Workflowable getWorkflowable(org.apache.avalon.framework.service.ServiceManager manager, Session session, org.apache.avalon.framework.logger.Logger logger, Document document)
          Returns a workflowable for a document.
static Workflow getWorkflowSchema(org.apache.avalon.framework.service.ServiceManager manager, Session session, org.apache.avalon.framework.logger.Logger logger, Document document)
          Returns the workflow schema of a document.
static boolean hasWorkflow(org.apache.avalon.framework.service.ServiceManager manager, Session session, org.apache.avalon.framework.logger.Logger logger, Document document)
          Returns if a document has a workflow.
static void invoke(org.apache.avalon.framework.service.ServiceManager manager, Session session, org.apache.avalon.framework.logger.Logger logger, DocumentSet documentSet, java.lang.String event, boolean force)
          Invokes a workflow event on a document set.
static void invoke(org.apache.avalon.framework.service.ServiceManager manager, Session session, org.apache.avalon.framework.logger.Logger logger, Document document, java.lang.String event)
          Invokes a workflow event on a document.
static void invoke(org.apache.avalon.framework.service.ServiceManager manager, Session session, org.apache.avalon.framework.logger.Logger logger, Document document, java.lang.String event, boolean force)
          Invokes a workflow event on a document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowUtil

public WorkflowUtil()
Method Detail

invoke

public static void invoke(org.apache.avalon.framework.service.ServiceManager manager,
                          Session session,
                          org.apache.avalon.framework.logger.Logger logger,
                          Document document,
                          java.lang.String event)
                   throws WorkflowException
Invokes a workflow event on a document. This is the same as invoke(Document, String, true).

Parameters:
manager - The service manager.
session - The repository session.
logger - The logger.
document - The document.
event - The name of the event.
Throws:
WorkflowException - if the event could not be invoked in the current situation.

invoke

public static void invoke(org.apache.avalon.framework.service.ServiceManager manager,
                          Session session,
                          org.apache.avalon.framework.logger.Logger logger,
                          Document document,
                          java.lang.String event,
                          boolean force)
                   throws WorkflowException
Invokes a workflow event on a document.

Parameters:
manager - The service manager.
session - The repository session.
logger - The logger.
document - The document.
event - The name of the event.
force - If this is set to true, the execution is forced, which means an exception is thrown if the workflowable in the set does not support the event. If set to false, non-supporting documents are ignored.
Throws:
WorkflowException - if the event could not be invoked in the current situation.

invoke

public static void invoke(org.apache.avalon.framework.service.ServiceManager manager,
                          Session session,
                          org.apache.avalon.framework.logger.Logger logger,
                          DocumentSet documentSet,
                          java.lang.String event,
                          boolean force)
                   throws WorkflowException
Invokes a workflow event on a document set.

Parameters:
manager - The service manager.
session - The repository session.
logger - The logger.
documentSet - The document.
event - The event.
force - If this is set to true, the execution is forced, which means an exception is thrown if a document in the set does not support the event. If set to false, non-supporting documents are ignored.
Throws:
WorkflowException - if force is set to true and a document does not support the workflow event.

canInvoke

public static boolean canInvoke(org.apache.avalon.framework.service.ServiceManager manager,
                                Session session,
                                org.apache.avalon.framework.logger.Logger logger,
                                Document document,
                                java.lang.String event)
                         throws WorkflowException
Checks if an event can be invoked on a document.

Parameters:
manager - The service manager.
session - The repository session.
logger - The logger.
document - The document.
event - The event.
Returns:
A boolean value.
Throws:
WorkflowException

canInvoke

public static boolean canInvoke(org.apache.avalon.framework.service.ServiceManager manager,
                                Session session,
                                org.apache.avalon.framework.logger.Logger logger,
                                DocumentSet documents,
                                java.lang.String event)
                         throws WorkflowException
Checks if an event can be invoked on all documents in a set.

Parameters:
manager - The service manager.
session - The repository session.
logger - The logger.
documents - The documents.
event - The event.
Returns:
if an error occurs.
Throws:
WorkflowException

hasWorkflow

public static boolean hasWorkflow(org.apache.avalon.framework.service.ServiceManager manager,
                                  Session session,
                                  org.apache.avalon.framework.logger.Logger logger,
                                  Document document)
                           throws WorkflowException
Returns if a document has a workflow.

Parameters:
manager - The service manager.
session - The repository session.
logger - The logger.
document - The document.
Returns:
A boolean value.
Throws:
WorkflowException - if an error occurs.

getWorkflowSchema

public static Workflow getWorkflowSchema(org.apache.avalon.framework.service.ServiceManager manager,
                                         Session session,
                                         org.apache.avalon.framework.logger.Logger logger,
                                         Document document)
                                  throws WorkflowException
Returns the workflow schema of a document.

Parameters:
manager - The service manager.
session - The repository session.
logger - The logger.
document - The document.
Returns:
A workflow schema.
Throws:
WorkflowException - if an error occurs.

getWorkflowable

public static Workflowable getWorkflowable(org.apache.avalon.framework.service.ServiceManager manager,
                                           Session session,
                                           org.apache.avalon.framework.logger.Logger logger,
                                           Document document)
Returns a workflowable for a document.

Parameters:
manager - The service manager.
session - The session.
logger - The logger.
document - The document.
Returns:
A workflowable.


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.