svn commit: r464510 - /incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java

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

svn commit: r464510 - /incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java

jonesde
Author: jonesde
Date: Mon Oct 16 07:57:07 2006
New Revision: 464510

URL: http://svn.apache.org/viewvc?view=rev&rev=464510
Log:
A small change to put a session variable in the environment for simple methods called as an event

Modified:
    incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java

Modified: incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java?view=diff&rev=464510&r1=464509&r2=464510
==============================================================================
--- incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java (original)
+++ incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java Mon Oct 16 07:57:07 2006
@@ -261,6 +261,7 @@
 
     // event fields
     protected String eventRequestName;
+    protected String eventSessionName;
     protected String eventResponseName;
     protected String eventResponseCodeName;
     protected String eventErrorMessageName;
@@ -309,6 +310,10 @@
         if (eventRequestName == null || eventRequestName.length() == 0) {
             eventRequestName = "request";
         }
+        eventSessionName = simpleMethodElement.getAttribute("event-session-object-name");
+        if (eventSessionName == null || eventSessionName.length() == 0) {
+            eventSessionName = "session";
+        }
         eventResponseName = simpleMethodElement.getAttribute("event-response-object-name");
         if (eventResponseName == null || eventResponseName.length() == 0) {
             eventResponseName = "response";
@@ -420,6 +425,10 @@
         return this.eventRequestName;
     }
 
+    public String getEventSessionName() {
+        return this.eventSessionName;
+    }
+
     public String getEventResponseCodeName() {
         return this.eventResponseCodeName;
     }
@@ -497,6 +506,7 @@
 
         if (methodContext.getMethodType() == MethodContext.EVENT) {
             methodContext.putEnv(eventRequestName, methodContext.getRequest());
+            methodContext.putEnv(eventSessionName, methodContext.getRequest().getSession());
             methodContext.putEnv(eventResponseName, methodContext.getResponse());
         }