org.apache.cocoon.woody.transformation
Class WoodyPipelineConfig

java.lang.Object
  extended by org.apache.cocoon.woody.transformation.WoodyPipelineConfig

public class WoodyPipelineConfig
extends Object

WoodyPipeLineConfig

Version:
CVS $Id: WoodyPipelineConfig.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
static String WOODY_FORM
          Default key under which the woody form is stored in the JXPath context.
 
Method Summary
static WoodyPipelineConfig createConfig(Map objectModel, Parameters parameters)
          Creates and initializes a WoodyPipelineConfig object based on the passed arguments of the setup() of the specific Pipeline-component.
 Object evaluateExpression(String expression)
          Evaluates the passed xpath expression using the internal jxpath context holding the declared variables: continuation: as made available by flowscript request: as present in the cocoon processing environment session: as present in the cocoon processing environment parameters: as present in the cocoon sitemap node of the pipeline component
 Form findForm()
          Overloads findForm(String) by setting the jxpath-expression to null
 Form findForm(String jxpathExpression)
          Finds the form from the current request-context based on the settings of this configuration object.
 String getFormAction()
          The value for the wi:form-generated/@action.
 Attributes getFormAttributes()
          The grouped attributes to set on the wi:form-generated element.
 String getFormMethod()
          The value for the wi:form-generated/@method.
 Locale getLocale()
           
 Locale getLocaleParameter()
           
 void setLocale(Locale locale)
           
 String translateText(String original)
          Replaces JXPath expressions embedded inside #{ and } by their value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WOODY_FORM

public static final String WOODY_FORM
Default key under which the woody form is stored in the JXPath context.

See Also:
Constant Field Values
Method Detail

createConfig

public static WoodyPipelineConfig createConfig(Map objectModel,
                                               Parameters parameters)
Creates and initializes a WoodyPipelineConfig object based on the passed arguments of the setup() of the specific Pipeline-component.

Parameters:
objectModel - the objectmodel as passed in the setup()
parameters - the parameters as passed in the setup()
Returns:
an instance of WoodyPipelineConfig initialized according to the settings in the sitemap.

findForm

public Form findForm()
              throws SAXException
Overloads findForm(String) by setting the jxpath-expression to null

Throws:
SAXException

findForm

public Form findForm(String jxpathExpression)
              throws SAXException
Finds the form from the current request-context based on the settings of this configuration object. The fall-back search-procedure is as follows:
  1. Use the provided jxpathExpression (if not null)
  2. Use the setting of the 'attribute-name' parameter on the request
  3. Obtain the form from it's default location in the flow context

Parameters:
jxpathExpression - that should be pointing to the form
Returns:
the found form if found
Throws:
SAXException - in any of the following cases:
  • The provided jxpathExpression (if not null) not point to a Form instance.
  • The request is not holding a Form instance under the key specified by 'attribute-name' (if specified)
  • Both jxpathExpression and 'attribute-name' were not specified AND also the default location was not holding a valid Form instance.

translateText

public String translateText(String original)
Replaces JXPath expressions embedded inside #{ and } by their value. This will parse the passed String looking for #{} occurences and then uses the evaluateExpression(String) to evaluate the found expression.

Returns:
the original String with it's #{}-parts replaced by the evaulated results.

evaluateExpression

public Object evaluateExpression(String expression)
Evaluates the passed xpath expression using the internal jxpath context holding the declared variables:
  1. continuation: as made available by flowscript
  2. request: as present in the cocoon processing environment
  3. session: as present in the cocoon processing environment
  4. parameters: as present in the cocoon sitemap node of the pipeline component

Parameters:
expression -
Returns:
the object-value resulting the expression evaluation.

getLocale

public Locale getLocale()

setLocale

public void setLocale(Locale locale)

getLocaleParameter

public Locale getLocaleParameter()

getFormAction

public String getFormAction()
The value for the wi:form-generated/@action. Note: wi:form-template copies this from its wt:form-template counterpart.

Returns:
the translateText(String) result of the 'form-action' sitemap parameter to the pipeline component, or null if that parameter was not set.

getFormMethod

public String getFormMethod()
The value for the wi:form-generated/@method. Note: wi:form-template copies this from its wt:form-template counterpart.

Returns:
the value of the 'form-method' sitemap parameter to the pipeline component. Defaults to 'POST' if it was not set.

getFormAttributes

public Attributes getFormAttributes()
The grouped attributes to set on the wi:form-generated element. Note: wi:form-template copies this from its wt:form-template counterpart.

See Also:
getFormAction(), getFormMethod()


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.