svn commit: r796896 - in /ofbiz/trunk/framework: common/widget/CommonScreens.xml widget/src/org/ofbiz/widget/screen/ScreenRenderer.java

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

svn commit: r796896 - in /ofbiz/trunk/framework: common/widget/CommonScreens.xml widget/src/org/ofbiz/widget/screen/ScreenRenderer.java

adrianc
Author: adrianc
Date: Wed Jul 22 22:27:27 2009
New Revision: 796896

URL: http://svn.apache.org/viewvc?rev=796896&view=rev
Log:
Moved user preferences code from Global Decorator to ScreenRenderer.java. Now user preferences can be queried before the Global Decorator is run.

Modified:
    ofbiz/trunk/framework/common/widget/CommonScreens.xml
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java

Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=796896&r1=796895&r2=796896&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Wed Jul 22 22:27:27 2009
@@ -121,11 +121,6 @@
                 <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true"/>
                 <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" default-value="main" global="true"/>
-                <service service-name="getUserPreferenceGroup" result-map="prefResult">
-                    <field-map field-name="userPrefGroupTypeId" value="GLOBAL_PREFERENCES"/>
-                </service>
-                <set field="userPreferences" from-field="prefResult.userPrefMap" global="true"/>
-                
                 <property-map resource="general" map-name="generalProperties" global="true"/>
                 <set field="defaultVisualThemeId" from-field="generalProperties.defaultVisualThemeId" default-value="SMOOTH_FEATHER"/>
                 <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" default-value="${defaultVisualThemeId}" global="true"/>

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java?rev=796896&r1=796895&r2=796896&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java Wed Jul 22 22:27:27 2009
@@ -35,6 +35,7 @@
 import javolution.util.FastList;
 import javolution.util.FastMap;
 
+import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilFormatOut;
@@ -49,6 +50,7 @@
 import org.ofbiz.security.Security;
 import org.ofbiz.security.authz.Authorization;
 import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.webapp.control.LoginWorker;
 import org.ofbiz.widget.cache.GenericWidgetOutput;
@@ -159,6 +161,12 @@
         context.put("locale", locale);
         context.put("userLogin", userLogin);
         context.put("nowTimestamp", UtilDateTime.nowTimestamp());
+        try {
+            Map<String, Object> result = dispatcher.runSync("getUserPreferenceGroup", UtilMisc.toMap("userLogin", userLogin, "userPrefGroupTypeId", "GLOBAL_PREFERENCES"));
+            context.put("userPreferences", result.get("userPrefMap"));
+        } catch (GenericServiceException e) {
+            Debug.logError(e, "Error while getting user preferences: ", module);
+        }
     }
 
     /**