cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/woody/samples/forms form1_template.xml registration_success_jx.xml form1_template_flow.xml registration_success.jx
Date Wed, 19 Nov 2003 18:19:15 GMT
sylvain     2003/11/19 10:19:15

  Modified:    src/blocks/woody/samples sitemap.xmap
               src/blocks/woody/samples/flow registration.js
                        upload_example.js woody_flow_example.js
  Added:       src/blocks/woody/samples/forms form1_template.xml
                        registration_success_jx.xml
  Removed:     src/blocks/woody/samples/forms form1_template_flow.xml
                        registration_success.jx
  Log:
  Samples refactoring that heavily reduces the size of the sitemap
  
  Revision  Changes    Path
  1.29      +33 -182   cocoon-2.1/src/blocks/woody/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/sitemap.xmap,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- sitemap.xmap	14 Nov 2003 09:47:27 -0000	1.28
  +++ sitemap.xmap	19 Nov 2003 18:19:12 -0000	1.29
  @@ -49,6 +49,19 @@
      <map:serialize type="links"/>
     </map:view>
    </map:views>
  + 
  + <map:resources>
  +   <!-- this will later become a virtual transformer -->
  +   <map:resource name="simple-page2html">
  +     <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  +       <map:parameter name="contextPath" value="{request:contextPath}"/>
  +       <map:parameter name="servletPath" value="{request:servletPath}"/>
  +       <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +       <map:parameter name="file" value="{file}"/>
  +       <map:parameter name="remove" value="{../0}"/>
  +     </map:transform> 
  +   </map:resource>
  + </map:resources>
   
     <!-- indicates what flowscript to attach to this sitemap -->
     <map:flow language="javascript">
  @@ -95,13 +108,9 @@
                <!-- the content of this action is only executed in case validation
                     succeeded, thus if the form handling is completed -->
                <map:generate type="serverpages" src="forms/form1_success.xsp"/>
  -             <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -               <map:parameter name="contextPath" value="{request:contextPath}"/>
  -               <map:parameter name="servletPath" value="{request:servletPath}"/>
  -               <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +             <map:call resource="simple-page2html">
                  <map:parameter name="file" value="forms/form1_success.xsp"/>
  -               <map:parameter name="remove" value="{../0}"/>
  -             </map:transform>
  +             </map:call>
                <map:serialize/>
              </map:act>
            </map:when>
  @@ -118,13 +127,9 @@
          <map:transform type="i18n">
            <map:parameter name="locale" value="en-US"/>
          </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/form1_template_action.xml"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform>
  +       <map:call resource="simple-page2html">
  +         <map:parameter name="file" value="forms/form1_success.xsp"/>
  +       </map:call>
          <map:transform type="i18n">
            <map:parameter name="locale" value="en-US"/>
          </map:transform>
  @@ -146,32 +151,25 @@
          <map:call continuation="{1}"/>
        </map:match>
   
  -     <map:match pattern="form1-display-pipeline">
  +     <map:match pattern="*-display-pipeline">
          <!-- pipeline to show the form -->
  -       <map:generate src="forms/form1_template_flow.xml"/>
  +       <map:generate src="forms/{1}_template.xml"/>
          <map:transform type="woody"/>
          <map:transform type="i18n">
            <map:parameter name="locale" value="en-US"/>
          </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/form1_template_flow.xml"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform> 
  +       <map:call resource="simple-page2html">
  +         <map:parameter name="file" value="forms/{1}_template.xml"/>
  +       </map:call>
          <map:transform src="resources/woody-samples-styling.xsl"/>
          <map:serialize/>
        </map:match>
   
  -     <map:match pattern="form1-success-pipeline">
  -       <map:generate type="serverpages" src="forms/form1_success.xsp"/>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/form1_success.xsp"/>
  -       </map:transform>
  +     <map:match pattern="*-success-pipeline.xsp">
  +       <map:generate type="serverpages" src="forms/{1}_success.xsp"/>
  +       <map:call resource="simple-page2html">
  +         <map:parameter name="file" value="forms/{1}_template.xsp"/>
  +       </map:call>
          <map:serialize/>
        </map:match>
   
  @@ -186,35 +184,12 @@
          <map:call continuation="{1}"/>
        </map:match>
   
  -     <map:match pattern="upload-display-pipeline">
  -       <!-- pipeline to show the form -->
  -       <map:generate src="forms/upload_template.xml"/>
  -       <map:transform type="woody"/>
  -       <map:transform type="i18n">
  -         <map:parameter name="locale" value="en-US"/>
  -       </map:transform>
  -       <map:transform type="i18n">
  -         <map:parameter name="locale" value="en-US"/>
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/form1_template_flow.xml"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform> 
  -       <map:transform src="resources/woody-samples-styling.xsl"/>
  -       <map:serialize/>
  -     </map:match>
   
  -     <map:match pattern="upload-success-pipeline">
  -       <map:generate type="jx" src="forms/upload_success_jx.xml"/>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/form1_success.xsp"/>
  -       </map:transform>
  +     <map:match pattern="*-success-pipeline.jx">
  +       <map:generate type="jx" src="forms/{1}_success_jx.xml"/>
  +       <map:call resource="simple-page2html">
  +         <map:parameter name="file" value="forms/{1}_success_jx.xml"/>
  +       </map:call>
          <map:serialize/>
        </map:match>
   
  @@ -239,24 +214,6 @@
          </map:call>
        </map:match>
   
  -     <map:match pattern="form2-display-pipeline">
  -       <!-- pipeline to show the form -->
  -       <map:generate src="forms/form2_template.xml"/>
  -       <map:transform type="woody"/>
  -       <map:transform type="i18n">
  -         <map:parameter name="locale" value="en-US"/>
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/form1_template.xml"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform> 
  -       <map:transform src="resources/woody-samples-styling.xsl"/>
  -       <map:serialize/>
  -     </map:match>
  -
        <map:match pattern="form2-success-pipeline">
          <map:generate src="forms/form2_data-result.xml"/>
          <map:transform type="i18n">
  @@ -281,36 +238,6 @@
          <map:call function="registration"/>
        </map:match>
   
  -     <map:match pattern="registration-display-pipeline">
  -       <map:generate src="forms/registration_template.xml"/>
  -       <map:transform type="woody"/>
  -       <map:transform type="i18n">
  -         <map:parameter name="locale" value="en-US"/>
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/registration_template.xml"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform>
  -       <map:transform src="resources/woody-samples-styling.xsl"/>
  -       <map:serialize/>
  -     </map:match>
  -
  -     <map:match pattern="registration-success-pipeline">
  -       <map:generate type="jx" src="forms/registration_success.jx"/>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/registration_success.jx"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform>
  -       <map:serialize/>
  -     </map:match>
  -
  -
        <!--
            | Car selector sample.
            -->
  @@ -356,35 +283,6 @@
          </map:select>
        </map:match>
        
  -     <map:match pattern="carselector-view">
  -       <map:generate src="forms/carselector_template.xml"/>
  -       <map:transform type="woody"/>
  -       <map:transform type="i18n">
  -         <map:parameter name="locale" value="en-US"/>
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/carselector_template.xsp"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform>
  -       <map:transform src="resources/woody-samples-styling.xsl"/>
  -       <map:serialize/>
  -     </map:match>
  -     
  -     <map:match pattern="carselector-success">
  -       <map:generate type="serverpages" src="forms/carselector_success.xsp"/>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/carselector_success.xsp"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform>
  -       <map:serialize/>
  -     </map:match>
  -
        <!--
            | Country selector sample.
            -->
  @@ -403,35 +301,6 @@
          </map:select>
        </map:match>
        
  -     <map:match pattern="countryselector-view">
  -       <map:generate src="forms/countryselector_template.xml"/>
  -       <map:transform type="woody"/>
  -       <map:transform type="i18n">
  -         <map:parameter name="locale" value="en-US"/>
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/countryselector_template.xsp"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform>
  -       <map:transform src="resources/woody-samples-styling.xsl"/>
  -       <map:serialize/>
  -     </map:match>
  -     
  -     <map:match pattern="countryselector-success">
  -       <map:generate type="serverpages" src="forms/countryselector_success.xsp"/>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/countryselector_success.xsp"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform>
  -       <map:serialize/>
  -     </map:match>
  -
        <!--
           | Custom validation example
            -->
  @@ -440,24 +309,6 @@
          <map:call function="customValidationDemo"/>
        </map:match>
   
  -     <map:match pattern="customvalidationdemo-display-pipeline">
  -       <!-- pipeline to show the form -->
  -       <map:generate src="forms/customvalidationdemo_template.xml"/>
  -       <map:transform type="woody"/>
  -       <map:transform type="i18n">
  -         <map:parameter name="locale" value="en-US"/>
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -         <map:parameter name="servletPath" value="{request:servletPath}"/>
  -         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -         <map:parameter name="file" value="forms/form1_template.xml"/>
  -         <map:parameter name="remove" value="{0}"/>
  -       </map:transform> 
  -       <map:transform src="resources/woody-samples-styling.xsl"/>
  -       <map:serialize/>
  -     </map:match>
  -     
        <map:match pattern="resources/**">
          <map:read src="{0}"/>
        </map:match>
  
  
  
  1.3       +1 -1      cocoon-2.1/src/blocks/woody/samples/flow/registration.js
  
  Index: registration.js
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/flow/registration.js,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- registration.js	9 Nov 2003 18:55:03 -0000	1.2
  +++ registration.js	19 Nov 2003 18:19:12 -0000	1.3
  @@ -9,5 +9,5 @@
   
       var model = form.getModel();
       var bizdata = { "username" : model.name }
  -    cocoon.sendPage("registration-success-pipeline", bizdata);
  +    cocoon.sendPage("registration-success-pipeline.jx", bizdata);
   }
  
  
  
  1.2       +1 -1      cocoon-2.1/src/blocks/woody/samples/flow/upload_example.js
  
  Index: upload_example.js
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/flow/upload_example.js,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- upload_example.js	13 Nov 2003 14:57:05 -0000	1.1
  +++ upload_example.js	19 Nov 2003 18:19:12 -0000	1.2
  @@ -7,7 +7,7 @@
   
       k.invalidate();
   
  -    cocoon.sendPage("upload-success-pipeline",
  +    cocoon.sendPage("upload-success-pipeline.jx",
           {
               uploadContent: handleUpload(form), 
               username: form.getWidget("user").getValue(),
  
  
  
  1.9       +7 -5      cocoon-2.1/src/blocks/woody/samples/flow/woody_flow_example.js
  
  Index: woody_flow_example.js
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/flow/woody_flow_example.js,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- woody_flow_example.js	6 Nov 2003 17:05:08 -0000	1.8
  +++ woody_flow_example.js	19 Nov 2003 18:19:12 -0000	1.9
  @@ -24,14 +24,16 @@
       } else {
         print("Form is not valid");
       }
  -    cocoon.sendPage("form1-success-pipeline");
  +    // also store the form as a request attribute as the XSP isn't flow-aware
  +    cocoon.request.setAttribute("form1", form.getWidget());
  +    cocoon.sendPage("form1-success-pipeline.xsp");
   }
   
   function selectCar() {
       var form = new Form("forms/carselector_form.xml");
  -    form.showForm("carselector-view");
  +    form.showForm("carselector-display-pipeline");
       cocoon.request.setAttribute("carselectorform", form.getWidget());
  -    cocoon.sendPage("carselector-success");
  +    cocoon.sendPage("carselector-success-pipeline.xsp");
   }
   
   var states = [
  @@ -47,9 +49,9 @@
   
   function selectCountry() {
       var form = new Form("forms/countryselector_form.xml");
  -    form.showForm("countryselector-view");
  +    form.showForm("countryselector-display-pipeline");
       cocoon.request.setAttribute("countryselectorform", form.getWidget());
  -    cocoon.sendPage("countryselector-success");
  +    cocoon.sendPage("countryselector-success-pipeline.xsp");
   }
   
   function determineLocale() {
  
  
  
  1.9       +74 -64    cocoon-2.1/src/blocks/woody/samples/forms/form1_template.xml
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/woody/samples/forms/registration_success_jx.xml
  
  Index: registration_success_jx.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <page>
    <title>Registration successful</title>
    <content>
      Registration was successful for ${username}!
    </content>
  </page>
  
  
  

Mime
View raw message