Author: lektran
Date: Wed May 5 01:13:47 2010 New Revision: 941129 URL: http://svn.apache.org/viewvc?rev=941129&view=rev Log: Rearrange some local variables in the hope of making things more readable Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java?rev=941129&r1=941128&r2=941129&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java Wed May 5 01:13:47 2010 @@ -60,22 +60,25 @@ public class MenuWrapTransform implement @SuppressWarnings("unchecked") public Writer getWriter(final Writer out, Map args) { - Map<String, Object> checkedArgs = UtilGenerics.checkMap(args); - final StringBuilder buf = new StringBuilder(); final Environment env = Environment.getCurrentEnvironment(); - final Map<String, Object> templateCtx = UtilGenerics.checkMap(FreeMarkerWorker.getWrappedObject("context", env)); final Delegator delegator = (Delegator) FreeMarkerWorker.getWrappedObject("delegator", env); final HttpServletRequest request = (HttpServletRequest) FreeMarkerWorker.getWrappedObject("request", env); final HttpServletResponse response = (HttpServletResponse) FreeMarkerWorker.getWrappedObject("response", env); final HttpSession session = (HttpSession) FreeMarkerWorker.getWrappedObject("session", env); + + final GenericValue userLogin = (GenericValue) FreeMarkerWorker.getWrappedObject("userLogin", env); + final Map<String, Object> templateCtx = UtilGenerics.checkMap(FreeMarkerWorker.getWrappedObject("context", env)); + FreeMarkerWorker.getSiteParameters(request, templateCtx); + final Map<String, Object> savedValuesUp = new HashMap<String, Object>(); FreeMarkerWorker.saveContextValues(templateCtx, upSaveKeyNames, savedValuesUp); + + Map<String, Object> checkedArgs = UtilGenerics.checkMap(args); FreeMarkerWorker.overrideWithArgs(templateCtx, checkedArgs); //final String menuDefFile = (String)templateCtx.get("menuDefFile"); //final String menuName = (String)templateCtx.get("menuName"); //final String associatedContentId = (String)templateCtx.get("associatedContentId"); - final GenericValue userLogin = (GenericValue) FreeMarkerWorker.getWrappedObject("userLogin", env); List<Map<String, ? extends Object>> trail = UtilGenerics.checkList(templateCtx.get("globalNodeTrail")); String contentAssocPredicateId = (String)templateCtx.get("contentAssocPredicateId"); String strNullThruDatesOnly = (String)templateCtx.get("nullThruDatesOnly"); @@ -126,6 +129,8 @@ public class MenuWrapTransform implement final Map<String, Object> savedValues = new HashMap<String, Object>(); FreeMarkerWorker.saveContextValues(templateCtx, saveKeyNames, savedValues); + final StringBuilder buf = new StringBuilder(); + return new LoopWriter(out) { @Override |
Free forum by Nabble | Edit this page |