Author: lektran
Date: Fri Jun 18 08:38:41 2010 New Revision: 955885 URL: http://svn.apache.org/viewvc?rev=955885&view=rev Log: Merged from trunk r955882 (Except for an unused import that I accidentally committed): Controller events (post/preprocessor, first-visit, after-login etc.) without 'name' attributes were not being loaded into the controller properly since the switch to storing them in <String, Event> maps, fixed by deriving a name from the other element attributes when an explicit one isn't provided Modified: ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Modified: ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?rev=955885&r1=955884&r2=955885&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java (original) +++ ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Fri Jun 18 08:38:41 2010 @@ -318,7 +318,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)); } } @@ -326,7 +330,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)); } } @@ -334,7 +342,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)); } } @@ -342,7 +354,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)); } } @@ -350,7 +366,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)); } } } |
Free forum by Nabble | Edit this page |