You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2004/04/18 13:06:43 UTC

cvs commit: cocoon-2.1/src/blocks/session-fw/conf session-fw.xsamples

cziegeler    2004/04/18 04:06:43

  Added:       src/blocks/session-fw/samples/stylesheets
                        simple-page2html.xsl
               src/blocks/session-fw/samples/docs request-test.xml
               src/blocks/session-fw/samples sitemap.xmap
               src/blocks/session-fw/conf session-fw.xsamples
  Log:
  Adding a simple sample
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/blocks/session-fw/samples/stylesheets/simple-page2html.xsl
  
  Index: simple-page2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!--
    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.
  -->
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template match="page">
      <html>
        <head>
          <title>
            <xsl:value-of select="title"/>
          </title>
        </head>
        <body bgcolor="white" alink="red" link="blue" vlink="blue">
          <xsl:apply-templates/>
        </body>
      </html>
    </xsl:template>
  
    <xsl:template match="title">
      <h2 style="color: navy; text-align: center">
        <xsl:apply-templates/>
      </h2>
    </xsl:template>
  
    <xsl:template match="para">
      <p align="center">
        <i><xsl:apply-templates/></i>
      </p>
    </xsl:template>
  
   <xsl:template match="source">
    <div style="background: #b9d3ee; border: thin; border-color: black; border-style: solid; padding-left: 0.8em; 
                padding-right: 0.8em; padding-top: 0px; padding-bottom: 0px; margin: 0.5ex 0px; clear: both;">
    <textarea name="context" cols="80" rows="20" readonly="true">
     <xsl:apply-templates/>
    </textarea>
    </div>
   </xsl:template>
  
    <xsl:template match="@*|node()" priority="-1" name="copy">
     <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/session-fw/samples/docs/request-test.xml
  
  Index: request-test.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    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.
  -->
  
  <page>
   <title>Request test</title>
   <content>
     <linkbar/>
     <para>
       This page serves as an example of using the session framework.
     </para>
     <para>Below, you see all information from the current request context.</para>
     <para xmlns:session="http://apache.org/cocoon/session/1.0">
         <source>
             <session:getxml context="request" path="/"/>
         </source>
     </para>
   </content>
  </page>
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/session-fw/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <!--
    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.
  -->
  
  <!--+
      | Session block samples sitemap.
      |
      | CVS $Id: sitemap.xmap,v 1.11 2004/03/06 02:26:17 antonio Exp $
      +-->
  
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
  <!-- =========================== Pipelines ================================= -->
    <map:pipelines>
      <map:pipeline>
        <map:match pattern="">
          <map:redirect-to uri="request-test"/>
        </map:match>
  
  
        <map:match pattern="request-test">
            <map:generate src="docs/request-test.xml"/>
            <map:transform type="session"/>
            <map:transform src="stylesheets/simple-page2html.xsl"/>
            <map:serialize/>
        </map:match>
      </map:pipeline>
    </map:pipelines>
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/session-fw/conf/session-fw.xsamples
  
  Index: session-fw.xsamples
  ===================================================================
  <?xml version="1.0"?>
  <!--
    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.
  -->
  
  <xsamples xpath="/samples" unless="group[@name='Session Framework']">
  
    <group name="Session Framework">
      <sample name="Session Framework Block" href="session-fw/">
        This is a demo of the session framework integrated into Cocoon.
      </sample>
    </group>
    
  </xsamples>