svn commit: r620647 - in /lenya/trunk/src: modules/menubar/ modules/menubar/resources/content/ modules/menubar/xslt/ webapp/ webapp/lenya/content/menus/ webapp/lenya/xslt/menu/ webapp/lenya/xslt/modules/

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Mon Feb 11 14:23:15 2008
New Revision: 620647

URL: http://svn.apache.org/viewvc?rev=620647&view=rev
Log:
Moving menu generation code to menubar module (cleaning up the core).

Added:
    lenya/trunk/src/modules/menubar/resources/content/emptyMenu.xml
      - copied unchanged from r620637, lenya/trunk/src/webapp/lenya/content/menus/emptyMenu.xml
    lenya/trunk/src/modules/menubar/xslt/menu2xhtml.xsl
      - copied unchanged from r620638, lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl
    lenya/trunk/src/modules/menubar/xslt/menu2xslt.xsl
      - copied unchanged from r619696, lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl
    lenya/trunk/src/modules/menubar/xslt/menubar2xhtml.xsl
      - copied unchanged from r620640, lenya/trunk/src/webapp/lenya/xslt/menu/menubar2xhtml.xsl
    lenya/trunk/src/modules/menubar/xslt/merge-menus.xsl
      - copied unchanged from r619696, lenya/trunk/src/webapp/lenya/xslt/menu/merge-menus.xsl
    lenya/trunk/src/modules/menubar/xslt/modules2include.xsl
      - copied unchanged from r620636, lenya/trunk/src/webapp/lenya/xslt/modules/modules2include.xsl
Removed:
    lenya/trunk/src/webapp/lenya/content/menus/emptyMenu.xml
    lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl
    lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl
    lenya/trunk/src/webapp/lenya/xslt/menu/menubar2xhtml.xsl
    lenya/trunk/src/webapp/lenya/xslt/menu/merge-menus.xsl
    lenya/trunk/src/webapp/lenya/xslt/modules/modules2include.xsl
Modified:
    lenya/trunk/src/modules/menubar/sitemap.xmap
    lenya/trunk/src/webapp/global-sitemap.xmap

Modified: lenya/trunk/src/modules/menubar/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/menubar/sitemap.xmap?rev=620647&r1=620646&r2=620647&view=diff
==============================================================================
--- lenya/trunk/src/modules/menubar/sitemap.xmap (original)
+++ lenya/trunk/src/modules/menubar/sitemap.xmap Mon Feb 11 14:23:15 2008
@@ -20,15 +20,124 @@
     
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
 
- <map:pipelines>
+  <map:pipelines>
+   
+    <map:pipeline>
+      <map:match pattern="dojo/**">
+        <map:read src="resource://org/apache/cocoon/dojo/resources/{1}"/>
+      </map:match>
+    </map:pipeline> 
+   
+    <map:pipeline internal-only="true">
+      
+      <!-- Generate a meta-stylesheet that adds the Lenya GUI menu to pages -->
+      <!-- {pub}/{area}/lenyaGui.xsl -->
+      <map:match pattern="*/*/lenyaGui.xsl">
+        <!-- no menu for revisions -->
+        <map:match type="request-parameter" pattern="lenya.revision">
+          <map:generate src="lenya/xslt/util/identity.xsl"/>
+          <map:serialize type="xml"/>
+        </map:match>
+        <!-- for everything else: --> 
+        <map:generate src="cocoon:/{1}/lenyaMenuBar.xml"/>
+        <map:transform type="menufilter"/>
+        <!-- Disable menu items according to usecase policies -->
+        <map:transform type="usecasemenu"/>
+        <map:transform src="fallback://lenya/modules/menubar/xslt/menubar2xhtml.xsl">
+          <map:parameter name="publicationid" value="{1}"/>
+          <map:parameter name="area" value="{2}"/>
+          <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
+          <map:parameter name="documentid" value="{page-envelope:document-uuid}"/>
+          <map:parameter name="userid" value="{access-control:user-id}"/>
+          <map:parameter name="servertime" value="{date-i18n:currentDate}"/>
+          <map:parameter name="workflowstate" value="{workflow:state}"/>
+          <map:parameter name="islive" value="{workflow:variable.is_live}"/>
+          <map:parameter name="usecase" value="{request-param:lenya.usecase}"/>
+          <map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/>
+          <map:parameter name="newMessages" value="{inbox:newMessageCount}"/>
+        </map:transform>
+        <map:transform type="i18n">
+          <map:parameter name="locale" value="{request:locale}"/>
+        </map:transform>
+        <!-- Generate the meta-stylesheet -->
+        <map:transform src="fallback://lenya/modules/menubar/xslt/menu2xslt.xsl">
+          <map:parameter name="publicationid" value="{1}"/>
+          <map:parameter name="area" value="{2}"/>
+          <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
+        </map:transform>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      
+      <!-- collect the menu items for the publication and all modules used in the publication -->
+      <!-- {pubId}/lenyaMenuBar.xml -->
+      <map:match pattern="*/lenyaMenuBar.xml">
+        <map:generate src="aggregate-fallback://config/publication.xml"/>
+        <map:transform src="fallback://lenya/modules/menubar/xslt/modules2include.xsl">
+          <map:parameter name="pub" value="{1}"/>
+        </map:transform>
+        <map:transform type="include"/>
+        <map:transform src="fallback://lenya/modules/menubar/xslt/merge-menus.xsl"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!--
+        FIXME: The following pipelines should be replaced by a direct inclusion of the menu XML,
+        so that the XML can be cached. This is not possible yet because we support dynamic menus
+        for backwards compatibility.
+      -->
+      
+      <!-- query menu items from modules (used by the xinclude above) -->
+      <!-- menu-xml/module/{area}/{module-id}.xml -->
+      <map:match pattern="menu-xml/module/*.xml">
+        <map:select type="resource-exists">
+          <map:when test="fallback://lenya/modules/{1}/config/menu.xml">
+            <map:generate src="fallback://lenya/modules/{1}/config/menu.xml"/>
+            <map:serialize type="xml"/>
+          </map:when>
+          <!-- @deprecated: Mount menus.xmap for backwards-compatibility reasons -->
+          <map:when test="fallback://lenya/modules/{1}/menus.xmap">
+            <map:mount uri-prefix="menu-xml/module/" src="{fallback:lenya/modules/{1}/menus.xmap}" check-reload="true" reload-method="synchron" pass-through="true"/>
+          </map:when>
+          <map:otherwise>
+            <map:generate src="resources/content/emptyMenu.xml"/>
+            <map:serialize type="xml"/>
+          </map:otherwise>
+        </map:select>
+      </map:match>
+      
+      <!-- include publication-specific menus -->
+      <!-- menu-xml/pub/{publication-id}/... -->
+      <map:match pattern="menu-xml/pub/*.xml" internal-only="true">
+        <map:select type="resource-exists">
+          <map:when test="fallback://config/menu.xml">
+            <map:generate src="fallback://config/menu.xml"/>
+            <map:serialize type="xml"/>
+          </map:when>
+          <!-- @deprecated: Mount menus.xmap for backwards-compatibility reasons -->
+          <map:otherwise>
+            <map:mount uri-prefix="menu-xml/pub/{1}" src="{fallback:menus.xmap}" check-reload="true" reload-method="synchron" pass-through="true"/>
+          </map:otherwise>
+        </map:select>
+      </map:match>
+      
+    </map:pipeline>
    
-   <map:pipeline>
-     <map:match pattern="dojo/**">
-       <map:read src="resource://org/apache/cocoon/dojo/resources/{1}"/>
-     </map:match>
-   </map:pipeline> 
 
-    <map:pipeline internal-only="true">  
+    <map:pipeline internal-only="true">
+      
+      <map:match pattern="addLenyaGui.xsl">
+        <map:select type="parameter">
+          <map:parameter name="parameter-selector-test" value="{page-envelope:area}"/>
+          <map:when test="live">
+            <map:generate src="context://lenya/xslt/util/identity.xsl"/>
+          </map:when>
+          <map:otherwise>
+            <map:generate src="fallback://lenya/modules/menubar/xslt/addLenyaGui.xsl"/>
+          </map:otherwise>
+        </map:select>
+        <map:serialize type="xml"/>
+      </map:match>
       
       <!-- AJAX menubar -->
       <!-- ajaxmenu/{1:pubId}/{2:area}/{3:...} -->

Modified: lenya/trunk/src/webapp/global-sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/global-sitemap.xmap?rev=620647&r1=620646&r2=620647&view=diff
==============================================================================
--- lenya/trunk/src/webapp/global-sitemap.xmap (original)
+++ lenya/trunk/src/webapp/global-sitemap.xmap Mon Feb 11 14:23:15 2008
@@ -125,92 +125,10 @@
       <!-- Generate a meta-stylesheet that adds the Lenya GUI menu to pages -->
       <!-- lenya-page/{publication-id}/{area}/... -->
       <map:match pattern="lenya-page/*/*/**">
-        <!-- no menu for revisions -->
-        <map:match type="request-parameter" pattern="lenya.revision">
-          <map:generate src="lenya/xslt/util/identity.xsl"/>
-          <map:serialize type="xml"/>
-        </map:match>
-        <!-- for everything else: --> 
-        <map:generate src="cocoon:/{1}/lenyaMenuBar.xml"/>
-        <map:transform type="menufilter"/>
-        <!-- Disable menu items according to usecase policies -->
-        <map:transform type="usecasemenu"/>
-        <map:transform src="fallback://lenya/xslt/menu/menubar2xhtml.xsl">
-          <map:parameter name="publicationid" value="{1}"/>
-          <map:parameter name="area" value="{2}"/>
-          <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
-          <map:parameter name="documentid" value="{page-envelope:document-uuid}"/>
-          <map:parameter name="userid" value="{access-control:user-id}"/>
-          <map:parameter name="servertime" value="{date-i18n:currentDate}"/>
-          <map:parameter name="workflowstate" value="{workflow:state}"/>
-          <map:parameter name="islive" value="{workflow:variable.is_live}"/>
-          <map:parameter name="usecase" value="{request-param:lenya.usecase}"/>
-          <map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/>
-          <map:parameter name="newMessages" value="{inbox:newMessageCount}"/>
-        </map:transform>
-        <map:call resource="i18n"/>
-        <!-- Generate the meta-stylesheet -->
-        <map:transform src="fallback://lenya/xslt/menu/menu2xslt.xsl">
-          <map:parameter name="publicationid" value="{1}"/>
-          <map:parameter name="area" value="{2}"/>
-          <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
-        </map:transform>
+        <map:generate src="cocoon://modules/menubar/{1}/{2}/lenyaGui.xsl"/>
         <map:serialize type="xml"/>
       </map:match>
-
-
-      <!-- collect the menu items for the publication and all modules used in the publication -->
-      <!-- {pubId}/lenyaMenuBar.xml -->
-      <map:match pattern="*/lenyaMenuBar.xml">
-        <map:generate src="aggregate-fallback://config/publication.xml"/>
-        <map:transform src="lenya/xslt/modules/modules2include.xsl">
-          <map:parameter name="pub" value="{1}"/>
-        </map:transform>
-        <map:transform type="include"/>
-        <map:transform src="lenya/xslt/menu/merge-menus.xsl"/>
-        <map:serialize type="xml"/>
-      </map:match>
-
-      <!--
-        FIXME: The following pipelines should be replaced by a direct inclusion of the menu XML,
-        so that the XML can be cached. This is not possible yet because we support dynamic menus
-        for backwards compatibility.
-      -->
       
-      <!-- query menu items from modules (used by the xinclude above) -->
-      <!-- menu-xml/module/{area}/{module-id}.xml -->
-      <map:match pattern="menu-xml/module/*.xml">
-        <map:select type="resource-exists">
-          <map:when test="fallback://lenya/modules/{1}/config/menu.xml">
-            <map:generate src="fallback://lenya/modules/{1}/config/menu.xml"/>
-            <map:serialize type="xml"/>
-          </map:when>
-          <!-- @deprecated: Mount menus.xmap for backwards-compatibility reasons -->
-          <map:when test="fallback://lenya/modules/{1}/menus.xmap">
-            <map:mount uri-prefix="menu-xml/module/" src="{fallback:lenya/modules/{1}/menus.xmap}" check-reload="true" reload-method="synchron" pass-through="true"/>
-          </map:when>
-          <map:otherwise>
-            <map:generate src="lenya/content/menus/emptyMenu.xml"/>
-            <map:serialize type="xml"/>
-          </map:otherwise>
-        </map:select>
-      </map:match>
-
-      <!-- include publication-specific menus -->
-      <!-- menu-xml/pub/{publication-id}/... -->
-      <map:match pattern="menu-xml/pub/*.xml" internal-only="true">
-        <map:select type="resource-exists">
-          <map:when test="fallback://lenya/pubs/{1}/config/menu.xml">
-            <map:generate src="fallback://lenya/pubs/{1}/config/menu.xml"/>
-            <map:serialize type="xml"/>
-          </map:when>
-          <!-- @deprecated: Mount menus.xmap for backwards-compatibility reasons -->
-          <map:otherwise>
-            <map:mount uri-prefix="menu-xml/pub/{1}" src="{fallback:menus.xmap}" check-reload="true" reload-method="synchron" pass-through="true"/>
-          </map:otherwise>
-        </map:select>
-      </map:match>
-
       <!-- FIXME: this is currently unused -->
       <!-- Access Control Policies -->
 <!--
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.