ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaco...@apache.org
Subject svn commit: r1213627 - /ofbiz/branches/release09.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
Date Tue, 13 Dec 2011 09:32:16 GMT
Author: jacopoc
Date: Tue Dec 13 09:32:15 2011
New Revision: 1213627

URL: http://svn.apache.org/viewvc?rev=1213627&view=rev
Log:
Backported from rev. 955882 (by Scott Gray): Unnamed events in controller processor maps silently
override each other (OFBIZ-3961)

Modified:
    ofbiz/branches/release09.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java

Modified: ofbiz/branches/release09.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?rev=1213627&r1=1213626&r2=1213627&view=diff
==============================================================================
--- ofbiz/branches/release09.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
(original)
+++ ofbiz/branches/release09.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
Tue Dec 13 09:32:15 2011
@@ -177,7 +177,11 @@ public class ConfigXMLReader {
             Element firstvisitElement = UtilXml.firstChildElement(rootElement, "firstvisit");
             if (firstvisitElement != null) {
                 for (Element eventElement: UtilXml.childElementList(firstvisitElement, "event"))
{
-                    this.firstVisitEventList.put(eventElement.getAttribute("name"), new Event(eventElement));
+                    String eventName = eventElement.getAttribute("name");
+                    if (UtilValidate.isEmpty(eventName)) {
+                        eventName = eventElement.getAttribute("type") + "::" + eventElement.getAttribute("path")
+ "::" + eventElement.getAttribute("invoke");
+                    }
+                    this.firstVisitEventList.put(eventName, new Event(eventElement));
                 }
             }
 
@@ -185,7 +189,11 @@ public class ConfigXMLReader {
             Element preprocessorElement = UtilXml.firstChildElement(rootElement, "preprocessor");
             if (preprocessorElement != null) {
                 for (Element eventElement: UtilXml.childElementList(preprocessorElement,
"event")) {
-                    this.preprocessorEventList.put(eventElement.getAttribute("name"), new
Event(eventElement));
+                    String eventName = eventElement.getAttribute("name");
+                    if (UtilValidate.isEmpty(eventName)) {
+                        eventName = eventElement.getAttribute("type") + "::" + eventElement.getAttribute("path")
+ "::" + eventElement.getAttribute("invoke");
+                    }
+                    this.preprocessorEventList.put(eventName, new Event(eventElement));
                 }
             }
 
@@ -193,7 +201,11 @@ public class ConfigXMLReader {
             Element postprocessorElement = UtilXml.firstChildElement(rootElement, "postprocessor");
             if (postprocessorElement != null) {
                 for (Element eventElement: UtilXml.childElementList(postprocessorElement,
"event")) {
-                    this.postprocessorEventList.put(eventElement.getAttribute("name"), new
Event(eventElement));
+                    String eventName = eventElement.getAttribute("name");
+                    if (UtilValidate.isEmpty(eventName)) {
+                        eventName = eventElement.getAttribute("type") + "::" + eventElement.getAttribute("path")
+ "::" + eventElement.getAttribute("invoke");
+                    }
+                    this.postprocessorEventList.put(eventName, new Event(eventElement));
                 }
             }
 
@@ -201,7 +213,11 @@ public class ConfigXMLReader {
             Element afterLoginElement = UtilXml.firstChildElement(rootElement, "after-login");
             if (afterLoginElement != null) {
                 for (Element eventElement: UtilXml.childElementList(afterLoginElement, "event"))
{
-                    this.afterLoginEventList.put(eventElement.getAttribute("name"), new Event(eventElement));
+                    String eventName = eventElement.getAttribute("name");
+                    if (UtilValidate.isEmpty(eventName)) {
+                        eventName = eventElement.getAttribute("type") + "::" + eventElement.getAttribute("path")
+ "::" + eventElement.getAttribute("invoke");
+                    }
+                    this.afterLoginEventList.put(eventName, new Event(eventElement));
                 }
             }
 
@@ -209,7 +225,11 @@ public class ConfigXMLReader {
             Element beforeLogoutElement = UtilXml.firstChildElement(rootElement, "before-logout");
             if (beforeLogoutElement != null) {
                 for (Element eventElement: UtilXml.childElementList(beforeLogoutElement,
"event")) {
-                    this.beforeLogoutEventList.put(eventElement.getAttribute("name"), new
Event(eventElement));
+                    String eventName = eventElement.getAttribute("name");
+                    if (UtilValidate.isEmpty(eventName)) {
+                        eventName = eventElement.getAttribute("type") + "::" + eventElement.getAttribute("path")
+ "::" + eventElement.getAttribute("invoke");
+                    }
+                    this.beforeLogoutEventList.put(eventName, new Event(eventElement));
                 }
             }
         }



Mime
View raw message