forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r491466 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher: dataModel-tabs.xmap dataModel.xmap
Date Sun, 31 Dec 2006 19:08:08 GMT
Author: thorsten
Date: Sun Dec 31 11:08:06 2006
New Revision: 491466

URL: http://svn.apache.org/viewvc?view=rev&rev=491466
Log:
FOR-937 Menus and Tabs not localized in Dispatcher. Reporter/Patch provided by: Sjur N. Moshagen
Patch applied. Thanks Sjur.

Added:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel-tabs.xmap
  (with props)
Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel-tabs.xmap
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel-tabs.xmap?view=auto&rev=491466
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel-tabs.xmap
(added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel-tabs.xmap
Sun Dec 31 11:08:06 2006
@@ -0,0 +1,78 @@
+<?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:components>
+    <map:pipes default="caching" />
+    <map:generators default="file" />
+    <map:transformers default="xslt">
+      <map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer">
+        <catalogues default="tabs">
+          <catalogue id="tabs" name="tabs" location="{lm:project.translations}"/>
+        </catalogues>
+        <cache-at-startup>true</cache-at-startup>
+      </map:transformer>
+    </map:transformers>
+    <map:serializers default="xml" />
+  </map:components>
+  <map:pipelines>
+    <!--
+      businessHelper for the TABs. It needs to be in a separate sitemap for proper
+      i18n - the i18nTransformer can have only one default catalogue, and to avoid
+      having to state the catalogue on every key, we utilise a separate sitemap.
+    -->
+    <map:pipeline>
+      <!-- navigation for the current request PART tab-->
+      <map:match pattern="**.tab.xml">
+        <map:select type="exists">
+          <map:when test="{properties:content.xdocs}tabs.xml">
+            <map:generate src="{properties:content.xdocs}tabs.xml" />
+          </map:when>
+          <map:when test="{lm:tabs.xml}">
+            <map:generate src="{lm:tabs.xml}" />
+          </map:when>
+          <map:otherwise>
+            <map:generate src="{properties:content.xdocs}tabs.xml" />
+          </map:otherwise>
+        </map:select>
+        <map:transform type="xinclude" />
+        <map:select type="config">
+          <map:parameter name="value" value="{properties:forrest.i18n}" />
+          <map:when test="true">
+            <map:act type="locale">
+              <map:transform src="{lm:transform.book.book-i18n}" />
+              <map:transform type="i18n">
+                <map:parameter name="locale" value="{locale}" />
+              </map:transform>
+            </map:act>
+          </map:when>
+        </map:select>
+        <map:match pattern="**/*.tab.xml">
+          <map:transform type="linkrewriter" src="cocoon://{1}/linkmap-{2}" />
+        </map:match>
+        <map:match pattern="*.tab.xml">
+          <map:transform type="linkrewriter" src="cocoon://linkmap-{1}" />
+        </map:match>
+        <map:transform src="{lm:dataModel-html-tab-to-menu.xsl}">
+          <!--<map:transform src="{lm:dataModel-html-tab2menu.xsl}">-->
+          <map:parameter name="path" value="{1}{2}.html" />
+        </map:transform>
+        <map:serialize />
+      </map:match>
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>
\ No newline at end of file

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel-tabs.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap?view=diff&rev=491466&r1=491465&r2=491466
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap
Sun Dec 31 11:08:06 2006
@@ -19,7 +19,14 @@
   <map:components>
     <map:pipes default="caching" />
     <map:generators default="file" />
-    <map:transformers default="xslt" />
+    <map:transformers default="xslt">
+      <map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer">
+        <catalogues default="menu">
+          <catalogue id="menu" name="menu" location="{lm:project.translations}"/>
+        </catalogues>
+        <cache-at-startup>true</cache-at-startup>
+      </map:transformer>
+    </map:transformers>
     <map:serializers default="xml" />
   </map:components>
   <map:pipelines>
@@ -110,42 +117,10 @@
       </map:match>
     </map:pipeline>
     <map:pipeline>
-      <!-- navigation for the current request PART tab-->
+      <!-- navigation for the current request PART tab: relegated to a separate
+           sitemap to allow proper i18n. -->
       <map:match pattern="**.tab.xml">
-        <map:select type="exists">
-          <map:when test="{properties:content.xdocs}tabs.xml">
-            <map:generate src="{properties:content.xdocs}tabs.xml" />
-          </map:when>
-          <map:when test="{lm:tabs.xml}">
-            <map:generate src="{lm:tabs.xml}" />
-          </map:when>
-          <map:otherwise>
-            <map:generate src="{properties:content.xdocs}tabs.xml" />
-          </map:otherwise>
-        </map:select>
-        <map:transform type="xinclude" />
-        <map:select type="config">
-          <map:parameter name="value" value="{properties:forrest.i18n}" />
-          <map:when test="true">
-            <map:act type="locale">
-              <map:transform src="{lm:transform.book.book-i18n}" />
-              <map:transform type="i18n">
-                <map:parameter name="locale" value="{locale}" />
-              </map:transform>
-            </map:act>
-          </map:when>
-        </map:select>
-        <map:match pattern="**/*.tab.xml">
-          <map:transform type="linkrewriter" src="cocoon://{1}/linkmap-{2}" />
-        </map:match>
-        <map:match pattern="*.tab.xml">
-          <map:transform type="linkrewriter" src="cocoon://linkmap-{1}" />
-        </map:match>
-        <map:transform src="{lm:dataModel-html-tab-to-menu.xsl}">
-          <!--<map:transform src="{lm:dataModel-html-tab2menu.xsl}">-->
-          <map:parameter name="path" value="{1}{2}.html" />
-        </map:transform>
-        <map:serialize />
+        <map:mount uri-prefix="" src="dataModel-tabs.xmap" check-reload="yes" />
       </map:match>
     </map:pipeline>
     <map:pipeline>



Mime
View raw message