svn commit: r576751 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java

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

svn commit: r576751 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java

byersa-3
Author: byersa
Date: Tue Sep 18 00:43:19 2007
New Revision: 576751

URL: http://svn.apache.org/viewvc?rev=576751&view=rev
Log:
writeDataResourceText was not getting rootDir correctly.

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=576751&r1=576750&r2=576751&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Tue Sep 18 00:43:19 2007
@@ -730,6 +730,12 @@
             if (context != null)
                 https = (String) context.get("https");
         }
+        
+        String rootDir = (String) templateContext.get("rootDir");
+        if (UtilValidate.isEmpty(rootDir)) {
+            if (context != null)
+                rootDir = (String) context.get("rootDir");
+        }
 
         String dataResourceId = dataResource.getString("dataResourceId");
         String dataResourceTypeId = dataResource.getString("dataResourceTypeId");
@@ -790,7 +796,6 @@
         } else if (dataResourceTypeId.endsWith("_FILE")) {
             String dataResourceMimeTypeId = dataResource.getString("mimeTypeId");
             String objectInfo = dataResource.getString("objectInfo");
-            String rootDir = (String) context.get("rootDir");
 
             if (dataResourceMimeTypeId == null || dataResourceMimeTypeId.startsWith("text")) {
                 renderFile(dataResourceTypeId, objectInfo, rootDir, out);