org.apache.cocoon.webapps.session.acting
Class SessionFormAction

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.acting.AbstractAction
          extended byorg.apache.cocoon.acting.AbstractConfigurableAction
              extended byorg.apache.cocoon.acting.ConfigurableServiceableAction
                  extended byorg.apache.cocoon.acting.AbstractComplementaryConfigurableAction
                      extended byorg.apache.cocoon.acting.AbstractValidatorAction
                          extended byorg.apache.cocoon.acting.FormValidatorAction
                              extended byorg.apache.cocoon.webapps.session.acting.SessionFormAction
All Implemented Interfaces:
Action, Configurable, LogEnabled, Serviceable, ThreadSafe

public class SessionFormAction
extends FormValidatorAction
implements ThreadSafe

This is the action used to validate Request parameters. The validation rules are either embedded within the form

    <session:form name="info_form">
      <session:action>next_page</session:action>
      <session:content>
        <session:inputxml name="name" type="text" context="trackdemo" path="/user/name"/>
      </session:content>
      <session:validate>
        <root>
          <parameter name="name" type="string" nullable="no"/>
          <constraint-set name="form_a_set">
            <validate name="name"/>
          </constraint-set>
        </root>
      </session:validate>
    </session:form>
 
or described via the external xml file referenced through the "src" attribute (the format is defined in AbstractValidatorAction). Then the constraint-set to be used has to be identified through the "constraint-set" element
    <session:form name="info_form>
      <session:action>next_page</session:action>
      <session:content>
        <session:inputxml name="name" type="text" context="trackdemo" path="/user/name"/>
      </session:content>
      <session:validate src="descriptor.xml">
        <constraint-set name="form_a_set"/>
      </session:validate>
    </session:form>
 
Since the validation rules are contained within the form document they are read and supplied by the SessionTransformer. So this action has to be used in conjunction with the SessionTransformer. The "next_page" pipeline might look like this:
     <map:match pattern="next_page">
       <map:act type="session-form">
           <map:generate src="next_page.xml"/>
           <map:transform type="session"/>
           <map:transform src="simple2html.xsl"/>
           <map:serialize/>
       </map:act>
       <map:generate src="first_page.xml"/>
       <map:transform type="session"/>
       <map:transform src="simple2html.xsl"/>
       <map:serialize/>
     </map:match>
 
where "session-form" is configured as SessionFormAction

Version:
CVS $Id: SessionFormAction.java 30941 2004-07-29 19:56:58Z vgritsenko $
Author:
Guido Casper, Christian Haul
See Also:
FormValidatorAction, AbstractValidatorAction

Field Summary
 
Fields inherited from class org.apache.cocoon.acting.AbstractValidatorAction
FORMVALIDATOR_PATH
 
Fields inherited from class org.apache.cocoon.acting.AbstractComplementaryConfigurableAction
DESCRIPTOR_RELOADABLE_DEFAULT
 
Fields inherited from class org.apache.cocoon.acting.ConfigurableServiceableAction
manager
 
Fields inherited from class org.apache.cocoon.acting.AbstractConfigurableAction
settings
 
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
 
Fields inherited from interface org.apache.cocoon.acting.Action
ROLE
 
Constructor Summary
SessionFormAction()
           
 
Method Summary
protected  Configuration getDescriptor(SourceResolver resolver, Map objectModel, Parameters parameters)
          Load the descriptor containing the constraints.
 
Methods inherited from class org.apache.cocoon.acting.FormValidatorAction
createMapOfParameters
 
Methods inherited from class org.apache.cocoon.acting.AbstractValidatorAction
act, getSetOfParameterNamesFromSitemap, indexConfiguration, isDescriptorReloadable, resolveConstraints, setResult, validateParameter, validateParameter, validateSetOfParameters, validateValue
 
Methods inherited from class org.apache.cocoon.acting.AbstractComplementaryConfigurableAction
getConfiguration, getConfiguration
 
Methods inherited from class org.apache.cocoon.acting.ConfigurableServiceableAction
service
 
Methods inherited from class org.apache.cocoon.acting.AbstractConfigurableAction
configure
 
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
 
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable
configure
 

Constructor Detail

SessionFormAction

public SessionFormAction()
Method Detail

getDescriptor

protected Configuration getDescriptor(SourceResolver resolver,
                                      Map objectModel,
                                      Parameters parameters)
Description copied from class: AbstractValidatorAction
Load the descriptor containing the constraints.

Overrides:
getDescriptor in class AbstractValidatorAction
Parameters:
resolver -
parameters -
Returns:
a Configuration containing the constraints or null if a problem occurred.


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.