svn commit: r1672849 - in /ofbiz/branches/release13.07/framework: common/src/org/ofbiz/common/email/NotificationServices.java webapp/src/org/ofbiz/webapp/control/RequestHandler.java webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java

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

svn commit: r1672849 - in /ofbiz/branches/release13.07/framework: common/src/org/ofbiz/common/email/NotificationServices.java webapp/src/org/ofbiz/webapp/control/RequestHandler.java webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java

Deepak Dixit-5
Author: deepak
Date: Sat Apr 11 09:06:56 2015
New Revision: 1672849

URL: http://svn.apache.org/r1672849
Log:
Manually applied fix from trunk r#1672846
============================================================
Applied patch from jira issue OFBIZ-6205 - Use EntityUtilProperties to get the WebSiteProperties

Thanks  Arun Patidar for reporting the issue and providing the patch.

Modified:
    ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java
    ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
    ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java

Modified: ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java?rev=1672849&r1=1672848&r2=1672849&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java (original)
+++ ofbiz/branches/release13.07/framework/common/src/org/ofbiz/common/email/NotificationServices.java Sat Apr 11 09:06:56 2015
@@ -40,6 +40,7 @@ import org.ofbiz.base.util.template.Free
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityUtilProperties;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
@@ -295,19 +296,19 @@ public class NotificationServices {
 
             // fill in any missing properties with fields from the global file
             if (UtilValidate.isEmpty(httpsPort)) {
-                httpsPort = UtilProperties.getPropertyValue("url.properties", "port.https", "443");
+                httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
             }
             if (UtilValidate.isEmpty(httpsServer)) {
-                httpsServer = UtilProperties.getPropertyValue("url.properties", "force.https.host", localServer);
+                httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", localServer, delegator);
             }
             if (UtilValidate.isEmpty(httpPort)) {
-                httpPort = UtilProperties.getPropertyValue("url.properties", "port.http", "80");
+                httpPort = EntityUtilProperties.getPropertyValue("url.properties", "port.http", "80", delegator);
             }
             if (UtilValidate.isEmpty(httpServer)) {
-                httpServer = UtilProperties.getPropertyValue("url.properties", "force.http.host", localServer);
+                httpServer = EntityUtilProperties.getPropertyValue("url.properties", "force.http.host", localServer, delegator);
             }
             if (UtilValidate.isEmpty(enableHttps)) {
-                enableHttps = (UtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y")) ? Boolean.TRUE : Boolean.FALSE;
+                enableHttps = (EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator)) ? Boolean.TRUE : Boolean.FALSE;
             }
 
             if (ClassLoaderContainer.portOffset != 0) {

Modified: ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1672849&r1=1672848&r2=1672849&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Sat Apr 11 09:06:56 2015
@@ -50,6 +50,7 @@ import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityUtilProperties;
 import org.ofbiz.webapp.event.EventFactory;
 import org.ofbiz.webapp.event.EventHandler;
 import org.ofbiz.webapp.event.EventHandlerException;
@@ -940,11 +941,12 @@ public class RequestHandler {
     }
 
     public static String getDefaultServerRootUrl(HttpServletRequest request, boolean secure) {
-        String httpsPort = UtilProperties.getPropertyValue("url.properties", "port.https", "443");
-        String httpsServer = UtilProperties.getPropertyValue("url.properties", "force.https.host");
-        String httpPort = UtilProperties.getPropertyValue("url.properties", "port.http", "80");
-        String httpServer = UtilProperties.getPropertyValue("url.properties", "force.http.host");
-        boolean useHttps = UtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y");
+        Delegator delegator = (Delegator) request.getAttribute("delegator");
+        String httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
+        String httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", delegator);
+        String httpPort = EntityUtilProperties.getPropertyValue("url.properties", "port.http", "80", delegator);
+        String httpServer = EntityUtilProperties.getPropertyValue("url.properties", "force.http.host", delegator);
+        boolean useHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator);
 
         if (ClassLoaderContainer.portOffset != 0) {
             Integer httpPortValue = Integer.valueOf(httpPort);
@@ -1082,19 +1084,19 @@ public class RequestHandler {
 
         // fill in any missing properties with fields from the global file
         if (UtilValidate.isEmpty(httpsPort)) {
-            httpsPort = UtilProperties.getPropertyValue("url.properties", "port.https", "443");
+            httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
         }
         if (UtilValidate.isEmpty(httpsServer)) {
-            httpsServer = UtilProperties.getPropertyValue("url.properties", "force.https.host");
+            httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", delegator);
         }
         if (UtilValidate.isEmpty(httpPort)) {
-            httpPort = UtilProperties.getPropertyValue("url.properties", "port.http", "80");
+            httpPort = EntityUtilProperties.getPropertyValue("url.properties", "port.http", "80", delegator);
         }
         if (UtilValidate.isEmpty(httpServer)) {
-            httpServer = UtilProperties.getPropertyValue("url.properties", "force.http.host");
+            httpServer = EntityUtilProperties.getPropertyValue("url.properties", "force.http.host", delegator);
         }
         if (enableHttps == null) {
-            enableHttps = UtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y");
+            enableHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator);
         }
 
         if (ClassLoaderContainer.portOffset != 0) {

Modified: ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java?rev=1672849&r1=1672848&r2=1672849&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java (original)
+++ ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java Sat Apr 11 09:06:56 2015
@@ -35,12 +35,12 @@ import org.ofbiz.base.component.Componen
 import org.ofbiz.base.container.ClassLoaderContainer;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityUtilProperties;
 import org.ofbiz.webapp.control.RequestHandler;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -127,19 +127,19 @@ public class OfbizUrlTransform implement
                         }
                         // fill in any missing properties with fields from the global file
                         if (UtilValidate.isEmpty(httpsPort)) {
-                            httpsPort = UtilProperties.getPropertyValue("url.properties", "port.https", "443");
+                            httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
                         }
                         if (UtilValidate.isEmpty(httpsServer)) {
-                            httpsServer = UtilProperties.getPropertyValue("url.properties", "force.https.host");
+                            httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", delegator);
                         }
                         if (UtilValidate.isEmpty(httpPort)) {
-                            httpPort = UtilProperties.getPropertyValue("url.properties", "port.http", "80");
+                            httpPort = EntityUtilProperties.getPropertyValue("url.properties", "port.http", "80", delegator);
                         }
                         if (UtilValidate.isEmpty(httpServer)) {
-                            httpServer = UtilProperties.getPropertyValue("url.properties", "force.http.host");
+                            httpServer = EntityUtilProperties.getPropertyValue("url.properties", "force.http.host", delegator);
                         }
                         if (enableHttps == null) {
-                            enableHttps = UtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y");
+                            enableHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator);
                         }
                         
                         if (ClassLoaderContainer.portOffset != 0) {