Author: jacopoc
Date: Wed Dec 3 07:17:12 2014
New Revision: 1643061
URL: http://svn.apache.org/r1643061
Log:
OFBIZ-5896 This commits fixes a regression I introduced with rev. 1635232 (this
actually reverts that commit) and provides a different and better fix for the
error affecting the "Did you know?" screenlet.
ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod was not
using the passed contentId in condition list, and also was not using the
ContentAssocDataResourceViewFrom/To view entity to get the result. Thanks to
Deepak Dixit for the patch.
Misc minor cleanups (removed commented out code) and some small formatting
fixes.
Modified:
ofbiz/trunk/applications/content/data/DemoBlogPubPtData.xml
ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml
ofbiz/trunk/specialpurpose/cmssite/template/cms/MainDecorator.ftl
ofbiz/trunk/specialpurpose/ecommerce/data/DemoWebSitePublishPointData.xml
ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/data/topic.ftl
Modified: ofbiz/trunk/applications/content/data/DemoBlogPubPtData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/data/DemoBlogPubPtData.xml?rev=1643061&r1=1643060&r2=1643061&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/data/DemoBlogPubPtData.xml (original)
+++ ofbiz/trunk/applications/content/data/DemoBlogPubPtData.xml Wed Dec 3
07:17:12 2014
@@ -34,7 +34,7 @@ under the License.
<ContentAssoc
contentId="BLOGROOT"
contentIdTo="BLOGROOTBIGAL"
- contentAssocTypeId="PUBLISH_LINK"
+ contentAssocTypeId="SUB_CONTENT"
fromDate="2004-11-22 17:32:33.987"
createdByUserLogin="admin"
lastModifiedByUserLogin="admin"
@@ -56,7 +56,7 @@ under the License.
<ContentAssoc
contentId="BLOGROOT"
contentIdTo="BLOGROOTMADMAX"
- contentAssocTypeId="PUBLISH_LINK"
+ contentAssocTypeId="SUB_CONTENT"
fromDate="2004-11-22 17:32:33.987"
createdByUserLogin="admin"
lastModifiedByUserLogin="admin"
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java?rev=1643061&r1=1643060&r2=1643061&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
(original)
+++
ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
Wed Dec 3 07:17:12 2014
@@ -564,7 +564,7 @@ public class ContentManagementWorker {
List<String> contentTypes = null;
// String fromDate = null;
// String thruDate = null;
- Map<String, Object> results =
ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator,
contentId, null, "To", null, null, assocTypes, contentTypes, Boolean.TRUE,
null);
+ Map<String, Object> results =
ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator,
contentId, null, "To", null, null, assocTypes, contentTypes, Boolean.TRUE,
null, null);
List<GenericValue> valueList =
UtilGenerics.checkList(results.get("entityList"));
if (valueList.size() > 0) {
GenericValue value = valueList.get(0);
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java?rev=1643061&r1=1643060&r2=1643061&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java
(original)
+++
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java
Wed Dec 3 07:17:12 2014
@@ -31,6 +31,7 @@ import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
@@ -186,7 +187,7 @@ public class ContentServicesComplex {
Boolean nullThruDatesOnly = (Boolean)context.get("nullThruDatesOnly");
Map<String, Object> results = null;
try {
- results = getAssocAndContentAndDataResourceCacheMethod(delegator,
contentId, mapKey, direction, fromDate, fromDateStr, assocTypes, contentTypes,
nullThruDatesOnly, contentAssocPredicateId);
+ results = getAssocAndContentAndDataResourceCacheMethod(delegator,
contentId, mapKey, direction, fromDate, fromDateStr, assocTypes, contentTypes,
nullThruDatesOnly, contentAssocPredicateId, null);
} catch (GenericEntityException e) {
return ServiceUtil.returnError(e.getMessage());
} catch (MiniLangException e2) {
@@ -195,57 +196,47 @@ public class ContentServicesComplex {
return results;
}
-
- public static Map<String, Object>
getAssocAndContentAndDataResourceCacheMethod(Delegator delegator, String
contentId, String mapKey, String direction,
- Timestamp fromDate, String fromDateStr, List<String>
assocTypes, List<String> contentTypes, Boolean nullThruDatesOnly, String
contentAssocPredicateId) throws GenericEntityException, MiniLangException {
- Map<String, Object> results =
getAssocAndContentAndDataResourceCacheMethod(delegator, contentId, mapKey,
direction, fromDate, fromDateStr, assocTypes, contentTypes, nullThruDatesOnly,
contentAssocPredicateId, null);
- return results;
- }
-
public static Map<String, Object>
getAssocAndContentAndDataResourceCacheMethod(Delegator delegator, String
contentId, String mapKey, String direction,
Timestamp fromDate, String fromDateStr, List<String>
assocTypes, List<String> contentTypes, Boolean nullThruDatesOnly, String
contentAssocPredicateId, String orderBy) throws GenericEntityException,
MiniLangException {
-
- //List exprList = FastList.newInstance();
- //EntityExpr joinExpr = null;
- //EntityExpr expr = null;
+ EntityExpr joinExpr = null;
String viewName = null;
String contentFieldName = null;
if (direction != null && direction.equalsIgnoreCase("From")) {
- contentFieldName = "contentIdTo";
+ contentFieldName = "caContentIdTo";
+ joinExpr = EntityCondition.makeCondition("caContentIdTo",
EntityOperator.EQUALS, contentId);
} else {
- contentFieldName = "contentId";
+ contentFieldName = "caContentId";
+ joinExpr = EntityCondition.makeCondition("contentId",
EntityOperator.EQUALS, contentId);
}
if (direction != null && direction.equalsIgnoreCase("From")) {
viewName = "ContentAssocDataResourceViewFrom";
} else {
viewName = "ContentAssocDataResourceViewTo";
}
- //if (Debug.infoOn()) Debug.logInfo("in getAssocAndContent...Cache,
assocTypes:" + assocTypes, module);
List<EntityCondition> conditionList = new ArrayList<EntityCondition>();
+ conditionList.add(joinExpr);
if (UtilValidate.isNotEmpty(mapKey)) {
String mapKeyValue = "is null".equalsIgnoreCase(mapKey) ? null :
mapKey;
- conditionList.add(EntityCondition.makeCondition("mapKey",
mapKeyValue));
+ conditionList.add(EntityCondition.makeCondition("caMapKey",
mapKeyValue));
}
if (UtilValidate.isNotEmpty(contentAssocPredicateId)) {
String contentAssocPredicateIdValue = "is
null".equalsIgnoreCase(contentAssocPredicateId) ? null :
contentAssocPredicateId;
- conditionList.add(EntityCondition.makeCondition("mapKey",
contentAssocPredicateIdValue));
+ conditionList.add(EntityCondition.makeCondition("caMapKey",
contentAssocPredicateIdValue));
}
if (nullThruDatesOnly != null && nullThruDatesOnly) {
- conditionList.add(EntityCondition.makeCondition("thruDate", null));
+ conditionList.add(EntityCondition.makeCondition("caThruDate",
null));
}
if (UtilValidate.isNotEmpty(assocTypes)) {
-
conditionList.add(EntityCondition.makeCondition("contentAssocTypeId",
EntityOperator.IN, assocTypes));
+
conditionList.add(EntityCondition.makeCondition("caContentAssocTypeId",
EntityOperator.IN, assocTypes));
}
if (fromDate == null && fromDateStr != null) {
fromDate = UtilDateTime.toTimestamp(fromDateStr);
}
- List<GenericValue> contentAssocsTypeFiltered =
EntityQuery.use(delegator).from("ContentAssoc")
- .where(conditionList).orderBy("sequenceNum", "-fromDate")
- .filterByDate(fromDate).cache().queryList();
-
+ List<GenericValue> contentAssocsTypeFiltered =
EntityQuery.use(delegator).from(viewName)
+ .where(conditionList).orderBy("caSequenceNum",
"-caFromDate").cache().queryList();
String assocRelationName = null;
if (direction != null && direction.equalsIgnoreCase("To")) {
@@ -259,7 +250,11 @@ public class ContentServicesComplex {
GenericValue dataResource = null;
List<GenericValue> contentAssocDataResourceList =
FastList.newInstance();
Locale locale = Locale.getDefault(); // TODO: this needs to be passed
in
- for (GenericValue contentAssoc : contentAssocsTypeFiltered) {
+ try{
+ for (GenericValue contentAssocView : contentAssocsTypeFiltered) {
+ GenericValue contentAssoc =
EntityQuery.use(delegator).from("ContentAssoc").where(UtilMisc.toMap("contentId",
contentAssocView.getString("contentId"),
+ "contentIdTo",
contentAssocView.getString(contentFieldName), "contentAssocTypeId",
contentAssocView.getString("caContentAssocTypeId"),
+ "fromDate",
contentAssocView.getTimestamp("caFromDate"))).queryOne();
content = contentAssoc.getRelatedOne(assocRelationName, true);
if (UtilValidate.isNotEmpty(contentTypes)) {
String contentTypeId = (String)content.get("contentTypeId");
@@ -272,24 +267,21 @@ public class ContentServicesComplex {
contentAssocDataResourceView.setAllFields(content, true, null,
null);
}
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml",
"contentAssocOut", contentAssoc, contentAssocDataResourceView,
FastList.newInstance(), locale);
- //if (Debug.infoOn()) Debug.logInfo("contentAssoc:" +
contentAssoc, module);
- //contentAssocDataResourceView.setAllFields(contentAssoc, false,
null, null);
String dataResourceId = content.getString("dataResourceId");
if (UtilValidate.isNotEmpty(dataResourceId))
dataResource = content.getRelatedOne("DataResource", true);
- //if (Debug.infoOn()) Debug.logInfo("dataResource:" +
dataResource, module);
- //if (Debug.infoOn())
Debug.logInfo("contentAssocDataResourceView:" + contentAssocDataResourceView,
module);
if (dataResource != null) {
- //contentAssocDataResourceView.setAllFields(dataResource,
false, null, null);
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml",
"dataResourceOut", dataResource, contentAssocDataResourceView,
FastList.newInstance(), locale);
}
- //if (Debug.infoOn())
Debug.logInfo("contentAssocDataResourceView:" + contentAssocDataResourceView,
module);
contentAssocDataResourceList.add(contentAssocDataResourceView);
}
-
- List<String> orderByList = null;
+ } catch (GenericEntityException e) {
+ Debug.logError(e, module);
+ return ServiceUtil.returnError(e.getMessage());
+ }
+
if (UtilValidate.isNotEmpty(orderBy)) {
- orderByList = StringUtil.split(orderBy, "|");
+ List<String> orderByList = StringUtil.split(orderBy, "|");
contentAssocDataResourceList =
EntityUtil.orderBy(contentAssocDataResourceList, orderByList);
}
Map<String, Object> results = FastMap.newInstance();
@@ -299,45 +291,4 @@ public class ContentServicesComplex {
}
return results;
}
-
-/*
- public static Map getSubContentAndDataResource(Delegator delegator, String
contentId, String direction, Timestamp fromDate, String assocType, String
contentType, String orderBy) throws GenericEntityException {
-
- List exprList = FastList.newInstance();
- EntityExpr joinExpr = null;
- EntityExpr expr = null;
- String viewName = null;
- GenericValue contentAssoc = null;
- String contentFieldName = null;
- if (direction != null && direction.equalsIgnoreCase("From")) {
- viewName = "ContentAssocDataResourceViewFrom";
- contentFieldName = "contentIdTo";
- joinExpr = EntityCondition.makeCondition("caContentIdTo",
EntityOperator.EQUALS, contentId);
- } else {
- viewName = "ContentAssocDataResourceViewTo";
- contentFieldName = "contentId";
- joinExpr = EntityCondition.makeCondition("caContentId",
EntityOperator.EQUALS, contentId);
- }
- exprList.add(joinExpr);
-
- if (UtilValidate.isNotEmpty(assocType)) {
- expr = EntityCondition.makeCondition("caContentAssocTypeId",
EntityOperator.EQUALS, assocType);
- exprList.add(expr);
- }
-
- if (UtilValidate.isNotEmpty(contentType)) {
- expr = EntityCondition.makeCondition("caContentTypeId",
EntityOperator.EQUALS, contentType);
- exprList.add(expr);
- }
-
- List orderByList = null;
- if (UtilValidate.isNotEmpty(orderBy)) {
- orderByList = StringUtil.split(orderBy, "|");
- contentAssocDataResourceList =
EntityUtil.orderBy(contentAssocDataResourceList, orderByList);
- }
- HashMap results = FastMap.newInstance();
- results.put("entityList", contentAssocDataResourceList);
- return results;
- }
-*/
}
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=1643061&r1=1643060&r2=1643061&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
Wed Dec 3 07:17:12 2014
@@ -691,7 +691,7 @@ public class ContentWorker implements or
Boolean nullThruDatesOnly = Boolean.TRUE;
Map<String, Object> results = null;
try {
- results =
ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator,
parentContentId, mapKey, direction, null, null, assocTypeList, contentTypeList,
nullThruDatesOnly, contentAssocPredicateId);
+ results =
ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator,
parentContentId, mapKey, direction, null, null, assocTypeList, contentTypeList,
nullThruDatesOnly, contentAssocPredicateId, null);
} catch (GenericEntityException e) {
throw new RuntimeException(e.getMessage());
} catch (MiniLangException e2) {
@@ -1110,7 +1110,7 @@ public class ContentWorker implements or
try {
// NOTE DEJ20060610: Changed "From" to "To" because it makes the
most sense for sub-content renderings using a root-contentId and mapKey to
determine the sub-contentId to have the ContentAssoc go from the root to the
sub, ie try to determine the contentIdTo from the contentId and mapKey
// This shouldn't be changed from "To" to "From", but if desired
could be parameterized to make this selectable in higher up calling methods
- results =
ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator,
contentId, mapKey, "To", fromDate, null, assocTypes, contentTypes,
nullThruDatesOnly, contentAssocPredicateId);
+ results =
ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator,
contentId, mapKey, "To", fromDate, null, assocTypes, contentTypes,
nullThruDatesOnly, contentAssocPredicateId, null);
} catch (MiniLangException e) {
throw new RuntimeException(e.getMessage());
}
Modified: ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml?rev=1643061&r1=1643060&r2=1643061&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml (original)
+++ ofbiz/trunk/specialpurpose/cmssite/data/CmsSiteDemoData.xml Wed Dec 3
07:17:12 2014
@@ -101,7 +101,7 @@ under the License.
<Content contentId="CMSS_DEMO_HOME" contentTypeId="DOCUMENT"
decoratorContentId="CMSS_DEC"
contentName="CMS Site Demo Home Page" dataResourceId="CMSS_DEMO_HOME"/>
<ContentPurpose contentId="CMSS_DEMO_HOME" contentPurposeTypeId="SECTION"/>
- <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_HOME"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"
mapKey="demoHome"/>
+ <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_HOME"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"
mapKey="demoHome"/>
<WebSiteContent webSiteId="CmsSite" contentId="CMSS_DEMO_HOME"
webSiteContentTypeId="DEFAULT_PAGE" fromDate="2001-01-01 00:00:00"/>
<!-- yet another demo page -->
@@ -114,7 +114,7 @@ under the License.
</ElectronicText>
<Content contentId="CMSS_DEMO_PAGE1" contentTypeId="DOCUMENT"
decoratorContentId="CMSS_DEC" contentName="CMS Site Demo Page 1"
dataResourceId="CMSS_DEMO_PAGE1"/>
<ContentPurpose contentId="CMSS_DEMO_PAGE1"
contentPurposeTypeId="SECTION"/>
- <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_PAGE1"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"
mapKey="demoPage1"/>
+ <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_PAGE1"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"
mapKey="demoPage1"/>
<DataResource dataResourceId="CMSS_DEMO_PAGE1_1"
dataResourceTypeId="SHORT_TEXT" objectInfo="Sub-content 1"/>
<Content contentId="CMSS_DEMO_PAGE1_1" contentTypeId="DOCUMENT"
contentName="CMS Site Demo Page 1_1" dataResourceId="CMSS_DEMO_PAGE1_1"/>
<ContentPurpose contentId="CMSS_DEMO_PAGE1_1"
contentPurposeTypeId="SECTION"/>
@@ -130,16 +130,16 @@ under the License.
<DataResource dataResourceId="CMSS_DEMO_SCREEN"
dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="SCREEN_COMBINED"
objectInfo="component://cmssite/widget/CmssiteScreens.xml#testScreen"/>
<Content contentId="CMSS_DEMO_SCREEN" contentTypeId="DOCUMENT"
contentName="CMS Site Demo screen/decorator example"
dataResourceId="CMSS_DEMO_SCREEN"/>
- <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_SCREEN"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"/>
+ <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_SCREEN"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
<DataResource dataResourceId="CMSS_DEMO_BLOG"
dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="SCREEN_COMBINED"
objectInfo="component://cmssite/widget/CmssiteScreens.xml#blogScreen"/>
<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="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"/>
+ <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_DATA" 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_DATA"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"/>
+ <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="CMSS_DEMO_TPL_DATA"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
<ElectronicText dataResourceId="CMSS_DEMO_TPL_DATA">
<textData><![CDATA[
<root>
@@ -194,7 +194,7 @@ under the License.
<DataResource dataResourceId="OFBIZ_HOME"
dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="SCREEN_COMBINED"
objectInfo="component://cmssite/widget/OfbizsiteScreens.xml#main"/>
<Content contentId="OFBIZ_HOME" contentTypeId="DOCUMENT"
contentName="OFBiz Site Home Page" dataResourceId="OFBIZ_HOME"/>
- <ContentAssoc contentId="OFBIZ_PPOINT" contentIdTo="OFBIZ_HOME"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"
mapKey="demoHome"/>
+ <ContentAssoc contentId="OFBIZ_PPOINT" contentIdTo="OFBIZ_HOME"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"
mapKey="demoHome"/>
<WebSiteContent webSiteId="OfbizSite" contentId="OFBIZ_HOME"
webSiteContentTypeId="DEFAULT_PAGE" fromDate="2001-01-01 00:00:00"/>
<!-- documents website -->
@@ -219,8 +219,8 @@ under the License.
<ContentAssoc contentId="DOCUMENTS" contentIdTo="APACHE_OFBIZ_U_HTML"
contentAssocTypeId="SUB_CONTENT" fromDate="2006-01-12 01:01:01" sequenceNum=""/>
- <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="PUBLIC_DOCS"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"/>
- <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="APACHE_OFBIZ_HTML"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"
mapKey="documents"/>
- <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="APACHE_OFBIZ_PDF"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-01-01 00:00:00"
mapKey="documents"/>
+ <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="PUBLIC_DOCS"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/>
+ <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="APACHE_OFBIZ_HTML"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"
mapKey="documents"/>
+ <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="APACHE_OFBIZ_PDF"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"
mapKey="documents"/>
</entity-engine-xml>
Modified: ofbiz/trunk/specialpurpose/cmssite/template/cms/MainDecorator.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/template/cms/MainDecorator.ftl?rev=1643061&r1=1643060&r2=1643061&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/cmssite/template/cms/MainDecorator.ftl (original)
+++ ofbiz/trunk/specialpurpose/cmssite/template/cms/MainDecorator.ftl Wed Dec
3 07:17:12 2014
@@ -16,11 +16,10 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<#if decoratedContent??>
+
${(decoratedContent.subcontent.htmlHead)?default((thisContent.subcontent.htmlHead)!)}
${(decoratedContent.subcontent.header)?default((thisContent.subcontent.header)!)}
${decoratedContent}
${(decoratedContent.subcontent.footer)?default((thisContent.subcontent.footer)!)}
-</#if>
\ No newline at end of file
Modified:
ofbiz/trunk/specialpurpose/ecommerce/data/DemoWebSitePublishPointData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoWebSitePublishPointData.xml?rev=1643061&r1=1643060&r2=1643061&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoWebSitePublishPointData.xml
(original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoWebSitePublishPointData.xml
Wed Dec 3 07:17:12 2014
@@ -25,39 +25,39 @@ under the License.
<WebSiteContent webSiteId="WebStore" contentId="WebStoreCONTENT"
webSiteContentTypeId="PUBLISH_POINT" fromDate="2001-01-01 00:00:00"/>
<Content contentId="CNTGIZMOS" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="WebStoreCONTENT" contentName="Gizmos" description="Gizmos"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="CNTGIZMOS"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="CNTGIZMOS"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<ContentAttribute contentId="CNTGIZMOS" attrName="publishOperation"
attrValue="HAS_USER_ROLE"/>
<Content contentId="CNTGIZMOSLRG" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="CNTGIZMOS" contentName="Large Gizmos" description="Large
Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="CNTGIZMOS" contentIdTo="CNTGIZMOSLRG"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="CNTGIZMOS" contentIdTo="CNTGIZMOSLRG"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="CNTGIZMOSSML" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="CNTGIZMOS" contentName="Small Gizmos" description="Large
Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="CNTGIZMOS" contentIdTo="CNTGIZMOSSML"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="CNTGIZMOS" contentIdTo="CNTGIZMOSSML"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="GIZMOSLRG" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="CNTGIZMOS" contentName="Advocacy" description="Advocacy"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="CNTGIZMOS" contentIdTo="GIZMOSLRG"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="CNTGIZMOS" contentIdTo="GIZMOSLRG"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="GIZMOSSML" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="WebStoreCONTENT" contentName="Case Studies" description="Case
Studies" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="CNTGIZMOS" contentIdTo="GIZMOSSML"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="CNTGIZMOS" contentIdTo="GIZMOSSML"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="CNTWIDGETS" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="WebStoreCONTENT" contentName="Widgets" description="Widgets"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<ContentAttribute contentId="CNTWIDGETS" attrName="publishOperation"
attrValue="HAS_USER_ROLE"/>
- <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="CNTWIDGETS"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="CNTWIDGETS"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="WIDGETSSML" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="WebStoreCONTENT" contentName="Sightings" description="Sightings
of Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="CNTWIDGETS" contentIdTo="WIDGETSSML"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="CNTWIDGETS" contentIdTo="WIDGETSSML"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="WIDGETSLRG" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="WebStoreCONTENT" contentName="Care & Groom"
description="Care and Grooming" createdDate="2001-05-13 12:00:00.000"
createdByUserLogin="admin"/>
- <ContentAssoc contentId="CNTWIDGETS" contentIdTo="WIDGETSLRG"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="CNTWIDGETS" contentIdTo="WIDGETSLRG"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="CNTWIDGETSLRG" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="CNTWIDGETS" contentName="Large Widgets" description="Large
Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="CNTWIDGETS" contentIdTo="CNTWIDGETSLRG"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="CNTWIDGETS" contentIdTo="CNTWIDGETSLRG"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="CNTWIDGETSSML" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="CNTWIDGETS" contentName="Small Widgets" description="Large
Widgets" createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="CNTWIDGETS" contentIdTo="CNTWIDGETSSML"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="CNTWIDGETS" contentIdTo="CNTWIDGETSSML"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<Content contentId="POLICY" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="WebStoreCONTENT" contentName="Policies" description="Policies"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="POLICY"
contentAssocTypeId="PUBLISH_LINK" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
+ <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="POLICY"
contentAssocTypeId="SUB_CONTENT" fromDate="2001-05-13 12:00:00.000"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
<ContentAttribute contentId="POLICY" attrName="publishOperation"
attrValue="HAS_USER_ROLE"/>
<Content contentId="WebStoreFACTOID" contentTypeId="WEB_SITE_PUB_PT"
ownerContentId="" contentName="Factoids" description="Factoids"
createdDate="2004-07-05 12:00:00.000" createdByUserLogin="admin"/>
@@ -79,7 +79,7 @@ under the License.
</ElectronicText>
<Content contentId="STORE_POLICIES" contentTypeId="DOCUMENT"
ownerContentId="WebStoreCONTENT" dataResourceId="STORE_POLICIES"
contentName="Store Policies 1" description="Store Policies 1
Description" mimeTypeId="text/html" localeString="en_US"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="STORE_POLICIES"
mapKey="policies" contentAssocTypeId="PUBLISH_LINK"
+ <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="STORE_POLICIES"
mapKey="policies" contentAssocTypeId="SUB_CONTENT"
fromDate="2001-05-13 12:00:00.000" createdDate="2001-05-13
12:00:00.000" createdByUserLogin="admin"/>
<DataResource dataResourceId="STORE_POLICIES2"
dataResourceTypeId="ELECTRONIC_TEXT" mimeTypeId="text/html"
localeString="en_US" isPublic="Y" dataResourceName="Store Policies"/>
<ElectronicText dataResourceId="STORE_POLICIES2">
@@ -96,6 +96,6 @@ under the License.
</ElectronicText>
<Content contentId="STORE_POLICIES2" contentTypeId="DOCUMENT"
ownerContentId="WebStoreCONTENT" dataResourceId="STORE_POLICIES2"
contentName="Store Policies 2" description="Store Policies 2
Description" mimeTypeId="text/html" localeString="en_US"
createdDate="2001-05-13 12:00:00.000" createdByUserLogin="admin"/>
- <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="STORE_POLICIES2"
mapKey="policies2" contentAssocTypeId="PUBLISH_LINK"
+ <ContentAssoc contentId="WebStoreCONTENT" contentIdTo="STORE_POLICIES2"
mapKey="policies2" contentAssocTypeId="SUB_CONTENT"
fromDate="2001-05-13 12:00:00.000" createdDate="2001-05-13
12:00:00.000" createdByUserLogin="admin"/>
</entity-engine-xml>
Modified:
ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/data/topic.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/data/topic.ftl?rev=1643061&r1=1643060&r2=1643061&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/data/topic.ftl
(original)
+++
ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/data/topic.ftl
Wed Dec 3 07:17:12 2014
@@ -34,7 +34,7 @@ under the License.
<#assign firstPart=internalNameParts[0] />
<#assign
nowStamp=Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp()/>
<#if firstPart == "WIDGETS">
- <ContentAssoc contentId="CNTWIDGETS" contentIdTo="${contentId}"
contentAssocTypeId="PUBLISH_LINK" fromDate="${nowStamp?string("yyyy-MM-dd
HH:mm:ss")}"/>
+ <ContentAssoc contentId="CNTWIDGETS" contentIdTo="${contentId}"
contentAssocTypeId="SUB_CONTENT" fromDate="${nowStamp?string("yyyy-MM-dd
HH:mm:ss")}"/>
</#if>
</#macro>