org.apache.lenya.cms.cocoon.flow
Class FlowHelper

java.lang.Object
  extended by org.apache.lenya.cms.cocoon.flow.FlowHelper

public class FlowHelper
extends java.lang.Object

Flowscript utility class. The FOM_Cocoon object is not passed in the constructor to avoid errors. This way, not the initial, but the current FOM_Cocoon object is used by the methods.


Field Summary
static java.lang.String SEPARATOR
           
 
Constructor Summary
FlowHelper()
          Ctor.
 
Method Summary
 DocumentHelper getDocumentHelper(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
          Returns a DocumentHelper instance.
 java.lang.String getImageParameterValue(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon, java.lang.String parameterName)
          Resolves the request parameter value for a specific name.
 java.util.Map getObjectModel(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
          Returns the Cocoon Object Model
 PageEnvelope getPageEnvelope(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
          Returns the current page envelope.
 org.apache.cocoon.environment.Request getRequest(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
          Returns the request object of the current request.
 java.lang.String getRequestURI(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
          Returns the request URI of the current request.
 RevisionController getRevisionController(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
          Get a RevisionController instance.
 Situation getSituation(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
          Returns the current workflow situation.
 void reservedCheckIn(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon, boolean backup)
          Checkis in the current document from the PageEnvelope context.
 void triggerWorkflow(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon, java.lang.String event)
          Trigger a workflow event for the document associated with the current PageEnvelope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final java.lang.String SEPARATOR
See Also:
Constant Field Values
Constructor Detail

FlowHelper

public FlowHelper()
Ctor.

Method Detail

getSituation

public Situation getSituation(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
                       throws AccessControlException
Returns the current workflow situation.

Parameters:
cocoon - The FOM_Cocoon object.
Returns:
A situation.
Throws:
AccessControlException - when something went wrong.

getPageEnvelope

public PageEnvelope getPageEnvelope(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
                             throws PageEnvelopeException
Returns the current page envelope.

Parameters:
cocoon - The FOM_Cocoon object.
Returns:
A page envelope.
Throws:
PageEnvelopeException - when something went wrong.

getRequestURI

public java.lang.String getRequestURI(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
Returns the request URI of the current request.

Parameters:
cocoon - The FOM_Cocoon object.
Returns:
A string.

getRequest

public org.apache.cocoon.environment.Request getRequest(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
Returns the request object of the current request.

Parameters:
cocoon - The FOM_Cocoon object.
Returns:
A request object.

getObjectModel

public java.util.Map getObjectModel(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
Returns the Cocoon Object Model

Parameters:
cocoon - The Flow Object Model of Cocoon
Returns:
The object model

getDocumentHelper

public DocumentHelper getDocumentHelper(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
Returns a DocumentHelper instance.

Parameters:
cocoon - The Flow Object Model of Cocoon
Returns:
The document helper
See Also:
DocumentHelper

getImageParameterValue

public java.lang.String getImageParameterValue(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon,
                                               java.lang.String parameterName)
Resolves the request parameter value for a specific name. The parameter names are encoded as {name}:{value}.{axis}. This is a workaround for the <input type="image"/> bug in Internet Explorer.

Parameters:
cocoon - The FOM_Cocoon object.
parameterName - The request parameter name.
Returns:
A string.

triggerWorkflow

public void triggerWorkflow(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon,
                            java.lang.String event)
                     throws WorkflowException,
                            PageEnvelopeException,
                            AccessControlException
Trigger a workflow event for the document associated with the current PageEnvelope.

Parameters:
cocoon - The Cocoon Flow Object Model
event - The name of the workflow event to trigger.
Throws:
WorkflowException - If an workflow error occurs
PageEnvelopeException - Page envelope can not operate properly.
AccessControlException - If an access control violation occurs.

getRevisionController

public RevisionController getRevisionController(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
                                         throws PageEnvelopeException,
                                                java.io.IOException
Get a RevisionController instance.

Parameters:
cocoon - The Cocoon Flow Object Model
Throws:
PageEnvelopeException - Page envelope can not operate properly.
java.io.IOException - If an IOException occurs.
See Also:
PageEnvelope, RevisionController

reservedCheckIn

public void reservedCheckIn(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon,
                            boolean backup)
                     throws FileReservedCheckInException,
                            java.lang.Exception
Checkis in the current document from the PageEnvelope context.

Parameters:
cocoon - The Cocoon Flow Object Model
backup - Wether a new revision should be created.
Throws:
FileReservedCheckInException
java.lang.Exception
See Also:
RevisionController.reservedCheckIn(String, String, boolean)


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.