Author: lektran
Date: Mon Apr  5 21:42:28 2010
New Revision: 930968

URL: http://svn.apache.org/viewvc?rev=930968&view=rev
Log:
In ContentWorker.renderContentAsText, I've moved the check for a dataResourceId 
down to the point where the DataResource record actually needs to be rendered.  
If a decorator content is present then it is quite possible that the content 
record is simply being used as a plcaeholder to render sub content records.

Modified:
    
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java

Modified: 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=930968&r1=930967&r2=930968&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
 Mon Apr  5 21:42:28 2010
@@ -204,14 +204,7 @@ public class ContentWorker implements or
             }
         }
 
-        // get the data resource info
-        String templateDataResourceId = 
content.getString("templateDataResourceId");
-        String dataResourceId = content.getString("dataResourceId");
         String contentId = content.getString("contentId");
-        if (UtilValidate.isEmpty(dataResourceId)) {
-            Debug.logError("No dataResourceId found for contentId: " + 
content.getString("contentId"), module);
-            return;
-        }
 
         if (templateContext == null) {
             templateContext = FastMap.newInstance();
@@ -255,6 +248,14 @@ public class ContentWorker implements or
             templateContext.put("thisContent", decFacade); // decorator content
             ContentWorker.renderContentAsText(dispatcher, delegator, 
contentDecoratorId, out, templateContext, locale, mimeTypeId, null, null, 
cache);
         } else {
+            // get the data resource info
+            String templateDataResourceId = 
content.getString("templateDataResourceId");
+            String dataResourceId = content.getString("dataResourceId");
+            if (UtilValidate.isEmpty(dataResourceId)) {
+                Debug.logError("No dataResourceId found for contentId: " + 
content.getString("contentId"), module);
+                return;
+            }
+
             // set this content facade in the context
             templateContext.put("thisContent", facade);
             templateContext.put("contentId", contentId);


Reply via email to