You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by th...@apache.org on 2005/11/07 15:39:06 UTC

svn commit: r331273 - /lenya/trunk/src/webapp/global-sitemap.xmap

Author: thorsten
Date: Mon Nov  7 06:39:02 2005
New Revision: 331273

URL: http://svn.apache.org/viewcvs?rev=331273&view=rev
Log:
Added a fallback for module specific menu generation. Now you can override the menus provided by the modules. e.g. If you want to override the menu provided by the xhtml module, just create a file in pub-id/conf/menus/xhtml.xsp and provide your own menu implementation for the module.

Modified:
    lenya/trunk/src/webapp/global-sitemap.xmap

Modified: lenya/trunk/src/webapp/global-sitemap.xmap
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/global-sitemap.xmap?rev=331273&r1=331272&r2=331273&view=diff
==============================================================================
--- lenya/trunk/src/webapp/global-sitemap.xmap (original)
+++ lenya/trunk/src/webapp/global-sitemap.xmap Mon Nov  7 06:39:02 2005
@@ -237,6 +237,10 @@
       <!-- menu-xml/module/{module-id}/{area}.xml -->
       <map:match pattern="menu-xml/module/*/*.xml">
         <map:select type="resource-exists">
+          <map:when test="fallback://config/menus/{2}.xsp">
+            <map:generate type="serverpages" src="fallback://config/menus/{2}.xsp"/>
+            <map:serialize type="xml"/>
+          </map:when>
           <map:when test="lenya/modules/{2}/menus.xmap">
             <map:mount uri-prefix="menu-xml/module/{1}/" src="lenya/modules/{2}/menus.xmap" check-reload="true" reload-method="synchron"/>
           </map:when>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org


Re: svn commit: r331273 - /lenya/trunk/src/webapp/global-sitemap.xmap

Posted by Andreas Hartmann <an...@apache.org>.
Felix Röthenbacher wrote:

[...]

>> IMO the fallback should be used in the module's menus.xmap, when the XSP
>> is loaded. We shouldn't add XSP locations to the contract.
>>
>> WDYT?
> 
> 
> +1
> 
> Then I would suggest to fallback enable the menus.xmap:
> 
> Index: src/webapp/global-sitemap.xmap
> ===================================================================
> --- src/webapp/global-sitemap.xmap      (revision 344071)
> +++ src/webapp/global-sitemap.xmap      (working copy)
> @@ -241,8 +241,8 @@
>              <map:generate type="serverpages" 
> src="fallback://config/menus/{2}.xsp"/>
>              <map:serialize type="xml"/>
>            </map:when>
> -          <map:when test="lenya/modules/{2}/menus.xmap">
> -            <map:mount uri-prefix="menu-xml/module/{1}/" 
> src="lenya/modules/{2}/menus.xmap" check-reload="true" 
> reload-method="synchron"/>
> +          <map:when test="fallback://lenya/modules/{2}/menus.xmap">
> +            <map:mount uri-prefix="menu-xml/module/{1}/" 
> src="fallback://lenya/modules/{2}/menus.xmap" check-reload="true" 
> reload-method="synchron"/>

Yes, that is probably the cleanest and most flexible solution.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: svn commit: r331273 - /lenya/trunk/src/webapp/global-sitemap.xmap

Posted by Felix Röthenbacher <fe...@wyona.com>.

Andreas Hartmann wrote:
> thorsten@apache.org wrote:
> 
>> Author: thorsten
>> Date: Mon Nov  7 06:39:02 2005
>> New Revision: 331273
>>
>> URL: http://svn.apache.org/viewcvs?rev=331273&view=rev
>> Log:
>> Added a fallback for module specific menu generation. Now you can 
>> override the menus provided by the modules. e.g. If you want to 
>> override the menu provided by the xhtml module, just create a file in 
>> pub-id/conf/menus/xhtml.xsp and provide your own menu implementation 
>> for the module.
>>
>> Modified:
>>     lenya/trunk/src/webapp/global-sitemap.xmap
>>
>> Modified: lenya/trunk/src/webapp/global-sitemap.xmap
>> URL: 
>> http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/global-sitemap.xmap?rev=331273&r1=331272&r2=331273&view=diff 
>>
>> ============================================================================== 
>>
>> --- lenya/trunk/src/webapp/global-sitemap.xmap (original)
>> +++ lenya/trunk/src/webapp/global-sitemap.xmap Mon Nov  7 06:39:02 2005
>> @@ -237,6 +237,10 @@
>>        <!-- menu-xml/module/{module-id}/{area}.xml -->
>>        <map:match pattern="menu-xml/module/*/*.xml">
>>          <map:select type="resource-exists">
>> +          <map:when test="fallback://config/menus/{2}.xsp">
>> +            <map:generate type="serverpages" 
>> src="fallback://config/menus/{2}.xsp"/>
>> +            <map:serialize type="xml"/>
>> +          </map:when>
> 
> 
> IMO the fallback should be used in the module's menus.xmap, when the XSP
> is loaded. We shouldn't add XSP locations to the contract.
> 
> WDYT?

+1

Then I would suggest to fallback enable the menus.xmap:

Index: src/webapp/global-sitemap.xmap
===================================================================
--- src/webapp/global-sitemap.xmap      (revision 344071)
+++ src/webapp/global-sitemap.xmap      (working copy)
@@ -241,8 +241,8 @@
              <map:generate type="serverpages" 
src="fallback://config/menus/{2}.xsp"/>
              <map:serialize type="xml"/>
            </map:when>
-          <map:when test="lenya/modules/{2}/menus.xmap">
-            <map:mount uri-prefix="menu-xml/module/{1}/" 
src="lenya/modules/{2}/menus.xmap" check-reload="true" 
reload-method="synchron"/>
+          <map:when test="fallback://lenya/modules/{2}/menus.xmap">
+            <map:mount uri-prefix="menu-xml/module/{1}/" 
src="fallback://lenya/modules/{2}/menus.xmap" check-reload="true" 
reload-method="synchron"/>
            </map:when>
            <map:otherwise>
              <map:generate type="serverpages" 
src="lenya/content/menus/live.xsp"/>


- Felix

> 
> -- Andreas
> 

-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: svn commit: r331273 - /lenya/trunk/src/webapp/global-sitemap.xmap

Posted by Andreas Hartmann <an...@apache.org>.
thorsten@apache.org wrote:
> Author: thorsten
> Date: Mon Nov  7 06:39:02 2005
> New Revision: 331273
> 
> URL: http://svn.apache.org/viewcvs?rev=331273&view=rev
> Log:
> Added a fallback for module specific menu generation. Now you can override the menus provided by the modules. e.g. If you want to override the menu provided by the xhtml module, just create a file in pub-id/conf/menus/xhtml.xsp and provide your own menu implementation for the module.
> 
> Modified:
>     lenya/trunk/src/webapp/global-sitemap.xmap
> 
> Modified: lenya/trunk/src/webapp/global-sitemap.xmap
> URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/global-sitemap.xmap?rev=331273&r1=331272&r2=331273&view=diff
> ==============================================================================
> --- lenya/trunk/src/webapp/global-sitemap.xmap (original)
> +++ lenya/trunk/src/webapp/global-sitemap.xmap Mon Nov  7 06:39:02 2005
> @@ -237,6 +237,10 @@
>        <!-- menu-xml/module/{module-id}/{area}.xml -->
>        <map:match pattern="menu-xml/module/*/*.xml">
>          <map:select type="resource-exists">
> +          <map:when test="fallback://config/menus/{2}.xsp">
> +            <map:generate type="serverpages" src="fallback://config/menus/{2}.xsp"/>
> +            <map:serialize type="xml"/>
> +          </map:when>

IMO the fallback should be used in the module's menus.xmap, when the XSP
is loaded. We shouldn't add XSP locations to the contract.

WDYT?

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org