cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: cocoon-2.1/src/webapp/samples/protected/stylesheets simple-page2html.xsl
Date Thu, 22 May 2003 13:37:46 GMT
vgritsenko    2003/05/22 06:37:46

  Modified:    src/webapp/samples/protected sitemap.xmap
               src/webapp/samples/protected/docs login.xml protected.xsp
               src/webapp/samples/protected/stylesheets
                        simple-page2html.xsl
  Log:
  Fix 'Protected Area' sample.
  
  Revision  Changes    Path
  1.4       +28 -32    cocoon-2.1/src/webapp/samples/protected/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/protected/sitemap.xmap,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemap.xmap	26 Mar 2003 21:21:55 -0000	1.3
  +++ sitemap.xmap	22 May 2003 13:37:46 -0000	1.4
  @@ -1,43 +1,35 @@
   <?xml version="1.0"?>
   
  +<!-- 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:actions>
         <map:action name="session-validator"
  -        src="org.apache.cocoon.acting.SessionValidatorAction"/>
  +                  src="org.apache.cocoon.acting.SessionValidatorAction"/>
         <map:action name="session-invalidator"
  -        src="org.apache.cocoon.acting.SessionInvalidatorAction"/>
  +                  src="org.apache.cocoon.acting.SessionInvalidatorAction"/>
         <map:action name="form-validator"
  -        src="org.apache.cocoon.acting.FormValidatorAction"/>
  +                  src="org.apache.cocoon.acting.FormValidatorAction"/>
         <map:action name="db-authenticator"
  -        src="org.apache.cocoon.acting.DatabaseAuthenticatorAction"/>
  +                  src="org.apache.cocoon.acting.DatabaseAuthenticatorAction"/>
       </map:actions>
  -
     </map:components>
   
  -  <!-- ======================= Pipelines ================================= -->
  +  <map:views>
  +    <map:view name="content" from-label="content">
  +      <map:serialize type="xml"/>
  +    </map:view>
  +  </map:views>
   
  +  <!-- ======================= Pipelines ================================= -->
     <map:pipelines>
       <map:pipeline>
   
         <map:match pattern="">
  -        <map:redirect-to uri="login"/>
  +        <map:redirect-to uri="page"/>
         </map:match>
   
         <!-- ================= -->
  @@ -45,12 +37,12 @@
         <!-- ================= -->
         <map:match pattern="login">
           <map:generate src="docs/login.xml"/>
  -     	<map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
  -     	   <map:parameter name="servletPath" value="{request:servletPath}"/>
  -     	   <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  -     	   <map:parameter name="contextPath" value="{request:contextPath}"/>
  -       	   <map:parameter name="file" value="docs/login.xml"/>
  -       	   <map:parameter name="remove" value="{0}"/>
  +        <map:transform src="stylesheets/simple-page2html.xsl">
  +          <map:parameter name="servletPath" value="{request:servletPath}"/>
  +          <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +          <map:parameter name="contextPath" value="{request:contextPath}"/>
  +          <map:parameter name="file" value="docs/login.xml"/>
  +          <map:parameter name="remove" value="{0}"/>
        	</map:transform>
           <map:serialize/>
         </map:match>
  @@ -67,7 +59,7 @@
             <map:act type="db-authenticator">
               <map:parameter name="descriptor" value="descriptors/auth.xml"/>
               <!-- now go to protected area -->
  -            <map:redirect-to uri="protected"/>
  +            <map:redirect-to uri="page"/>
             </map:act>
           </map:act>
           <!-- something was wrong, try it again -->
  @@ -77,14 +69,20 @@
         <!-- ================ -->
         <!-- Protected area   -->
         <!-- ================ -->
  -      <map:match pattern="protected">
  +      <map:match pattern="page">
           <!-- first validate whether user has logged in -->
           <map:act type="session-validator">
             <map:parameter name="descriptor" value="descriptors/params.xml"/>
             <map:parameter name="validate" value="username,department_id,theme"/>
             <!-- generate protected content -->
             <map:generate type="serverpages" src="docs/protected.xsp"/>
  -          <map:transform src="stylesheets/{theme}-page2html.xsl"/>
  +          <map:transform src="stylesheets/{theme}-page2html.xsl">
  +            <map:parameter name="servletPath" value="{request:servletPath}"/>
  +            <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +            <map:parameter name="contextPath" value="{request:contextPath}"/>
  +            <map:parameter name="file" value="docs/protected.xsp"/>
  +            <map:parameter name="remove" value="{../0}"/>
  +          </map:transform>
             <map:serialize/>
           </map:act>
           <!-- something was wrong, redirect to login page -->
  @@ -101,9 +99,7 @@
         </map:match>
    
       </map:pipeline>
  -
     </map:pipelines>
  -
   </map:sitemap>
   
   <!-- end of file -->
  
  
  
  1.2       +16 -14    cocoon-2.1/src/webapp/samples/protected/docs/login.xml
  
  Index: login.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/protected/docs/login.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- login.xml	9 Mar 2003 00:11:18 -0000	1.1
  +++ login.xml	22 May 2003 13:37:46 -0000	1.2
  @@ -1,19 +1,21 @@
   <?xml version="1.0"?>
   
  +<!-- CVS: $Id$ -->
  +
   <page>
  - <title>Login page</title>
  - <content>
  -   <linkbar/>
  -   <para>
  -     This page serves as an example of simple web application built
  -     around db-authenticator, form-validator, session-validator and
  -     session-invalidator actions.
  -   </para>
  -   <para>Please log in using your name (Donald Ball will work)</para>
  -   <form target="do-login">
  -     <input type="text" name="username"/>
  -     <input type="submit">Login</input>
  -   </form>
  - </content>
  +  <title>Login page</title>
  +  <content>
  +    <linkbar/>
  +    <para>
  +      This page serves as an example of simple web application built
  +      around db-authenticator, form-validator, session-validator and
  +      session-invalidator actions.
  +    </para>
  +    <para>Please log in using your name (Donald Ball will work)</para>
  +    <form action="do-login">
  +      <input type="text" name="username"/>
  +      <input type="submit" value="Login"/>
  +    </form>
  +  </content>
   </page>
   <!-- vim: set et ts=2 sw=2: -->
  
  
  
  1.2       +11 -3     cocoon-2.1/src/webapp/samples/protected/docs/protected.xsp
  
  Index: protected.xsp
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/protected/docs/protected.xsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- protected.xsp	9 Mar 2003 00:11:18 -0000	1.1
  +++ protected.xsp	22 May 2003 13:37:46 -0000	1.2
  @@ -1,9 +1,16 @@
   <?xml version="1.0"?>
   
  +<!-- CVS: $Id$ -->
  +
   <xsp:page language="java"
  -  xmlns:xsp="http://apache.org/xsp"
  -  xmlns:session="http://apache.org/xsp/session/2.0">
  +          xmlns:xsp="http://apache.org/xsp"
  +          xmlns:session="http://apache.org/xsp/session/2.0">
     <page>
  +    <resources>
  +      <resource type="file" href="descriptors/auth.xml">Authenticator</resource>
  +      <resource type="file" href="descriptors/params.xml">Validator</resource>
  +      <resource type="doc" href="userdocs/actions/database-actions.html">Actions</resource>
  +    </resources>
       <title>Protected area</title>
       <content>
         <linkbar/>
  @@ -13,8 +20,9 @@
           think about what can be improved regarding flow control and especially
           aspect capturing, so that it is not necessary to check session in every
           map:match fragment. :-))
  +        <br/>
  +        &#160; -- Martin Man
         </para>
  -      <para>Martin Man</para>
         <para>You are logged in under username: 
           <session:get-attribute name="username"/></para>
         <para>Your department id is: 
  
  
  
  1.2       +7 -43     cocoon-2.1/src/webapp/samples/protected/stylesheets/simple-page2html.xsl
  
  Index: simple-page2html.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/protected/stylesheets/simple-page2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- simple-page2html.xsl	9 Mar 2003 00:11:18 -0000	1.1
  +++ simple-page2html.xsl	22 May 2003 13:37:46 -0000	1.2
  @@ -1,57 +1,21 @@
   <?xml version="1.0"?>
   
  -<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>
  -        <META content="0" http-equiv="expires"/>
  -        <META content="nocache" http-equiv="pragma"/>
  -      </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>
  +<!-- CVS: $Id$ -->
   
  -  <xsl:template match="para">
  -    <p align="center">
  -      <i><xsl:apply-templates/></i>
  -    </p>
  -  </xsl:template>
  -
  -  <xsl:template match="form">
  -    <form method="POST" action="{@target}">
  -      <xsl:apply-templates/>
  -    </form>
  -  </xsl:template>
  -
  -  <xsl:template match="input">
  -    <center>
  -      <xsl:value-of select="@title"/>
  -      <input type="{@type}" name="{@name}" value="{.}"/>
  -    </center><br/>
  -  </xsl:template>
  +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
  +  <xsl:include href="context://samples/common/style/xsl/html/simple-page2html.xsl"/>
  + 
     <xsl:template match="linkbar">
  -    <center>
  +    <div>
         [
         <a href="login"> login </a>
         |
  -      <a href="protected"> protected </a>
  +      <a href="page"> protected </a>
         |
         <a href="do-logout"> logout </a>
         ]
  -    </center>
  +    </div>
     </xsl:template>
   
   </xsl:stylesheet>
  
  
  

Mime
View raw message