Author: hansbak
Date: Sat Apr 18 05:33:50 2009
New Revision: 766217
URL: http://svn.apache.org/viewvc?rev=766217&view=rev
Log:
improve form, remove debug messages and show with demo data how to render an
xml datResourceId using an ftl dataResourceId as template
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java
ofbiz/trunk/applications/content/widget/content/ContentForms.xml
ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java?rev=766217&r1=766216&r2=766217&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java
(original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java
Sat Apr 18 05:33:50 2009
@@ -104,7 +104,6 @@
}
} // if called through the default request, there is no request in
pathinfo
- Debug.log("========pathinfo: " + pathInfo);
// if path info is null; check for a default content
if (pathInfo == null) {
List<GenericValue> defaultContents = null;
@@ -182,7 +181,6 @@
contentId = pathInfo;
}
}
- Debug.log("========contentId: " + contentId);
// verify the request content is associated with the current
website
boolean websiteOk;
Modified: ofbiz/trunk/applications/content/widget/content/ContentForms.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/content/ContentForms.xml?rev=766217&r1=766216&r2=766217&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/content/ContentForms.xml (original)
+++ ofbiz/trunk/applications/content/widget/content/ContentForms.xml Sat Apr 18
05:33:50 2009
@@ -145,6 +145,13 @@
</sub-hyperlink>
</lookup>
</field>
+ <field name="templateDataResourceId">
+ <lookup target-form-name="LookupDataResource">
+ <sub-hyperlink link-style="buttontext"
target="EditDataResource" description="${uiLabelMap.ContentGoToDataResource}">
+ <parameter param-name="dataResourceId"
from-field="currentValue.templateDataResourceId"/>
+ </sub-hyperlink>
+ </lookup>
+ </field>
<field name="ownerContentId"><lookup
target-form-name="LookupContent"/></field>
<field name="decoratorContentId">
<lookup target-form-name="LookupContent">
Modified: ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml?rev=766217&r1=766216&r2=766217&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml (original)
+++ ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml Sat Apr 18
05:33:50 2009
@@ -81,6 +81,7 @@
<div><a
href="${thisContent.content.CMSS_DEMO_PAGE1.link}">Demo Page 1 - Dynamic
Link</a></div>
<div><a
href="${thisContent.content.CMSS_DEMO_SCREEN.link}">Demo Page with screen
widget and screen decorator</a></div>
<div><a href="${thisContent.content.CMSS_DEMO_BLOG.link}">Demo
Page with belog using screen decorator</a></div>
+ <div><a
href="${thisContent.content.CMSS_DEMO_TPL_DATA.link}">Demo Page with an xml
resource formatted with a template ftl resource</a></div>
</div>
]]></textData>
</ElectronicText>
@@ -122,6 +123,33 @@
<Content contentId="CMSS_DEMO_BLOG" contentTypeId="DOCUMENT"
contentName="CMS Site Demo blog screen example"
dataResourceId="CMSS_DEMO_BLOG"/>
<ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_BLOG"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
+ <DataResource dataResourceId="CMSS_DEMO_TPL_DATA" localeString="en"
dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="NONE"
statusId="CTNT_IN_PROGRESS" dataResourceName="data xml file"
mimeTypeId="text/xml" isPublic="Y"/>
+ <DataResource dataResourceId="CMSS_DEMO_TPL_TEMPL"
dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="FTL"
statusId="CTNT_IN_PROGRESS" dataResourceName="demo xml templ"
mimeTypeId="text/html" isPublic="Y" />
+ <Content contentId="CMSS_DEMO_TPL" contentTypeId="DOCUMENT"
templateDataResourceId="CMSS_DEMO_TPL_TEMPL"
dataResourceId="CMSS_DEMO_TPL_DATA" statusId="CTNT_IN_PROGRESS"
contentName="Demo xml data + ftl template file" mimeTypeId="text/html"/>
+ <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_TPL"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
+ <ElectronicText dataResourceId="CMSS_DEMO_TPL_DATA">
+ <textData><![CDATA[
+ <root>
+ <headerText>
+ Demo to show how to format a xml resource using an ftl
template dataresource.
+ </headerText>
+ <bodyText>
+ This is XML data in dataResourceId CMSS_DEMO_TPL_DATA
which is normal xml data, stored in a dataresource.<br/>
+ It is formatted using the ftl template in dataResourceId
CMSS_DEMO_TPL_TEMPL and rendered in the program renderContentAsText in
+ java file ContentWorker.java
+ </bodyText>
+ </root>
+ ]]></textData>
+ </ElectronicText>
+ <ElectronicText dataResourceId="CMSS_DEMO_TPL_TEMPL" >
+ <textData><![CDATA[
+ <h3>${doc.root.headerText}</h3>
+ ${doc.root.bodyText}
+ <br/><br/>
+ ]]></textData>
+ </ElectronicText>
+
+
<!--
CmsSite (WebSite)