svn commit: r671564 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java

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

svn commit: r671564 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java

jonesde
Author: jonesde
Date: Wed Jun 25 07:31:29 2008
New Revision: 671564

URL: http://svn.apache.org/viewvc?rev=671564&view=rev
Log:
Changed so that the parameters Map is more consistent with the one in the screen widget,, other small cleanups

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java?rev=671564&r1=671563&r2=671564&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java Wed Jun 25 07:31:29 2008
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -15,20 +15,21 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *******************************************************************************/
+ */
 package org.ofbiz.webapp.event;
 
 import java.util.Map;
+
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import javolution.util.FastMap;
+
 import org.ofbiz.base.util.GroovyUtil;
 import org.ofbiz.base.util.UtilHttp;
-import org.ofbiz.entity.GenericValue;
-
-import javolution.util.FastMap;
+import org.ofbiz.base.util.UtilMisc;
 
 public class GroovyEventHandler implements EventHandler {
     
@@ -42,16 +43,16 @@
             Map<String, Object> groovyContext = FastMap.newInstance();
             groovyContext.put("request", request);
             groovyContext.put("response", response);
+            HttpSession session = request.getSession();
+            groovyContext.put("session", session);
 
             groovyContext.put("dispatcher", request.getAttribute("dispatcher"));
             groovyContext.put("delegator", request.getAttribute("delegator"));
             groovyContext.put("security", request.getAttribute("security"));
             groovyContext.put("locale", UtilHttp.getLocale(request));
             groovyContext.put("timeZone", UtilHttp.getTimeZone(request));
-            HttpSession session = request.getSession();
-            groovyContext.put("session", session);
             groovyContext.put("userLogin", session.getAttribute("userLogin"));
-            groovyContext.put("parameters", request.getParameterMap());
+            groovyContext.put("parameters", UtilHttp.getCombinedMap(request, UtilMisc.toSet("delegator", "dispatcher", "security", "locale", "timeZone", "userLogin")));
 
             Object result = GroovyUtil.runScriptAtLocation(eventPath + eventMethod, groovyContext);
             // check the result