Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java?rev=1337665&r1=1337664&r2=1337665&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java
(original)
+++
ofbiz/trunk/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java
Sat May 12 21:18:36 2012
@@ -90,7 +90,7 @@ public class SimpleContentViewHandler ex
if (UtilValidate.isEmpty(contentRevisionSeqId)) {
if (UtilValidate.isEmpty(mapKey) &&
UtilValidate.isEmpty(contentAssocTypeId)) {
if (UtilValidate.isNotEmpty(contentId)) {
- GenericValue content =
delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId",
contentId));
+ GenericValue content = delegator.findOne("Content",
UtilMisc.toMap("contentId", contentId), true);
dataResourceId =
content.getString("dataResourceId");
}
if (Debug.verboseOn()) Debug.logVerbose("SCVH(0b)-
dataResourceId:" + dataResourceId, module);
@@ -112,7 +112,7 @@ public class SimpleContentViewHandler ex
if (Debug.verboseOn()) Debug.logVerbose("SCVH(0b)-
dataResourceId:" + dataResourceId, module);
}
} else {
- GenericValue contentRevisionItem =
delegator.findByPrimaryKeyCache("ContentRevisionItem", UtilMisc.toMap("contentId", rootContentId,
"itemContentId", contentId, "contentRevisionSeqId", contentRevisionSeqId));
+ GenericValue contentRevisionItem = delegator.findOne("ContentRevisionItem",
UtilMisc.toMap("contentId", rootContentId, "itemContentId", contentId,
"contentRevisionSeqId", contentRevisionSeqId), true);
if (contentRevisionItem == null) {
throw new ViewHandlerException("ContentRevisionItem record
not found for contentId=" + rootContentId
+ ", contentRevisionSeqId=" +
contentRevisionSeqId + ", itemContentId=" + contentId);
@@ -124,7 +124,7 @@ public class SimpleContentViewHandler ex
}
}
if (UtilValidate.isNotEmpty(dataResourceId)) {
- GenericValue dataResource =
delegator.findByPrimaryKeyCache("DataResource",
UtilMisc.toMap("dataResourceId", dataResourceId));
+ GenericValue dataResource = delegator.findOne("DataResource",
UtilMisc.toMap("dataResourceId", dataResourceId), true);
// DEJ20080717: why are we rendering the DataResource
directly instead of rendering the content?
ByteBuffer byteBuffer =
DataResourceWorker.getContentAsByteBuffer(delegator, dataResourceId, https,
webSiteId, locale, rootDir);
ByteArrayInputStream bais = new
ByteArrayInputStream(byteBuffer.array());
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java?rev=1337665&r1=1337664&r2=1337665&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java
(original)
+++
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java
Sat May 12 21:18:36 2012
@@ -135,7 +135,7 @@ public class EditRenderSubContentTransfo
mimeTypeIdTemp = (String)
subContentDataResourceView.get("mimeTypeId");
if (UtilValidate.isEmpty(mimeTypeIdTemp) &&
UtilValidate.isNotEmpty(contentId)) { // will need these below
try {
- parentContent = delegator.findByPrimaryKey("Content",
UtilMisc.toMap("contentId", contentId));
+ parentContent = delegator.findOne("Content",
UtilMisc.toMap("contentId", contentId), false);
if (parentContent != null) {
mimeTypeIdTemp = (String)
parentContent.get("mimeTypeId");
}
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java?rev=1337665&r1=1337664&r2=1337665&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
(original)
+++
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
Sat May 12 21:18:36 2012
@@ -116,7 +116,7 @@ public class LoopSubContentTransform imp
String parentContentId = (String)ctx.get("contentId");
if (UtilValidate.isEmpty(mimeTypeId) &&
UtilValidate.isNotEmpty(parentContentId)) { // will need these below
try {
- GenericValue parentContent = delegator.findByPrimaryKey("Content",
UtilMisc.toMap("contentId", parentContentId));
+ GenericValue parentContent = delegator.findOne("Content",
UtilMisc.toMap("contentId", parentContentId), false);
if (parentContent != null) {
mimeTypeId = (String) parentContent.get("mimeTypeId");
ctx.put("parentContent", parentContent);
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java?rev=1337665&r1=1337664&r2=1337665&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
(original)
+++
ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
Sat May 12 21:18:36 2012
@@ -124,7 +124,7 @@ public class TraverseSubContentTransform
}
if (UtilValidate.isNotEmpty(thisContentId)) {
try {
- view = delegator.findByPrimaryKey("Content",
UtilMisc.toMap("contentId", thisContentId));
+ view = delegator.findOne("Content",
UtilMisc.toMap("contentId", thisContentId), false);
} catch (GenericEntityException e) {
Debug.logError(e, "Error getting sub-content", module);
throw new RuntimeException(e.getMessage());
@@ -186,7 +186,7 @@ public class TraverseSubContentTransform
/*
if (UtilValidate.isNotEmpty(contentId)) {
try {
- content = delegator.findByPrimaryKey("Content",
UtilMisc.toMap("contentId", contentId));
+ content = delegator.findOne("Content",
UtilMisc.toMap("contentId", contentId), false);
} catch (GenericEntityException e) {
// TODO: Not sure what to put here.
throw new RuntimeException(e.getMessage());
Modified: ofbiz/trunk/applications/content/webapp/content/cms/AdminSearch.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/cms/AdminSearch.ftl?rev=1337665&r1=1337664&r2=1337665&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/cms/AdminSearch.ftl
(original)
+++ ofbiz/trunk/applications/content/webapp/content/cms/AdminSearch.ftl Sat May
12 21:18:36 2012
@@ -75,7 +75,7 @@ under the License.
-->
<#list productFeatureTypeIdsOrdered as productFeatureTypeId>
<#assign findPftMap =
Static["org.ofbiz.base.util.UtilMisc"].toMap("productFeatureTypeId",
productFeatureTypeId)>
- <#assign productFeatureType =
delegator.findByPrimaryKeyCache("ProductFeatureType", findPftMap)>
+ <#assign productFeatureType = delegator.findOne("ProductFeatureType",
findPftMap, true)>
<#assign productFeatures =
productFeaturesByTypeMap[productFeatureTypeId]>
<tr>
<td align="right" valign="middle">
Modified: ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl?rev=1337665&r1=1337664&r2=1337665&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl
(original)
+++ ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl Sat
May 12 21:18:36 2012
@@ -35,7 +35,7 @@ var rawdata = [
<#macro fillTree assocList>
<#if (assocList?has_content)>
<#list assocList as assoc>
- <#assign content =
delegator.findByPrimaryKey("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo))/>
+ <#assign content =
delegator.findOne("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo),
false)/>
{
"data": {"title" : unescapeHtmlText("${content.contentName!assoc.contentIdTo}"), "attr":
{"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}},
<#assign assocChilds =
delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId",
"TREE_CHILD"))/>
Modified:
ofbiz/trunk/applications/content/webapp/content/content/ContentSearchResults.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/ContentSearchResults.ftl?rev=1337665&r1=1337664&r2=1337665&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/webapp/content/content/ContentSearchResults.ftl
(original)
+++
ofbiz/trunk/applications/content/webapp/content/content/ContentSearchResults.ftl
Sat May 12 21:18:36 2012
@@ -55,7 +55,7 @@ under the License.
<table width="100%" cellpadding="0" cellspacing="0">
<#assign listIndex = lowIndex>
<#list contentIds as contentId><#-- note that there is no boundary range
because that is being done before the list is put in the content -->
- <#assign content = delegator.findByPrimaryKey("Content",
Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentId))>
+ <#assign content = delegator.findOne("Content",
Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentId), false)>
<tr>
<td>
<a href="<@ofbizUrl>editContent?contentId=${contentId}</@ofbizUrl>"
class="buttontext">${contentId} ${(content.contentName)?if_exists}</a>
Modified:
ofbiz/trunk/applications/content/webapp/content/content/EditContentTree.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/EditContentTree.ftl?rev=1337665&r1=1337664&r2=1337665&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/content/EditContentTree.ftl
(original)
+++ ofbiz/trunk/applications/content/webapp/content/content/EditContentTree.ftl
Sat May 12 21:18:36 2012
@@ -17,7 +17,7 @@
under the License.
-->
<form name="editContentTree" action="<#if
parameters.rename?has_content><@ofbizUrl>updateDocumentTree</@ofbizUrl><#else><@ofbizUrl>addDocumentToTree</@ofbizUrl></#if>"
method="post">
- <#assign content =
delegator.findByPrimaryKey("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",parameters.contentId))/>
+ <#assign content =
delegator.findOne("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",parameters.contentId),
false)/>
<#if parameters.rename?has_content>
<div class="h3">${uiLabelMap.ContentRenameFolder}</div>
${uiLabelMap.ContentRenameFolder} : ${content.contentName}<br />