You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2004/03/09 02:33:09 UTC

cvs commit: cocoon-2.2/src/webapp/samples/filter samples.xml tobefiltered.xml sitemap.xmap

joerg       2004/03/08 17:33:09

  Modified:    src/webapp/samples components-samples.xml
  Added:       src/webapp/samples/filter samples.xml tobefiltered.xml
                        sitemap.xmap
  Log:
  FilterTransformer sample added
  
  Revision  Changes    Path
  1.3       +5 -2      cocoon-2.2/src/webapp/samples/components-samples.xml
  
  Index: components-samples.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/webapp/samples/components-samples.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- components-samples.xml	6 Mar 2004 14:34:40 -0000	1.2
  +++ components-samples.xml	9 Mar 2004 01:33:09 -0000	1.3
  @@ -26,11 +26,14 @@
       <sample href="paginator/" name="Paginator">
         Examples of Paginator transformer usage
       </sample> 
  +    <sample href="filter/" name="FilterTransformer">
  +      Examples of filter transformer usage
  +    </sample> 
     </group>
   
     <group name="Readers">
       <sample href="imagereader/" name="Image Reader">
         Examples of ImageReader component usage
  -    </sample> 
  +    </sample>
     </group>
   </samples>
  
  
  
  1.1                  cocoon-2.2/src/webapp/samples/filter/samples.xml
  
  Index: samples.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!-- CVS $ID$ -->
  <samples xmlns:xlink="http://www.w3.org/1999/xlink">
  
    <group name="Main examples page.">
      <sample name="Back" href="..">to Cocoon examples main page</sample>
    </group>
  
    <group name="FilterTransformer">
      <sample href="original" name="Original">
        The original file.
      </sample>
      <sample href="filter-element-6-3" name="Filter">
        Selects the 3rd block of 6 elements out of the file.
      </sample>
    </group>
  </samples>
  
  
  
  1.1                  cocoon-2.2/src/webapp/samples/filter/tobefiltered.xml
  
  Index: tobefiltered.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!-- CVS $ID$ -->
  <elements>
    <element>1</element>
    <element>2</element>
    <element>3</element>
    <element>4</element>
    <element>5</element>
    <element>6</element>
    <element>7</element>
    <element>8</element>
    <element>9</element>
    <element>10</element>
    <element>11</element>
    <element>12</element>
    <element>13</element>
    <element>14</element>
    <element>15</element>
    <element>16</element>
    <element>17</element>
    <element>18</element>
    <element>19</element>
    <element>20</element>
  </elements>
  
  
  
  1.1                  cocoon-2.2/src/webapp/samples/filter/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!-- CVS $ID$ -->
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
  <!-- =========================== Components ================================ -->
  
   <map:components>
    <map:generators default="file"/>
    <map:transformers default="xslt"/>
    <map:readers default="resource"/>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:selectors default="browser"/>
   </map:components>
  
  <!-- =========================== Views =================================== -->
  
   <map:views>
    <map:view name="content" from-label="content">
     <map:serialize type="xml"/>
    </map:view>
  
    <map:view from-label="content" name="pretty-content">
     <map:transform src="context://stylesheets/system/xml2html.xslt"/>
     <map:serialize type="html"/>
    </map:view>
  
    <map:view name="links" from-position="last">
     <map:serialize type="links"/>
    </map:view>
   </map:views>
  
  <!-- =========================== Pipelines ================================= -->
  
   <map:pipelines>
    <map:pipeline>
  
     <map:match pattern="">
      <map:generate src="samples.xml"/>
      <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
       <map:parameter name="contextPath" value="{request:contextPath}"/>
      </map:transform>
      <map:serialize/>
     </map:match>
  
     <map:match pattern="original">
      <map:generate src="tobefiltered.xml"/>
      <map:serialize type="xml"/>
     </map:match>
  
     <map:match pattern="filter-*-*-*">
      <map:generate src="tobefiltered.xml"/>
      <map:transform type="filter">
       <map:parameter name="element-name" value="{1}"/>
       <map:parameter name="count" value="{2}"/>
       <map:parameter name="blocknr" value="{3}"/> 
      </map:transform>
      <map:serialize type="xml"/>
     </map:match>
    </map:pipeline>
   </map:pipelines>
  </map:sitemap>