shannon 2002/08/21 19:39:06 Modified: targets/cocoon/userdocs/actions actions.html database-actions.html targets/cocoon/userdocs/concepts catalog.html modules.html sitemap.html targets/cocoon/userdocs/generators directory-generator.html error-generator.html extractor-generator.html file-generator.html generators.html html-generator.html imagedirectory-generator.html jsp-generator.html linkstatus-generator.html php-generator.html profile-generator.html request-generator.html script-generator.html search-generator.html serverpages-generator.html status-generator.html stream-generator.html velocity-generator.html xmldb-generator.html xmldbcollection-generator.html targets/cocoon/userdocs/serializers link-serializer.html targets/cocoon/userdocs/transformers cinclude-transformer.html encodeurl-transformer.html extractor-transformer.html filter-transformer.html i18n-transformer.html ldap-transformer.html log-transformer.html readdomsession-transformer.html sourcewriting-transformer.html sql-transformer.html transformers.html writedomsession-transformer.html xinclude-transformer.html xslt-transformer.html xt-transformer.html targets/cocoon/userdocs/xsp esql.html logicsheet-forms.html Added: targets/cocoon/userdocs/actions session-action.html targets/cocoon/userdocs/generators textparser-generator.html targets/cocoon/userdocs/generators/images note.gif targets/cocoon/userdocs/transformers augment-transformer.html textparser-transformer.html Log: update site Revision Changes Path 1.7 +7 -0 xml-site/targets/cocoon/userdocs/actions/actions.html Index: actions.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/actions/actions.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- actions.html 15 Jul 2002 13:57:04 -0000 1.6 +++ actions.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -90,6 +90,9 @@
Optional + +Session Action +
@@ -134,6 +137,10 @@
  • Database Actions +
  • + +
  • +Session Action
  • 1.4 +3 -0 xml-site/targets/cocoon/userdocs/actions/database-actions.html Index: database-actions.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/actions/database-actions.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- database-actions.html 15 Jul 2002 13:57:04 -0000 1.3 +++ database-actions.html 22 Aug 2002 02:39:02 -0000 1.4 @@ -90,6 +90,9 @@
    Optional + +Session Action +
    1.1 xml-site/targets/cocoon/userdocs/actions/session-action.html Index: session-action.html =================================================================== Session Action
    Session Action
    http://xml.apache.org/http://www.apache.org/http://www.w3.org/

    Main
    User Documentation

    Actions
    Overview
    Database

    Default

    Core

    Optional
    Session Action

    Session Action

    The session action helps in managing the session of a user on the server. It can create and terminate a session. The function is controlled by a parameter named 'action'.

    For more information on session handling and session contexts have a look at the Session Context documentation.

    Creating a Session

    To create a session (if it not already exists) simply add the action in your pipeline:

      
          <map:act type="session"/>
      	
      

    This is the equivalent to specify the 'action' parameter with the value 'create':

      
          <map:act type="session">
              <map:parameter name="action" value="create"/>
          </map:act>
      	
      
    Terminating a Session

    Terminating a session is as easy as creating a session, simply add the action to your pipeline and set the 'action' parameter to 'terminate':

      
          <map:act type="session">
              <map:parameter name="action" value="terminate"/>
          </map:act>
      	
      

    This terminates the session immediately.

    You can optionally specifiy the 'mode' parameter which controlls the termination of the session. You have the choice between 'immediately' (the default) and 'if-unsued'. If you use the mode 'if-unused', the session is only terminated, if no session context exists for the user:

      
          <map:act type="session">
              <map:parameter name="action" value="terminate"/>
              <map:parameter name="mode" value="if-unused"/>
          </map:act>
      	
      
    Configuration
    • Name : session
    • Class: org.apache.cocoon.webapps.session.acting.SessionAction
    Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.
    1.7 +6 -7 xml-site/targets/cocoon/userdocs/concepts/catalog.html Index: catalog.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/concepts/catalog.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- catalog.html 15 Jul 2002 13:57:04 -0000 1.6 +++ catalog.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -713,7 +713,7 @@ A default catalog and some base entities (e.g. ISO*.pen character entity sets) are included in the Cocoon distribution at - webapp/resources/entities/ + WEB-INF/entities/ - the default catalog is automatically loaded when Cocoon starts.

    @@ -746,7 +746,7 @@

    Parameters (properties) for the resolver component can be specified in the - java/org/apache/cocoon/components/resolver/resolver.xconf + src/webapp/WEB-INF/cocoon.xconf configuration file. See the detailed internal notes - here is a precis.

    @@ -794,11 +794,10 @@

    - The build process will automatically copy the properties file from -$COCOON_HOME/webapp/resources/entities/CatalogManager.properties - to -$TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/CatalogManager.properties - thereby making it available to the Java classpath. + The file is at +webapp/WEB-INF/classes/CatalogManager.properties + thereby making it available to the Java classpath during startup of the + servlet engine.

    1.4 +11 -11 xml-site/targets/cocoon/userdocs/concepts/modules.html Index: modules.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/concepts/modules.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- modules.html 15 Jul 2002 13:57:05 -0000 1.3 +++ modules.html 22 Aug 2002 02:39:02 -0000 1.4 @@ -149,17 +149,6 @@ of the underlying rationale and principles.

    - -

    - - - - -
    Note - To use modules, Apache Cocoon needs to have been build to include - scratchpad components. -
    -

    Types of Modules @@ -351,6 +340,17 @@ declared above allows to override the skin with a request parameter named "skin". +

    + +

    + + + + +
    Note + The above sitemap syntax is only available with the 2.1-dev version + of Apache Cocoon. +

    1.7 +56 -105 xml-site/targets/cocoon/userdocs/concepts/sitemap.html Index: sitemap.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/concepts/sitemap.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- sitemap.html 15 Jul 2002 13:57:05 -0000 1.6 +++ sitemap.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -270,7 +270,6 @@
    <?xml version="1.0"?>
      -
         <map:sitemap 
             xmlns:map="http://apache.org/cocoon/sitemap/1.0">
           <map:components/>
      @@ -278,7 +277,7 @@
           <map:resources/>
           <map:action-sets/>
           <map:pipelines/>
      -  </map:sitemap>
    + </map:sitemap> @@ -299,7 +298,7 @@
    <map:sitemap 
      -    xmlns:map="http://apache.org/cocoon/sitemap/1.0">
    + xmlns:map="http://apache.org/cocoon/sitemap/1.0"> @@ -340,18 +339,15 @@
      -
      -<map:components>
      -  <map:generators/>
      -  <map:transformers/>
      -  <map:serializers/>
      -  <map:readers/>
      -  <map:selectors/>
      -  <map:matchers/>
      -  <map:actions/>
      -</map:components>
      -
      -    
    + <map:components> + <map:generators/> + <map:transformers/> + <map:serializers/> + <map:readers/> + <map:selectors/> + <map:matchers/> + <map:actions/> + </map:components> @@ -415,9 +411,7 @@ <!-- This is a parameter to the transformer component --> <use-request-parameters>false</use-request-parameters> </map:transformer> -</map:components> - - +</map:components> @@ -461,9 +455,7 @@ src="org.apache.cocoon.generation.ServerPagesGenerator"> ... </map:generator> -</map:generators> - - +</map:generators> @@ -509,9 +501,7 @@ </map:transformer> <map:transformer name="xinclude" src="org.apache.cocoon.transformation.XIncludeTransformer"/> -</map:transformers> - - +</map:transformers> @@ -579,9 +569,7 @@ <map:serializer name="svg2png" mime-type="image/png" src="org.apache.cocoon.serialization.SVGSerializer"> </map:serializer> -</map:serializers> - - +</map:serializers> @@ -640,9 +628,7 @@ <browser name="netscape" useragent="Mozilla"/> ... </map:selection> -</map:selection> - - +</map:selection> @@ -689,9 +675,7 @@ src="org.apache.cocoon.matching.RegexpURIMatcher"> ... </map:matcher> -</map:matchers> - - +</map:matchers> @@ -741,9 +725,7 @@ src="org.apache.cocoon.acting.RequestParamAction"/> <map:action name="form-validator" src="org.apache.cocoon.acting.FormValidatorAction"/> -</map:actions> - - +</map:actions> @@ -785,9 +767,7 @@ <map:view name="links" from-position="last"> <map:serialize type="links"/> </map:view> -</map:views> - - +</map:views> @@ -822,9 +802,7 @@ <map:transform src="./stylesheets/general-browser.xsl"/> <map:serialize status-code="401"/> </map:resource> -</map:resources> - - +</map:resources> @@ -861,9 +839,7 @@ <map:act type="upd-employee" action="Update"/> <map:act type="sel-employee" action="Select"/> </map:action-set> -</map:action-sets> - - +</map:action-sets> @@ -1105,8 +1081,7 @@
       <map:aggregate element="the-aggregated-content">
         <!-- define your map:parts here -->
      -</map:aggregate>
      -    
    +</map:aggregate> @@ -1226,8 +1201,7 @@ <map:part src="cocoon:/book-{1}.xml"/> <map:part src="cocoon:/body-{1}.xml"/> </map:aggregate> - ... - + ... @@ -1259,8 +1233,7 @@ <!-- content of body xml --> ... </document> -</site> - +</site> @@ -1353,8 +1326,7 @@ <map:transform type="i18n"/> <map:serialize/> </map:error-handler> -</map:pipeline> - +</map:pipeline> @@ -1421,8 +1393,7 @@ </map:match> <map:match pattern="welcome"> ... -</map:pipeline> - +</map:pipeline> @@ -1472,8 +1443,7 @@ <map:parameter name="target" value="target-1"/> </map:call> ... -</map:pipeline> - +</map:pipeline> @@ -1484,7 +1454,10 @@ Mounting sitemaps - Introduction + +
    + +Introduction

    @@ -1514,9 +1487,7 @@ <map:match pattern="faq/*"> <map:mount uri-prefix="faq" check-reload="no" src="faq/sitemap.xmap"/> -</map:match> - - +</map:match> @@ -1653,9 +1624,7 @@ </map:pipeline> </map:pipelines> -</map:sitemap> - - +</map:sitemap> @@ -1684,9 +1653,7 @@ <map:match pattern="faq/*"> <map:mount uri-prefix="faq/" check-reload="no" src="faq/sitemap.xmap" reload-method="asynchron"/> -</map:match> - - +</map:match> @@ -1852,9 +1819,7 @@ */ public void setConsumer(XMLConsumer consumer); -} - - +} @@ -1891,9 +1856,7 @@ public interface XMLConsumer extends ContentHandler, LexicalHandler { -} - - +} @@ -1930,9 +1893,7 @@ public interface XMLPipe extends XMLConsumer , XMLProducer { -} - - +} @@ -1973,9 +1934,7 @@ void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException; -} - - +} @@ -2024,9 +1983,7 @@ * Test if the component wants to set the content length */ boolean shouldSetContentLength(); -} - - +} @@ -2064,9 +2021,7 @@ public void generate() throws IOException, SAXException, ProcessingException; -} - - +} @@ -2102,9 +2057,7 @@ String ROLE = "org.apache.cocoon.transformation.Transformer"; -} - - +} @@ -2140,9 +2093,7 @@ String ROLE = "org.apache.cocoon.serialization.Serializer"; -} - - +} @@ -2191,9 +2142,7 @@ */ boolean select (String expression, Map objectModel, Parameters parameters); -} - - +} @@ -2244,9 +2193,7 @@ * If the return value is null there was no match. */ Map match (String pattern, Map objectModel, Parameters parameters); -} - - +} @@ -2311,9 +2258,7 @@ Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters par) throws Exception; -} - - +} @@ -2325,14 +2270,20 @@ -Additional information +Additional resources


    - + +

    + +Learn more about advanced Sitemap features by downloading the free chapter, A User's Look at the Cocoon architecture, from Langham and Ziegler's Cocoon: Building XML Applications available at the New Riders web site. + +

    +

    - Also there is a draft XML Schema grammar for the Cocoon sitemap, and some external documentation - generated from this Schema. There you will also find a poster diagram of - the sitemap structure. + Check out a draft XML Schema grammar for the Cocoon sitemap, and some external documentation + generated from this Schema. A poster diagram of + the sitemap structure is also available.

    1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/directory-generator.html Index: directory-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/directory-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- directory-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ directory-generator.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/error-generator.html Index: error-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/error-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- error-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ error-generator.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/extractor-generator.html Index: extractor-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/extractor-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- extractor-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ extractor-generator.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/file-generator.html Index: file-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/file-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- file-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ file-generator.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.7 +7 -0 xml-site/targets/cocoon/userdocs/generators/generators.html Index: generators.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/generators.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- generators.html 15 Jul 2002 13:57:05 -0000 1.6 +++ generators.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional @@ -265,6 +268,10 @@
  • XML:DB Collection Generator (optional) +
  • + +
  • +Text Parser Generator
  • 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/html-generator.html Index: html-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/html-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- html-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ html-generator.html 22 Aug 2002 02:39:02 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/imagedirectory-generator.html Index: imagedirectory-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/imagedirectory-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- imagedirectory-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ imagedirectory-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/jsp-generator.html Index: jsp-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/jsp-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jsp-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ jsp-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.2 +3 -0 xml-site/targets/cocoon/userdocs/generators/linkstatus-generator.html Index: linkstatus-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/linkstatus-generator.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- linkstatus-generator.html 15 Jul 2002 14:01:30 -0000 1.1 +++ linkstatus-generator.html 22 Aug 2002 02:39:03 -0000 1.2 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/php-generator.html Index: php-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/php-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- php-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ php-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.6 +3 -0 xml-site/targets/cocoon/userdocs/generators/profile-generator.html Index: profile-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/profile-generator.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- profile-generator.html 15 Jul 2002 13:57:05 -0000 1.5 +++ profile-generator.html 22 Aug 2002 02:39:03 -0000 1.6 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional 1.7 +56 -0 xml-site/targets/cocoon/userdocs/generators/request-generator.html Index: request-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/request-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- request-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ request-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ LinkStatus Generator +Text Parser Generator + +
    Optional @@ -206,6 +209,7 @@ http://xml.apache.org/cocoon/requestgenerator/2.0

    +
    @@ -244,6 +248,16 @@ </parameter> </requestParameters> + <!-- All request attributes; see below the note on generate-attributes parameter. + (This feature is available startign with version 2.1 --> + <requestAttributes> + <!-- Create an attribute element for each attribute --> + <attribute name="errorMessage"> + <!-- Create a value element for the attribute value --> + <value>I was put here by an earlier action.</value> + </attribute> + </requestAttributes> + <!-- All configuration parameters: --> <configurationParameters> <!-- Create a parameter element for each parameter specified @@ -252,6 +266,48 @@ </configurationParameters> </request> + + + + + + +
    +
    + + + +

    + + + + +
    NoteIf you want request attributes to be generated, you must specify generate-attributes parameter at generator definition or invocation in the sitemap.
    +

    + +
    + + + + + + 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/script-generator.html Index: script-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/script-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- script-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ script-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ + + + 1.6 +3 -0 xml-site/targets/cocoon/userdocs/generators/search-generator.html Index: search-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/search-generator.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- search-generator.html 15 Jul 2002 13:57:05 -0000 1.5 +++ search-generator.html 22 Aug 2002 02:39:03 -0000 1.6 @@ -132,6 +132,9 @@ + + + 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/serverpages-generator.html Index: serverpages-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/serverpages-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- serverpages-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ serverpages-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ + + + 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/status-generator.html Index: status-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/status-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- status-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ status-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ + + + 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/stream-generator.html Index: stream-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/stream-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- stream-generator.html 15 Jul 2002 13:57:05 -0000 1.6 +++ stream-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ + + + 1.7 +3 -0 xml-site/targets/cocoon/userdocs/generators/velocity-generator.html Index: velocity-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/velocity-generator.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- velocity-generator.html 15 Jul 2002 13:57:06 -0000 1.6 +++ velocity-generator.html 22 Aug 2002 02:39:03 -0000 1.7 @@ -132,6 +132,9 @@ + + + 1.6 +3 -0 xml-site/targets/cocoon/userdocs/generators/xmldb-generator.html Index: xmldb-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/xmldb-generator.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- xmldb-generator.html 15 Jul 2002 13:57:06 -0000 1.5 +++ xmldb-generator.html 22 Aug 2002 02:39:03 -0000 1.6 @@ -132,6 +132,9 @@ + + + 1.6 +3 -0 xml-site/targets/cocoon/userdocs/generators/xmldbcollection-generator.html Index: xmldbcollection-generator.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/generators/xmldbcollection-generator.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- xmldbcollection-generator.html 15 Jul 2002 13:57:06 -0000 1.5 +++ xmldbcollection-generator.html 22 Aug 2002 02:39:03 -0000 1.6 @@ -132,6 +132,9 @@ + + + 1.1 xml-site/targets/cocoon/userdocs/generators/textparser-generator.html Index: textparser-generator.html =================================================================== Text Parser Generator
    +
      +<!-- This will turn on attribute generation on by default -->
      +<map:generator name="request" src="org.apache.cocoon.generation.RequestGenerator"> 
      +    <map:parameter name="generate-attributes" value="true"/>
      +</map:generator>
      +
      +<!-- or -->
      +
      +    <!-- This will turn on attribute generation for this invocation only. -->
      +    <map:match pattern="request">
      +        <map:generate type="request">
      +	    <map:parameter name="generate-attributes" value="true"/>
      +        </map:generate>
      +    </map:match>
      +
      +
       
    LinkStatus Generator
    Text Parser Generator

    Optional
    LinkStatus Generator
    Text Parser Generator

    Optional
    LinkStatus Generator
    Text Parser Generator

    Optional
    LinkStatus Generator
    Text Parser Generator

    Optional
    LinkStatus Generator
    Text Parser Generator

    Optional
    LinkStatus Generator
    Text Parser Generator

    Optional
    LinkStatus Generator
    Text Parser Generator

    Optional
    LinkStatus Generator
    Text Parser Generator

    Optional
    Text Parser Generator
    http://xml.apache.org/http://www.apache.org/http://www.w3.org/

    Main
    User Documentation

    Generators
    Overview

    Default
    File Generator

    Core
    HTML Generator
    Directory Generator
    Image Directory Generator
    Fragment Extractor Generator
    JSP Generator
    Script Generator
    Server Pages Generator
    Velocity Generator
    Request Generator
    Status Generator
    Stream Generator
    Profile Generator
    Error Generator
    Search Generator
    LinkStatus Generator
    Text Parser Generator

    Optional
    Php Generator
    XML:DB Generator
    XML:DB Collection Generator

    Text Parser Generator

    The text parser generator parser a text file, which an specified grammar, and generates a XML file from it.

    • Name : textparser
    • Class: org.apache.cocoon.generation.TextParserGenerator
    • Cacheable: yes - uses the last modification date of the text document and of the grammar file for validation.

    The location of the source xml document is specified in the pipeline by the src attribute.

      <map:generate src="example.txt" type="textparser">
       <map:parameter name="grammar" value="example.grm"/>
       <map:parameter name="includeignorabletokens" value="false"/>
      </map:generate>
      

    The parameter to specify the grammar must be declared. The second paramter tells the parser if it should include all obsolete tokens, and must not specified.

    The explanation of function and the grammar format can be found at the howto section

    Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.
    1.1 xml-site/targets/cocoon/userdocs/generators/images/note.gif <> 1.7 +56 -9 xml-site/targets/cocoon/userdocs/serializers/link-serializer.html Index: link-serializer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/serializers/link-serializer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- link-serializer.html 15 Jul 2002 13:57:06 -0000 1.6 +++ link-serializer.html 22 Aug 2002 02:39:04 -0000 1.7 @@ -142,29 +142,76 @@ Link Serializer
    - +

    -????. +The link serializer generates a list of links + using XLink + from the sax events. + Most XHTML + attributes are also supported (href, src, longdesc, + background). The mime-type of the output is + application/x-cocoon-links. This serializer is + required by the link status generator and the command line + mode to follow links.

    - +
      - +
    • -Name : links +Name: links
    • - +
    • Class: org.apache.cocoon.serialization.LinkSerializer
    • - +
    • -Cacheable: ????. +Cacheable: no
    • - +
    + +Usage +
    + +

    +To use the link serializer for the command-line or the + link status generator, you need the following entries in + your sitemap: +

    + +
    + + + + + + + + + + +
    +
      +<map:components>
      +  <map:serializers>
      +    <map:serializer logger="sitemap.serializer.links" name="links"
      +                    src="org.apache.cocoon.serialization.LinkSerializer" />
      +  </map:serializers>
      +</map:components>
      +
      +<map:views>
      +  <map:view from-position="last" name="links">
      +    <map:serialize type="links" />
      +  </map:view>
      +</map:views>
      +
    +
    +
    + 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/cinclude-transformer.html Index: cinclude-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/cinclude-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- cinclude-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ cinclude-transformer.html 22 Aug 2002 02:39:04 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.2 +6 -0 xml-site/targets/cocoon/userdocs/transformers/encodeurl-transformer.html Index: encodeurl-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/encodeurl-transformer.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- encodeurl-transformer.html 15 Jul 2002 14:01:30 -0000 1.1 +++ encodeurl-transformer.html 22 Aug 2002 02:39:04 -0000 1.2 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/extractor-transformer.html Index: extractor-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/extractor-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- extractor-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ extractor-transformer.html 22 Aug 2002 02:39:04 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/filter-transformer.html Index: filter-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/filter-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- filter-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ filter-transformer.html 22 Aug 2002 02:39:04 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/i18n-transformer.html Index: i18n-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/i18n-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- i18n-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ i18n-transformer.html 22 Aug 2002 02:39:04 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/ldap-transformer.html Index: ldap-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/ldap-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ldap-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ ldap-transformer.html 22 Aug 2002 02:39:04 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +7 -1 xml-site/targets/cocoon/userdocs/transformers/log-transformer.html Index: log-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/log-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- log-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ log-transformer.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional @@ -167,7 +173,7 @@ <map:transform type="log">   <map:parameter name="logfile" value="logfile.log"/>   <map:parameter name="append" value="no"/> - </map:transform>> + </map:transform> 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/readdomsession-transformer.html Index: readdomsession-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/readdomsession-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- readdomsession-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ readdomsession-transformer.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.2 +6 -0 xml-site/targets/cocoon/userdocs/transformers/sourcewriting-transformer.html Index: sourcewriting-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/sourcewriting-transformer.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- sourcewriting-transformer.html 15 Jul 2002 14:01:30 -0000 1.1 +++ sourcewriting-transformer.html 22 Aug 2002 02:39:05 -0000 1.2 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/sql-transformer.html Index: sql-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/sql-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- sql-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ sql-transformer.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +14 -0 xml-site/targets/cocoon/userdocs/transformers/transformers.html Index: transformers.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/transformers.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- transformers.html 15 Jul 2002 13:57:07 -0000 1.6 +++ transformers.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional @@ -224,6 +230,10 @@
  • SourceWriting Transformer
  • + +
  • +Augment Transformer +
  • XT Transformer (optional) @@ -231,6 +241,10 @@
  • LDAP Transformer (optional) +
  • + +
  • +Text Parser Transformer
  • 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/writedomsession-transformer.html Index: writedomsession-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/writedomsession-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- writedomsession-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ writedomsession-transformer.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/xinclude-transformer.html Index: xinclude-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/xinclude-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- xinclude-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ xinclude-transformer.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.7 +7 -1 xml-site/targets/cocoon/userdocs/transformers/xslt-transformer.html Index: xslt-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/xslt-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- xslt-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ xslt-transformer.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional @@ -271,7 +277,7 @@

    In addition all other parameters to the transformer are - available in the stylesheet as xsl:variables (These values + available in the stylesheet as <xsl:param/>s (These values are also used in the caching algorithm.)

    1.7 +6 -0 xml-site/targets/cocoon/userdocs/transformers/xt-transformer.html Index: xt-transformer.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/transformers/xt-transformer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- xt-transformer.html 15 Jul 2002 13:57:07 -0000 1.6 +++ xt-transformer.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -120,6 +120,12 @@ SourceWriting Transformer +Augment Transformer + + +Text Parser Transformer + +
    Optional 1.1 xml-site/targets/cocoon/userdocs/transformers/augment-transformer.html Index: augment-transformer.html =================================================================== Augment Transformer
    Augment Transformer
    http://xml.apache.org/http://www.apache.org/http://www.w3.org/

    Main
    User Documentation

    Transformers
    Overview

    Default
    XSLT Transformer

    Core
    Fragment Extractor Transformer
    I18n Transformer
    Log Transformer
    SQL Transformer
    Filter Transformer
    Read DOM Session Transformer
    Write DOM Session Transformer
    XInclude Transformer
    CInclude Transformer
    EncodeURL Transformer
    SourceWriting Transformer
    Augment Transformer
    Text Parser Transformer

    Optional
    XT Transformer
    LDAP Transformer

    Augment Transformer

    The AugmentTransformer augments all href attributes with the full path to the request. If a href is already a full HTTP URL, or HTTPS URL the value of href is not changed.

    The AugmentTransformer has serveral configuration options. These options may be specified by each request.

    mount -
    If this request parameter is specified it defines the URI relative to the servlet's context-path. If no mount parameter is specified the resolution is calculated relative to the request URI.
    • Name : augment
    • Class: org.apache.cocoon.transformation.AugmentTransformer
    • Cacheable: no.

    A simple example might help to use the AugmentTransformer effectivly:

    Add the AugmentTransformer to the components in your sitemap.xmap

      ...
      <map:components>
      ...
        <map:transformers default="xslt">
        ...
          <map:transformer name="augment"
            src="org.apache.cocoon.transformation.AugmentTransformer">
          </map:transformer>
        ...
      

    Next define in your pipeline to use the AugmentTransformer

      <map:match pattern="**book-**.xml">
        <map:generate src="docs/{1}book.xml"/>
        <map:transform type="augment">
          <map:parameter name="mount" value="samples/flow/"/>
        </map:transform>
        ...
      

    In the example above all href attributes which do not start with http, or https are augmented.

    Assuming Cocoon is deployed at http://localhost:8080/cocoon a href href="overview.html" is augmented to href="http://localhost:8080/cocoon/samples/flow/overview.html".

    Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.
    1.1 xml-site/targets/cocoon/userdocs/transformers/textparser-transformer.html Index: textparser-transformer.html =================================================================== Text Parser Transformer
    Text Parser Transformer
    http://xml.apache.org/http://www.apache.org/http://www.w3.org/

    Main
    User Documentation

    Transformers
    Overview

    Default
    XSLT Transformer

    Core
    Fragment Extractor Transformer
    I18n Transformer
    Log Transformer
    SQL Transformer
    Filter Transformer
    Read DOM Session Transformer
    Write DOM Session Transformer
    XInclude Transformer
    CInclude Transformer
    EncodeURL Transformer
    SourceWriting Transformer
    Augment Transformer
    Text Parser Transformer

    Optional
    XT Transformer
    LDAP Transformer

    Text Parser Transformer

    The text parser transformer parse the content of special marked element of a SAX stream, by using a grammar file.

    • Name : textparser
    • Class: org.apache.cocoon.transformation.TextFragmentParserTransformer
    • Cacheable: yes - uses the last modification date of the grammar document for validation.

    The parser parse following elements from the SAX stream, and replace them through generated documents.

      <tf:textfragment xmlns:tf="http://chaperon.sourceforge.net/schema/textfragment/1.0">
       [Text, which should be parsed]
      </tf:textfragment>
      

    The parameter to specify the grammar must be declared. The second parameter tells the parser if it should include all obsolete tokens, and must not specified.

      <map:transform type="textparser">
       <map:parameter name="grammar" value="example.grm"/>
       <map:parameter name="includeignorabletokens" value="false"/>
      </map:transform>
      

    The explanation of function and the grammar format can be found at the howto section

    Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.
    1.7 +57 -4 xml-site/targets/cocoon/userdocs/xsp/esql.html Index: esql.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/xsp/esql.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- esql.html 15 Jul 2002 13:57:08 -0000 1.6 +++ esql.html 22 Aug 2002 02:39:05 -0000 1.7 @@ -232,6 +232,57 @@
    + + +Connection + +

    +Esql can use connection pools configured in cocoon.xconf or + individually set up connections. +

    + + +

    +esql:pool gives the name of the connection pool to use. +

    + + +

    +Individually configured connections use the esql:driver, + esql:dburl, esql:username, esql:password tags. Their meaning + should be obvious. +

    + + +Connection Options + +

    +Per default, esql will try to switch a connection to autocommit + mode. This is because it prevents hanging transactions that hold locks and + disturb further database accesses. Esql can be forced to not use + autocommit, by giving the + <esql:autocommit>false</esql:autocommit> nested + element to esql:connection. +

    + + +

    + + + + +
    NoteEven if a connection is configured with autocommit off in + cocoon.xconf, esql will switch autocommit on if not + instructed to do otherwise.
    +

    + + +

    +Other options like limiting the size of the resultset are discussed + below. +

    + + @@ -608,10 +659,12 @@

    Parameters for a stored procedure call may be of - direction="in|out|inout" with the usual JDBC meaning. In - addition a type needs to be supplied as well. This would be - the same "XXX" as used in a get-XXX JDBC-method call. -

    + direction="in|out|inout" with the usual JDBC meaning. In + addition a type needs to be supplied for "out" and "inout" + parameters. This would be the same "XXX" as used in a get-XXX + JDBC-method call. Alternatively, you can use a fully qualified field name, + e.g. "java.sql.Types.CHAR" +

    1.7 +453 -164 xml-site/targets/cocoon/userdocs/xsp/logicsheet-forms.html Index: logicsheet-forms.html =================================================================== RCS file: /home/cvs/xml-site/targets/cocoon/userdocs/xsp/logicsheet-forms.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- logicsheet-forms.html 15 Jul 2002 13:57:08 -0000 1.6 +++ logicsheet-forms.html 22 Aug 2002 02:39:06 -0000 1.7 @@ -112,49 +112,56 @@ --------------------------------------------------------------------- To unsubscribe, e-mail: general-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: general-cvs-help@xml.apache.org
    - - - Introduction + + + Introduction
    +

    - For most web applications input is essential. Apache Cocoon provides a - variety of modules to support basic interaction like simple syntax - checking of input data or writing input data to databases. + For most web applications input is essential. Apache Cocoon provides a + variety of modules to support basic interaction like simple syntax checking + of input data or writing input data to databases.

    +

    - This is about syntax checking. See - org.apache.cocoon.acting.DatabaseAbstractAction (in javadocs) for - details on database interaction. + Two different packages deal with validating user input:XMLForm + which tries to stay as close as possible with the W3C XForms working draft. + Another, simpler and older implementation is the validation using the + FormValidatorAction, which is described here.

    - + +

    - FormValidatorAction communicates to the application a verbose - error status through an request attribute. In addition a taglib - allows easy access to the results. On top of that this taglib - gives access to the attributes for parameters declared in those - sections in descriptor.xml relevant to the validation process. - + To validate user input, an action, the FormValidatorAction, is + placed in your pipeline. Together with a descriptor file, that specifies + the allowed input, this action validates the request parameters. Based on + the result, a different page can be displayed and feedback can be given to + the user either using XSP and the formval logicsheet or the + SimpleFormTransformer. +

    - -The Descriptor File + + +Sitemap Usage

    - For details on the syntax of the descriptor file see - javadocs. Basically it consists of two sections, a list of - parameters and their properties and a list of constraints or - constraint sets. The file syntax is set up so that it can be - shared with the database actions. + To take advantage of the form validator action, create two pages. One for + the input form and one indicating the acceptance of the reservation. + Create a pipeline in your sitemap so that the confirmation page is only + shown when the action completed successfully and the input form is + returned otherwise.

    - + +
    @@ -165,22 +172,21 @@
       
       <?xml version="1.0"?>
      -<root>
      -
      -  <parameter name="persons" type="long" min="1" default="4" nullable="no"/>
      -  <parameter name="deposit" type="double" min="10.0" max="999.99"/>
      -  <parameter name="email" type="string" max-len="50"
      -             matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)\w\w\w?$">
      -
      -  <constraint-set name="car-reservation">
      -    <validate name="persons"/>
      -    <validate name="deposit" min="50.0"/>
      -    <validate name="email"/>
      -  </constraint-set>
      -
      -</root>
      +   <map:match pattern="car-reservation">
      +     <map:act type="form-validator">
      +        <!-- add you favourite database action here -->
      +        <map:parameter name="descriptor" value="descriptor.xml"/>
      +        <map:parameter name="validate-set" value="car-reservation"/>
      +    <map:generate type="serverpages" src="OK.xsp"/>
      +    <map:transform src="stylesheets/dynamic-page2html.xsl"/>
      +    <map:serialize/>
      +     </map:act>
      +     <map:generate type="serverpages" src="test/ERROR.xsp"/>
      +     <map:transform src="stylesheets/dynamic-page2html.xsl"/>
      +     <map:serialize/>
      +   </map:match>
       
      -     
    + @@ -188,28 +194,26 @@
    +

    - The above could for example describe expected input from a reservation - form. Specifications in a constraint set take precedence over - the general ones. + Note here that you may not use a redirection to point to the pages if you + would like to access the validation results e.g. on the error page. A + redirection would create a new request object and thus discard the + validation results.

    - - -Sitemap Usage +

    - To take advantage of the form validator action create two - pages. One for the input form and one indicating the acceptance of - the reservation. Create a pipeline in your sitemap so that the - confirmation page is only shown when the action completed - successfully and the input form is returned otherwise. + A different example, that does not need serverpages but the + SimpleFormTransformer:

    - + +
    @@ -221,20 +225,26 @@ <?xml version="1.0"?> <map:match pattern="car-reservation"> - <map:act type="form-validator"> - <!-- add you favourite database action here --> - <map:parameter name="descriptor" value="descriptor.xml"/> - <map:parameter name="validate-set" value="car-reservation"/> - <map:generate type="serverpages" src="OK.xsp"/> - <map:transform src="stylesheets/dynamic-page2html.xsl"/> - <map:serialize/> + <map:act type="req-params"> + <map:parameter name="parameters" value="order"/> + + <map:act type="form-validator"> + <map:parameter name="descriptor" value="descriptor.xml"/> + <map:parameter name="validate-set" value="car-reservation"/> + <!-- add you favourite database action here --> + + <map:generate type="file" src="OK.xml"/> + <map:transform src="stylesheets/dynamic-page2html.xsl"/> + <map:serialize/> + </map:act> </map:act> - <map:generate type="serverpages" src="test/ERROR.xsp"/> + <map:generate type="file" src="test/ERROR.xml"/> <map:transform src="stylesheets/dynamic-page2html.xsl"/> + <map:transform type="simple-form"/> <map:serialize/> </map:match> - + @@ -242,33 +252,209 @@
    + + +

    + + Although this looks more complicated at first, it has advantages if you + don't want to or cannot use XSP. For example, if the form is stored as + XHTML in a database, XSP could not be used to fill the form with values + from request parameters or to display detailed error messages. + +

    + +

    + + + + +
    Note + Keep in mind that files, here the descriptor file, could be specified + using the cocoon: pseudo-protocol. Thus the file could be + generated dynamically from another pipeline! +
    +

    + + + + +The Descriptor File + + +

    + + For details on the syntax of the descriptor file see javadocs. Basically + it consists of two sections, a list of parameters and their properties and + a list of constraints or constraint sets. The file syntax is set up so + that it can be shared with the database actions. + +

    + + +The types recognized by validator and their attributes + + + + + + + + + + + + + + + + + + + + + +
    + +
    stringnullable="yes|no" default="str"
    longnullable="yes|no" default="123123"
    doublenullable="yes|no" default="0.5"
    + +

    - Note here that you may not use a redirection to point to the - pages if you would like to access the validation results e.g. on - the error page. A redirection would create a new request object - and thus discard the validation results. - + Default value takes place only when specified parameter is nullable and + really is null or empty. Long numbers may be specified in decimal, hex or + octal values as accepted by java.Lang.decode (String s). +

    + +Constraints + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    matches-regexPOSIX regular expression
    one-ofList of strings, enclosed and separated by |
    min-lenpositive integer
    max-lenpositive integer
    minDouble / Long
    maxDouble / Long
    + +

    + + Constraints can be defined globally for a parameter and can be overridden + by redefinition in a constraint-set. Thus if e.g. a database field can take + at maximum 200 character, this property can be set globally. + +

    + +

    + + Values in parameter arrays are validated individually and the worst + error is reported back. + +

    + + +
    + + + + + + + + + + +
    +
      +
      +<?xml version="1.0"?>
      +<root>
      +
      +  <parameter name="persons" type="long" min="1" default="4" nullable="no"/>
      +  <parameter name="deposit" type="double" min="10.0" max="999.99"/>
      +  <parameter name="email" type="string" max-len="50"
      +             matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)\w\w\w?$"/>
      +  <parameter name="colour" type="string" one-of="|red|green|blue|white|"/>
      +
      +  <constraint-set name="car-reservation">
      +    <validate name="persons"/>
      +    <validate name="deposit" min="50.0"/>
      +    <validate name="email"/>
      +  </constraint-set>
      +
      +</root>
      +
      +    
    +
    +
    + + +

    + + The above could for example describe expected input from a reservation + form. Specifications in a constraint set take precedence over the general + ones. + +

    + + + + + XSP Usage +

    - To give the user some feedback why her/his submitted data was rejected - there is a special taglib "xsp-formval". Declare its name space as - usual. + To give the user some feedback why her/his submitted data was rejected + there is a special taglib "xsp-formval". Declare its name space as usual.

    +

    - If only interested in validation results, just: + If only interested in validation results, just:

    - + +
    @@ -282,7 +468,7 @@ <myapp:error>(ERROR)</myapp:error> </xsp-formval:on-ok> - + @@ -290,14 +476,16 @@
    - + +

    - Alternatively, if you just want a boolean value from the logicsheet - if a test is successful, use this method: - + Alternatively, if you just want a boolean value from the logicsheet if a + test is successful, use this method: +

    - + +
    @@ -308,12 +496,12 @@
       
            <xsp:logic>
      -	 if (!<xsp-formval:is-ok name="persons"/>) {
      -	      <myapp:error>(ERROR)</myapp:error>
      +     if (!<xsp-formval:is-ok name="persons"/>) {
      +          <myapp:error>(ERROR)</myapp:error>
                };
            </xsp:logic>
       
      -     
    + @@ -321,115 +509,105 @@
    - + +

    - Internationalization issues are a separate concern and are not - discussed here. - + Internationalization issues are a separate concern and are not discussed + here. +

    - +

    Currently the following validation result codes are supported: - +

    - + + - + - + - + - + - + - + + isn't allowed to - + - + - + - - - + + + - + - + - + - +
    tagMeaning
    xsp-formval:is-okno error occurred, - parameter successfully - checkedxsp-formval:is-okno error occurred, parameter + successfully checked
    xsp-formval:is-errorsome error occurred, - this is a result that - is never set but serves - as a comparison target - xsp-formval:is-errorsome error occurred, this is a result + that is never set but serves as a comparison target +
    xsp-formval:is-nullthe parameter is null but - isn't allowed to
    xsp-formval:is-toosmalleither value or - length in case of a - string is less than - the specified - minimumxsp-formval:is-toosmalleither value or length in case of + a string is less than the specified minimum
    xsp-formval:is-toolargeeither value or - length in case of a - string is greater - than the specified - maximum
    xsp-formval:is-toolargeeither value or length in case of + a string is greater than the specified maximum
    xsp-formval:is-nomatcha string parameter's - value is not matched - by the specified - regular expressionxsp-formval:is-nomatcha string parameter's value is not + matched by the specified regular expression
    xsp-formval:is-notpresentthis is returned - when the result of - a validation is - requested but no - such result is - found in the - request attribute xsp-formval:is-notpresentthis is returned when the result + of a validation is requested but no such result is found in the request + attribute
    - + +

    - For debugging purposes or if you would like to iterate over the - validation results, xsp-formval:results returns a + For debugging purposes or if you would like to iterate over the validation + results, xsp-formval:results returns a java.util.Map containing them all. - +

    - + +

    - If you would like to be more specific what went wrong, you can - query the descriptor file for attributes. - + If you would like to be more specific what went wrong, you can query the + descriptor file for attributes. +

    - + +

    - First set the url of the file or resource that contains the - parameter descriptions and constraint sets. This needs to be an - ancestor to all other tags (of this taglib). Multiple use of this - tag is allowed (although probably not necessary). - + First set the url of the file or resource that contains the parameter + descriptions and constraint sets. This needs to be an ancestor to all + other tags (of this taglib). Multiple use of this tag is allowed (although + probably not necessary). +

    - + +

    - - You need to do this only if you plan to query the - descriptor file or if you'd like to use the shorthand - below. - + You need to do this only if you plan to query the descriptor file or if + you'd like to use the shorthand below. +

    - + +
    @@ -444,7 +622,7 @@ <xsp-formval:get-attribute parameter="deposit" name="min"/> </xsp-formval:descriptor> - + @@ -452,26 +630,28 @@
    - + +

    - If you need to use one parameter a lot, there's a short hand. Use - this e.g. if you'd like to set up the properties of an input tag - according to the information from the descriptor file or if you'd - like to give detailed error messages. - + If you need to use one parameter a lot, there's a short hand. Use this + e.g. if you'd like to set up the properties of an input tag according to + the information from the descriptor file or if you'd like to give detailed + error messages. +

    - + +

    - Note that you can specify additional attributes in the - description file that are not understood (and therefore ignored) - by the FormValidatorAction but that could be queried here. This - might be e.g. the size of the input field which might be - different from the max-len a parameter can take. - + Note that you can specify additional attributes in the description file + that are not understood (and therefore ignored) by the FormValidatorAction + but that could be queried here. This might be e.g. the size of the input + field which might be different from the max-len a parameter can take. +

    - + +
    @@ -501,7 +681,7 @@ </xsp-formval:validate> </xsp-formval:descriptor> - + @@ -509,8 +689,117 @@
    - + + + +SimpleFormTransformer + + +

    + + An alternative solution to using the formval logicsheet and + XSP is to use the SimpleFormTransformer. If fills the form + with values obtained from request parameters, overwriting existing + values. Hence the data entered by the user is not discarded when it does + not validate successfully. + +

    + + +

    + + + + +
    Note + Beware when using the SimpleFormTransformer together with + XSP: The observer behaviour can be very confusing when trying to set a + value from XSP and it is silently overwritten by the transformer! +
    +

    + + +

    + + When a form element carries the attribute fixed="true", the + transformer does not replace the value. + +

    + + +

    + + Feedback can be given to the user through <error/> + tags. Error tags need to have a name attribute identical to the input + element they refer to. Multiple error elements may be present for any + input element. The FormValidatorAction sets a special field + * that indicates whether all parameters were validated + successfully or not. + +

    + + +

    + + An error element is omitted together with all contents whenever the + specified condition is not met. Conditions are either exact or greater + equal constraints indicated by the attribute when or + when-ge respectively. + +

    + + +

    + + Allowed values for error conditions are: ok, not-present, error, + is-null, too-small, too-large, no-match + +

    + + +
    + + + + + + + + + + +
    +
      +
      +     <input name="email" type="text"/><error name="email" when-ge="error">*</error>
      +     <!-- ... -->
      +     <error name="email" when="is-null">Please enter your email address.</errro>
      +     <error name="email" when="no-match">Please enter a <em>syntacticly</em> correct
      +     email address.</errro>
      +
      +    
    +
    +
    + + + +Other Validations + + +

    + + In addition to validating form input, other actions exists that validate + values from different sources using the same techniques and syntax. For + example, the SessionValidatorAction operates on session + attributes. + +

    + + + + +