Save This Page
Home » cocoon-2.1.11-src » org.apache.cocoon.webapps » session » acting » [javadoc | source]
org.apache.cocoon.webapps.session.acting
public class: SessionFormAction [javadoc | source]
java.lang.Object
   org.apache.avalon.framework.logger.AbstractLogEnabled
      org.apache.cocoon.acting.AbstractAction
         org.apache.cocoon.acting.AbstractConfigurableAction
            org.apache.cocoon.acting.ConfigurableServiceableAction
               org.apache.cocoon.acting.AbstractComplementaryConfigurableAction
                  org.apache.cocoon.acting.AbstractValidatorAction
                     org.apache.cocoon.acting.FormValidatorAction
                        org.apache.cocoon.webapps.session.acting.SessionFormAction

All Implemented Interfaces:
    org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.configuration.Configurable, Action

Deprecated! This - block is deprecated and will be removed in future versions.

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
Fields inherited from org.apache.cocoon.acting.ConfigurableServiceableAction:
manager
Fields inherited from org.apache.cocoon.acting.AbstractConfigurableAction:
settings
Fields inherited from org.apache.cocoon.acting.AbstractAction:
EMPTY_MAP
Method from org.apache.cocoon.webapps.session.acting.SessionFormAction Summary:
getDescriptor
Methods from org.apache.cocoon.acting.FormValidatorAction:
createMapOfParameters,   isStringEncoded
Methods from org.apache.cocoon.acting.AbstractValidatorAction:
act,   createMapOfParameters,   getDescriptor,   getSetOfParameterNamesFromSitemap,   indexConfiguration,   isDescriptorReloadable,   isStringEncoded,   resolveConstraints,   setResult,   validateParameter,   validateParameter,   validateSetOfParameters,   validateValue
Methods from org.apache.cocoon.acting.AbstractComplementaryConfigurableAction:
getConfiguration,   getConfiguration,   getConfiguration
Methods from org.apache.cocoon.acting.ConfigurableServiceableAction:
service
Methods from org.apache.cocoon.acting.AbstractConfigurableAction:
configure
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.webapps.session.acting.SessionFormAction Detail:
 protected Configuration getDescriptor(SourceResolver resolver,
    Map objectModel,
    Parameters parameters) 
      Deprecated!