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

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.cocoon.flow.FlowHelperImpl
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, FlowHelper

public class FlowHelperImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements FlowHelper, org.apache.avalon.framework.service.Serviceable

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
          SEPARATOR The separator
 
Fields inherited from interface org.apache.lenya.cms.cocoon.flow.FlowHelper
ROLE
 
Constructor Summary
FlowHelperImpl()
          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.
 void reservedCheckIn(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon, boolean backup)
          Checkis in the current document from the PageEnvelope context.
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
 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 org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
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
SEPARATOR The separator

See Also:
Constant Field Values
Constructor Detail

FlowHelperImpl

public FlowHelperImpl()
Ctor.

Method Detail

getPageEnvelope

public PageEnvelope getPageEnvelope(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
                             throws PageEnvelopeException
Description copied from interface: FlowHelper
Returns the current page envelope.

Specified by:
getPageEnvelope in interface FlowHelper
Parameters:
cocoon - The FOM_Cocoon object.
Returns:
A page envelope.
Throws:
PageEnvelopeException - when something went wrong.
See Also:
FlowHelper.getPageEnvelope(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon)

getRequestURI

public java.lang.String getRequestURI(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
Description copied from interface: FlowHelper
Returns the request URI of the current request.

Specified by:
getRequestURI in interface FlowHelper
Parameters:
cocoon - The FOM_Cocoon object.
Returns:
A string.
See Also:
FlowHelper.getRequestURI(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon)

getRequest

public org.apache.cocoon.environment.Request getRequest(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
Description copied from interface: FlowHelper
Returns the request object of the current request.

Specified by:
getRequest in interface FlowHelper
Parameters:
cocoon - The FOM_Cocoon object.
Returns:
A request object.
See Also:
FlowHelper.getRequest(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon)

getObjectModel

public java.util.Map getObjectModel(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
Description copied from interface: FlowHelper
Returns the Cocoon Object Model

Specified by:
getObjectModel in interface FlowHelper
Parameters:
cocoon - The Flow Object Model of Cocoon
Returns:
The object model
See Also:
FlowHelper.getObjectModel(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon)

getDocumentHelper

public DocumentHelper getDocumentHelper(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon)
Description copied from interface: FlowHelper
Returns a DocumentHelper instance.

Specified by:
getDocumentHelper in interface FlowHelper
Parameters:
cocoon - The Flow Object Model of Cocoon
Returns:
The document helper
See Also:
FlowHelper.getDocumentHelper(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon)

getImageParameterValue

public java.lang.String getImageParameterValue(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon cocoon,
                                               java.lang.String parameterName)
Description copied from interface: FlowHelper
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.

Specified by:
getImageParameterValue in interface FlowHelper
Parameters:
cocoon - The FOM_Cocoon object.
parameterName - The request parameter name.
Returns:
A string.
See Also:
FlowHelper.getImageParameterValue(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon, java.lang.String)

triggerWorkflow

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

Specified by:
triggerWorkflow in interface FlowHelper
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.
See Also:
FlowHelper.triggerWorkflow(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon, java.lang.String)

reservedCheckIn

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

Specified by:
reservedCheckIn in interface FlowHelper
Parameters:
cocoon - The Cocoon Flow Object Model
backup - Wether a new revision should be created.
Throws:
FileReservedCheckInException
java.lang.Exception
See Also:
FlowHelper.reservedCheckIn(org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon, boolean)

service

public void service(org.apache.avalon.framework.service.ServiceManager manager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)


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