cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject cvs commit: xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard howto-xmlform-wizard-1.xml howto-xmlform-wizard-2.xml howto-xmlform-wizard-3.xml howto-xmlform-wizard-4.xml howto-xmlform-wizard-5.xml
Date Wed, 05 Jun 2002 15:03:16 GMT
shannon     2002/06/05 08:03:16

  Modified:    src/documentation/xdocs/howto/xmlform-wizard
                        howto-xmlform-wizard-1.xml
                        howto-xmlform-wizard-2.xml
                        howto-xmlform-wizard-3.xml
                        howto-xmlform-wizard-4.xml
                        howto-xmlform-wizard-5.xml
  Log:
  Fixed grammar issues, tightened sentence
  structure. Added fixme comments for the
  author to consider.
  
  Revision  Changes    Path
  1.2       +156 -64   xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-1.xml
  
  Index: howto-xmlform-wizard-1.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-1.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- howto-xmlform-wizard-1.xml	1 Jun 2002 13:18:09 -0000	1.1
  +++ howto-xmlform-wizard-1.xml	5 Jun 2002 15:03:16 -0000	1.2
  @@ -1,25 +1,34 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
  -
   <document>
  -
     <header>
  -    <title>XMLForm's HowTo Step 1</title>
  +    <title>XMLForm Wizard&#39;s How-To Step 1</title>
  +
       <authors>
  -      <person name="Heidi Brannan" email="heidi@wkwyw.net"/>
  +      <person name="Heidi Brannan"
  +              email="heidi@wkwyw.net" />
       </authors>
     </header>
   
     <body>
  -    <s1 title="XMLForm's HowTo Step 1: XMLForm markup language"> 
  -      <p>First we need to create our own forms in XML.</p>
  +    <s1 title="Step 1: XMLForm markup language">
  +      <fixme author="DS">It may help to use screen shots here. It gets a bit
  +      confusing, otherwise. What do you think?</fixme>
  +
  +      <p>First, we need to create our own form pages in XML.</p>
  +
         <ul>
  -        <li>Create a folder called "howto" in src\webapp\sample\xmlform.</li>
  -        <li>Copy the following xml files below and save them in the folder you created.</li>
  +        <li>Create a folder called &#34;howto&#34; in
  +        src\webapp\sample\xmlform.</li>
  +
  +        <li>Create and copy the following xml files, as instructed below, and
  +        save them in the folder you created.</li>
         </ul>
   
         <s2 title="start.xml">
  -      <p>Below is the first page which you can copy and save as start.xml in the folder src\webapp\mount\xmlform\howto</p>
  +        <p>Here is the first page. Copy and save as start.xml in the folder
  +        src\webapp\mount\xmlform\howto.</p>
  +
         <source>
           <![CDATA[
   <?xml version="1.0" ?>
  @@ -30,7 +39,7 @@
           <tr>
               <td align="center">
                   <h1>
  -                    Welcome to the XLMForm HowTo!
  +                    Welcome to the XLMForm How-To!
                   </h1>
               </td>
           </tr>
  @@ -40,7 +49,8 @@
                   <code>
                   The following form allows users to join mailing lists. 
                   They are given a choice of areas of interest. 
  -                Depending on their interests they will see a selection of mailing lists which they can sign up to.
  +                Depending on their interests they will see a 
  +                selection of mailing lists to which they can sign up.
                   </code>
               </td>
           </tr>
  @@ -59,40 +69,92 @@
   
   ]]>
         </source>  
  -      <p>The important part to notice is the link: </p>
  +
  +        <p>Note the value below of href:</p>
  +
         <source>
           <![CDATA[
             <a href="howto-wizard.html?cocoon-action-start=true">
           ]]>
         </source>
  -      <p>The text between "cocoon-action" and "=true" is passed to the method prepare of HowtoWizardAction.java which we will write soon.</p>
  +
  +        <fixme author="DS">Isn&#39;t the relevant text what is between
  +        &#34;cocoon-action-&#34; and &#34;=true&#34;? Note the addition of the
  +        hyphen after cocoon-action.</fixme>
  +
  +        <p>The text between &#34;cocoon-action&#34; and &#34;=true&#34; is
  +        passed to the method prepare of HowtoWizardAction.java (to be written
  +        in a next step). In the above case, this value to be passed is
  +        &#34;-start&#34;.</p>
         </s2>
   
  +      <fixme author="DS">Isn&#39;t start.xml, described earlier also an
  +      &#34;actual XML page&#34;. What do you mean below?</fixme>
  +
         <p>Next are the actual XML pages that make up the form. These are:</p>
  +
         <ul>
  -          <li>registration.xml</li>
  -          <li>interest.xml</li>          
  -          <li>organicGardening.xml</li>
  -          <li>cooking.xml</li>
  -          <li>smallholding.xml</li>
  -          <li>confirm.xml</li>
  -          <li>end.xml</li>          
  +        <li>registration.xml</li>
  +
  +        <li>interest.xml</li>
  +
  +        <li>organicGardening.xml</li>
  +
  +        <li>cooking.xml</li>
  +
  +        <li>smallholding.xml</li>
  +
  +        <li>confirm.xml</li>
  +
  +        <li>end.xml</li>
         </ul>
  -      
  +
         <s2 title="register.xml">
  -      <p>registration.xml lets the user register their username, password and email address so they can join the mailing lists they will next choose.</p>
  -      <p>The important part of the form you will need to change in your own forms are inside the xf:form tag. The id attribute value should match the sitemaps xmlform-id parameters value:</p>
  -      <source>
  -      <![CDATA[
  -       <map:parameter name="xmlform-id" value="form-feedback"/>
  -       ]]>
  -      </source> 
  -      <p>The view attribute should contain the name of the current xml file, the action attribute should contain the name of the url you are using in the sitemap.</p>
  -      <p>The caption tag is the page heading. Next we have the error tags which are used if you have a validation set in your sitemap. If an error is found then this will display them when the user clicks the next button on your form.</p>
  +        <fixme author="DS">Which is correct The title above, registration.xml,
  +        or the reference below to register.xml?</fixme>
  +
  +        <p>registration.xml lets the user register a username, password and
  +        email address in order to join the mailing lists (chosen next).</p>
   
  -	  <p>Now we see the input options for the user, such as xf:textbox which will display a textbox.  Each such option has a ref attribute which is very important as this is the value we will map to the JavaBean. If we are validating this input then it must have a violations tag inside it. The violations tag serves as a container or place holder for validation errors. It has a single optional attribute "class" which refers to the CSS class to use when displaying validation errors.</p>
  +        <p>The important part of the form, which you will need to change in
  +        your own forms, is located inside the xf:form tag. Make sure the value
  +        of the xf:form&#39;s id attribute, form-feedback, is matched by the
  +        sitemap&#39;s map:parameter name-value pair shown here:</p>
  +
  +        <source>
  +      
  +       &#60;map:parameter name=&#34;xmlform-id&#34; value=&#34;form-feedback&#34;/&#62;
  +       
  +      </source>
  +
  +        <fixme author="DS">This is confusing. Your view is named register,
  +        your filename is registration. You appear to be contradicting your own
  +        instructions.</fixme>
  +
  +        <p>The view attribute should contain the name of the current xml file.
  +        The action attribute should contain the name of the url you are using
  +        in the sitemap.</p>
  +
  +        <fixme author="DS">Should you show how validation is set in the
  +        sitemap, or does that appear later?</fixme>
  +
  +        <p>The caption element is the page heading. Next, we have error
  +        elements which are used if you have a validation set in your sitemap.
  +        When an error is found, the error will be displayed once the user
  +        clicks the next button on your form.</p>
  +
  +        <p>Next we see the input options for the user, such as xf:textbox,
  +        which will display a textbox. Each of these options has a very
  +        important ref attribute whose value is mapped to the JavaBean. If we
  +        are validating this input, then it must have a violations element
  +        inside of it. The violations element serves as a container or
  +        placeholder for validation errors. It has a single optional attribute
  +        &#34;class&#34; which references the CSS class to use when displaying
  +        validation errors.</p>
  +
  +        <p>Finally, the form needs a submit element This enables the user
  +        continue on through the rest of the form.</p>
   
  -      <p>Finally the form needs a submit tag.  This lets the user navigate forward to the rest of the form.</p>
          <source>
           <![CDATA[
           <?xml version="1.0" ?>
  @@ -132,11 +194,20 @@
   	</document>
           ]]>
           </source>
  -	</s2>
  -        
  -        <s2 title="interest.xml">
  -        <p>This XML page lets the user select areas of interest and depending on their answers they will be shown a selection of mailing lists they can join. The intelligence for deciding which pages to show next are in a java file which we will show you how to write later.</p>
  -        <p>This page consists of tick boxes which are either true or false.</p>
  +      </s2>
  +
  +      <s2 title="interest.xml">
  +        <p>This XML page lets the user select areas of interest. Based on
  +        selected areas of interest, a user will later view a group of mailing
  +        lists on subsequent pages. The logic that determines what pages are
  +        shown next is found in a java file (which will be explained in later
  +        steps).</p>
  +
  +        <fixme author="DS">Can you describe the example below this sentence?</fixme>
  +
  +        <p>This page consists of tick boxes which are either true or false.
  +        </p>
  +
           <source>
           <![CDATA[
           <xf:selectBoolean ref="/organicGardening">
  @@ -144,7 +215,10 @@
   	    </xf:selectBoolean>
            ]]>
            </source>
  -         <p>Below is the page which you can copy into the folder "howto".</p>
  +
  +        <p>Below is the page which you can copy into the folder
  +        &#34;howto&#34;.</p>
  +
            <source>
           <![CDATA[
   <?xml version="1.0" ?>
  @@ -181,10 +255,16 @@
   </document>     
           ]]>
           </source>
  -	</s2>
  +      </s2>
  +
  +      <s2 title="organicGardening.xml">
  +        <p>If the user ticked the organic gardening box on the previous page,
  +        interest.xml, organicGardening.xml is the next page is shown. This
  +        page shows a selection of mailing lists from which the user can chose.
  +        It is very similar to the previous page which contained three tick
  +        boxes. The user has the choice of moving forward through the form or
  +        back to the previous page to adjust the areas of interest.</p>
   
  -         <s2 title="organicGardening.xml">
  -         <p>The next page is shown if the user ticked the organic gardening box in the previous page, interest.xml. This page consists a selection of mailing lists the user can chose. It is very similar to the previous page containing 3 tick boxes. The user has the choice of moving forward through the form or back to the previous page so they can alter their area of interest.</p>
            <source>
           <![CDATA[
   <?xml version="1.0" ?>
  @@ -221,10 +301,13 @@
   </document>        
           ]]>
           </source>
  -	</s2>
  -        
  -        <s2 title="cooking.xml">
  -        <p>The next page is a selection of cookery mailing lists, very similar to the organicGardening.xml page. This page will appear if the user ticked the organic gardening option on the interest.xml page.</p>
  +      </s2>
  +
  +      <s2 title="cooking.xml">
  +        <p>The next page is a selection of cookery mailing lists, very similar
  +        to the organicGardening.xml page. This page will appear if the user
  +        ticked the organic gardening option on the interest.xml page.</p>
  +
            <source>
           <![CDATA[
   <?xml version="1.0" ?>
  @@ -261,11 +344,14 @@
   </document>        
           ]]>
           </source>
  -	</s2>
  -        
  -        <s2 title="smallholdingManagement.xml">
  -        <p>Again this page is similar to organicGardening.xml, cooking.xml as it gives the user a choice of mailing lists.  This page will only appear if the user selected Smallholding Management as an interest on the interest.xml page.</p>
  -        
  +      </s2>
  +
  +      <s2 title="smallholdingManagement.xml">
  +        <p>Again, this page is similar to organicGardening.xml, cooking.xml as
  +        it gives the user a choice of mailing lists. This page will only
  +        appear if the user selected Smallholding Management as an interest on
  +        the interest.xml page.</p>
  +
           <source>
           <![CDATA[
   <?xml version="1.0" ?>
  @@ -305,10 +391,17 @@
           
           ]]>
           </source>
  -	</s2>
  -        
  -        <s2 title="confirm.xml">
  -        <p>This page shows the user the data that has been collected from them. The JavaBean that stores all the data is queried and the information collected is displayed. This is done using the xf:output tag, specifying which value to display with the ref attribute. If they wish to change any of the information they can do this now by clicking the previous button and altering their answers.  Otherwise they can click the finish button which will take them to the end page, end.xml.</p>
  +      </s2>
  +
  +      <s2 title="confirm.xml">
  +        <p>This page shows the user all of the previously submitted data. This
  +        information is the result of querying a JavaBean where all of this
  +        data was stored. This is accomplished using the xf:output element
  +        which specifies what value to display with the ref attribute. A user
  +        can change any of the information by clicking the previous button and
  +        adjusting previous selections. Otherwise, the user can click the
  +        finish button to go to the final page, end.xml.</p>
  +
           <source>
            <![CDATA[
   <?xml version="1.0" ?>
  @@ -404,10 +497,13 @@
   </document>	        
            ]]>
           </source>
  -        </s2>
  +      </s2>
  +
  +      <s2 title="end.xml">
  +        <p>end.xml is the final page. It informs the user of successful form
  +        completion and provides the user with the option to return to the
  +        start page.</p>
   
  -        <s2 title="end.xml">
  -        <p>This page displays the final page. It tells the reader they have succesfully filled in the form and gives them the option to return to the start.</p> 
           <source>
            <![CDATA[
   	   <?xml version="1.0" ?>
  @@ -417,7 +513,7 @@
           <tr>
               <td align="center">
                   <h1>
  -                    You have reached the last page of the How To Form example!
  +                    You have reached the last page of the How-To Form example!
                   </h1>
               </td>
           </tr>
  @@ -443,13 +539,9 @@
        
            ]]>
           </source>
  -	</s2>
  -        <p><link href="howto-xmlform-wizard-2.html">Step 2: Validation</link></p>
  -        
  +      </s2>
   
  +      <p><link href="howto-xmlform-wizard-2.html">Step 2: Validation</link></p>
       </s1>
     </body>
  -
   </document>
  -
  -
  
  
  
  1.2       +81 -44    xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-2.xml
  
  Index: howto-xmlform-wizard-2.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-2.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- howto-xmlform-wizard-2.xml	1 Jun 2002 13:18:09 -0000	1.1
  +++ howto-xmlform-wizard-2.xml	5 Jun 2002 15:03:16 -0000	1.2
  @@ -2,76 +2,113 @@
   <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
   
   <document>
  -
     <header>
  -    <title>XMLForm's HowTo Step 2</title>
  +    <title>XMLForm&#39;s How-To Step 2</title>
  +
       <authors>
  -      <person name="Heidi Brannan" email="heidi@wkwyw.net"/>
  +      <person name="Heidi Brannan"
  +              email="heidi@wkwyw.net" />
       </authors>
     </header>
   
     <body>
  -    <s1 title="XMLForm's HowTo Step 2: Validation"> 
  -      <p>The next step validation is optional, you do not have to validate your forms but its very easy to do so, so we will.</p>
  -      <p>In the sitemap there are 2 parameters, xmlform-validator-schema and xmlform-validator-schema-ns. If these are left empty then no validation will be carried out. xmlform-validator-schema contains the name of the xml schema file we are using and xmlform-validator-schema-ns is the validator namespace we are using.  Below are the 2 parameters in the sitemap we are referring to.</p>
  +    <s1 title="Step 2: Validation">
  +      <fixme author="DS">Who is we? The &#34;royal&#34; we? ;-). Shifting to
  +      we, in the middle of this doc, is confusing. Give a reason or two why
  +      it&#39;s helpful to validate...</fixme>
  +
  +      <p>The next step, validation, is optional. You do not have to validate
  +      your forms. Because we believe it&#39;s very easy to do so, we will do
  +      so here.</p>
  +
  +      <fixme author="DS">Below you write: if these are left empty. If you
  +      leave *what* empty? The name, values, or both?</fixme>
  +
  +      <p>In the sitemap there are two parameters, xmlform-validator-schema and
  +      xmlform-validator-schema-ns. If you leave them empty, then no validation
  +      will be carried out. xmlform-validator-schema contains the name of the
  +      xml schema file we are using. xmlform-validator-schema-ns is the
  +      validator namespace we are using. Here is how the two parameters are
  +      referenced in the sitemap.</p>
  +
         <source>
         <![CDATA[
  -          <map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
  -          <map:parameter name="xmlform-validator-schema" value="schematron/wizard-xmlform-sch-report.xml"/>
  +<map:parameter name="xmlform-validator-schema-ns" 
  +  value="http://www.ascc.net/xml/schematron"/>
  +  
  +<map:parameter name="xmlform-validator-schema" 
  +  value="schematron/wizard-xmlform-sch-report.xml"/>
         ]]>    
         </source>
  -      <p>Copy the "howto-xmlform-sch-report.xml" and place this in the folder src\scratchpad\webapp\samples\xmlform\howto\schematron.</p>
  -      <p>The schema is simple and only validates the registration.xml page.  The phase tag relates to an xml page that contains values which will be validated. The id attribute contains the page name.  Inside the phase tag is the active tag which contains the pattern attribute which match up to the pattern tags below. Each pattern can contain one or more rule tags. Each rule tag has a context attribute which maps to a javaBean value, for example userName. Nested inside the rule tag is one or more assert tag. Each assert tag contains a test attribute. The test value can check the value passes certain criteria, for example, the value is more than 7 characters long. Nested between the beginning and closing assert tags is an error message which will be displayed if the test is not met.</p>
  +
  +      <p>Copy the &#34;howto-xmlform-sch-report.xml,&#34; and place it in the
  +      folder src\scratchpad\webapp\samples\xmlform\howto\schematron.</p>
  +
  +      <fixme author="DS">Sometimes it&#39;s useful to show the dtd for the
  +      schema.</fixme>
  +
  +      <p>The schema shown below is simple. It validates only the
  +      registration.xml page. The phase element includes information concerning
  +      the xml page to be validated. The id attribute contains the page name.
  +      The phase element contains an active element whose pattern attribute
  +      matches up to the pattern element below. Each pattern can contain one or
  +      more rule elements. Each rule element has a context attribute which maps
  +      to a javaBean value, for example userName. Nested inside the rule
  +      element is one or more assert element. Each assert element contains a
  +      test attribute. The value of test can be used to check certain criteria,
  +      for example, if a passed value is more than seven characters long.
  +      Nested between the beginning and closing assert tags is an error message
  +      text to be displayed when the test fails.</p>
  +
         <source>
           <![CDATA[
   <?xml version="1.0" ?>
   
  -<schema ns="http://xml.apache.cocoon/xmlform"  xmlns="http://www.ascc.net/xml/schematron">
  +<schema ns="http://xml.apache.cocoon/xmlform"  
  +        xmlns="http://www.ascc.net/xml/schematron">
   
  -	<title>Schema for the XML Form example</title>
  +  <title>Schema for the XML Form example</title>
     
  -    <phase id="registration">
  -            <p>For user identity information.</p>
  -            <active pattern="reg"/>
  +  <phase id="registration">
  +    <p>For user identity information.</p>
  +    <active pattern="reg"/>
       </phase>
       
  -    <phase id="confirm">
  -            <p>For final total validation and tracking 
  -                some tricky problems.</p>
  -            <active pattern="reg" />
  -         
  -    </phase>
  -
  +  <phase id="confirm">
  +    <p>For final total validation and tracking 
  +       some tricky problems.</p>
  +    <active pattern="reg" />
  +  </phase>
       
  -	<pattern name="User Info Validation Pattern" id="reg">
  -		<rule context="/userName">
  -			<assert  test="string-length(.) &gt; 7">
  -        Username should be at least 8 characters.
  -      </assert>
  -			<assert  test="string-length(.) &lt; 20">
  -        Username should be less than 20 characters.
  +  <pattern name="User Info Validation Pattern" id="reg">
  +    <rule context="/userName">
  +      <assert  test="string-length(.) &gt; 7">
  +	   Username should be at least 8 characters.
         </assert>
  -		</rule>
  -		<rule context="/password">
  -			<assert  test="string-length(.) &gt; 7">
  -        Password should be at least 8 characters.
  +	  <assert  test="string-length(.) &lt; 20">
  +	    Username should be less than 20 characters.
         </assert>
  -			<assert  test="string-length(.) &lt; 20">
  -        Password should be less than 20 characters.
  +	</rule>
  +	<rule context="/password">
  +	  <assert  test="string-length(.) &gt; 7">
  +	      Password should be at least 8 characters.
         </assert>
  -		</rule>
  -		<rule context="/email">
  -			<assert test="contains( string(.),'@')">
  -        Email format is invalid.
  +	  <assert  test="string-length(.) &lt; 20">
  +	    Password should be less than 20 characters.
  +     </assert>
  +	</rule>
  +	<rule context="/email">
  +	  <assert test="contains( string(.),'@')">
  +	    Email format is invalid.
         </assert>
  -		</rule>		
  -	</pattern>
  +	</rule>		
  +  </pattern>
   </schema>
   ]]>
         </source>  
  -      <p>Now you are ready for <link href="howto-xmlform-wizard-3.html">Step 3: Form instance model</link> </p>     
  +
  +      <p>Now you are ready for <link href="howto-xmlform-wizard-3.html">Step
  +      3: Form instance model</link></p>
       </s1>
     </body>
  -
   </document>
  -
  
  
  
  1.2       +20 -13    xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-3.xml
  
  Index: howto-xmlform-wizard-3.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-3.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- howto-xmlform-wizard-3.xml	1 Jun 2002 13:18:09 -0000	1.1
  +++ howto-xmlform-wizard-3.xml	5 Jun 2002 15:03:16 -0000	1.2
  @@ -2,21 +2,31 @@
   <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
   
   <document>
  -
     <header>
  -    <title>XMLForm's HowTo Step 3</title>
  +    <title>XMLForm Wizard&#39;s How-To Step 3</title>
  +
       <authors>
  -      <person name="Heidi Brannan" email="heidi@wkwyw.net"/>
  +      <person name="Heidi Brannan"
  +              email="heidi@wkwyw.net" />
       </authors>
     </header>
   
     <body>
  -    <s1 title="XMLForm's HowTo Step 3: Form instance model"> 
  +    <s1 title="Step 3: Form instance model">
         <s2 title="HowToBean.java">
  -        <p>Next we create the simple JavaBean which holds the data filled in the form. Each value has a set and get method. Each value must map with the form data. This is done using 
  -<link href="http://jakarta.apache.org/commons/jxpath/index.html">JXPath</link> (an XPath implementation applicable for JavaBeans, DOM nodes and mix of the two).
  -		</p>
  -        <p>Copy the file below and save it as HowToBean.java in the folder \src\java\org\apache\cocoon\samples\xmlform\howto</p>
  +        <fixme author="DS">Each value must map with the form data... can you
  +        reword?</fixme>
  +
  +        <p>Next, we create the simple JavaBean which holds the data provided
  +        by users on each form. Each value has a corresponding set and get
  +        method. Each value must also map with the form data. This is done
  +        using <link href="http://jakarta.apache.org/commons/jxpath/index.html">JXPath</link>
  +        (an XPath implementation applicable for JavaBeans, DOM nodes, and mix
  +        of the two).</p>
  +
  +        <p>Copy the file below, and save it as HowToBean.java in the folder
  +        \src\java\org\apache\cocoon\samples\xmlform\howto</p>
  +
           <source>
           <![CDATA[
   package org.apache.cocoon.samples.xmlform.howto;
  @@ -206,12 +216,9 @@
   }
   ]]>
           </source>  
  -        <p>Now we move on to <link href="howto-xmlform-wizard-4.html">Step 4: Writing the Action</link></p>
  -      
  -      
  +        <p>Now we move on to <link href="howto-xmlform-wizard-4.html">Step 4:
  +        Writing the Action</link></p>
         </s2>
       </s1>
     </body>
  -
   </document>
  -
  
  
  
  1.2       +44 -26    xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-4.xml
  
  Index: howto-xmlform-wizard-4.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-4.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- howto-xmlform-wizard-4.xml	1 Jun 2002 13:18:09 -0000	1.1
  +++ howto-xmlform-wizard-4.xml	5 Jun 2002 15:03:16 -0000	1.2
  @@ -2,39 +2,58 @@
   <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
   
   <document>
  -
     <header>
  -    <title>XMLForm's HowTo Step 4</title>
  +    <title>XMLForm&#39;s HowTo Step 4</title>
  +
       <authors>
  -      <person name="Heidi Brannan" email="heidi@wkwyw.net"/>
  +      <person name="Heidi Brannan"
  +              email="heidi@wkwyw.net" />
       </authors>
     </header>
   
     <body>
  -    <s1 title="XMLForm's HowTo Step 4: Writing the Action">
  -      <p>HowtoWizardAction.java is based on the WizardAction.java, which is part of the XMLForm feedback wizard demo distributed with Cocoon.  The prepare, perform and reset methods need to be altered. You also need to define the pages which comprise the navigation states.</p> 
  -      <s2 title="XML Pages defined"> 
  +    <s1 title="Step 4: Writing the Action">
  +      <p>HowtoWizardAction.java is based on the WizardAction.java which is
  +      part of the XMLForm feedback wizard demo distributed with Cocoon. You
  +      need to adjust the prepare, perform and reset methods. You also need to
  +      define the pages which comprise the navigation states.</p>
  +
  +      <s2 title="XML Pages defined">
           <source>
           <![CDATA[
  -  // different form views 
  -  // participating in the wizard
  -  final String VIEW_START = "start";
  -  final String VIEW_REGISTRATION = "registration";
  -  final String VIEW_INTEREST = "interest";
  -  final String VIEW_GARDENING = "organicGardening";
  -  final String VIEW_COOKING = "cooking";
  -  final String VIEW_SMALLHOLDING = "smallholdingManagement";
  -  final String VIEW_CONFIRM = "confirm";
  -  final String VIEW_END = "end";
  +// different form views 
  +// participating in the wizard
  +final String VIEW_START = "start";
  +final String VIEW_REGISTRATION = "registration";
  +final String VIEW_INTEREST = "interest";
  +final String VIEW_GARDENING = "organicGardening";
  +final String VIEW_COOKING = "cooking";
  +final String VIEW_SMALLHOLDING = "smallholdingManagement";
  +final String VIEW_CONFIRM = "confirm";
  +final String VIEW_END = "end";
           ]]>
           </source>
         </s2>
  -      
  +
         <s2 title="Prepare Method">
  -      <p>This method prepares the form and the pages to be returned before the actual form population starts.</p>
  -      <p>The first time the URL http://localhost:8080/cocoon/mount/xmlform/howto-wizard.html is called there is no command passed so the if statement test is met and the start page is returned.</p>
  -      <p>After the start page has been viewed and the user clicks on "Start" the command start is passed so the else test is met and the registration page is returned. Any old forms are removed and a form listener is added to the form.</p>  
  -      <p>If neither of these tests are met then nothing is returned.</p>
  +        <p>This method prepares the form and the pages to be returned before
  +        actual form population starts.</p>
  +
  +        <p>The first time the URL
  +        http://localhost:8080/cocoon/mount/xmlform/howto-wizard.html is
  +        requested, no command is passed. Thus, the &#34;if statement&#34; test
  +        is met, and the start page is returned.</p>
  +
  +        <fixme author="DS">Explain what you mean below by old forms are
  +        removed.</fixme>
  +
  +        <p>After the start page has been viewed, and the user clicks on
  +        &#34;Start&#34;, the command start is passed. Thus, the &#34;else
  +        test&#34; is met, and the registration page is returned. Any old forms
  +        are removed, and a form listener is added to the form.</p>
  +
  +        <p>If neither of these tests are met, then nothing is returned.</p>
  +
         <source>
           <![CDATA[
   
  @@ -416,11 +435,10 @@
   
       ]]>
       </source>
  -    </s2>
  -    <p>Finally <link href="howto-xmlform-wizard-5.html">Step 5: The Sitemap</link></p>
  +
  +      </s2>
  +
  +      <p>Finally <link href="howto-xmlform-wizard-5.html">Step 5: The Sitemap</link></p>
       </s1>
     </body>
  -
   </document>
  -
  -
  
  
  
  1.2       +164 -138  xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-5.xml
  
  Index: howto-xmlform-wizard-5.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/howto/xmlform-wizard/howto-xmlform-wizard-5.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- howto-xmlform-wizard-5.xml	1 Jun 2002 13:18:09 -0000	1.1
  +++ howto-xmlform-wizard-5.xml	5 Jun 2002 15:03:16 -0000	1.2
  @@ -2,160 +2,186 @@
   <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
   
   <document>
  -
     <header>
  -    <title>XMLForm's HowTo Step 5</title>
  +    <title>XMLForm Wizard&#39;s How-To Step 5</title>
  +
       <authors>
  -      <person name="Heidi Brannan" email="heidi@wkwyw.net"/>
  +      <person name="Heidi Brannan"
  +              email="heidi@wkwyw.net" />
       </authors>
     </header>
   
     <body>
  -    <s1 title="XMLForm's HowTo Step 5: The Sitemap"> 
  -      <p>The Sitemap finally pulls all the previous files together into an understandable whole.</p>
  -      <p>In the components section we add a map:action tag named HowToWizardAction.  This points to the Java file HowToWizardAction which we met in step 4.</p>
  +    <s1 title="Step 5: The Sitemap">
  +      <p>Finally, the Sitemap pulls all of the previously created files
  +      together into one understandable whole.</p>
  +
  +      <p>Within the components section of the sitemap, we add a map:action
  +      element named HowToWizardAction. This points to the Java file
  +      HowToWizardAction encountered during Step 4.</p>
  +
         <source>
           <![CDATA[
  -  <!-- =========================== Components ================================ -->
  -  <map:components> 
  -    <map:actions>
  -      <map:action name="WizardAction" src="org.apache.cocoon.samples.xmlform.WizardAction"  
  -        logger="webapp.xmlform"/>
  -      <map:action name="HowtoWizardAction" src="org.apache.cocoon.samples.xmlform.howton.HowtoWizardAction"  
  -        logger="webapp.xmlform"/>
  -    </map:actions>
  -    <map:generators default="file"/>
  -    <map:transformers default="xslt">
  -      <map:transformer name="xmlform" src="org.apache.cocoon.transformation.XMLFormTransformer" 
  -        logger="webapp.xmlform"/>
  -    </map:transformers>
  -    <map:readers default="resource"/>
  -    <map:serializers default="html"/>
  -    <map:selectors default="browser"/>
  -    <map:matchers default="wildcard">
  -      <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
  -    </map:matchers>
  -  </map:components>
  +<!-- =========================== Components ================================ -->
  +<map:components> 
  +<map:actions>
  +  <map:action name="WizardAction" 
  +	  src="org.apache.cocoon.samples.xmlform.WizardAction"  
  +	logger="webapp.xmlform"/>
  +  <map:action name="HowtoWizardAction" src="org.apache.cocoon.samples.xmlform.howton.HowtoWizardAction"  
  +	logger="webapp.xmlform"/>
  +</map:actions>
  +<map:generators default="file"/>
  +<map:transformers default="xslt">
  +  <map:transformer name="xmlform" 
  +    src="org.apache.cocoon.transformation.XMLFormTransformer" 
  +	logger="webapp.xmlform"/>
  +</map:transformers>
  +<map:readers default="resource"/>
  +<map:serializers default="html"/>
  +<map:selectors default="browser"/>
  +<map:matchers default="wildcard">
  +  <map:matcher name="wildcard" 
  +    src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
  +</map:matchers>
  +</map:components>
   ]]>
  -      </source>  
  -      <p>We add to the pipeline the following tags:</p>
  -      <source>
  -        <![CDATA[
  -      <!-- A non-trivial example - Feedback HowTo Wizard -->
  -      <map:match pattern="howto-wizard.html">
  -        <map:act type="HowtoWizardAction">
  -
  -          <!-- XMLForm parameters for the HowtoWizardAction -->
  -          <map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
  -          <map:parameter name="xmlform-validator-schema" value="howto/schematron/howto-xmlform-sch-report.xml"/>
  -          <map:parameter name="xmlform-id" value="form-feedback"/>
  -          <map:parameter name="xmlform-scope" value="session"/>
  -          <map:parameter name="xmlform-model" value="org.apache.cocoon.samples.xmlform.howto.HowToBean"/>
  -
  -          <!-- Content transformation logic -->
  -          <map:generate src="howto/{page}.xml"/>
  -          <map:transform type="xmlform" label="xml"/>
  -          <map:transform src="stylesheets/wizard2html.xsl"/>
  -          <map:transform src="context://stylesheets/xmlform/xmlform2html.xsl"/>
  -          <map:serialize type="html"/>
  -        </map:act>
  -      </map:match>         
  +  </source>  
  +  <p>We then add the following to the pipeline.</p>
  +  <source>
  +	<![CDATA[
  +  <!-- A non-trivial example - Feedback HowTo Wizard -->
  +  <map:match pattern="howto-wizard.html">
  +	<map:act type="HowtoWizardAction">
  +
  +	  <!-- XMLForm parameters for the HowtoWizardAction -->
  +	  <map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
  +	  <map:parameter name="xmlform-validator-schema" value="howto/schematron/howto-xmlform-sch-report.xml"/>
  +	  <map:parameter name="xmlform-id" value="form-feedback"/>
  +	  <map:parameter name="xmlform-scope" value="session"/>
  +	  <map:parameter name="xmlform-model" value="org.apache.cocoon.samples.xmlform.howto.HowToBean"/>
  +
  +	  <!-- Content transformation logic -->
  +	  <map:generate src="howto/{page}.xml"/>
  +	  <map:transform type="xmlform" label="xml"/>
  +	  <map:transform src="stylesheets/wizard2html.xsl"/>
  +	  <map:transform src="context://stylesheets/xmlform/xmlform2html.xsl"/>
  +	  <map:serialize type="html"/>
  +	</map:act>
  +  </map:match>         
           ]]>
  -      </source>     
  -      <p>The whole sitemap.xmap is below so you can just copy this over your current sitemap if you like. Your current sitemap is located in \src\webapp\samples\xmlform</p>
  +      </source>    
  +
  +      <p>The whole sitemap.xmap is found below. You can simply copy and past
  +      it into your own sitemap. Your current sitemap is located in
  +      \src\webapp\samples\xmlform.</p>
  +
         <source>
         <![CDATA[
  -      <?xml version="1.0"?>
  -      <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  -      
  -        <!-- =========================== Components ================================ -->
  -        <map:components> 
  -          <map:actions>
  -            <map:action name="WizardAction" src="org.apache.cocoon.samples.xmlform.WizardAction"  
  -              logger="webapp.xmlform"/>
  -            <map:action name="HowtoWizardAction" src="org.apache.cocoon.samples.xmlform.howto.HowtoWizardAction"  
  -              logger="webapp.xmlform"/>
  -          </map:actions>
  -          <map:generators default="file"/>
  -          <map:transformers default="xslt">
  -            <map:transformer name="xmlform" src="org.apache.cocoon.transformation.XMLFormTransformer" 
  -              logger="webapp.xmlform"/>
  -          </map:transformers>
  -          <map:readers default="resource"/>
  -          <map:serializers default="html"/>
  -          <map:selectors default="browser"/>
  -          <map:matchers default="wildcard">
  -            <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
  -          </map:matchers>
  -        </map:components>
  -      
  -        <!-- =========================== Resources ================================= -->
  -        <map:resources>
  -        </map:resources>
  -      
  -        <!-- =========================== Pipelines ================================= -->
  -        <map:pipelines> 
  -          <map:pipeline>
  -      
  -            <map:match pattern="">
  -              <map:redirect-to uri="wizard.html"/>
  -            </map:match>
  -      
  -            <!-- A non-trivial example - Feedback Wizard -->
  -            <map:match pattern="wizard.html">
  -              <map:act type="WizardAction">
  -      
  -                <!-- XMLForm parameters for the AbstractXMLFormAction -->
  -                <map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
  -                <map:parameter name="xmlform-validator-schema" value="schematron/wizard-xmlform-sch-report.xml"/>
  -                <map:parameter name="xmlform-id" value="form-feedback"/>
  -                <map:parameter name="xmlform-scope" value="session"/>
  -                <map:parameter name="xmlform-model" value="org.apache.cocoon.samples.xmlform.UserBean"/>
  -      
  -                <!-- Content transformation logic -->
  -                <map:generate src="wizard/{page}.xml"/>
  -                <map:transform type="xmlform" label="xml"/>
  -                <map:transform src="stylesheets/wizard2html.xsl"/>
  -                <map:transform src="context://stylesheets/xmlform/xmlform2html.xsl"/>
  -                <map:serialize type="html"/>
  -              </map:act>
  -            </map:match>  
  +<?xml version="1.0"?>
  +<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   
  -      
  -            <!-- A non-trivial example - Feedback HowTo Wizard -->
  -            <map:match pattern="howto-wizard.html">
  -              <map:act type="HowtoWizardAction">
  -      
  -                <!-- XMLForm parameters for the HowtoWizardAction -->
  -                <map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
  -                <map:parameter name="xmlform-validator-schema" value="howto/schematron/howto-xmlform-sch-report.xml"/>
  -                <map:parameter name="xmlform-id" value="form-howto"/>
  -                <map:parameter name="xmlform-scope" value="session"/>
  -                <map:parameter name="xmlform-model" value="org.apache.cocoon.samples.xmlform.howto.HowToBean"/>
  -      
  -                <!-- Content transformation logic -->
  -                <map:generate src="howto/{page}.xml"/>
  -                <map:transform type="xmlform" label="xml"/>
  -                <map:transform src="stylesheets/wizard2html.xsl"/>
  -                <map:transform src="context://stylesheets/xmlform/xmlform2html.xsl"/>
  -                <map:serialize type="html"/>
  -              </map:act>
  -            </map:match> 
  -          </map:pipeline>
  -        </map:pipelines> 
  -      </map:sitemap>
  +<!-- =========================== Components ================================ -->
  +<map:components> 
  +  <map:actions>
  +	<map:action name="WizardAction" 
  +	  src="org.apache.cocoon.samples.xmlform.WizardAction"  
  +	  logger="webapp.xmlform"/>
  +	<map:action name="HowtoWizardAction" src="org.apache.cocoon.samples.xmlform.howto.HowtoWizardAction"  
  +	  logger="webapp.xmlform"/>
  +  </map:actions>
  +  <map:generators default="file"/>
  +  <map:transformers default="xslt">
  +	<map:transformer name="xmlform" src="org.apache.cocoon.transformation.XMLFormTransformer" 
  +	  logger="webapp.xmlform"/>
  +  </map:transformers>
  +  <map:readers default="resource"/>
  +  <map:serializers default="html"/>
  +  <map:selectors default="browser"/>
  +  <map:matchers default="wildcard">
  +	<map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
  +  </map:matchers>
  +</map:components>
  +
  +<!-- =========================== Resources ================================= -->
  +<map:resources>
  +</map:resources>
  +
  +<!-- =========================== Pipelines ================================= -->
  +<map:pipelines> 
  +  <map:pipeline>
  +
  +	<map:match pattern="">
  +	  <map:redirect-to uri="wizard.html"/>
  +	</map:match>
  +
  +	<!-- A non-trivial example - Feedback Wizard -->
  +	<map:match pattern="wizard.html">
  +	  <map:act type="WizardAction">
  +
  +		<!-- XMLForm parameters for the AbstractXMLFormAction -->
  +		<map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
  +		<map:parameter name="xmlform-validator-schema" value="schematron/wizard-xmlform-sch-report.xml"/>
  +		<map:parameter name="xmlform-id" value="form-feedback"/>
  +		<map:parameter name="xmlform-scope" value="session"/>
  +		<map:parameter name="xmlform-model" value="org.apache.cocoon.samples.xmlform.UserBean"/>
  +
  +		<!-- Content transformation logic -->
  +		<map:generate src="wizard/{page}.xml"/>
  +		<map:transform type="xmlform" label="xml"/>
  +		<map:transform src="stylesheets/wizard2html.xsl"/>
  +		<map:transform src="context://stylesheets/xmlform/xmlform2html.xsl"/>
  +		<map:serialize type="html"/>
  +	  </map:act>
  +	</map:match>  
  +
  +
  +	<!-- A non-trivial example - Feedback HowTo Wizard -->
  +	<map:match pattern="howto-wizard.html">
  +	  <map:act type="HowtoWizardAction">
  +
  +		<!-- XMLForm parameters for the HowtoWizardAction -->
  +		<map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
  +		<map:parameter name="xmlform-validator-schema" value="howto/schematron/howto-xmlform-sch-report.xml"/>
  +		<map:parameter name="xmlform-id" value="form-howto"/>
  +		<map:parameter name="xmlform-scope" value="session"/>
  +		<map:parameter name="xmlform-model" value="org.apache.cocoon.samples.xmlform.howto.HowToBean"/>
  +
  +		<!-- Content transformation logic -->
  +		<map:generate src="howto/{page}.xml"/>
  +		<map:transform type="xmlform" label="xml"/>
  +		<map:transform src="stylesheets/wizard2html.xsl"/>
  +		<map:transform src="context://stylesheets/xmlform/xmlform2html.xsl"/>
  +		<map:serialize type="html"/>
  +	  </map:act>
  +	</map:match> 
  +  </map:pipeline>
  +</map:pipelines> 
  +</map:sitemap>
         <!-- end of file -->
         ]]>
         </source>
  -      <p>Congratulations! Now you have covered everything you need to create the mailing list forms.  Now all you need to do is to build the files and then deploy them in your web server.</p>
  -      <p>Use the command:</p>
  -      <p>build webapp -Dinclude.webapp.libs=true webapp</p>
  -      <p>Place cocoon.war in your webapp folder if you are using Tomcat then restart Tomcat.</p>
  -      <p>In a browser go to http://localhost:8080/cocoon/samples/xmlform/howto-wizard.html and you should see the start page of the mailing list forms.</p>
  -      <p>To return to the <link href="howto-xmlform-wizard.html">start</link></p>
  -    </s1>
  -  </body>
   
  -</document>
  +      <p>Congratulations! You have just covered everything you need to know to
  +      create the mailing list forms. Now all you need to do is to build and
  +      then deploy the files on your web server.</p>
  +
  +      <p>To build your webapp, use the command:</p>
  +
  +      <source>
  +        
  +build webapp -Dinclude.webapp.libs=true webapp
  +      
  +      </source>
  +
  +      <p>If you are using Tomcat, for example, place cocoon.war in your
  +      webapps folder and then restart Tomcat.</p>
   
  +      <p>In a browser go to
  +      http://localhost:8080/cocoon/samples/xmlform/howto-wizard.html. You
  +      should see the start page of the mailing list forms.</p>
   
  +      <p>Return to the <link href="howto-xmlform-wizard.html">overview page.</link></p>
  +    </s1>
  +  </body>
  +</document>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message