Author: jleroux
Date: Wed Jan 19 10:28:01 2011
New Revision: 1060744

URL: http://svn.apache.org/viewvc?rev=1060744&view=rev
Log:
A slightly modified patch from Sascha "In Content Manager's CMS sub-module 
CMSContentFind page doesn't show the content list." 
(https://issues.apache.org/jira/browse/OFBIZ-2746) - OFBIZ-2746

Sascha: There are some more issues in the groovy file
In entity field [ContentAssoc.fromDate] set the value passed in 
[java.lang.String] is not compatible with the Java type of the field 
[java.sql.Timestamp]
I'm not quite sure why this is going wrong. Maybe we have to explicitly create 
an Timestamp here.
DataResourceWorker.getDataResourceTextCache(dataResource, "text/html", 
Locale.getDefault(), templateRoot, delegator);
should be replaced with
DataResourceWorker.getDataResourceText(dataResource, "text/html", 
Locale.getDefault(), templateRoot, delegator, true);

JLR: this patch allows now to create a content from CMSContentFind but I'm not 
quire sure all is resolved. I jave also set the fromDate field in the calling 
screen as Timestamp type, not sure it's needed but it can't hurt. Nevertheless 
I think there are still some issues. But at least now it does not break


Modified:
    
ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/cms/CmsEditAddPrep.groovy
    ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml

Modified: 
ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/cms/CmsEditAddPrep.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/cms/CmsEditAddPrep.groovy?rev=1060744&r1=1060743&r2=1060744&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/cms/CmsEditAddPrep.groovy
 (original)
+++ 
ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/cms/CmsEditAddPrep.groovy
 Wed Jan 19 10:28:01 2011
@@ -22,6 +22,7 @@ import org.ofbiz.minilang.SimpleMapProce
 import org.ofbiz.content.ContentManagementWorker
 import org.ofbiz.content.content.ContentWorker
 import org.ofbiz.content.data.DataResourceWorker
+import org.ofbiz.webapp.ftl.FreeMarkerViewHandler
 
 userLogin = session.getAttribute("userLogin");
 contentAssocDataResourceViewFrom = 
delegator.makeValue("ContentAssocDataResourceViewFrom");
@@ -71,8 +72,8 @@ if (dataResourceId) {
     
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml",
 "dataResourceOut", dataResource, contentAssocDataResourceViewFrom, new 
ArrayList(), Locale.getDefault());
     templateRoot = [:];
     FreeMarkerViewHandler.prepOfbizRoot(templateRoot, request, response);
-    txt = DataResourceWorker.getDataResourceTextCache(dataResource, 
"text/html", Locale.getDefault(), templateRoot, delegator);
-    
+    txt = DataResourceWorker.getDataResourceText(dataResource, "text/html", 
Locale.getDefault(), templateRoot, delegator, true);
+
     if (txt) {
         textData = UtilFormatOut.encodeXmlValue(txt);
     }

Modified: ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml?rev=1060744&r1=1060743&r2=1060744&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/cms/CMSScreens.xml Wed Jan 19 
10:28:01 2011
@@ -121,7 +121,7 @@ under the License.
                 <set field="MASTER_caContentIdTo" 
from-field="parameters.MASTER_caContentIdTo" 
default-value="${parameters.caContentIdTo}"/>
                 <set field="MASTER_caContentId" 
from-field="parameters.MASTER_caContentId" 
default-value="${parameters.caContentIdFrom}"/>
                 <set field="MASTER_caContentAssocTypeId" 
from-field="parameters.MASTER_caContentAssocTypeId" 
default-value="${parameters.caContentAssocTypeId}"/>
-                <set field="MASTER_caFromDate" 
from-field="parameters.MASTER_caFromDate" 
default-value="${parameters.caFromDate}"/>
+                <set field="MASTER_caFromDate" 
from-field="parameters.MASTER_caFromDate" 
default-value="${parameters.caFromDate}" type="Timestamp"/>
 
                 <set field="contentId" from-field="MASTER_contentId"/>
                 <set field="drDataResourceId" 
from-field="MASTER_drDataResourceId"/>
@@ -162,7 +162,7 @@ under the License.
                 <set field="MASTER_caContentIdTo" 
from-field="parameters.MASTER_caContentIdTo"/>
                 <set field="MASTER_caContentId" 
from-field="parameters.MASTER_caContentId"/>
                 <set field="MASTER_caContentAssocTypeId" 
from-field="parameters.MASTER_caContentAssocTypeId"/>
-                <set field="MASTER_caFromDate" 
from-field="parameters.MASTER_caFromDate"/>
+                <set field="MASTER_caFromDate" 
from-field="parameters.MASTER_caFromDate" type="Timestamp"/>
 
                 <set field="caContentIdTo" from-field="parameters.contentId"/>
                 <set field="caMapKey" from-field="parameters.mapKey"/>


Reply via email to