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 2012/12/29 18:14:17 UTC

svn commit: r1426787 - in /ofbiz/trunk: applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/ specialpurpose/ecommerce/script/org/ofbiz/ecommerce/misc/ specialpurpose/ecommerce/w...

Author: jleroux
Date: Sat Dec 29 17:14:16 2012
New Revision: 1426787

URL: http://svn.apache.org/viewvc?rev=1426787&view=rev
Log:
Fix an issue reported by Duc Trung NGUYEN on user ML:
>  I tried to test the theme multiflex (for ecommerce) and detect a small
> problem as the following: (USING http://demo-trunk.ofbiz.apache.org)
> 
> 1.connect to catalog manager
> 2.go to "store" tab and select the store with id 9000
> 3.change its viual theme to MULTIFLEX
> 
> 4.open the ecommerce site (it's ok with new theme)
> 5.select a catagory from the categories menu on the left side.
> 6.select another language
> 
> And the problem come up:
> The theme now is EC_DEFAULT instead of MULTIFLEX

It was related to a not finished change introduced with  http://svn.apache.org/viewvc?view=revision&revision=1128983
I mean the addCheckValue request and sequel... 

I briefly tried to do it in a simpler way using a redirected parameter on setSessionLocale request, but got issue, gave up and simply reused the same way but moved the simple method from AffiliateSimpleEvents.xml to CustomerEvents.xml

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy
    ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
    ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/misc/AffiliateSimpleEvents.xml
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/ecommerce/widget/CatalogScreens.xml

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy?rev=1426787&r1=1426786&r2=1426787&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy Sat Dec 29 17:14:16 2012
@@ -27,6 +27,7 @@ import org.ofbiz.entity.*;
 import org.ofbiz.product.catalog.*;
 import org.ofbiz.product.category.CategoryWorker;
 import org.ofbiz.product.category.CategoryContentWrapper;
+import org.ofbiz.product.store.ProductStoreWorker;
 
 detailScreen = "categorydetail";
 catalogName = CatalogWorker.getCatalogName(request);
@@ -34,6 +35,8 @@ catalogName = CatalogWorker.getCatalogNa
 productCategoryId = request.getAttribute("productCategoryId") ?: parameters.category_id;
 context.productCategoryId = productCategoryId;
 
+context.productStore = ProductStoreWorker.getProductStore(request);
+
 pageTitle = null;
 metaDescription = null;
 metaKeywords = null;

Modified: ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml?rev=1426787&r1=1426786&r2=1426787&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml Sat Dec 29 17:14:16 2012
@@ -1314,4 +1314,9 @@ under the License.
             <default-message property="CommonGenericServiceSuccessMessage" resource="CommonUiLabels"></default-message>
         </call-service>
     </simple-method>
+    <simple-method method-name="fromSetSessionLocale" 
+      short-description="Add field to request for redirection after SetSessionLocale" login-required="false">
+        <set field="fromSetSessionLocale" value="true"/>
+        <field-to-request field="fromSetSessionLocale" request-name="fromSetSessionLocale"/>
+    </simple-method>    
 </simple-methods>

Modified: ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/misc/AffiliateSimpleEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/misc/AffiliateSimpleEvents.xml?rev=1426787&r1=1426786&r2=1426787&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/misc/AffiliateSimpleEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/misc/AffiliateSimpleEvents.xml Sat Dec 29 17:14:16 2012
@@ -126,10 +126,5 @@ under the License.
         <call-service service-name="createAffiliate" in-map-name="af_context">
             <default-message resource="EcommerceUiLabels" property="EcommerceAffiliateCreatedSuccessfully"/>
         </call-service>
-
-    </simple-method>
-    <simple-method method-name="addCheckValue" short-description="Add field to request for investigation purpose" login-required="false">
-        <set field="checkValue" value="check" type="PlainString"/>
-        <field-to-request field="checkValue" request-name="checkValue"/>
     </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=1426787&r1=1426786&r2=1426787&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Sat Dec 29 17:14:16 2012
@@ -132,7 +132,7 @@ under the License.
     <request-map uri="setSessionLocale">
         <security https="false" auth="false"/>
         <event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionLocale"/>
-        <response name="success" type="request-redirect" value="checkValue"/>
+        <response name="success" type="request-redirect" value="fromSetSessionLocale"/>        
         <response name="error" type="view" value="main"/>
     </request-map>
 
@@ -1966,8 +1966,8 @@ under the License.
         <security https="true" auth="false"/>
         <response name="success" type="view" value="productCategoryList" save-current-view="true"/>
     </request-map>
-    <request-map uri="checkValue">
-        <event type="simple" path="component://ecommerce/script/org/ofbiz/ecommerce/misc/AffiliateSimpleEvents.xml" invoke="addCheckValue"/>
+    <request-map uri="fromSetSessionLocale">
+        <event type="simple" path="component://ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml" invoke="fromSetSessionLocale"/>
         <response name="success" type="view-last" value="main"/>
         <response name="error" type="view" value="main"/>
     </request-map>

Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CatalogScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CatalogScreens.xml?rev=1426787&r1=1426786&r2=1426787&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/widget/CatalogScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/widget/CatalogScreens.xml Sat Dec 29 17:14:16 2012
@@ -534,7 +534,7 @@ under the License.
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy"/>
-                <set field="check" type="PlainString" value="${groovy: return request.getAttribute('checkValue');}"/>
+                <set field="fromSetSessionLocale" value="${groovy: return request.getAttribute('fromSetSessionLocale');}"/>
                 <set field="visualThemeId" from-field="productStore.visualThemeId" default-value="EC_DEFAULT"/>
                 <service service-name="getVisualThemeResources">
                     <field-map field-name="visualThemeId"/>
@@ -545,7 +545,7 @@ under the License.
             <widgets>
                 <section>
                     <condition>
-                        <if-compare operator="equals" value="check" field="check" type="PlainString"/>
+                        <if-compare operator="equals" value="true" field="fromSetSessionLocale"/>
                     </condition>
                     <widgets>
                         <include-screen name="category"/>