cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-cocoon2/src/webapp/samples/modules index.xhtml menu.xml properties2html.xsl sitemap.xmap
Date Sun, 19 Jan 2003 03:21:09 GMT
jefft       2003/01/18 19:21:09

  Modified:    src/java/org/apache/cocoon/components/modules modules.xconf
               src/webapp/samples/modules index.xhtml menu.xml
                        properties2html.xsl sitemap.xmap
  Log:
  - Add demonstrations for DateInputModule, DefaultsMetaModule,
    SessionAttributeModule and ChainMetaModule.
  - Add brief description of the module to each demo page.
  
  Revision  Changes    Path
  1.18      +0 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/modules.xconf
  
  Index: modules.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/modules.xconf,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- modules.xconf	19 Jan 2003 03:08:47 -0000	1.17
  +++ modules.xconf	19 Jan 2003 03:21:09 -0000	1.18
  @@ -31,14 +31,12 @@
         <input-module name="defaults"/>
       </component-instance>
       <!-- sample -->
  -    <!-- 
       <component-instance logger="core.modules.input" name="defaults"     class="org.apache.cocoon.components.modules.input.DefaultsMetaModule">
         <values>
           <skin>defaultSkin</skin>
           <base-url>http://localhost:8080/cocoon</base-url>
         </values>
       </component-instance>
  -    -->
   
       <!-- input modules sample -->
       <component-instance class="org.apache.cocoon.components.modules.input.XMLFileModule"
logger="core.modules.xml" name="myxml">
  
  
  
  1.5       +35 -19    xml-cocoon2/src/webapp/samples/modules/index.xhtml
  
  Index: index.xhtml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/modules/index.xhtml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- index.xhtml	19 Jan 2003 02:51:23 -0000	1.4
  +++ index.xhtml	19 Jan 2003 03:21:09 -0000	1.5
  @@ -1,35 +1,51 @@
   <page>
     <title>Index</title>
  -<table>
  +  <table>
       <tr>
  -        <td>
  +      <td>
           <h3>Input Modules</h3>
  -    <p>Modules are used to access input and output data in 
  -    modular way.
  -    </p>
  -    <table class="table">
  -        <tr>
  +        <p>Modules are used to access input and output data in 
  +          modular way.
  +        </p>
  +        <table class="table">
  +          <tr>
               <th>Input module</th>
               <th>Description</th>
  -        </tr>
  -        <tr>
  +          </tr>
  +          <tr>
               <td><a href="request.xsp">request</a></td>
               <td>Request object properties</td>
  -        </tr>
  -        <tr>
  +          </tr>
  +          <tr>
  +            <td><a href="defaults.xsp">defaults</a></td>
  +            <td>Default (static) values</td>
  +          </tr>
  +          <tr>
  +            <td><a href="date.xsp">date</a></td>
  +            <td>Date</td>
  +          </tr>
  +          <tr>
               <td><a href="session.xsp">session</a></td>
               <td>Session object properties</td>
  -        </tr>
  -        <tr>
  +          </tr>
  +          <tr>
  +            <td><a href="session-attr.xsp">session-attr</a></td>
  +            <td>Session attributes</td>
  +          </tr>
  +          <tr>
               <td><a href="system-property.xsp">system-property</a></td>
               <td>System properties (environment variables)</td>
  -        </tr>
  -        <tr>
  +          </tr>
  +          <tr>
               <td><a href="xml.xsp">xml</a></td>
               <td>XML node values</td>
  -        </tr>
  -    </table>
  -        </td>
  +          </tr>
  +          <tr>
  +            <td><a href="chain.xsp">chain</a></td>
  +            <td>Chained values</td>
  +          </tr>
  +        </table>
  +      </td>
       </tr>
  -</table>
  +  </table>
   </page>
  
  
  
  1.5       +4 -0      xml-cocoon2/src/webapp/samples/modules/menu.xml
  
  Index: menu.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/modules/menu.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- menu.xml	19 Dec 2002 11:10:38 -0000	1.4
  +++ menu.xml	19 Jan 2003 03:21:09 -0000	1.5
  @@ -13,9 +13,13 @@
    
     <menu label="Modules">
       <menu-item label="RequestModule" href="request.xsp"/>
  +    <menu-item label="DateInputModule" href="date.xsp"/>
  +    <menu-item label="DefaultsMetaModule" href="defaults.xsp"/>
       <menu-item label="SessionModule" href="session.xsp"/>
  +    <menu-item label="SessionAttributeModule" href="session-attr.xsp"/>
       <menu-item label="SystemPropertiesModule" href="system-property.xsp"/>
       <menu-item label="XMLFileModule" href="xml.xsp"/>
  +    <menu-item label="ChainMetaModule" href="chain.xsp"/>
       <menu-item label="AttributeModule" />
     </menu>
   
  
  
  
  1.3       +2 -0      xml-cocoon2/src/webapp/samples/modules/properties2html.xsl
  
  Index: properties2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/modules/properties2html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- properties2html.xsl	19 Jan 2003 02:51:23 -0000	1.2
  +++ properties2html.xsl	19 Jan 2003 03:21:09 -0000	1.3
  @@ -2,6 +2,7 @@
   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
   <xsl:param name="title">Input Module</xsl:param>
  +<xsl:param name="description"></xsl:param>
   
   <xsl:template match="/">
   <page>
  @@ -10,6 +11,7 @@
           <tr>
               <td>    
                   <h3><xsl:value-of select="$title"/></h3>
  +                <p><xsl:value-of select="$description"/></p>
                   <xsl:apply-templates />
               </td>
           </tr>
  
  
  
  1.6       +74 -9     xml-cocoon2/src/webapp/samples/modules/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/modules/sitemap.xmap,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- sitemap.xmap	19 Jan 2003 02:51:23 -0000	1.5
  +++ sitemap.xmap	19 Jan 2003 03:21:09 -0000	1.6
  @@ -81,7 +81,7 @@
             <map:parameter name="user-principal" value="{request:userPrincipal}"/>
           </map:generate>
           <map:transform src="properties2html.xsl">
  -          <map:parameter name="title" value="Request Input Module (RequestModule)"/>

  +          <map:parameter name="title" value="Request Input Module (RequestModule)"/>
           </map:transform>
           <map:serialize />
         </map:match>               
  @@ -93,10 +93,12 @@
             <map:parameter name="last-accessed-time" value="{session:lastAccessedTime}"/>
             <map:parameter name="max-inactive-interval" value="{session:maxInactiveInterval}"/>
             <map:parameter name="id" value="{session:id}"/>
  -          <map:parameter name="new" value="{session:new}"/>				
  +          <map:parameter name="new" value="{session:new}"/>
           </map:generate>
           <map:transform src="properties2html.xsl">
  -          <map:parameter name="title" value="Session Input Module (SessionModule)"/>

  +          <map:parameter name="title" value="Session Input Module (SessionModule)"/>
  +          <map:parameter name="description" value="SessionModule provides access
  +            to Session object properties."/>
           </map:transform>
           <map:serialize />
         </map:match>               
  @@ -128,11 +130,11 @@
             <map:parameter name="user.name" value="{system-property:user.name}"/>
             <map:parameter name="user.home" value="{system-property:user.home}"/>
             <map:parameter name="user.dir" value="{system-property:user.dir}"/>
  -          <!-- Function call -->	
  +          <!-- Function call -->
             <map:parameter name="users-home-base" value="{system-property:substring-before(user.home,
user.name)}"/>
           </map:generate>
           <map:transform src="properties2html.xsl">
  -          <map:parameter name="title" value="System Properties Input Module (SystemPropertiesModule)"/>

  +          <map:parameter name="title" value="System Properties Input Module (SystemPropertiesModule)"/>
           </map:transform>
           <map:serialize />
         </map:match>               
  @@ -140,15 +142,78 @@
   
         <map:match pattern="content/xml.xsp">
           <map:generate type="serverpages" src="properties.xsp">
  -          <map:parameter name="version" value="{myxml:/forrestconf/@version}"/>
  -          <map:parameter name="skin" value="{myxml:/forrestconf/skin}"/>
  -          <map:parameter name="base-url" value="{myxml:/*/base-url}"/>
  +          <map:parameter name="/forrestconf/@version" value="{myxml:/forrestconf/@version}"/>
  +          <map:parameter name="/forrestconf/skin" value="{myxml:/forrestconf/skin}"/>
  +          <map:parameter name="/*/base-url" value="{myxml:/*/base-url}"/>
             <!--
             <map:parameter name="slashdot-headline" value="{slashdot:/*:RDF/item[1]/title}"/>
             -->
           </map:generate>
           <map:transform src="properties2html.xsl">
             <map:parameter name="title" value="XML File Input Module (XMLFileModule)"/>
 
  +          <map:parameter name="description" value="XMLFileModule uses an XML
  +            file as a data source, with XPath expressions as the key values. In
  +            this example, the keys identify nodes in
  +            context:///samples/modules/forrestconf.xml"/>
  +        </map:transform>
  +        <map:serialize />
  +      </map:match>
  +
  +      <map:match pattern="content/defaults.xsp">
  +        <map:generate type="serverpages" src="properties.xsp">
  +          <map:parameter name="skin" value="{defaults:skin}"/>
  +          <map:parameter name="base-url" value="{defaults:base-url}"/>
  +        </map:generate>
  +        <map:transform src="properties2html.xsl">
  +          <map:parameter name="title" value="Defaults Input Module (DefaultsMetaModule)"/>
  +          <map:parameter name="description" value="DefaultsMetaModule
  +            contains 'default' values, hardcoded into cocoon.xconf.
  +            It is simply a lookup table containing static values."/>
  +        </map:transform>
  +        <map:serialize />
  +      </map:match>
  +
  +
  +      <map:match pattern="content/chain.xsp">
  +        <map:generate type="serverpages" src="properties.xsp">
  +          <map:parameter name="skin" value="{chain:skin}"/>
  +        </map:generate>
  +        <map:transform src="properties2html.xsl">
  +          <map:parameter name="title" value="Chaining Input module (ChainMetaModule)"/>
  +          <map:parameter name="description" value="ChainMetaModule
  +            iterates through a set of modules until one returns a
  +            non-null value for the specified key.  In this example, we
  +            chain together request-param, request-attr, session-attr
  +            and defaults modules.  The 'skin' value is taken from the
  +            first that returns a non-null value, usually 'defaults'.
  +            Try adding '?skin=myskin' to the URL, and it should
  +            change."/>
  +        </map:transform>
  +        <map:serialize />
  +      </map:match>
  +
  +
  +      <map:match pattern="content/date.xsp">
  +        <map:generate type="serverpages" src="properties.xsp">
  +          <map:parameter name="date" value="{date:date}"/>
  +        </map:generate>
  +        <map:transform src="properties2html.xsl">
  +          <map:parameter name="title" value="Date Input module (DateMetaModule)"/>
  +          <map:parameter name="description" value="Returns the current
  +            date and time.  The format is specified in cocoon.xconf"/>
  +        </map:transform>
  +        <map:serialize />
  +      </map:match>
  +
  +      <map:match pattern="content/session-attr.xsp">
  +        <map:generate type="serverpages" src="properties.xsp">
  +          <map:parameter name="fruit" value="{session-attr:fruit}"/>            
  
  +        </map:generate>
  +        <map:transform src="properties2html.xsl">
  +          <map:parameter name="title" value="Session Attribute Input Module
  +            (SessionAttributeModule)"/>  
  +          <map:parameter name="description" value="SessionAttributeModule provides access
  +            to Session attributes."/>
           </map:transform>
           <map:serialize />
         </map:match>
  
  
  

----------------------------------------------------------------------
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