svn commit: r589887 - in /lenya/trunk/src: pubs/default/ pubs/default/lenya/resources/i18n/ pubs/default/lenya/xslt/ pubs/default/lenya/xslt/exception/ webapp/ webapp/lenya/ webapp/lenya/config/sitemap/

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Mon Oct 29 15:21:58 2007
New Revision: 589887

URL: http://svn.apache.org/viewvc?rev=589887&view=rev
Log:
Overriding error handler in default publication

Added:
    lenya/trunk/src/pubs/default/error.xmap
    lenya/trunk/src/pubs/default/lenya/xslt/
    lenya/trunk/src/pubs/default/lenya/xslt/exception/
    lenya/trunk/src/pubs/default/lenya/xslt/exception/generic.xsl
    lenya/trunk/src/webapp/error.xmap
      - copied unchanged from r589872, lenya/trunk/src/webapp/lenya/error.xmap
Removed:
    lenya/trunk/src/webapp/lenya/error.xmap
Modified:
    lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml
    lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml
    lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap

Added: lenya/trunk/src/pubs/default/error.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/error.xmap?rev=589887&view=auto
==============================================================================
--- lenya/trunk/src/pubs/default/error.xmap (added)
+++ lenya/trunk/src/pubs/default/error.xmap Mon Oct 29 15:21:58 2007
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  
+  <map:pipelines>
+    <map:pipeline>
+      <map:match pattern="*/*/**">
+        <map:generate type="notifying"/>
+        <map:transform src="fallback://lenya/xslt/exception/generic.xsl">
+          <map:parameter name="root" value="/{1}/{2}"/>
+        </map:transform>
+        <map:transform type="i18n">
+          <map:parameter name="language" value="{page-envelope:language}"/>
+        </map:transform>
+        <map:transform type="proxy"/>
+        <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/>
+        <map:serialize type="xhtml" status-code="500" />
+      </map:match>
+    </map:pipeline>
+  </map:pipelines>
+  
+</map:sitemap>

Modified: lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml?rev=589887&r1=589886&r2=589887&view=diff
==============================================================================
--- lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml (original)
+++ lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml Mon Oct 29 15:21:58 2007
@@ -34,5 +34,7 @@
 
   <message key="last-published">This page was last published at {0} by {1}.</message>
   <message key="never-published">This page has not been published yet.</message>
+
+  <message key="error-generic-comment">Please contact your system administrator.</message>
   
 </catalogue>

Modified: lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml?rev=589887&r1=589886&r2=589887&view=diff
==============================================================================
--- lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml (original)
+++ lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml Mon Oct 29 15:21:58 2007
@@ -35,5 +35,7 @@
   <message key="last-published">Diese Seite wurde zuletzt publiziert am {0} von {1}.</message>
   <message key="never-published">Diese Seite wurde noch nicht publiziert.</message>
   
+  <message key="error-generic-comment">Bitte kontaktieren Sie den Systemadministrator.</message>
+  
 </catalogue>
 

Added: lenya/trunk/src/pubs/default/lenya/xslt/exception/generic.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/lenya/xslt/exception/generic.xsl?rev=589887&view=auto
==============================================================================
--- lenya/trunk/src/pubs/default/lenya/xslt/exception/generic.xsl (added)
+++ lenya/trunk/src/pubs/default/lenya/xslt/exception/generic.xsl Mon Oct 29 15:21:58 2007
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: generic.xsl 589872 2007-10-29 21:47:39Z andreas $ -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:error="http://apache.org/cocoon/error/2.1"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+  
+  <xsl:param name="root"/>
+  
+  <xsl:template match="error:notify">
+    <html>
+      <head>
+        <title><i18n:text i18n:key="error-generic" /></title>
+        <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
+      </head>
+      <body>
+        
+        <div id="page">
+          <table width="100%" cellpadding="0" cellspacing="0" border="0">
+            <tr>
+              <td/>
+              <td id="project-logo"><img src="{$root}/images/project-logo.png" alt="project logo"/></td>
+            </tr>
+          </table>
+          <table width="100%" border="0" cellpadding="0" cellspacing="0">
+            <tr>
+              <td valign="top" style="width: 230px"/>
+              <td valign="top">
+                <div id="main">
+                  <div id="body">
+                    <h1>
+                      <i18n:text i18n:key="error-generic" />
+                    </h1>
+                    <p>
+                      <i18n:text i18n:key="error-generic-comment"/>
+                    </p>
+                    <xsl:comment>
+                      <xsl:value-of select="error:message"/>
+                      <xsl:value-of select="error:description"/>
+                      <xsl:apply-templates select="error:extra"/>
+                    </xsl:comment>
+                  </div>
+                </div>
+              </td>
+            </tr>
+          </table>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  
+  <xsl:template match="error:extra">
+    <xsl:choose>
+      <xsl:when test="contains(@error:description,'stacktrace')">
+        <xsl:value-of select="@error:description"/>
+        <xsl:value-of select="translate(.,'&#13;','')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+</xsl:stylesheet>

Modified: lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap?rev=589887&r1=589886&r2=589887&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap (original)
+++ lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap Mon Oct 29 15:21:58 2007
@@ -109,7 +109,7 @@
 
     <!-- this is the default error handler -->
     <map:handle-errors>
-      <map:mount src="fallback://lenya/error.xmap" check-reload="true" reload-method="synchron" uri-prefix=""/>
+      <map:mount src="{fallback:error.xmap}" check-reload="true" reload-method="synchron" uri-prefix=""/>
     </map:handle-errors>    
     
   </map:pipelines></xmap>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.