You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2024/03/19 12:34:06 UTC

(ofbiz-framework) branch trunk updated: Improved: CommonExt - Move from hard-code menu location to parameterized (OFBIZ-12951) (#734)

This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a9fc12b902 Improved: CommonExt - Move from hard-code menu location to parameterized (OFBIZ-12951) (#734)
a9fc12b902 is described below

commit a9fc12b902a7faa8c077e10dfd95012b3becb9da
Author: Pierre Smits <pi...@somonar.com>
AuthorDate: Tue Mar 19 13:34:01 2024 +0100

    Improved: CommonExt - Move from hard-code menu location to parameterized (OFBIZ-12951) (#734)
    
    Move the menu location in various commonext screens from hard-coded to parameterized.
    
    modified re ofbizsetup:
    - web.xml - added context-param for mainMenuLocation
    - CommonScreens.xml
    - SetupScreens.xml
---
 applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml   | 5 +++++
 applications/commonext/widget/ofbizsetup/CommonScreens.xml | 4 ++--
 applications/commonext/widget/ofbizsetup/SetupScreens.xml  | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml b/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml
index 0312557b3b..bb9c92eaa0 100644
--- a/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml
+++ b/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml
@@ -38,6 +38,11 @@
         <param-name>mainDecoratorLocation</param-name>
         <param-value>component://commonext/widget/ofbizsetup/CommonScreens.xml</param-value>
     </context-param>
+    <context-param>
+        <description>The location of the menus file to be used in this webapp; referred to as a context variable in screen def XML files.</description>
+        <param-name>mainMenuLocation</param-name>
+        <param-value>component://commonext/widget/ofbizsetup/Menus.xml</param-value>
+    </context-param>
 
     <filter>
         <display-name>ControlFilter</display-name>
diff --git a/applications/commonext/widget/ofbizsetup/CommonScreens.xml b/applications/commonext/widget/ofbizsetup/CommonScreens.xml
index 7bdc2d78b2..7efafbc1e2 100644
--- a/applications/commonext/widget/ofbizsetup/CommonScreens.xml
+++ b/applications/commonext/widget/ofbizsetup/CommonScreens.xml
@@ -39,7 +39,7 @@
                     then the global layoutSettings.commonHeaderImageUrl (specified in GlobalDecorator) will be used. -->
                 <set field="activeApp" value="ofbizsetup" global="true"/>
                 <set field="applicationMenuName" value="SetupAppBar" global="true"/>
-                <set field="applicationMenuLocation" value="component://commonext/widget/ofbizsetup/Menus.xml" global="true"/>
+                <set field="applicationMenuLocation" value="${parameters.mainMenuLocation}" global="true"/>
                 <set field="applicationTitle" from-field="uiLabelMap.SetupApp" global="true"/>
                 <set field="helpAnchor" from-field="helpAnchor" default-value="_the_ofbiz_setup_application_overview"/>
             </actions>
@@ -78,7 +78,7 @@
                                 </and>
                             </condition>
                             <widgets>
-                                <include-menu name="SetupSubTabBar" location="component://commonext/widget/ofbizsetup/Menus.xml"/>
+                                <include-menu name="SetupSubTabBar" location="${parameters.mainMenuLocation}"/>
                             </widgets>
                         </section>
                         <section>
diff --git a/applications/commonext/widget/ofbizsetup/SetupScreens.xml b/applications/commonext/widget/ofbizsetup/SetupScreens.xml
index da15a60cd3..ed3e1c2c0d 100644
--- a/applications/commonext/widget/ofbizsetup/SetupScreens.xml
+++ b/applications/commonext/widget/ofbizsetup/SetupScreens.xml
@@ -345,7 +345,7 @@
                                 </or>      
                             </condition>
                             <widgets>
-                                <include-menu name="FirstProductTabBar" location="component://commonext/widget/ofbizsetup/Menus.xml"/>
+                                <include-menu name="FirstProductTabBar" location="${parameters.mainMenuLocation}"/>
                             </widgets>
                         </section>
                         <decorator-section-include name="body"/>