[Yanel-commits] rev 49663 - public/yanel/trunk/src/realms/yanel-website/content/xslt

michi at wyona.com michi at wyona.com
Tue May 18 09:14:14 CEST 2010


Author: michi
Date: 2010-05-18 09:14:12 +0200 (Tue, 18 May 2010)
New Revision: 49663

Added:
   public/yanel/trunk/src/realms/yanel-website/content/xslt/404.xsl
Log:
custom 404 added

Added: public/yanel/trunk/src/realms/yanel-website/content/xslt/404.xsl
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/xslt/404.xsl	                        (rev 0)
+++ public/yanel/trunk/src/realms/yanel-website/content/xslt/404.xsl	2010-05-18 07:14:12 UTC (rev 49663)
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:yanel="http://www.wyona.org/yanel/1.0"
+  xmlns:i18n="http://www.wyona.org/yanel/i18n/1.0"
+>
+
+<!-- NOTE: This XSLT is copied during the build process into the jar file! -->
+
+  <xsl:output method="xhtml" encoding="UTF-8"/>
+
+  <xsl:param name="yanel.back2realm" select="'BACK2REALM_IS_NULL'"/>
+  <xsl:param name="yanel.reservedPrefix" select="'RESERVEDPREFIX_IS_NULL'"/>
+  
+  <xsl:template match="/">
+        <html>
+          <head>
+            <title>
+              <xsl:choose>
+                <xsl:when test="/yanel:yanel/yanel:exception/@yanel:status = '404'">
+                  404 - No such page:  <xsl:value-of select="/yanel:yanel/yanel:request/@yanel:uri"/>
+                </xsl:when>
+                <xsl:when test="child::node()/yanel:exception">
+                  <i18n:message key="anErrorOccurred">- An error occurred</i18n:message>
+                </xsl:when>
+                <xsl:otherwise>
+                  <i18n:message key="pageInfo">- Page Info</i18n:message>
+                </xsl:otherwise>
+              </xsl:choose>
+            </title>
+            <link rel="stylesheet" href="{$yanel.back2realm}{$yanel.reservedPrefix}/yanel-css/global.css" type="text/css"/>
+          </head>
+          <body>
+
+<xsl:comment>
+Back 2 Realm: <xsl:value-of select="$yanel.back2realm"/>,
+Yanel reserved prefix: <xsl:value-of select="$yanel.reservedPrefix"/>
+</xsl:comment>
+
+<!--
+              <xsl:apply-templates select="child::node()/yanel:exception"/>
+-->
+              <xsl:choose>
+                <xsl:when test="/yanel:yanel/yanel:exception/@yanel:status = '404'">
+                  <i18n:message key="error404">404</i18n:message>: <xsl:value-of select="/yanel:yanel/yanel:request/@yanel:uri"/>
+                </xsl:when>
+                <xsl:when test="child::node()/yanel:exception">
+                  <i18n:message key="anErrorOccurred">An error occurred</i18n:message>
+                </xsl:when>
+                <xsl:otherwise>
+                  <i18n:message key="pageInfo">Page Info</i18n:message>
+                </xsl:otherwise>
+              </xsl:choose>
+
+              <xsl:choose>
+                <xsl:when test="child::node()/yanel:exception">
+                  <p><a href="?yanel.format=xml">Show XML source</a> </p>
+                </xsl:when>
+                <xsl:otherwise>
+                  <p><a href="?yanel.resource.meta&amp;yanel.format=xml">Show XML source</a> </p>
+                </xsl:otherwise>
+              </xsl:choose>
+
+              <p>
+              Do you want to <a href="{$yanel.back2realm}create-new-page.html?resource-type=http%3A%2F%2Fwww.wyona.org%2Fyanel%2Fresource%2F1.0%3A%3Axml">create</a> a new page?
+              </p>
+
+
+
+<!-- OLD STUFF, but which might be still useful
+        <table cellspacing="0" cellpadding="0" id="bodytable">
+          <tr>
+            <td id="title">
+              Yanel - 
+              <xsl:choose>
+                <xsl:when test="/yanel:yanel/yanel:exception/@yanel:status = '404'">
+                  <i18n:message key="error404">404</i18n:message>
+                </xsl:when>
+                <xsl:when test="child::node()/yanel:exception">
+                  <i18n:message key="anErrorOccurred">An error occurred</i18n:message>
+                </xsl:when>
+                <xsl:otherwise>
+                  <i18n:message key="pageInfo">Page Info</i18n:message>
+                </xsl:otherwise>
+              </xsl:choose>
+            </td>
+            <td id="logo">  
+               <img src="{$yanel.back2realm}{$yanel.reservedPrefix}/yanel-img/yanel_header.png"/>
+            </td>
+          </tr>
+          <tr>
+            <td width="100%" valign="top"  colspan="2">
+              <div id="content">
+              <xsl:apply-templates select="child::node()/yanel:exception"/>
+
+              <xsl:choose>
+                <xsl:when test="child::node()/yanel:exception">
+                  <p><a href="?yanel.format=xml">Show XML source</a> </p>
+                </xsl:when>
+                <xsl:otherwise>
+                  <p><a href="?yanel.resource.meta&amp;yanel.format=xml">Show XML source</a> </p>
+                </xsl:otherwise>
+              </xsl:choose>
+              </div>
+            </td>
+          </tr>
+          </table>
+-->
+          </body>
+        </html>
+  </xsl:template>
+  
+  <xsl:template match="yanel:request">
+    <p>
+    <h4>Request:</h4>
+    <ul>
+      <li>Servlet Path: <xsl:value-of select="@yanel:servlet-path"/></li>
+      <li>URI: <a href="{@yanel:uri}"><xsl:value-of select="@yanel:uri"/></a></li>
+    </ul>
+    </p>
+  </xsl:template>
+  
+  <xsl:template match="session">
+    <p>
+      <h4>Session:</h4>
+      <ul>
+        <li>Session ID: <xsl:value-of select="@id"/></li>
+        <xsl:for-each select="attribute">
+          <li><xsl:value-of select="@name"/><xsl:text>: </xsl:text> <xsl:value-of select="."/></li>
+        </xsl:for-each>
+      </ul>
+    </p>
+  </xsl:template>
+  
+<!-- OBSOLETE
+  <xsl:template match="resource-type-identifier">
+    <p>
+      <h4> Resource Type Identifier:</h4>
+      <ul> 
+        <li>Namespace: <xsl:value-of select="@namespace"/></li>
+        <li>Local Name: <xsl:value-of select="@local-name"/></li>
+      </ul>
+    </p>   
+  </xsl:template>
+-->
+  
+  <xsl:template match="resource">
+    <p>
+      <h4>Resource:</h4>
+      <ul>
+      <xsl:apply-templates/>
+      </ul>
+    </p>    
+  </xsl:template>
+  
+  <xsl:template match="yanel:config">
+    <li>Configuration: <b><xsl:value-of select="@yanel:rti-name"/></b> (<xsl:value-of select="@yanel:rti-namespace"/>)</li>
+  </xsl:template>
+  
+  <xsl:template match="yanel:no-config">
+    <li>No Configuration!</li>
+  </xsl:template>
+  
+  <xsl:template match="not-viewable">
+    <li>Resource is not viewable: <xsl:apply-templates/></li>
+  </xsl:template>
+  
+  <xsl:template match="not-versionable">
+    <li>Resource has no versions</li>
+  </xsl:template>
+  
+  <xsl:template match="no-last-modified">
+    <li>Resource has no last modified</li>
+  </xsl:template>
+  
+  <xsl:template match="size">
+    <li>Size: <xsl:apply-templates/></li>
+  </xsl:template>
+  
+  <xsl:template match="view">
+    <li>View (Version <xsl:value-of select="@yanel:version"/>): <xsl:apply-templates/></li>
+  </xsl:template>
+  
+  <xsl:template match="last-modified">
+    <li>Last modified: <xsl:apply-templates/></li>
+  </xsl:template>
+
+  <xsl:template match="revisions">
+    <li>Revisions:
+      <table border="1" cellspacing="0">
+        <tr>
+          <th>Revision</th>
+          <th>Date</th>
+          <th>User</th>
+          <th>Comment</th>
+        </tr>
+        <xsl:for-each select="revision">
+          <tr>
+            <td><a href="?yanel.resource.revision={name}"><xsl:value-of select="name"/></a> <xsl:if test="position() = 1">&#160;(most recent version)</xsl:if></td>
+            <td><xsl:value-of select="date"/></td>
+            <td><xsl:value-of select="user"/></td>
+            <td><xsl:value-of select="comment"/></td>
+          </tr>
+        </xsl:for-each>
+      </table>
+    </li>
+  </xsl:template>
+
+  <xsl:template match="translations">
+    <li>Translations:
+      <xsl:if test="not(translation)">No translations yet!</xsl:if>
+      <xsl:apply-templates/>
+    </li>
+  </xsl:template>
+
+  <xsl:template match="translation">
+    <a href="{$yanel.back2realm}{substring-after(@path, '/')}"><xsl:value-of select="@language"/></a>
+    <xsl:if test="position() != last()">, </xsl:if>
+  </xsl:template>
+
+<!-- OBSOLETE
+  <xsl:template match="no-resource-type-identifier">
+    <p>
+      <h4>No Resource Type Identifier:</h4>
+      <ul>
+        <li>Servlet Path: <xsl:value-of select="@servlet-path"/></li>
+      </ul>
+      </p>     
+  </xsl:template>
+-->
+  
+  <xsl:template match="yanel:exception">
+    <p>
+      <xsl:choose>
+        <xsl:when test="@yanel:status = '404'">
+        No such page:  <xsl:value-of select="/yanel:yanel/yanel:request/@yanel:uri"/>
+        </xsl:when>
+        <xsl:otherwise>
+      <h4>Exception</h4>
+      <ul>
+        <xsl:if test="@yanel:status"><li>Status: <xsl:value-of select="@yanel:status"/></li></xsl:if>
+        <li>Error Message: 
+          <ul>
+            <li><pre><xsl:value-of select="."/></pre></li>
+          </ul>
+        </li>
+      </ul>
+        </xsl:otherwise>
+      </xsl:choose>
+    </p>
+  </xsl:template> 
+
+  <xsl:template match="descriptor">
+    <br/>Descriptor (<xsl:value-of select="@yanel:id"/>): <a href="?yanel.resource.viewid={@yanel:id}"><xsl:value-of select="."/></a>
+  </xsl:template> 
+
+</xsl:stylesheet>



More information about the Yanel-commits mailing list