froehlich    01/12/14 04:30:58

  Modified:    webapp/stylesheets/system Tag: cocoon_20_branch
                        status2html.xsl error2html.xsl
  Log:
  Applied patch from Nicola Ken Barozzi [[EMAIL PROTECTED]]
  stylesheets changed to look good in Mozilla as in IE.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.3   +134 -104  xml-cocoon2/webapp/stylesheets/system/status2html.xsl
  
  Index: status2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/stylesheets/system/status2html.xsl,v
  retrieving revision 1.2.2.2
  retrieving revision 1.2.2.3
  diff -u -r1.2.2.2 -r1.2.2.3
  --- status2html.xsl   2001/12/11 21:09:40     1.2.2.2
  +++ status2html.xsl   2001/12/14 12:30:58     1.2.2.3
  @@ -1,5 +1,5 @@
   <?xml version="1.0"?>
  -
  +<!-- Author: Nicola Ken Barozzi "[EMAIL PROTECTED]" -->
   <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:status="http://apache.org/cocoon/status/2.0";>
  @@ -10,98 +10,130 @@
           <title>Cocoon2 status [<xsl:value-of select="@status:host"/>]</title>
         </head>
         <body bgcolor="white">
  -
  -  <table bgcolor="#000000" cellspacing="0" cellpadding="2" width="100%">
  -    <tr>
  -      <td>
  -
  -  <table bgcolor="#ffffff" noshade="noshade" cellspacing="0" cellpadding="6" 
width="100%">
  -    <tr>
  -      <td bgcolor="#0086b2" valign="top" align="left">
  -        <img src="images/cocoon.gif" border="0"/>
  -      </td>
  -      <td bgcolor="#0086b2" valign="top" align="right">
  -       <FONT face="arial,helvetica,sanserif" color="#ffffff">
  -     [<xsl:value-of select="@status:host"/>] <xsl:value-of select="@status:date"/>
  -       </FONT>
  -      </td>
  -    </tr>
  -        </table>
  -
  -      </td>
  -    </tr>
  -        </table>
  -
  -  <table bgcolor="#000000" cellspacing="0" cellpadding="2" width="100%">
  -    <tr>
  -      <td bgcolor="#ffffff" valign="top" align="left" colspan="2" height="12">
  -      </td>
  -    </tr>
  -  </table>
   
  -          <xsl:apply-templates />
  +      <table bgcolor="#000000" cellspacing="0" cellpadding="2" width="97%">
  +        <tr>
  +          <td>
  +    
  +           <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" 
width="100%">
  +             <tr>
  +              <td>   
  +              
  +                <table bgcolor="#ffffff" noshade="noshade" cellspacing="0" 
cellpadding="6" width="100%">
  +                  <tr>
  +                    <td bgcolor="#0086b2" valign="top" align="left">
  +                      <img src="images/cocoon.gif" border="0"/>
  +                    </td>
  +                    <td bgcolor="#0086b2" valign="top" align="right">
  +                     <FONT face="arial,helvetica,sanserif" color="#ffffff">
  +                       [<xsl:value-of select="@status:host"/>] <xsl:value-of 
select="@status:date"/>
  +                     </FONT>
  +                    </td>
  +                  </tr>
  +                 </table>
  +
  +                </td>
  +               </tr>
  +             </table>      
  +        
  +            </td>
  +          </tr>
  +         </table>
  + 
  +      <xsl:call-template name="spacer">
  +       <xsl:with-param name="height" select="number(10)"/>
  +      </xsl:call-template>
  +      
  +      <xsl:apply-templates />
  +        
         </body>
       </html>
     </xsl:template>
   
     <xsl:template match="status:group">
  -   <table bgcolor="#000000" noshade="noshade" border="0" cellspacing="2" 
cellpadding="6" width="100%">
  -    <tr>
  -      <td bgcolor="#0086b2" valign="top" align="left" colspan="2">
  -       <FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1">
  -        -<xsl:value-of select="@status:name"/>
  -       </FONT>
  -      </td>
  -    </tr>
  -    <tr>
  -      <td bgcolor="ffffff" width="100%" colspan="2">
  -        <table bgcolor="#000000" noshade="noshade" border="0" cellspacing="2" 
cellpadding="6" bordercolor="black" width="100%">
  -          <xsl:apply-templates />
  -        </table>
  -      </td>
  -    </tr>
  -   </table>
  -
  -  <table bgcolor="#000000" cellspacing="0" cellpadding="2" width="100%">
  -    <tr>
  -      <td bgcolor="#ffffff" valign="top" align="left" colspan="2" height="8">
  -      </td>
  -    </tr>
  -  </table>
  +       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" 
width="100%">
  +         <tr>
  +          <td>    
  +          
  +           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="6" 
width="100%">
  +            <tr>
  +              <td bgcolor="#0086b2" valign="top" align="left" colspan="2">
  +               <FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1">
  +                -<xsl:value-of select="@status:name"/>
  +               </FONT>
  +              </td>
  +            </tr>
  +            <tr>
  +   
  +          <td bgcolor="#ffffff">
  +      
  +            <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" 
width="100%">
  +             <tr>
  +              <td>    
  + 
  +                <table width="100%" bgcolor="#000000" border="0" cellspacing="2" 
cellpadding="6">
  +                  <xsl:apply-templates select="status:value"/>
  +                  <xsl:call-template name="spacer">
  +                   <xsl:with-param name="height" select="number(8)"/>
  +                  </xsl:call-template>
  +                  <xsl:apply-templates select="status:group"/>
  +                </table>
  +        
  +             </td>
  +            </tr>
  +          </table>    
  +        
  +        </td>
  +      
  +      
  +       </tr>
  +     </table>
  +
  +    </td>
  +   </tr>
  + </table>
  +
  +   
  +  <xsl:call-template name="spacer">
  +   <xsl:with-param name="height" select="number(6)"/>
  +  </xsl:call-template>
   
     </xsl:template>
  -
  -     <xsl:template match="status:value[count(status:line) &lt;= 1]">
  -             <tr>
  -                     <td bgcolor="#0086b2" valign="top" align="left">
  -                             <font face="arial,helvetica,sanserif" color="#ffffff">
  -                                     <xsl:value-of select="@status:name"/>
  -                             </font>
  -                     </td>
  -                     <td bgcolor="ffffff" width="100%">
  -                             <font face="arial,helvetica,sanserif">
  -                                     <xsl:value-of select="status:line" />
  -                             </font>
  -                     </td>
  -             </tr>
  -     </xsl:template>
  -
  -
  -     <xsl:template match="status:value[count(status:line) &gt; 1]">
  -             <tr>
  -                     <td bgcolor="#0086b2" valign="top" align="left">
  -                             <font face="arial,helvetica,sanserif" color="#ffffff">
  -                                     <xsl:value-of select="@status:name"/>
  -                             </font>
  -                     </td>
  -                     <td bgcolor="ffffff" width="100%">
  -                             <ul>
  -                                     <xsl:apply-templates />
  -                             </ul>
  -                     </td>
  -             </tr>
  -     </xsl:template>
   
  +     <xsl:template match="status:value">
  +   <tr>
  +    <td bgcolor="#0086b2" valign="top" align="left" width="1%">
  +     <font face="arial,helvetica,sanserif" color="#ffffff">
  +        <xsl:value-of select="@status:name"/>
  +     </font>
  +    </td>
  +    
  +    <td bgcolor="#eeeeee" width="100%">
  +      
  +    <xsl:choose>
  +      <xsl:when test="../@status:name='memory' and ( @status:name='total' or 
@status:name='free')">
  +          <font face="arial,helvetica,sanserif">
  +          <xsl:call-template name="suffix">
  +            <xsl:with-param 
  +              name="bytes" 
  +              select="number(.)"/>
  +          </xsl:call-template>
  +          </font>
  +      </xsl:when>    
  +      <xsl:when test="count(status:line) &lt;= 1">
  +          <font face="arial,helvetica,sanserif">
  +            <xsl:value-of select="status:line" />
  +          </font>
  +      </xsl:when>
  +      <xsl:otherwise>
  +          <ul>
  +            <xsl:apply-templates />
  +          </ul>
  +      </xsl:otherwise>
  +    </xsl:choose>
  +    </td>
  +   </tr>
  +  </xsl:template>
   
        <xsl:template match="status:line">
                <li>
  @@ -111,26 +143,6 @@
                </li>
        </xsl:template>
   
  -
  -     <xsl:template match="status:value[../@status:name='memory' and ( 
@status:name='total' or @status:name='free')]">
  -             <tr>
  -                     <td bgcolor="#0086b2" valign="top" align="left">
  -                      <FONT face="arial,helvetica,sanserif" color="#ffffff">
  -                             <xsl:value-of select="@status:name"/>
  -                      </FONT>
  -                     </td>
  -                     <td bgcolor="ffffff" width="100%">
  -                      <FONT face="arial,helvetica,sanserif">
  -                             <xsl:call-template name="suffix">
  -                                     <xsl:with-param 
  -                                             name="bytes" 
  -                                             select="number(.)"/>
  -                             </xsl:call-template>
  -                      </FONT>
  -                     </td>
  -             </tr>
  -     </xsl:template>
  -
        <xsl:template name="suffix">
                <xsl:param name="bytes"/>
                <xsl:choose>
  @@ -149,6 +161,24 @@
                                <xsl:value-of select="$bytes"/> B
                        </xsl:otherwise>
                </xsl:choose>
  +     </xsl:template>
  +  
  +  <xsl:template name="spacer">
  +     <xsl:param name="height"/>
  +    <table bgcolor="#ffffff" cellspacing="0" cellpadding="2" width="100%">
  +      <tr>
  +        <td bgcolor="#ffffff"> 
  +              
  +          <table bgcolor="#ffffff" cellspacing="0" cellpadding="2" width="100%">
  +           <tr>
  +            <td width="100%" bgcolor="#ffffff" valign="top" align="left" 
height="$height"> 
  +            </td>
  +          </tr>
  +         </table>
  +    
  +        </td>
  +      </tr>
  +    </table>
        </xsl:template>
   
   
  
  
  
  1.2.2.2   +150 -26   xml-cocoon2/webapp/stylesheets/system/error2html.xsl
  
  Index: error2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/stylesheets/system/error2html.xsl,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- error2html.xsl    2001/08/15 03:31:19     1.2.2.1
  +++ error2html.xsl    2001/12/14 12:30:58     1.2.2.2
  @@ -1,4 +1,5 @@
   <?xml version="1.0"?>
  +<!-- Author: Nicola Ken Barozzi "[EMAIL PROTECTED]" -->
   
   <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  @@ -8,24 +9,73 @@
    <html>
     <head>
      <title>
  -    <xsl:value-of select="@type"/>:<xsl:value-of select="error:title"/>
  +    <xsl:value-of select="@error:type"/>:<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>
  +   <script language="JavaScript1.2"><![CDATA[
  +    <!--
  +      var head="display:''"
  +      function expand(whatToExpand)
  +      {
  +        var head=whatToExpand.style
  +        if (head.display=="none"){
  +          head.display=""
  +        }
  +        else{
  +          head.display="none"
  +        }
  +      }
  +     //-->]]>
  +   </script>
     </head>
  -  <body bgcolor="#ffffff">
  -   <table border="0" bgcolor="#000000" cellpadding="2" cellspacing="2">
  +  <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" face="arial,helvetica,sanserif" size="+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 precisly:<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" face="arial,helvetica,sanserif" size="+1">
  -        <xsl:value-of select="@type"/>
  +       <font color="#ffffff" size="+1">
  +        <xsl:value-of select="@error:type"/>
          </font>
         </td>
         <td bgcolor="#ffffff" >
  @@ -35,24 +85,24 @@
   
        <tr>
         <td bgcolor="#0086b2" valign="top" colspan="2">
  -       <font color="#ffffff" face="arial,helvetica,sanserif" 
size="+1">details</font>
  +       <font color="#ffffff" size="+1">details</font>
         </td>
        </tr>
   
        <tr>
         <td bgcolor="#0086b2" valign="top">
  -       <font face="arial,helvetica,sanserif" color="#ffffff">from</font>
  +       <font color="#ffffff">from</font>
         </td>
         <td bgcolor="#ffffff">
          <font face="arial,helvetica,sanserif">
  -        <xsl:value-of select="@sender"/>
  +        <xsl:value-of select="@error:sender"/>
          </font>
         </td>
        </tr>
   
        <tr>
         <td bgcolor="#0086b2" valign="top">
  -       <font face="arial,helvetica,sanserif" color="#ffffff">source</font>
  +       <font color="#ffffff">source</font>
         </td>
         <td bgcolor="#ffffff">
          <font face="arial,helvetica,sanserif">
  @@ -62,17 +112,59 @@
        </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>
  +       <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://xml.apache.org/cocoon/faq.html";>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:[EMAIL PROTECTED]?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 al 
  +        <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>
  +   
  +   
     </body>
    </html>
   </xsl:template>
  @@ -83,32 +175,64 @@
       <font color="#ffffff" face="arial,helvetica,sanserif">description</font>
      </td>
      <td bgcolor="#ffffff">
  -    <font face="arial,helvetica,sanserif">
  -     <xsl:value-of select="."/>
  -    </font>
  +         <xsl:call-template name="returns2br">
  +           <xsl:with-param name="string" select="."/>
  +         </xsl:call-template>
      </td>
     </tr>
    </xsl:template>
   
    <xsl:template match="error:message">
  -  <font face="arial,helvetica,sanserif">
  -   <xsl:value-of select="."/>
  -  </font>
  +         <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" face="arial,helvetica,sanserif">
  -     <xsl:value-of select="@description"/>
  +    <font color="#ffffff">
  +     <xsl:value-of select="@error:description"/>
       </font>
  -   </td>
  +   </td>   
      <td bgcolor="#ffffff">
  -    <xsl:variable name="x" select="translate(.,'&#13;',' ')"/>
  -    <pre>
  -     <xsl:value-of select="$x"/>
  -    </pre>
  +    <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:stylesheet>
  
  
  

----------------------------------------------------------------------
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