svn commit: r1857398 - in /ofbiz/ofbiz-framework/trunk: applications/product/widget/catalog/CatalogMenus.xml framework/common/widget/CommonScreens.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1857398 - in /ofbiz/ofbiz-framework/trunk: applications/product/widget/catalog/CatalogMenus.xml framework/common/widget/CommonScreens.xml

jleroux@apache.org
Author: jleroux
Date: Fri Apr 12 12:16:31 2019
New Revision: 1857398

URL: http://svn.apache.org/viewvc?rev=1857398&view=rev
Log:
Improved: Removes ecommerce links from applications
(OFBIZ-9241)

While working on OFBIZ-9206 I remembered how the ecommerce webapp is deeply
entrenched in some applications components. This can at least be tested with
product and catalog webapp.

    Get to catalog/control/EditProduct?productId=GZ-1000
    Click on the "Product Page" button => ecommerce

There are much more cases (96 occurrences actually) but most of them are not
hard dependencies.

Since the ecommerce component is now a plugin, we need to remove all ecommerce
links from applications, I even wonder if this issue is really an improvement
or should not be now considered a bug...

This is a temporary solution with a FIXME it was waiting for months and I
almost forgot it. There are better ideas in the Jira but nothing have been done
yet.


Thanks: Michael and Deepak for discussion and ideas

Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml
    ofbiz/ofbiz-framework/trunk/framework/common/widget/CommonScreens.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml?rev=1857398&r1=1857397&r2=1857398&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/widget/catalog/CatalogMenus.xml Fri Apr 12 12:16:31 2019
@@ -172,7 +172,12 @@ under the License.
         </menu-item>
         <menu-item name="ProductCategoryPage" title="${uiLabelMap.ProductCategoryPage}" widget-style="buttontext website">
             <condition>
-                <not><if-empty field="productCategory"/></not>
+                <not>
+                    <or>
+                        <if-empty field="productCategory"/>
+                        <if-compare field="isEcommercePresent" operator="equals" value="false"/><!-- FIXME this is only temporary a more elaborate solution would be preferred, see OFBIZ-9241 -->
+                    </or>
+                </not>
             </condition>
             <link target="/ecommerce/control/category" url-mode="plain">
                 <parameter param-name="category_id" from-field="productCategoryId"/>
@@ -533,7 +538,12 @@ under the License.
         </menu-item>
         <menu-item name="ProductProductPage" title="${uiLabelMap.ProductProductPage}">
             <condition>
-                <not><if-empty field="product"/></not>
+                <not>
+                    <or>
+                        <if-empty field="product"/>
+                        <if-compare field="isEcommercePresent" operator="equals" value="false"/><!-- FIXME this is only temporary a more elaborate solution would be preferred, see OFBIZ-9241 -->
+                    </or>
+                </not>
             </condition>
             <link target="/ecommerce/control/product" url-mode="inter-app">
                 <parameter param-name="product_id" from-field="productId"/>

Modified: ofbiz/ofbiz-framework/trunk/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/widget/CommonScreens.xml?rev=1857398&r1=1857397&r2=1857398&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/ofbiz-framework/trunk/framework/common/widget/CommonScreens.xml Fri Apr 12 12:16:31 2019
@@ -133,6 +133,8 @@ under the License.
                 <script location="component://common/groovyScripts/InitTheme.groovy"/>
                 <set field="commonDecoratorLocation" from-field="layoutSettings.VT_COMMON_DECO_LOC" default-value="component://common-theme/widget/CommonScreens.xml" global="true"/>
                 <set field="initialLocaleComplete" type="String" value="${groovy:parameters?.userLogin?.lastLocale}" default-value="${groovy:locale.toString()}" global="true"/>
+                <!-- FIXME this is only temporary a more elaborate solution would be preferred, see OFBIZ-9241 -->
+                <set field="isEcommercePresent" value="${groovy:null != org.apache.ofbiz.base.util.UtilURL.fromOfbizHomePath('plugins/ecommerce/ofbiz-component.xml')}" type="Boolean" global="true"/>
             </actions>
             <widgets />
         </section>