cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject cvs commit: cocoon-2.1/src/webapp/stylesheets/system error2html.xslt
Date Sun, 16 Mar 2003 22:26:36 GMT
stefano     2003/03/16 14:26:36

  Modified:    src/webapp/stylesheets/system error2html.xslt
  Log:
  improved the default error2html stylesheet by making it fully HTML4/CSS2/DOM compliant.
  
  Revision  Changes    Path
  1.2       +132 -219  cocoon-2.1/src/webapp/stylesheets/system/error2html.xslt
  
  Index: error2html.xslt
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/stylesheets/system/error2html.xslt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- error2html.xslt	15 Mar 2003 23:24:32 -0000	1.1
  +++ error2html.xslt	16 Mar 2003 22:26:36 -0000	1.2
  @@ -1,239 +1,152 @@
   <?xml version="1.0"?>
  -<!-- Author: Nicola Ken Barozzi "barozzi@nicolaken.com" -->
   
   <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  - xmlns:error="http://apache.org/cocoon/error/2.0">
  + xmlns:error="http://apache.org/cocoon/error/2.1">
   
   <xsl:template match="error:notify">
    <html>
     <head>
      <title>
  -    <xsl:value-of select="@error:type"/>:<xsl:value-of select="error:title"/>
  +    <xsl:value-of select="error:title"/>
      </title>
  -   <style><![CDATA[
  -   <!--
  -      H1{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}

  -      BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color : white;}

  -      TABLE{font-family : sans-serif,Arial,Tahoma;color : black;background-color : black;}

  -      B{color : white;background-color : #0086b2;}
  -      HR{color : #0086b2;} 
  -   //-->]]>
  +   <style>
  +        body { background-color: white; color: black; font-family: verdana, helvetica,
sanf serif; }
  +        h1 { color: #336699; margin: 0px 0px 30px 0px; border-width: 0px 0px 1px 0px; border-style:
solid; border-color: #336699;}
  +        a:link { font-weight: bold; color: #336699; }
  +        a:visited { color: #336699; }
  +        a:hover { color: #800000; background-color: #ffff80; }
  +        a:active { color: #006666; }
  +        p.message { padding: 10px 30px 10px 30px; font-weight: bold; font-size: 130%; border-width:
1px; border-style: dashed; border-color: #336699; }
  +        p.description { padding: 10px 30px 20px 30px; border-width: 0px 0px 1px 0px; border-style:
solid; border-color: #336699;}
  +        p.topped { padding-top: 10px; border-width: 1px 0px 0px 0px; border-style: solid;
border-color: #336699; }
  +        span.description { color: #336699; font-weight: bold; }
  +        span.switch { cursor: pointer; margin-left: 5px; text-decoration: underline; }
      </style>
  -   <script language="JavaScript1.2"><![CDATA[
  -    <!--
  -      var head="display:''"
  -      function expand(whatToExpand)
  -      {
  -        var head=whatToExpand.style
  -        if (head.display=="none"){
  -          head.display=""
  +   <script>
  +        function toggle(id) {
  +            var element = document.getElementById(id);
  +            with (element.style) {
  +                if ( display == "none" ){
  +                    display = ""
  +                } else{
  +                    display = "none"
  +                }
  +            }
  +            var text = document.getElementById(id + "-switch").firstChild;
  +            if (text.nodeValue == "[show]") {
  +                text.nodeValue = "[hide]";
  +            } else {
  +                text.nodeValue = "[show]";
  +            }
           }
  -        else{
  -          head.display="none"
  -        }
  -      }
  -     //-->]]>
      </script>
     </head>
     <body>
  -     <table align="center" border="0" bgcolor="#000000" cellpadding="0" cellspacing="0">
  -    <tbody>
  -     <tr>
  -      <td>
  -      
  -      
  -   <table align="center" border="0" bgcolor="#000000" cellpadding="2" cellspacing="2">
  -    <tbody>
  -     <tr>
  -      <td bgcolor="#0086b2" colspan="2">
  -       <font color="#ffffff" size="+2">
  -        <xsl:value-of select="error:title"/>
  -       </font>
  -      </td>
  -     </tr>
  -
  -     <tr>
  -      <td bgcolor="#ffffff" colspan="2" valign="top">
  -       <font color="#000000">
  -        The <xsl:value-of select="@error:sender"/> notifies that 
  -        <xsl:value-of select="error:source"/> says:<br/><br/>
  -        <i><xsl:call-template name="returns2br">
  -           <xsl:with-param name="string" select="error:message"/>
  -         </xsl:call-template></i><br/><br/>
  -        More precisely:<br/><br/>
  -        <i><xsl:call-template name="returns2br">
  -           <xsl:with-param name="string" select="error:description"/>
  -         </xsl:call-template></i><br/>
  -        <br/>
  -       </font>
  -      </td>
  -     </tr>
  -     
  -<!--     
  -     
  -     <tr>
  -      <td bgcolor="#0086b2" valign="top">
  -       <font color="#ffffff" size="+1">
  -        <xsl:value-of select="@error: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" size="+1">details</font>
  -      </td>
  -     </tr>
  -
  -     <tr>
  -      <td bgcolor="#0086b2" valign="top">
  -       <font color="#ffffff">from</font>
  -      </td>
  -      <td bgcolor="#ffffff">
  -       <font face="arial,helvetica,sanserif">
  -        <xsl:value-of select="@error:sender"/>
  -       </font>
  -      </td>
  -     </tr>
  -
  -     <tr>
  -      <td bgcolor="#0086b2" valign="top">
  -       <font 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" size="+1">extra info</font>
  -      </td>
  -     </tr>
  -
  -     <xsl:apply-templates select="error:extra"/>
  -     
  -     <tr>
  -      <td bgcolor="#ffffff" colspan="2" valign="top">
  -       <font color="#000000" size="-1">
  -       <br/>
  -        If you need help and this information is not enough, you
  -        are invited to read the
  -        <a href="http://cocoon.apache.org/faq/">Cocoon FAQ</a>.<br/>
  -        If you still don't find the answers you need,
  -        can send a mail to the 
  -        <a>
  -        <xsl:attribute name="href">mailto:cocoon-users@xml.apache.org?subject=[HELP]<xsl:value-of
select="error:message"/>&amp;body=Description:<xsl:value-of select="error:description"/></xsl:attribute>
  -        Cocoon users mailing list</a>,
  -        remembering to
  -        <ul>
  -          <li> specify the version of Cocoon you're using, or we suppose that you
  -          are talking about the latest version;</li>
  -          <li>specify the taglibs and sitemap components that are pertinent;</li>
  -          <li>specify the platform-operating system-version-servlet container version;</li>
  -          <li>send any pertinent error message;</li>
  -          <li>send pertinent log snippets;</li>
  -          <li>send pertinent sitemap snippets;</li>
  -          <li>send pertinent parts of the page that gives you problems.</li>
  -        </ul>
  -        For more detailed technical information, take a look at the log
  -        files in the log directory of Cocoon, which is <code>/WEB-INF/logs</code>
by default.<br/>
  -        Logging configuration is by default in <code>/WEB-INF/logkit.xconf.</code><br/><br/>
  -        If you think you found a bug, please report it to 
  -        <a href="http://nagoya.apache.org/bugzilla/">Apache's Bugzilla</a>;
  -        a message will be sent to the developer mailing list.<br/>
  -       </font>
  -      </td>
  -     </tr>
  -       
  -    </tbody>
  -   </table>
  -   
  -   
  -   
  -         </td>
  -     </tr>
  -       
  -    </tbody>
  -   </table>
  -   
  -   
  +   <h1><xsl:value-of select="error:title"/></h1>
  +
  +   <p class="message">
  +    <xsl:call-template name="returns2br">
  +     <xsl:with-param name="string" select="error:message"/>
  +    </xsl:call-template>
  +   </p>
  +
  +   <p class="description">
  +    <xsl:call-template name="returns2br">
  +     <xsl:with-param name="string" select="error:description"/>
  +    </xsl:call-template>
  +   </p>
  +
  +   <xsl:apply-templates select="error:extra"/>
  +
  +   <p class="topped">
  +    If you need help and this information is not enough, you
  +    are invited to read the
  +    <a href="http://cocoon.apache.org/faq/">Cocoon FAQ</a>.<br/>
  +    If you still don't find the answers you need,
  +    can send a mail to the
  +    <a>
  +    <xsl:attribute name="href">mailto:cocoon-users@xml.apache.org?subject=[HELP]<xsl:value-of
select="error:message"/>&amp;body=Description:<xsl:value-of select="error:description"/></xsl:attribute>
  +    Cocoon users mailing list</a>,
  +    remembering to:
  +   </p>
  +
  +   <ul>
  +    <li>specify the version of Cocoon you're using, or we'll assume that you
  +          are talking about the latest released version;</li>
  +    <li>specify the platform-operating system-version-servlet container version;</li>
  +    <li>send any pertinent error message;</li>
  +    <li>send pertinent log snippets;</li>
  +    <li>send pertinent sitemap snippets;</li>
  +    <li>send pertinent parts of the page that give you problems.</li>
  +   </ul>
  +
  +   <p>
  +    For more detailed technical information, take a look at the log
  +    files in the log directory of Cocoon, which is placed by default in
  +    the <code>WEB-INF/logs/</code> folder of your cocoon webapp context.<br/>
  +    If the logs don't give you enough information, you might want to increase the
  +    log level by changing the Logging configuration which is by default the
  +    <code>WEB-INF/logkit.xconf</code> file.
  +   </p>
  +
  +   <p>
  +    If you think you found a bug, please report it to
  +    <a href="http://nagoya.apache.org/bugzilla/">Apache's Bugzilla</a>;
  +    a message will automatically be sent to the developer mailing list and you'll
  +    be kept in contact automatically with the further progress on that bug.
  +   </p>
  +
  +   <p>
  +     Thanks, and sorry for the trouble if this is our fault.
  +   </p>
  +
  +   <p class="topped">
  +    The <a href="http://cocoon.apache.org/">Apache Cocoon</a> Project
  +   </p>
     </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">
  -         <xsl:call-template name="returns2br">
  -           <xsl:with-param name="string" select="."/>
  -         </xsl:call-template>
  -   </td>
  -  </tr>
  - </xsl:template>
  -
  - <xsl:template match="error:message">
  -         <xsl:call-template name="returns2br">
  -           <xsl:with-param name="string" select="."/>
  -         </xsl:call-template>
  - </xsl:template>
  -
  - <xsl:template match="error:extra">
  -  <tr>
  -   <td bgcolor="#0086b2" valign="top">
  -    <font color="#ffffff">
  -     <xsl:value-of select="@error:description"/>
  -    </font>
  -   </td>   
  -   <td bgcolor="#ffffff">
  -    <font size="-1">
  -		<xsl:choose>
  -			<xsl:when test="contains(@error:description,'stacktrace')">
  -       <!-- degrade gracefully on Netscape-->
  -       <a href="javascript:" onclick="expand(document.all[this.sourceIndex+2])"><script>if(document.all){document.write('show');}</script></a>
  -       <div style="display:'none';">
  -         <xsl:call-template name="returns2br">
  -           <xsl:with-param name="string" select="."/>
  -         </xsl:call-template>
  -       </div>
  -			</xsl:when>
  -			<xsl:otherwise>
  -         <xsl:call-template name="returns2br">
  -           <xsl:with-param name="string" select="."/>
  -         </xsl:call-template>
  -			</xsl:otherwise>
  -		</xsl:choose>
  -    </font>
  -   </td>
  -  </tr>
  - </xsl:template>
  - 
  -  <xsl:template name="returns2br">
  -    <xsl:param name="string"/>
  -    <xsl:variable name="return" select="'&#xa;'"/>
  -    <xsl:choose>
  -      <xsl:when test="contains($string,$return)">
  -        <xsl:value-of select="substring-before($string,$return)"/>
  -        <br/>
  -        <xsl:call-template name="returns2br">
  -          <xsl:with-param name="string" select="substring-after($string,$return)"/>
  -        </xsl:call-template>
  -      </xsl:when>
  -      <xsl:otherwise>
  -        <xsl:value-of select="$string"/>
  -      </xsl:otherwise>
  -   </xsl:choose>
  -  </xsl:template>
  -  
  +<xsl:template match="error:extra">
  + <xsl:choose>
  +  <xsl:when test="contains(@error:description,'stacktrace')">
  +   <p class="stacktrace">
  +    <span class="description"><xsl:value-of select="@error:description"/></span>
  +    <span class="switch" id="{@error:description}-switch" onclick="toggle('{@error:description}')">[show]</span>
  +    <pre id="{@error:description}" style="display: none">
  +     <xsl:call-template name="returns2br">
  +      <xsl:with-param name="string" select="."/>
  +     </xsl:call-template>
  +    </pre>
  +   </p>
  +  </xsl:when>
  +  <xsl:otherwise>
  +   <p class="extra">
  +    <span class="description"><xsl:value-of select="@error:description"/>:&#160;</span>
  +    <xsl:call-template name="returns2br">
  +     <xsl:with-param name="string" select="."/>
  +    </xsl:call-template>
  +   </p>
  +  </xsl:otherwise>
  + </xsl:choose>
  +</xsl:template>
  +
  +<xsl:template name="returns2br">
  +  <xsl:param name="string"/>
  +  <xsl:variable name="return" select="'&#xa;'"/>
  +  <xsl:choose>
  +    <xsl:when test="contains($string,$return)">
  +      <xsl:value-of select="substring-before($string,$return)"/>
  +      <br/>
  +      <xsl:call-template name="returns2br">
  +        <xsl:with-param name="string" select="substring-after($string,$return)"/>
  +      </xsl:call-template>
  +    </xsl:when>
  +    <xsl:otherwise>
  +      <xsl:value-of select="$string"/>
  +    </xsl:otherwise>
  +  </xsl:choose>
  +</xsl:template>
  +
   </xsl:stylesheet>
  
  
  

Mime
View raw message