Author: jleroux
Date: Tue Oct 29 22:00:33 2013
New Revision: 1536905

URL: http://svn.apache.org/r1536905
Log:
A modified patch from  Gareth Carter for "NotificationServices.java 
prepareNotification does not allow component:// urls" 
https://issues.apache.org/jira/browse/OFBIZ-5374


The prepareNotification method in NotificationServices.java does not allow urls 
that start with component:// because its using UtilURL rather than 
FlexibleLocation. Here is a patch that adds FlexibleLocation. I am not sure if 
its best to remove UtilURL or not - that can be up to you.

jleroux: since FlexibleLocation.resolveLocation() supersedes 
UtilURL.fromResource() I used it instead

Modified:
    
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java

Modified: 
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java?rev=1536905&r1=1536904&r2=1536905&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java
 (original)
+++ 
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java
 Tue Oct 29 22:00:33 2013
@@ -28,10 +28,10 @@ import java.util.Map;
 import javolution.util.FastMap;
 
 import org.ofbiz.base.component.ComponentConfig.WebappInfo;
+import org.ofbiz.base.location.FlexibleLocation;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilProperties;
-import org.ofbiz.base.util.UtilURL;
 import org.ofbiz.base.util.template.FreeMarkerWorker;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.service.DispatchContext;
@@ -199,7 +199,7 @@ public class NotificationServices {
             setBaseUrl(delegator, webSiteId, templateData);
 
             // initialize the template reader and processor
-            URL templateUrl = UtilURL.fromResource(templateName);
+            URL templateUrl = FlexibleLocation.resolveLocation(templateName);
 
             if (templateUrl == null) {
                 Debug.logError("Problem getting the template URL: " + 
templateName + " not found", module);


Reply via email to