vgritsenko    01/08/23 18:22:24

  Modified:    webapp/sub Tag: cocoon_20_branch sitemap.xmap
               webapp/sub/docs Tag: cocoon_20_branch samples.xml
               webapp/sub/stylesheets Tag: cocoon_20_branch error2html.xsl
  Added:       webapp/sub/docs Tag: cocoon_20_branch error-giving-page.xml
                        hello-page.xml simple.xsp
               webapp/sub/stylesheets Tag: cocoon_20_branch
                        simple-samples2html.xsl
  Log:
  More examples: variants of source usage
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.2   +67 -3     xml-cocoon2/webapp/sub/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sub/sitemap.xmap,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- sitemap.xmap      2001/06/18 21:48:47     1.2.2.1
  +++ sitemap.xmap      2001/08/24 01:22:24     1.2.2.2
  @@ -33,15 +33,79 @@
   
      <map:match pattern="welcome">
       <map:generate src="docs/samples.xml"/>
  +    <map:transform src="stylesheets/simple-samples2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +
  +   <map:match pattern="xsl-source">
  +    <map:generate src="stylesheets/simple-page2html.xsl"/>
  +    <map:serialize type="xml"/>
  +   </map:match>
  +   <map:match pattern="xsl">
  +    <map:generate src="docs/hello-page.xml"/>
       <map:transform src="stylesheets/simple-page2html.xsl"/>
       <map:serialize/>
      </map:match>
  +   <map:match pattern="xsl-cocoon">
  +    <map:generate src="docs/hello-page.xml"/>
  +    <map:transform src="cocoon:/xsl-source"/>
  +    <map:serialize/>
  +   </map:match>
  +   <map:match pattern="xsl-cocoon-root">
  +    <map:generate src="docs/hello-page.xml"/>
  +    <map:transform src="cocoon://sub/xsl-source"/>
  +    <map:serialize/>
  +   </map:match>
  +   <map:match pattern="xsl-http">
  +    <map:generate src="docs/hello-page.xml"/>
  +    <map:transform src="http://localhost:8080/cocoon/sub/xsl-source"/>
  +    <map:serialize/>
  +   </map:match>
   
  -   <map:handle-errors>
  +   <map:match pattern="xsp-source">
  +    <map:generate src="docs/simple.xsp"/>
  +    <map:serialize type="xml"/>
  +   </map:match>
  +   <map:match pattern="xsp">
  +    <map:generate type="serverpages" src="docs/simple.xsp"/>
  +    <map:transform src="stylesheets/simple-page2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +   <map:match pattern="xsp-cocoon">
  +    <map:generate type="serverpages" src="cocoon:/xsp-source"/>
  +    <map:transform src="stylesheets/simple-page2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +   <map:match pattern="xsp-cocoon-root">
  +    <map:generate type="serverpages" src="cocoon://sub/xsp-source"/>
  +    <map:transform src="stylesheets/simple-page2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +   <map:match pattern="xsp-http">
  +    <map:generate type="serverpages" 
src="http://localhost:8080/cocoon/sub/xsp-source"/>
  +    <map:transform src="stylesheets/simple-page2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +
  +   <map:match pattern="generror">
  +    <map:generate src="docs/error-giving-page.xml"/>
  +    <map:transform src="stylesheets/simple-samples2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +
  +   <map:match pattern="test404">
  +    <map:aggregate element="page">
  +      <map:part src="cocoon://sub/get/simple.xsp"/>
  +      <map:part src="cocoon://sub1z/get/simple.xsp"/>
  +    </map:aggregate>
  +    <map:transform src="stylesheets/simple-page2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +
  +   <map:handle-errors type="404">
       <map:transform src="stylesheets/error2html.xsl"/>
  -    <map:serialize status-code="500"/>
  +    <map:serialize/>
      </map:handle-errors>
  -
     </map:pipeline>
    </map:pipelines>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.1 +57 -14    xml-cocoon2/webapp/sub/docs/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sub/docs/samples.xml,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- samples.xml       2001/05/09 20:50:10     1.1.1.1
  +++ samples.xml       2001/08/24 01:22:24     1.1.1.1.2.1
  @@ -1,15 +1,58 @@
  -<?xml version="1.0"?>
  +<?xml version="1.0" encoding="iso-8859-1"?>
   
  -<!DOCTYPE page [
  - <!ELEMENT page (title?, content)>
  - <!ELEMENT title (#PCDATA)>
  - <!ELEMENT content (para+)>
  - <!ELEMENT para (#PCDATA)>
  -]>
  -
  -<page>
  - <title>Hello</title>
  - <content>
  -  <para>This page is served by a sub sitemap!</para>
  - </content>
  -</page>
  +<samples xmlns:xlink="http://www.w3.org/1999/xlink";>
  +
  +  <group name="This page is served by sub-sitemap!">
  +   <sample name="Back" href="..">
  +    to examples main page
  +   </sample>
  +  </group>
  +
  +  <group name="Obtaining XSP Source">
  +   <sample name="Plain XSP" href="xsp">
  +    Source is obtained from local file
  +   </sample>
  +
  +   <sample name="This sitemap XSP" href="xsp-cocoon">
  +    Source is obtained via cocoon:/xsp-source
  +   </sample>
  +
  +   <sample name="Root sitemap XSP" href="xsp-cocoon-root">
  +    Source is obtained via cocoon://sub/xsp-source
  +   </sample>
  +
  +   <sample name="External XSP" href="xsp-http">
  +    Source is obtained via http://localhost:8080/cocoon/sub/xsp-source
  +    (note: if you have different port, you need to edit sub-sitemap)
  +   </sample>
  +  </group>
  +
  +  <group name="Obtaining XSL Source">
  +   <sample name="Plain XSL" href="xsl">
  +    XSL is obtained from local file
  +   </sample>
  +
  +   <sample name="This sitemap XSL" href="xsl-cocoon">
  +    XSL is obtained via cocoon:/xsl-source, processed by this sitemap directly.
  +   </sample>
  +
  +   <sample name="Root sitemap XSL" href="xsl-cocoon-root">
  +    XSL is obtained via cocoon://sub/xsp-source, processed by root sitemap.
  +   </sample>
  +
  +   <sample name="External XSL" href="xsl-http">
  +    XSL is obtained via http://localhost:8080/cocoon/sub/xsl-source
  +    (note: if you have different port, you need to edit sub-sitemap)
  +   </sample>
  +  </group>
  +
  +  <group name="System pages">
  +   <sample name="Error" href="generror">
  +    Error is generated in sub-sitemap and processed in main sitemap
  +   </sample>
  +
  +   <sample name="Not Found" href="does-not-exist">
  +    Cusomized Resource Not Found page
  +   </sample>
  +  </group>
  +</samples>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/sub/docs/error-giving-page.xml
  
  Index: error-giving-page.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sub/docs/error-giving-page.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/sub/docs/hello-page.xml
  
  Index: hello-page.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sub/docs/hello-page.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/sub/docs/simple.xsp
  
  Index: simple.xsp
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sub/docs/simple.xsp,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +21 -106   xml-cocoon2/webapp/sub/stylesheets/error2html.xsl
  
  Index: error2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sub/stylesheets/error2html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- error2html.xsl    2001/05/23 12:32:22     1.2
  +++ error2html.xsl    2001/08/24 01:22:24     1.2.2.1
  @@ -1,113 +1,28 @@
   <?xml version="1.0"?>
   
  -<xsl:stylesheet version="1.0"
  - xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  - xmlns:error="http://apache.org/cocoon/error/2.0";>
  -
  -<xsl:template match="error:notify">
  - <html>
  +<html xmlns:error="http://apache.org/cocoon/error/2.0";
  +      xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  +      xsl:version="1.0">
     <head>
  -   <title>
  -    <xsl:value-of select="@type"/>:<xsl:value-of select="error:title"/>
  -   </title>
  +    <title>Requested resource is not found</title>
     </head>
     <body bgcolor="#ffffff">
  -   <table border="0" bgcolor="#000000" cellpadding="2" cellspacing="2">
  -    <tbody>
  -     <tr>
  -      <td bgcolor="#0086b2" colspan="2">
  -       <font color="#ffffff" face="arial,helvetica,sanserif" size="+2">
  -        <xsl:value-of select="error:title"/>
  -       </font>
  -      </td>
  -     </tr>
  -
  -     <tr>
  -      <td bgcolor="#0086b2" valign="top">
  -       <font color="#ffffff" face="arial,helvetica,sanserif" size="+1">
  -        <xsl:value-of select="@type"/>
  -       </font>
  -      </td>
  -      <td bgcolor="#ffffff" >
  -       <xsl:apply-templates select="error:message"/>
  -      </td>
  -     </tr>
  -
  -     <tr>
  -      <td bgcolor="#0086b2" valign="top" colspan="2">
  -       <font color="#ffffff" face="arial,helvetica,sanserif" 
size="+1">details</font>
  -      </td>
  -     </tr>
  -
  -     <tr>
  -      <td bgcolor="#0086b2" valign="top">
  -       <font face="arial,helvetica,sanserif" color="#ffffff">from</font>
  -      </td>
  -      <td bgcolor="#ffffff">
  -       <font face="arial,helvetica,sanserif">
  -        <xsl:value-of select="@sender"/>
  -       </font>
  -      </td>
  -     </tr>
  -
  -     <tr>
  -      <td bgcolor="#0086b2" valign="top">
  -       <font face="arial,helvetica,sanserif" color="#ffffff">source</font>
  -      </td>
  -      <td bgcolor="#ffffff">
  -       <font face="arial,helvetica,sanserif">
  -        <xsl:value-of select="error:source"/>
  -       </font>
  -      </td>
  -     </tr>
  -
  -     <xsl:apply-templates select="error:description"/>
  -
  -     <tr>
  -      <td bgcolor="#0086b2" valign="top" colspan="2">
  -       <font color="#ffffff" face="arial,helvetica,sanserif" size="+1">extra 
info</font>
  -      </td>
  -     </tr>
  -
  -     <xsl:apply-templates select="error:extra"/>
  -
  -    </tbody>
  -   </table>
  -  </body>
  - </html>
  -</xsl:template>
  -
  - <xsl:template match="error:description">
  -  <tr>
  -   <td bgcolor="#0086b2" valign="top">
  -    <font color="#ffffff" face="arial,helvetica,sanserif">description</font>
  -   </td>
  -   <td bgcolor="#ffffff">
  -    <font face="arial,helvetica,sanserif">
  -     <xsl:value-of select="."/>
  -    </font>
  -   </td>
  -  </tr>
  - </xsl:template>
  -
  - <xsl:template match="error:message">
  -  <font face="arial,helvetica,sanserif">
  -   <xsl:value-of select="."/>
  -  </font>
  - </xsl:template>
  -
  - <xsl:template match="error:extra">
  -  <tr>
  -   <td bgcolor="#0086b2" valign="top">
  -    <font color="#ffffff" face="arial,helvetica,sanserif">
  -     <xsl:value-of select="@description"/>
  -    </font>
  -   </td>
  -   <td bgcolor="#ffffff">
  +    <p>
  +      <font face="Verdana" size="+2">Requested resource is not found</font>
  +    </p>
  +    <p>
  +      <font face="Verdana">
  +        Error occured during request processing:
  +        <b><xsl:value-of select="error:notify/error:message"/></b>
  +      </font>
  +    </p>
  +    <br/>
  +    <font face="Verdana" size="-1">The corresponding exception stacktrace:</font>
       <pre>
  -     <xsl:value-of select="."/>
  +      <xsl:value-of select="translate(error:notify/error:extra[2],'&#13;',' ')"/>
       </pre>
  -   </td>
  -  </tr>
  - </xsl:template>
  -</xsl:stylesheet>
  +    <font face="Verdana" size="-2">
  +      Brought to you by <a href="http://xml.apache.org/cocoon2/";>@docname@</a> in 
no time!
  +    </font>
  +  </body>
  +</html>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/sub/stylesheets/simple-samples2html.xsl
  
  Index: simple-samples2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sub/stylesheets/simple-samples2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to