stephan     2003/05/08 02:44:54

  Modified:    src/blocks/xmlform/samples sitemap.xmap
               src/blocks/xmlform/samples/wizard end.xml start.xml
  Added:       src/blocks/xmlform/samples/stylesheets wizard2page.xsl
  Removed:     src/blocks/xmlform/samples/stylesheets wizard2html.xsl
  Log:
  Add some eye candy.
  
  Revision  Changes    Path
  1.2       +54 -42    cocoon-2.1/src/blocks/xmlform/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xmlform/samples/sitemap.xmap,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sitemap.xmap      25 Apr 2003 08:34:58 -0000      1.1
  +++ sitemap.xmap      8 May 2003 09:44:54 -0000       1.2
  @@ -4,37 +4,43 @@
     <!-- =========================== Components 
================================ -->
     <map:components> 
       <map:transformers default="xslt">
  -      <map:transformer name="xmlform" 
src="org.apache.cocoon.transformation.XMLFormTransformer" 
logger="xmlform.sitemap.transformer"/>
  +      <map:transformer name="xmlform" logger="xmlform.sitemap.transformer"
  +                       
src="org.apache.cocoon.transformation.XMLFormTransformer"/>
       </map:transformers>
  +
       <map:actions>
  -      <map:action name="WizardAction" 
src="org.apache.cocoon.samples.xmlform.WizardAction"  
logger="xmlform.sitemap.action.wizard"/>
  -      <map:action name="UsageFeedbackAction" 
src="org.apache.cocoon.samples.xmlform.UsageFeedbackAction"  
logger="xmlform.sitemap.action.UsageFeedback"/>
  +      <map:action name="WizardAction" logger="xmlform.sitemap.action.wizard"
  +                  src="org.apache.cocoon.samples.xmlform.WizardAction"/>
  +      <map:action name="UsageFeedbackAction" 
logger="xmlform.sitemap.action.UsageFeedback"
  +                  
src="org.apache.cocoon.samples.xmlform.UsageFeedbackAction"/>
       </map:actions>
  +
       <map:flow-interpreters default="JavaScript"/>
  +
       <map:serializers default="html"/>
  +
       <map:matchers default="wildcard"/>
     </map:components>
   
  +  <!-- =========================== Views =================================== 
-->
   
  -<!-- =========================== Views =================================== 
-->
  -
  -<!--
  -  The debug view can be used to output an intermediate 
  -  snapshot of the pipeline.
  -  Pass cocoon-view=debug as a URL parameter to see
  -  the pipeline output produced by the transofrmer
  -  labeled "debug". You can move the label to different
  -  transformers to understand each processing
  -  stage better.
  --->
  -<map:views>
  -  <map:view name="debug" from-label="debug">
  -    <map:serialize type="xml"/>
  -  </map:view>
  -  <map:view name="xml" from-label="xml">
  -    <map:serialize type="xml"/>
  -  </map:view>
  -</map:views>
  +  <!--
  +    The debug view can be used to output an intermediate 
  +    snapshot of the pipeline.
  +    Pass cocoon-view=debug as a URL parameter to see
  +    the pipeline output produced by the transofrmer
  +    labeled "debug". You can move the label to different
  +    transformers to understand each processing
  +    stage better.
  +  -->
  +  <map:views>
  +    <map:view name="debug" from-label="debug">
  +      <map:serialize type="xml"/>
  +    </map:view>
  +    <map:view name="xml" from-label="xml">
  +      <map:serialize type="xml"/>
  +    </map:view>
  +  </map:views>
   
     <!-- =========================== Resources 
================================= -->
   
  @@ -42,9 +48,9 @@
     </map:resources>
   
     <!-- =========================== Pipelines 
================================= -->
  -    <map:flow language="JavaScript">
  -      <map:script src="flow/feedbackWizard.js"/>
  -    </map:flow>
  +  <map:flow language="JavaScript">
  +    <map:script src="flow/feedbackWizard.js"/>
  +  </map:flow>
   
     <map:pipelines> 
     
  @@ -75,35 +81,38 @@
             <map:parameter name="xmlform-model" 
value="org.apache.cocoon.samples.xmlform.UserBean"/>
   
          
  -           <!-- original XMLForm document -->
  -           <map:generate src="wizard/{page}.xml"/>
  +          <!-- original XMLForm document -->
  +          <map:generate src="wizard/{page}.xml"/>
              
  -           <!-- populating the document with model instance data -->
  -           <map:transform type="xmlform"  label="xml"/>
  +          <!-- populating the document with model instance data -->
  +          <map:transform type="xmlform"  label="xml"/>
        
  -           <!-- personalizing the look and feel of the form controls  -->
  -           <map:transform type="xalan" src="stylesheets/wizard2html.xsl" />
  +          <!-- personalizing the look and feel of the form controls  -->
  +          <map:transform type="xalan" src="stylesheets/wizard2page.xsl"/>
  +          <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  +            <map:parameter name="contextPath" value="{request:contextPath}"/>
  +          </map:transform>
        
  -           <!-- Transforming the XMLForm controls to HTML controls -->
  -           <map:transform 
src="context://stylesheets/system/xmlform2html.xslt" />
  +          <!-- Transforming the XMLForm controls to HTML controls -->
  +          <map:transform 
src="context://stylesheets/system/xmlform2html.xslt"/>
              
  -           <!-- sending the HTML back to the browser -->
  -           <map:serialize type="html" label="debug"/>
  +          <!-- sending the HTML back to the browser -->
  +          <map:serialize type="html" label="debug"/>
              
           </map:act>
         </map:match>  
       </map:pipeline>
  +
       
       <map:pipeline>
   
         <!-- The same application, exposed as a Web Service (REST style) -->
         
  -      
         <!-- WSDL descriptor -->
         <map:match pattern="UsageFeedbackService/WSDL">
             <map:generate src="webservice/usagefeedback.wsdl"/>
             <map:serialize type="xml"/>
  -       </map:match>
  +      </map:match>
         
         
         <!-- The REST resource (or Web Service) -->
  @@ -125,7 +134,6 @@
         </map:match>  
       </map:pipeline>
       
  -    
     
       <map:pipeline>
   
  @@ -134,7 +142,7 @@
         <map:match pattern="flow">
           <map:call function="xmlForm">
             <map:parameter name="xmlform-function" value="feedbackWizard"/>
  -       <map:parameter name="xmlform-id" value="form-feedback"/>
  +             <map:parameter name="xmlform-id" value="form-feedback"/>
             <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-scope" value="session"/>
  @@ -149,15 +157,19 @@
              <map:transform type="xmlform"  label="xml"/>
        
              <!-- personalizing the look and feel of the form controls  -->
  -           <map:transform type="xalan" src="stylesheets/wizard2html.xsl" />
  +           <map:transform type="xalan" src="stylesheets/wizard2page.xsl"/>
  +        <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  +          <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        </map:transform>
        
              <!-- Transforming the XMLForm controls to HTML controls -->
  -           <map:transform 
src="context://stylesheets/system/xmlform2html.xslt" />
  +           <map:transform 
src="context://stylesheets/system/xmlform2html.xslt"/>
              
              <!-- sending the HTML back to the browser -->
              <map:serialize type="html" label="debug"/>
  -     </map:match>          
  +      </map:match>         
       </map:pipeline>
  +
     </map:pipelines> 
     
   </map:sitemap>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/xmlform/samples/stylesheets/wizard2page.xsl
  
  Index: wizard2page.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
        Cocoon Feedback Wizard XMLForm processing and displaying stylesheet.    
    
    This stylesheet merges an XMLForm document into 
    a final document. It includes other presentational
    parts of a page orthogonal to the xmlform.
  
    author: Ivelin Ivanov, [EMAIL PROTECTED], May 2002
    author: Konstantin Piroumian <[EMAIL PROTECTED]>, September 2002
    author: Simon Price <[EMAIL PROTECTED]>, September 2002
  
  -->
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:xf="http://xml.apache.org/cocoon/xmlform/2002";
        exclude-result-prefixes="xalan" >
  
        <xsl:template match="document">
      <document>
        <header>
          <title>XMLForm - Cocoon Feedback Wizard</title>
          <tab title="back" href=".."/>
        </header>
        <body>
                                <xsl:apply-templates />
                        </body>
                </document>
        </xsl:template>
  
        <xsl:template match="xf:form">
                <xf:form method="post">
                        <xsl:copy-of select="@*" />
  <!--                  <br/>
                        <br/>
                        <br/>
                        <br/>-->
        <section>
          <title><xsl:value-of select="xf:caption"/></title>
                        <table align="center" border="0">
                                <xsl:if test="count(error/xf:violation) > 0">
                                        <tr>
                                                <td align="left" colspan="3" 
style="border-width:1px;border-style:solid;border-color:red"
                                                        
class="{error/xf:violation[1]/@class}">
                                                        <p>* There are 
[<b><xsl:value-of
                                                                
select="count(error/xf:violation)"/></b>] 
                                                                errors. Please 
fix these errors and submit the
                                                                  form 
again.</p>
                                                          <p>
                                                                <xsl:variable 
name="localViolations"
                                                                        
select=".//xf:*[ child::xf:violation ]"/>
                                                                <xsl:for-each 
select="error/xf:violation">
                                                                        
<xsl:variable name="eref" select="./@ref"/>
                                                                        <xsl:if
                                                                                
test="count ($localViolations[ @ref=$eref ]) = 0"
                                                                                
>* <xsl:value-of select="." /> <br/> </xsl:if>
                                                                </xsl:for-each>
                                                        </p>
                                                        <p/>
                                                </td>
                                        </tr>
                                </xsl:if>
                                <xsl:for-each select="*[name() != 'xf:submit']">
                                        <xsl:choose>
                                                <xsl:when test="name() = 
'error'"/>
                                                <xsl:when test="name() = 
'xf:caption'"/>
                                                <xsl:when test="xf:*">
                                                        <xsl:apply-templates 
select="."/>
                                                </xsl:when>
                                                <xsl:otherwise>
                                                        <xsl:copy-of 
select="."/>
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </xsl:for-each>
                                <tr>
                                        <td align="center" colspan="3">
                                                <xsl:for-each select="*[name() 
= 'xf:submit']">
                                                        <xsl:copy-of select="." 
/>
                                                        <xsl:text>
                                                        </xsl:text>
                                                </xsl:for-each>
                                        </td>
                                </tr>
                          </table>
        </section>
                </xf:form>
        </xsl:template>
  
        <xsl:template match="xf:repeat">
                <tr width="100%">
                        <td colspan="3" width="100%">
                                <table 
style="border-width:1px;border-style:solid;border-color:#336699">
                                        <xsl:apply-templates select="*"/>
                                </table>
                        </td>
                </tr>
        </xsl:template>
  
        <xsl:template match="xf:group">
                <tr width="100%">
                        <td width="100%" colspan="2">
                                <table class="group" border="0">
                                        <tr>
                                                <td align="left">
                                                        <xsl:value-of 
select="xf:caption" />
                                                </td>
                                        </tr>
                                        <xsl:apply-templates select="*"/>
                                </table>
                        </td>
                </tr>
        </xsl:template>
  
        <xsl:template match="xf:[EMAIL PROTECTED]">
                <div align="center">
                        <hr width="30%"/>
                        <br/>
                        <font size="-1">
                                <code> <xsl:value-of select="xf:caption" /> : 
<xsl:copy-of
                                        select="." /> </code>
                        </font>
                        <br/>
                </div>
        </xsl:template>
  
        <xsl:template match="xf:caption"/>
  
        <xsl:template match="xf:*">
                <tr>
                        <td align="left" valign="top">
                                <p class="caption">
                                        <xsl:value-of select="xf:caption" />
                                </p>
                        </td>
                        <td align="left">
                                <table class="plaintable">
                                        <tr>
                                                <td align="left">
                                                        <xsl:copy-of select="." 
/>
                                                </td>
                                                <xsl:if test="xf:violation">
                                                        <td align="left" 
class="{xf:violation[1]/@class}"
                                                                width="100%">
                                                                <xsl:for-each 
select="xf:violation">* 
                                                                        
<xsl:value-of select="." /> <br/> </xsl:for-each>
                                                        </td>
                                                </xsl:if>
                                        </tr>
                                </table>
                                <xsl:if test="xf:help">
                                        <div class="help">
                                                <xsl:value-of select="xf:help" 
/>
                                        </div>
                                        <br />
                                </xsl:if>
                        </td>
                </tr>
        </xsl:template>
  
        <xsl:template match="*">
                <xsl:copy-of select="." />
        </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.2       +9 -26     cocoon-2.1/src/blocks/xmlform/samples/wizard/end.xml
  
  Index: end.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xmlform/samples/wizard/end.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- end.xml   25 Apr 2003 08:34:59 -0000      1.1
  +++ end.xml   8 May 2003 09:44:54 -0000       1.2
  @@ -1,30 +1,13 @@
   <?xml version="1.0" ?>
   <document>
  -    <br/><br/><br/>
  -    <table align="center" width="50%" cellspacing="20">
  -        <tr>
  -            <td align="center">
  -                <h1>
  -                    Congratulations, Wizard Complete!
  -                </h1>
  -            </td>
  -        </tr>
  -
  -        <tr>
  -            <td align="center" class="info">
  -                <code>
  -                    Your feedback form was processed successfully.
  -                </code>
  -            </td>
  -        </tr>
  -         
  -        <tr>
  -            <td align="center">
  -                <h3>
  -                    <a href="wizard">Go to home page.</a>
  -                </h3>
  -            </td>
  -        </tr>
  -    </table>
  +  <section>
  +    <title>Congratulations, Wizard Complete!</title>
  +    <p align="center">
  +      Your feedback form was processed successfully.
  +    </p>
  +    <p align="center">
  +      <a href="wizard">Go to home page.</a>
  +    </p>
  +  </section>
   </document>
   
  
  
  
  1.2       +17 -32    cocoon-2.1/src/blocks/xmlform/samples/wizard/start.xml
  
  Index: start.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xmlform/samples/wizard/start.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- start.xml 25 Apr 2003 08:34:59 -0000      1.1
  +++ start.xml 8 May 2003 09:44:54 -0000       1.2
  @@ -1,38 +1,23 @@
   <?xml version="1.0" ?>
   
   <document>
  -    <br/><br/><br/>
  -    <table align="center" width="50%" cellspacing="20">
  -        <tr>
  -            <td align="center">
  -                <h1>
  -                    Welcome !
  -                </h1>
  -            </td>
  -        </tr>
  +  <section>
  +    <title>Welcome !</title>
   
  -        <tr>
  -            <td align="center" class="info">
  -                <p>
  -                This wizard will collect feedback information
  -                for the     
  -                <a href="http://cocoon.apache.org/";>Apache Cocoon</a>
  -                project.
  -                </p>
  -                <p>
  -                 See <a href="overview.html">overview</a> documentation.
  -                </p>
  -            </td>
  -        </tr>
  +    <p align="center">
  +      This wizard will collect feedback information
  +      for the <a href="http://cocoon.apache.org/";>Apache Cocoon</a>
  +      project.
  +    </p>
  +
  +    <p align="center">
  +      See <a href="overview.html">overview</a> documentation.
  +    </p>
            
  -        <tr>
  -            <td align="center">
  -                <h3>
  -                    <a href="wizard?cocoon-action-start=true">
  -                        Start!
  -                    </a>
  -                </h3>
  -            </td>
  -        </tr>
  -    </table>
  +    <p align="center">
  +      <a href="wizard?cocoon-action-start=true">
  +        Start!
  +      </a>
  +    </p>
  +  </section>
   </document>
  
  
  

Reply via email to