Author: doogie
Date: Sat May 12 21:18:36 2012 New Revision: 1337665 URL: http://svn.apache.org/viewvc?rev=1337665&view=rev Log: DEPRECATION: applications/content: findByPrimaryKey variants replaced with findOne Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentKeywordIndex.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentPermissionServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentSearch.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java ofbiz/trunk/applications/content/src/org/ofbiz/content/search/ContentDocument.java ofbiz/trunk/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java ofbiz/trunk/applications/content/src/org/ofbiz/content/search/SearchWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java ofbiz/trunk/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java ofbiz/trunk/applications/content/webapp/content/cms/AdminSearch.ftl ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl ofbiz/trunk/applications/content/webapp/content/content/ContentSearchResults.ftl ofbiz/trunk/applications/content/webapp/content/content/EditContentTree.ftl Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java Sat May 12 21:18:36 2012 @@ -195,7 +195,7 @@ public class ContentManagementEvents { List<Object []> origPublishedLinkList = null; try { // TODO: this needs to be given author userLogin - delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", authorId)); + delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", authorId), true); origPublishedLinkList = ContentManagementWorker.getPublishedLinks(delegator, targContentId, webSiteId, userLogin, security, permittedAction, permittedOperations, roles); } catch (GenericEntityException e) { request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); @@ -296,7 +296,7 @@ public class ContentManagementEvents { //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, results(3b):" + results , module); if (!statusIdUpdated) { try { - GenericValue targContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", targContentId)); + GenericValue targContent = delegator.findOne("Content", UtilMisc.toMap("contentId", targContentId), false); targContent.set("statusId", "CTNT_PUBLISHED"); targContent.store(); statusIdUpdated = true; Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Sat May 12 21:18:36 2012 @@ -317,7 +317,7 @@ public class ContentManagementServices { contentExists = false; } else { try { - GenericValue val = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue val = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (val == null) contentExists = false; } catch (GenericEntityException e) { return ServiceUtil.returnError(e.toString()); @@ -407,7 +407,7 @@ public class ContentManagementServices { contentAssocContext.put("skipPermissionCheck", context.get("skipPermissionCheck")); Map<String, Object> thisResult = null; try { - GenericValue contentAssocExisting = delegator.findByPrimaryKey("ContentAssoc", contentAssoc.getPrimaryKey()); + GenericValue contentAssocExisting = delegator.findOne("ContentAssoc", contentAssoc.getPrimaryKey(), false); if (contentAssocExisting == null) { ModelService contentAssocModel = dispatcher.getDispatchContext().getModelService("createContentAssoc"); Map<String, Object> ctx = contentAssocModel.makeValid(contentAssoc, "IN"); @@ -581,7 +581,7 @@ public class ContentManagementServices { Locale locale = (Locale) context.get("locale"); Map<String, Object> result = FastMap.newInstance(); try { - //GenericValue content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + //GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); ModelService checkPermModel = dispatcher.getDispatchContext().getModelService("checkContentPermission"); Map<String, Object> ctx = checkPermModel.makeValid(context, "IN"); Map<String, Object> thisResult = dispatcher.runSync("checkContentPermission", ctx); @@ -638,7 +638,7 @@ public class ContentManagementServices { dataResourceExists = false; } else { try { - GenericValue val = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue val = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); if (val == null) { dataResourceExists = false; } @@ -901,7 +901,7 @@ public class ContentManagementServices { if (Debug.infoOn()) { Debug.logInfo("in updateOrRemove, entityValuePK:" + entityValuePK, module); } - GenericValue entityValueExisting = delegator.findByPrimaryKeyCache(entityName, entityValuePK); + GenericValue entityValueExisting = delegator.findOne(entityName, entityValuePK, true); if (Debug.infoOn()) { Debug.logInfo("in updateOrRemove, entityValueExisting:" + entityValueExisting, module); } @@ -1015,7 +1015,7 @@ public class ContentManagementServices { Locale locale = (Locale) context.get("locale"); //int seqNum = 9999; try { - GenericValue content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (content == null) { Debug.logError("content was null", module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", ""), locale)); @@ -1100,7 +1100,7 @@ public class ContentManagementServices { String contentId = (String)context.get("contentId"); try { - GenericValue thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (thisContent == null) throw new RuntimeException("No entity found for id=" + contentId); @@ -1123,7 +1123,7 @@ public class ContentManagementServices { while (iter.hasNext()) { GenericValue contentAssoc = (GenericValue)iter.next(); String subContentId = contentAssoc.getString("contentId"); - GenericValue contentTo = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", subContentId)); + GenericValue contentTo = delegator.findOne("Content", UtilMisc.toMap("contentId", subContentId), true); Integer childBranchCount = (Integer)contentTo.get("childBranchCount"); int branchCount = (childBranchCount == null) ? 1 : childBranchCount.intValue(); if (mode != null && mode.equalsIgnoreCase("remove")) @@ -1171,7 +1171,7 @@ public class ContentManagementServices { contentTypeId = "OUTLINE_NODE"; GenericValue thisContent = null; try { - thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (thisContent == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); } @@ -1211,7 +1211,7 @@ public class ContentManagementServices { } GenericValue thisContent = null; try { - thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (thisContent == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); @@ -1412,7 +1412,7 @@ public class ContentManagementServices { String contentAssocTypeId = (String)context.get("contentAssocTypeId"); try { - GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); if (content == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); } @@ -1438,7 +1438,7 @@ public class ContentManagementServices { String contentAssocTypeId = (String)context.get("contentAssocTypeId"); try { - GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); if (content == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); } @@ -1627,7 +1627,7 @@ public class ContentManagementServices { return ServiceUtil.returnFailure(msg); } - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); if (orderHeader == null) { String msg = "No OrderHeader found for orderId:" + orderId; return ServiceUtil.returnError(msg); @@ -1680,7 +1680,7 @@ public class ContentManagementServices { ctx.put("contentAssocTypeIdList", contentAssocTypeIdList); try { - GenericValue content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); result = followNodeChildrenMethod(content, dispatcher, serviceName, ctx); } catch (GenericEntityException e) { Debug.logError(e.toString(), module); @@ -1730,7 +1730,7 @@ public class ContentManagementServices { } if (UtilValidate.isNotEmpty(oldDataResourceId)) { try { - dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", oldDataResourceId)); + dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", oldDataResourceId), false); } catch (GenericEntityException e) { Debug.logError(e.toString(), module); return ServiceUtil.returnError(e.toString()); 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=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java Sat May 12 21:18:36 2012 @@ -346,7 +346,7 @@ public class ContentManagementWorker { GenericValue webSitePublishPoint = null; for(GenericValue contentAssoc : relatedPubPts) { String pub = (String)contentAssoc.get("contentId"); - //webSitePublishPoint = delegator.findByPrimaryKeyCache("WebSitePublishPoint", UtilMisc.toMap("contentId", pub)); + //webSitePublishPoint = delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId", pub), true); webSitePublishPoint = getWebSitePublishPoint(delegator, pub, false); allPublishPoints.add(webSitePublishPoint); } @@ -429,7 +429,7 @@ public class ContentManagementWorker { webSitePublishPoint = cachedWebSitePublishPoints.get(contentId); if (webSitePublishPoint == null) { - webSitePublishPoint = delegator.findByPrimaryKey("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId)); + webSitePublishPoint = delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId), false); // If no webSitePublishPoint exists, still try to look for parent by making a dummy value if (webSitePublishPoint == null) { webSitePublishPoint = delegator.makeValue("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId)); @@ -448,7 +448,7 @@ public class ContentManagementWorker { //if (Debug.infoOn()) Debug.logInfo("in overrideWebSitePublishPoint, contentIdTo:" + contentIdTo, module); if (contentIdTo != null) { //webSitePublishPoint = getWebSitePublishPoint(delegator, contentIdTo, false); - webSitePublishPoint = delegator.findByPrimaryKeyCache("WebSitePublishPoint", UtilMisc.toMap("contentId", contentIdTo)); + webSitePublishPoint = delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId", contentIdTo), true); if (webSitePublishPoint != null) { webSitePublishPoint = GenericValue.create(webSitePublishPoint); webSitePublishPoint = overrideWebSitePublishPoint(delegator, webSitePublishPoint); @@ -463,7 +463,7 @@ public class ContentManagementWorker { public static GenericValue getParentWebSitePublishPointValue(Delegator delegator, String contentId) throws GenericEntityException { String contentIdTo = getParentWebSitePublishPointId(delegator, contentId); - GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentIdTo)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentIdTo), true); return content; } @@ -493,7 +493,7 @@ public class ContentManagementWorker { /* if (webSitePublishPoint == null) { - webSitePublishPoint = delegator.findByPrimaryKey("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId)); + webSitePublishPoint = delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId), false); // If no webSitePublishPoint exists, still try to look for parent by making a dummy value if (webSitePublishPoint == null) { webSitePublishPoint = delegator.makeValue("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId)); @@ -648,7 +648,7 @@ public class ContentManagementWorker { GenericValue departmentContent = null; for(GenericValue contentAssoc : relatedPubPts) { String pub = (String)contentAssoc.get("contentId"); - departmentContent = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", pub)); + departmentContent = delegator.findOne("Content", UtilMisc.toMap("contentId", pub), true); allDepartmentPoints.add(departmentContent); } return allDepartmentPoints; @@ -657,7 +657,7 @@ public class ContentManagementWorker { public static String getUserName(HttpServletRequest request, String userLoginId) throws GenericEntityException { String userName = null; Delegator delegator = (Delegator)request.getAttribute("delegator"); - GenericValue userLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + GenericValue userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", userLoginId), true); GenericValue person = userLogin.getRelatedOneCache("Person"); userName = person.getString("firstName") + " " + person.getString("lastName"); return userName; @@ -665,7 +665,7 @@ public class ContentManagementWorker { public static int updateStatsTopDown(Delegator delegator, String contentId, List<String> typeList) throws GenericEntityException { int subLeafCount = 0; - GenericValue thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (thisContent == null) throw new RuntimeException("No entity found for id=" + contentId); @@ -694,7 +694,7 @@ public class ContentManagementWorker { } public static void updateStatsBottomUp(Delegator delegator, String contentId, List<String> typeList, int branchChangeAmount, int leafChangeAmount) throws GenericEntityException { - GenericValue thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (thisContent == null) throw new RuntimeException("No entity found for id=" + contentId); @@ -704,7 +704,7 @@ public class ContentManagementWorker { List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll); for(GenericValue contentAssoc : listFiltered) { String contentIdTo = contentAssoc.getString("contentIdTo"); - GenericValue contentTo = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentIdTo)); + GenericValue contentTo = delegator.findOne("Content", UtilMisc.toMap("contentId", contentIdTo), false); int intLeafCount = 0; Long leafCount = (Long)contentTo.get("childLeafCount"); if (leafCount != null) { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java Sat May 12 21:18:36 2012 @@ -149,7 +149,7 @@ In order ta make this service active add Iterator<GenericValue> contentAssChecks = contentAssocCheck.iterator(); while (contentAssChecks.hasNext() && contentNameMatch == false) { GenericValue contentAss = contentAssChecks.next(); - GenericValue contentcheck = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentAss.get("contentId"))); + GenericValue contentcheck = delegator.findOne("Content", UtilMisc.toMap("contentId", contentAss.get("contentId")), false); if (contentcheck!=null) { if (contentcheck.get("contentName").equals(contentName) && contentNameMatch == false) { contentNameMatch = true; Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java Sat May 12 21:18:36 2012 @@ -75,7 +75,7 @@ public class BlogRssServices { // get the main blog content GenericValue content = null; try { - content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); } catch (GenericEntityException e) { Debug.logError(e, module); } 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=1337665&r1=1337664&r2=1337665&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 May 12 21:18:36 2012 @@ -146,7 +146,7 @@ public class CmsEvents { GenericValue pathAlias = null; try { - pathAlias = delegator.findByPrimaryKeyCache("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "pathAlias", pathInfo)); + pathAlias = delegator.findOne("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "pathAlias", pathInfo), true); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -235,7 +235,7 @@ public class CmsEvents { // We try to find a generic content Error page concerning the status code if (!hasErrorPage) { try { - GenericValue errorPage = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", "CONTENT_ERROR_" + statusCode)); + GenericValue errorPage = delegator.findOne("Content", UtilMisc.toMap("contentId", "CONTENT_ERROR_" + statusCode), true); if (errorPage != null) { Debug.logVerbose("Found generic page " + statusCode, module); contentId = errorPage.getString("contentId"); @@ -310,14 +310,14 @@ public class CmsEvents { String contentName = null; String siteName = null; try { - GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); if (content != null && UtilValidate.isNotEmpty(content)) { contentName = content.getString("contentName"); } else { request.setAttribute("_ERROR_MESSAGE_", "Content: " + contentName + " [" + contentId + "] is not a publish point for the current website: [" + webSiteId + "]"); return "error"; } - siteName = delegator.findByPrimaryKeyCache("WebSite", UtilMisc.toMap("webSiteId", webSiteId)).getString("siteName"); + siteName = delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteId), true).getString("siteName"); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -328,7 +328,7 @@ public class CmsEvents { String siteName = null; GenericValue webSite = null; try { - webSite = delegator.findByPrimaryKeyCache("WebSite", UtilMisc.toMap("webSiteId", webSiteId)); + webSite = delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteId), true); if (webSite != null) { siteName = webSite.getString("siteName"); } Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java Sat May 12 21:18:36 2012 @@ -80,7 +80,7 @@ public class CompDocEvents { if (UtilValidate.isNotEmpty(contentId)) { try { - delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); } catch (GenericEntityException e) { Debug.logError(e, "Error running serviceName persistContentAndAssoc", module); String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.error_modelservice_for_srv_name", locale); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java Sat May 12 21:18:36 2012 @@ -86,7 +86,7 @@ public class CompDocServices { if (UtilValidate.isNotEmpty(contentId)) { try { - delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); } catch (GenericEntityException e) { Debug.logError(e, "Error running serviceName persistContentAndAssoc", module); return ServiceUtil.returnError(UtilProperties.getMessage(CoreEvents.err_resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); @@ -182,7 +182,7 @@ public class CompDocServices { //String thisContentId = contentAssocRevisionItemView.getString("contentId"); //String thisContentRevisionSeqId = contentAssocRevisionItemView.getString("maxRevisionSeqId"); String thisDataResourceId = contentAssocRevisionItemView.getString("dataResourceId"); - GenericValue dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", thisDataResourceId)); + GenericValue dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", thisDataResourceId), false); String inputMimeType = null; if (dataResource != null) { inputMimeType = dataResource.getString("mimeTypeId"); @@ -205,13 +205,13 @@ public class CompDocServices { String acroFormContentId = null; GenericValue surveyResponse = null; if (UtilValidate.isNotEmpty(surveyResponseId)) { - surveyResponse = delegator.findByPrimaryKey("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId)); + surveyResponse = delegator.findOne("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId), false); if (surveyResponse != null) { surveyId = surveyResponse.getString("surveyId"); } } if (UtilValidate.isNotEmpty(surveyId)) { - GenericValue survey = delegator.findByPrimaryKey("Survey", UtilMisc.toMap("surveyId", surveyId)); + GenericValue survey = delegator.findOne("Survey", UtilMisc.toMap("surveyId", surveyId), false); if (survey != null) { acroFormContentId = survey.getString("acroFormContentId"); if (UtilValidate.isNotEmpty(acroFormContentId)) { @@ -315,12 +315,12 @@ public class CompDocServices { GenericValue dataResource = null; if (UtilValidate.isEmpty(contentRevisionSeqId)) { - GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); dataResourceId = content.getString("dataResourceId"); Debug.logInfo("SCVH(0b)- dataResourceId:" + dataResourceId, module); - dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); } else { - GenericValue contentRevisionItem = delegator.findByPrimaryKeyCache("ContentRevisionItem", UtilMisc.toMap("contentId", contentId, "itemContentId", contentId, "contentRevisionSeqId", contentRevisionSeqId)); + GenericValue contentRevisionItem = delegator.findOne("ContentRevisionItem", UtilMisc.toMap("contentId", contentId, "itemContentId", contentId, "contentRevisionSeqId", contentRevisionSeqId), true); if (contentRevisionItem == null) { throw new ViewHandlerException("ContentRevisionItem record not found for contentId=" + contentId + ", contentRevisionSeqId=" + contentRevisionSeqId + ", itemContentId=" + contentId); @@ -330,7 +330,7 @@ public class CompDocServices { + ", contentRevisionSeqId=" + contentRevisionSeqId + ", itemContentId=" + contentId, module); dataResourceId = contentRevisionItem.getString("newDataResourceId"); Debug.logInfo("SCVH(3)- dataResourceId:" + dataResourceId, module); - dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); } String inputMimeType = null; if (dataResource != null) { @@ -351,13 +351,13 @@ public class CompDocServices { String acroFormContentId = null; GenericValue surveyResponse = null; if (UtilValidate.isNotEmpty(surveyResponseId)) { - surveyResponse = delegator.findByPrimaryKey("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId)); + surveyResponse = delegator.findOne("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId), false); if (surveyResponse != null) { surveyId = surveyResponse.getString("surveyId"); } } if (UtilValidate.isNotEmpty(surveyId)) { - GenericValue survey = delegator.findByPrimaryKey("Survey", UtilMisc.toMap("surveyId", surveyId)); + GenericValue survey = delegator.findOne("Survey", UtilMisc.toMap("surveyId", surveyId), false); if (survey != null) { acroFormContentId = survey.getString("acroFormContentId"); if (UtilValidate.isNotEmpty(acroFormContentId)) { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentKeywordIndex.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentKeywordIndex.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentKeywordIndex.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentKeywordIndex.java Sat May 12 21:18:36 2012 @@ -92,7 +92,7 @@ public class ContentKeywordIndex { // ContentRole List<GenericValue> contentRoles = delegator.findByAnd("ContentRole", UtilMisc.toMap("contentId", contentId)); for (GenericValue contentRole: contentRoles) { - GenericValue party = delegator.findByPrimaryKey("PartyNameView", UtilMisc.toMap("partyId", contentRole.getString("partyId"))); + GenericValue party = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", contentRole.getString("partyId")), false); if (party != null) { addWeightedKeywordSourceString(party, "description", strings); addWeightedKeywordSourceString(party, "firstName", strings); @@ -105,7 +105,7 @@ public class ContentKeywordIndex { // DataResourceRole List<GenericValue> dataResourceRoles = delegator.findByAnd("DataResourceRole", UtilMisc.toMap("dataResourceId", content.getString("dataResourceId"))); for (GenericValue dataResourceRole: dataResourceRoles) { - GenericValue party = delegator.findByPrimaryKey("PartyNameView", UtilMisc.toMap("partyId", dataResourceRole.getString("partyId"))); + GenericValue party = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", dataResourceRole.getString("partyId")), false); if (party != null) { addWeightedKeywordSourceString(party, "description", strings); addWeightedKeywordSourceString(party, "firstName", strings); @@ -118,7 +118,7 @@ public class ContentKeywordIndex { // Product List<GenericValue> productContentList = delegator.findByAnd("ProductContent", UtilMisc.toMap("contentId", contentId)); for (GenericValue productContent: productContentList) { - GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productContent.getString("productId"))); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productContent.getString("productId")), false); if (product != null) { addWeightedKeywordSourceString(product, "productName", strings); addWeightedKeywordSourceString(product, "internalName", strings); @@ -131,7 +131,7 @@ public class ContentKeywordIndex { // ProductCategory List<GenericValue> productCategoryContentList = delegator.findByAnd("ProductCategoryContent", UtilMisc.toMap("contentId", contentId)); for (GenericValue productCategoryContent: productCategoryContentList) { - GenericValue productCategory = delegator.findByPrimaryKey("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryContent.getString("productCategoryId"))); + GenericValue productCategory = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryContent.getString("productCategoryId")), false); if (productCategory != null) { addWeightedKeywordSourceString(productCategory, "categoryName", strings); addWeightedKeywordSourceString(productCategory, "description", strings); @@ -142,7 +142,7 @@ public class ContentKeywordIndex { // PartyContent List<GenericValue> partyContents = delegator.findByAnd("PartyContent", UtilMisc.toMap("contentId", contentId)); for (GenericValue partyContent: partyContents) { - GenericValue party = delegator.findByPrimaryKey("PartyNameView", UtilMisc.toMap("partyId", partyContent.getString("partyId"))); + GenericValue party = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", partyContent.getString("partyId")), false); if (party != null) { addWeightedKeywordSourceString(party, "description", strings); addWeightedKeywordSourceString(party, "firstName", strings); @@ -155,7 +155,7 @@ public class ContentKeywordIndex { // WebSiteContent List<GenericValue> webSiteContents = delegator.findByAnd("WebSiteContent", UtilMisc.toMap("contentId", contentId)); for (GenericValue webSiteContent: webSiteContents) { - GenericValue webSite = delegator.findByPrimaryKey("WebSite", UtilMisc.toMap("webSiteId", webSiteContent.getString("webSiteId"))); + GenericValue webSite = delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteContent.getString("webSiteId")), false); if (webSite != null) { addWeightedKeywordSourceString(webSite, "siteName", strings); addWeightedKeywordSourceString(webSite, "httpHost", strings); @@ -166,14 +166,14 @@ public class ContentKeywordIndex { // WorkEffortContent List<GenericValue> workEffortContents = delegator.findByAnd("WorkEffortContent", UtilMisc.toMap("contentId", contentId)); for (GenericValue workEffortContent: workEffortContents) { - GenericValue workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortContent.getString("workEffortId"))); + GenericValue workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortContent.getString("workEffortId")), false); if (workEffort != null) { addWeightedKeywordSourceString(workEffort, "workEffortName", strings); } } // DataResource - GenericValue dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", content.getString("dataResourceId"))); + GenericValue dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", content.getString("dataResourceId")), false); if (dataResource != null) { addWeightedKeywordSourceString(dataResource, "dataResourceName", strings); addWeightedKeywordSourceString(dataResource, "objectInfo", strings); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java Sat May 12 21:18:36 2012 @@ -112,9 +112,9 @@ public class ContentMapFacade implements this.cache = cache; try { if (cache) { - this.value = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + this.value = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); } else { - this.value = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + this.value = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); } } catch (GenericEntityException e) { Debug.logError(e, module); @@ -233,9 +233,9 @@ public class ContentMapFacade implements } try { if (cache) { - this.fields = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + this.fields = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); } else { - this.fields = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + this.fields = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); } } catch (GenericEntityException e) { Debug.logError(e, module); @@ -433,9 +433,9 @@ public class ContentMapFacade implements GenericValue content = null; try { if (cache) { - content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", name)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", name), true); } else { - content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", name)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", name), false); } } catch (GenericEntityException e) { Debug.logError(e, module); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentPermissionServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentPermissionServices.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentPermissionServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentPermissionServices.java Sat May 12 21:18:36 2012 @@ -121,7 +121,7 @@ public class ContentPermissionServices { String passedUserLoginId = (String)context.get("userLoginId"); if (UtilValidate.isNotEmpty(passedUserLoginId)) { try { - userLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", passedUserLoginId)); + userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", passedUserLoginId), true); if (userLogin != null) { partyId = userLogin.getString("partyId"); } @@ -276,8 +276,8 @@ public class ContentPermissionServices { GenericValue contentTo = null; GenericValue contentFrom = null; try { - contentTo = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentIdTo)); - contentFrom = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentIdFrom)); + contentTo = delegator.findOne("Content", UtilMisc.toMap("contentId", contentIdTo), true); + contentFrom = delegator.findOne("Content", UtilMisc.toMap("contentId", contentIdFrom), true); } catch (GenericEntityException e) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentContentToOrFromErrorRetriving", locale)); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentSearch.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentSearch.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentSearch.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentSearch.java Sat May 12 21:18:36 2012 @@ -555,8 +555,8 @@ public class ContentSearch { GenericValue content = null; GenericValue contentAssocType = null; try { - content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", this.contentId)); - contentAssocType = delegator.findByPrimaryKeyCache("ContentAssocType", UtilMisc.toMap("contentAssocTypeId", this.contentAssocTypeId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", this.contentId), true); + contentAssocType = delegator.findOne("ContentAssocType", UtilMisc.toMap("contentAssocTypeId", this.contentAssocTypeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up ContentAssocConstraint pretty print info: " + e.toString(), module); } Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java Sat May 12 21:18:36 2012 @@ -187,7 +187,7 @@ public class ContentServices { GenericValue content = null; try { - content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); } catch (GenericEntityException e) { Debug.logError(e, "Entity Error:" + e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); @@ -537,7 +537,7 @@ public class ContentServices { Locale locale = (Locale) context.get("locale"); String contentId = (String) context.get("contentId"); try { - content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); } catch (GenericEntityException e) { Debug.logWarning(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale)); @@ -625,7 +625,7 @@ public class ContentServices { GenericValue contentAssoc = null; try { - contentAssoc = delegator.findByPrimaryKey("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", contentIdTo, "contentAssocTypeId", contentAssocTypeId, "fromDate", fromDate)); + contentAssoc = delegator.findOne("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", contentIdTo, "contentAssocTypeId", contentAssocTypeId, "fromDate", fromDate), false); } catch (GenericEntityException e) { Debug.logError(e, "Entity Error:" + e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentAssocRetrievingError", UtilMisc.toMap("errorString", e.getMessage()), locale)); @@ -739,8 +739,8 @@ public class ContentServices { GenericValue contentAssoc = null; try { - //contentAssoc = delegator.findByPrimaryKey("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", contentIdTo, "contentAssocTypeId", contentAssocTypeId, "fromDate", fromDate)); - contentAssoc = delegator.findByPrimaryKey("ContentAssoc", pk); + //contentAssoc = delegator.findOne("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", contentIdTo, "contentAssocTypeId", contentAssocTypeId, "fromDate", fromDate), false); + contentAssoc = delegator.findOne("ContentAssoc", pk, false); } catch (GenericEntityException e) { Debug.logError(e, "Entity Error:" + e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentAssocRetrievingError", UtilMisc.toMap("errorString", e.getMessage()), locale)); @@ -809,7 +809,7 @@ public class ContentServices { try { GenericValue activeAssoc = null; if (fromDate != null) { - activeAssoc = delegator.findByPrimaryKey("ContentAssoc", UtilMisc.toMap("contentId", activeContentId, "contentIdTo", contentIdTo, "fromDate", fromDate, "contentAssocTypeId", contentAssocTypeId)); + activeAssoc = delegator.findOne("ContentAssoc", UtilMisc.toMap("contentId", activeContentId, "contentIdTo", contentIdTo, "fromDate", fromDate, "contentAssocTypeId", contentAssocTypeId), false); if (activeAssoc == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentAssocNotFound", UtilMisc.toMap("activeContentId", activeContentId, "contentIdTo", contentIdTo, "contentAssocTypeId", contentAssocTypeId, "fromDate", fromDate), locale)); } @@ -990,7 +990,7 @@ public class ContentServices { isPublished = true; if (Debug.infoOn()) Debug.logInfo("in publishContent, contentId:" + contentId + " contentIdTo:" + contentIdTo + " contentAssocTypeId:" + contentAssocTypeId + " publish:" + publish + " isPublished:" + isPublished, module); if (UtilValidate.isNotEmpty(publish) && publish.equalsIgnoreCase("Y")) { - GenericValue content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); String contentStatusId = (String) content.get("statusId"); String contentPrivilegeEnumId = (String) content.get("privilegeEnumId"); 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=1337665&r1=1337664&r2=1337665&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 Sat May 12 21:18:36 2012 @@ -114,11 +114,7 @@ public class ContentWorker implements or Debug.logError("No content ID found.", module); return null; } - if (cache) { - content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); - } else { - content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); - } + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), cache); if (content == null) { throw new GeneralException("No content found for content ID [" + contentId + "]"); } @@ -228,12 +224,7 @@ public class ContentWorker implements or if (!isDecorated && UtilValidate.isNotEmpty(contentDecoratorId)) { // if there is a decorator content; do not render this content; // instead render the decorator - GenericValue decorator; - if (cache) { - decorator = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentDecoratorId)); - } else { - decorator = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentDecoratorId)); - } + GenericValue decorator = delegator.findOne("Content", UtilMisc.toMap("contentId", contentDecoratorId), cache); if (decorator == null) { throw new GeneralException("No decorator content found for decorator contentId [" + contentDecoratorId + "]"); } @@ -292,8 +283,8 @@ public class ContentWorker implements or // This part is using an xml file as the input data and an ftl or xsl file to present it. if (UtilValidate.isNotEmpty(mimeType)) { if (mimeType.toLowerCase().indexOf("xml") >= 0) { - GenericValue dataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); - GenericValue templateDataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId", templateDataResourceId)); + GenericValue dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), true); + GenericValue templateDataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", templateDataResourceId), true); if ("FTL".equals(templateDataResource.getString("dataTemplateTypeId"))) { StringReader sr = new StringReader(textData); try { @@ -768,7 +759,7 @@ public class ContentWorker implements or for(GenericValue assoc : assocList) { String contentId = (String) assoc.get(contentIdName); if (Debug.infoOn()) Debug.logInfo("contentId:" + contentId, ""); - content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (UtilValidate.isNotEmpty(contentTypes)) { contentTypeId = content.getString("contentTypeId"); if (contentTypes.contains(contentTypeId)) { @@ -897,7 +888,7 @@ public class ContentWorker implements or public static void getContentTypeAncestry(Delegator delegator, String contentTypeId, List<String> contentTypes) throws GenericEntityException { contentTypes.add(contentTypeId); - GenericValue contentTypeValue = delegator.findByPrimaryKey("ContentType", UtilMisc.toMap("contentTypeId", contentTypeId)); + GenericValue contentTypeValue = delegator.findOne("ContentType", UtilMisc.toMap("contentTypeId", contentTypeId), false); if (contentTypeValue == null) return; String parentTypeId = (String) contentTypeValue.get("parentTypeId"); @@ -966,7 +957,7 @@ public class ContentWorker implements or if (!contentAncestorList.contains(contentIdOther)) { getContentAncestryAll(delegator, contentIdOther, passedContentTypeId, direction, contentAncestorList); if (!contentAncestorList.contains(contentIdOther)) { - GenericValue contentTo = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentIdOther)); + GenericValue contentTo = delegator.findOne("Content", UtilMisc.toMap("contentId", contentIdOther), true); String contentTypeId = contentTo.getString("contentTypeId"); if (contentTypeId != null && contentTypeId.equals(passedContentTypeId)) contentAncestorList.add(contentIdOther); @@ -1017,7 +1008,7 @@ public class ContentWorker implements or if (lst2.size() > 0) { GenericValue contentAssoc = lst2.get(0); getContentAncestryValues(delegator, contentAssoc.getString(contentIdOtherField), contentAssocTypeId, direction, contentAncestorList); - GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentAssoc.getString(contentIdOtherField))); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentAssoc.getString(contentIdOtherField)), true); contentAncestorList.add(content); } @@ -1233,7 +1224,7 @@ public class ContentWorker implements or ctx.put("contentIdTo", assocContentId); } if (thisContent == null) - thisContent = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", assocContentId)); + thisContent = delegator.findOne("Content", UtilMisc.toMap("contentId", assocContentId), true); ctx.put("content", thisContent); List<Object> purposes = getPurposes(thisContent); ctx.put("purposes", purposes); @@ -1464,7 +1455,7 @@ public class ContentWorker implements or List<String> values = null; for(String contentId : contentIdList) { try { - content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); } catch (GenericEntityException e) { Debug.logError(e.getMessage(), module); return FastList.newInstance(); @@ -1487,7 +1478,7 @@ public class ContentWorker implements or GenericValue content = null; for(String contentId : contentIdList) { try { - content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); } catch (GenericEntityException e) { Debug.logError(e.getMessage(), module); return FastList.newInstance(); @@ -1518,7 +1509,7 @@ public class ContentWorker implements or 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); @@ -1555,7 +1546,7 @@ public class ContentWorker implements or if (UtilValidate.isEmpty(mimeTypeId)) { if (UtilValidate.isNotEmpty(contentId) && UtilValidate.isNotEmpty(dataResourceId)) { - view = delegator.findByPrimaryKey("SubContentDataResourceView", UtilMisc.toMap("contentId", contentId, "drDataResourceId", dataResourceId)); + view = delegator.findOne("SubContentDataResourceView", UtilMisc.toMap("contentId", contentId, "drDataResourceId", dataResourceId), false); if (view != null) { mimeTypeId = view.getString("mimeTypeId"); String drMimeTypeId = view.getString("drMimeTypeId"); @@ -1574,7 +1565,7 @@ public class ContentWorker implements or if (UtilValidate.isEmpty(mimeTypeId)) { if (UtilValidate.isNotEmpty(parentContentId)) { - parentContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + parentContent = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (parentContent != null) { mimeTypeId = parentContent.getString("mimeTypeId"); } Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java Sat May 12 21:18:36 2012 @@ -295,7 +295,7 @@ public class UploadContentAndImage { // Check for existing AUTHOR link String userLoginId = userLogin.getString("userLoginId"); - GenericValue authorContent = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", userLoginId)); + GenericValue authorContent = delegator.findOne("Content", UtilMisc.toMap("contentId", userLoginId), true); if (authorContent != null) { List<GenericValue> authorAssocList = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", ftlContentId, "contentIdTo", userLoginId, "contentAssocTypeId", "AUTHOR")); List<GenericValue> currentAuthorAssocList = EntityUtil.filterByDate(authorAssocList); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java Sat May 12 21:18:36 2012 @@ -79,7 +79,7 @@ public class DataEvents { // get the content record GenericValue content; try { - content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); } catch (GenericEntityException e) { Debug.logError(e, module); request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); @@ -106,7 +106,7 @@ public class DataEvents { // get the data resource GenericValue dataResource; try { - dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); } catch (GenericEntityException e) { Debug.logError(e, module); request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); @@ -241,7 +241,7 @@ public class DataEvents { } try { - GenericValue dataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), true); if (!"Y".equals(dataResource.getString("isPublic"))) { // now require login... GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Sat May 12 21:18:36 2012 @@ -576,7 +576,7 @@ public class DataResourceWorker impleme throw new GeneralException("Cannot clear dataResource related cache for a null dataResourceId"); } - GenericValue dataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), true); if (dataResource != null) { String dataTemplateTypeId = dataResource.getString("dataTemplateTypeId"); if ("FTL".equals(dataTemplateTypeId)) { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java Sat May 12 21:18:36 2012 @@ -312,7 +312,7 @@ public class DataServices { // If textData exists, then create DataResource and return dataResourceId String dataResourceId = (String) context.get("dataResourceId"); try { - dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); } catch (GenericEntityException e) { Debug.logWarning(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentDataResourceNotFound", UtilMisc.toMap("parameters.dataResourceId", dataResourceId), locale)); @@ -366,7 +366,7 @@ public class DataServices { Debug.logVerbose("in updateElectronicText, textData:" + textData, module); } try { - electronicText = delegator.findByPrimaryKey("ElectronicText", UtilMisc.toMap("dataResourceId", dataResourceId)); + electronicText = delegator.findOne("ElectronicText", UtilMisc.toMap("dataResourceId", dataResourceId), false); if (electronicText != null) { electronicText.put("textData", textData); electronicText.store(); @@ -524,7 +524,7 @@ public class DataServices { if (byteBuffer != null) { byte[] imageBytes = byteBuffer.array(); try { - GenericValue imageDataResource = delegator.findByPrimaryKey("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue imageDataResource = delegator.findOne("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); if (Debug.infoOn()) { Debug.logInfo("imageDataResource(U):" + imageDataResource, module); Debug.logInfo("imageBytes(U):" + imageBytes, module); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java Sat May 12 21:18:36 2012 @@ -136,7 +136,7 @@ public class LayoutEvents { dispatcher.runSync("deactivateAssocs", context2); } - GenericValue dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); //Debug.logVerbose("in createLayoutImage, dataResource:" + dataResource, module); // Use objectInfo field to store the name of the file, since there is no // place in ImageDataResource for it. @@ -147,7 +147,7 @@ public class LayoutEvents { } // See if this needs to be a create or an update procedure - GenericValue imageDataResource = delegator.findByPrimaryKey("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue imageDataResource = delegator.findOne("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); //Debug.logVerbose("in createLayoutImage, imageDataResource(0):" + imageDataResource, module); if (imageDataResource == null) { imageDataResource = delegator.makeValue("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); @@ -195,7 +195,7 @@ public class LayoutEvents { String dataResourceId = (String) context.get("drDataResourceId"); Debug.logVerbose("in createLayoutImage(java), dataResourceId:" + dataResourceId, ""); - GenericValue dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); Debug.logVerbose("in createLayoutImage(java), dataResource:" + dataResource, ""); // Use objectInfo field to store the name of the file, since there is no // place in ImageDataResource for it. @@ -207,7 +207,7 @@ public class LayoutEvents { } // See if this needs to be a create or an update procedure - GenericValue imageDataResource = delegator.findByPrimaryKey("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue imageDataResource = delegator.findOne("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); if (imageDataResource == null) { imageDataResource = delegator.makeValue("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); imageDataResource.set("imageData", byteWrap.array()); @@ -321,7 +321,7 @@ public class LayoutEvents { String newId = null; String newDataResourceId = null; try { - content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); Debug.logVerbose("in cloneLayout, content:" + content, ""); if (content == null) { String errMsg = UtilProperties.getMessage(LayoutEvents.err_resource, "layoutEvents.content_empty", locale); @@ -334,7 +334,7 @@ public class LayoutEvents { newId = delegator.getNextSeqId("Content"); newContent.set("contentId", newId); String dataResourceId = (String) content.get("dataResourceId"); - GenericValue dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + GenericValue dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), false); if (dataResource != null) { GenericValue newDataResource = delegator.makeValue("DataResource", dataResource); Debug.logVerbose("in cloneLayout, newDataResource:" + newDataResource, ""); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/search/ContentDocument.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/search/ContentDocument.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/search/ContentDocument.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/search/ContentDocument.java Sat May 12 21:18:36 2012 @@ -59,7 +59,7 @@ public class ContentDocument { Document doc = null; GenericValue content; try { - content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId",id)); + content = delegator.findOne("Content", UtilMisc.toMap("contentId",id), true); } catch (GenericEntityException e) { Debug.logError(e, module); return doc; @@ -122,7 +122,7 @@ public class ContentDocument { //Debug.logInfo("in ContentDocument, dataResourceId:" + dataResourceId, module); GenericValue dataResource; try { - dataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId)); + dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId), true); } catch (GenericEntityException e) { Debug.logError(e, module); List<String> badIndexList = UtilGenerics.checkList(context.get("badIndexList")); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java Sat May 12 21:18:36 2012 @@ -52,7 +52,7 @@ public class DataResourceDocument { Document doc = null; GenericValue dataResource = null; try { - dataResource = delegator.findByPrimaryKeyCache("DataResource", UtilMisc.toMap("dataResourceId",id)); + dataResource = delegator.findOne("DataResource", UtilMisc.toMap("dataResourceId",id), true); } catch (GenericEntityException e) { Debug.logError(e, module); return doc; Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/search/SearchWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/search/SearchWorker.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/search/SearchWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/search/SearchWorker.java Sat May 12 21:18:36 2012 @@ -117,7 +117,7 @@ public class SearchWorker { for (String id : idList) { if (Debug.infoOn()) Debug.logInfo("in indexContent, id:" + id, module); try { - content = delegator.findByPrimaryKeyCache("Content", UtilMisc .toMap("contentId", id)); + content = delegator.findOne("Content", UtilMisc .toMap("contentId", id), true); if (content != null) { if (reader != null) { deleteContentDocument(content, reader); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java Sat May 12 21:18:36 2012 @@ -215,7 +215,7 @@ public class PdfSurveyServices { } pdfStamper.close(); if (UtilValidate.isNotEmpty(contentId)) { - survey = delegator.findByPrimaryKey("Survey", UtilMisc.toMap("surveyId", surveyId)); + survey = delegator.findOne("Survey", UtilMisc.toMap("surveyId", surveyId), false); survey.set("acroFormContentId", contentId); survey.store(); } @@ -248,7 +248,7 @@ public class PdfSurveyServices { //String contentId = (String)context.get("contentId"); surveyResponseId = (String)context.get("surveyResponseId"); if (UtilValidate.isNotEmpty(surveyResponseId)) { - GenericValue surveyResponse = delegator.findByPrimaryKey("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId)); + GenericValue surveyResponse = delegator.findOne("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId), false); if (surveyResponse != null) { surveyId = surveyResponse.getString("surveyId"); } @@ -423,13 +423,13 @@ public class PdfSurveyServices { Document document = new Document(); try { if (UtilValidate.isNotEmpty(surveyResponseId)) { - GenericValue surveyResponse = delegator.findByPrimaryKey("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId)); + GenericValue surveyResponse = delegator.findOne("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId), false); if (surveyResponse != null) { surveyId = surveyResponse.getString("surveyId"); } } if (UtilValidate.isNotEmpty(surveyId) && UtilValidate.isEmpty(contentId)) { - GenericValue survey = delegator.findByPrimaryKey("Survey", UtilMisc.toMap("surveyId", surveyId)); + GenericValue survey = delegator.findOne("Survey", UtilMisc.toMap("surveyId", surveyId), false); if (survey != null) { String acroFormContentId = survey.getString("acroFormContentId"); if (UtilValidate.isNotEmpty(acroFormContentId)) { @@ -445,7 +445,7 @@ public class PdfSurveyServices { for(GenericValue surveyResponseAnswer : responses) { String value = null; String surveyQuestionId = (String) surveyResponseAnswer.get("surveyQuestionId"); - GenericValue surveyQuestion = delegator.findByPrimaryKey("SurveyQuestion", UtilMisc.toMap("surveyQuestionId", surveyQuestionId)); + GenericValue surveyQuestion = delegator.findOne("SurveyQuestion", UtilMisc.toMap("surveyQuestionId", surveyQuestionId), false); String questionType = surveyQuestion.getString("surveyQuestionTypeId"); // DEJ20060227 this isn't used, if needed in the future should get from SurveyQuestionAppl.externalFieldRef String fieldName = surveyQuestion.getString("description"); if ("OPTION".equals(questionType)) { @@ -493,7 +493,7 @@ public class PdfSurveyServices { List<GenericValue> responses = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId)); for(GenericValue surveyResponseAnswer : responses) { String surveyQuestionId = (String) surveyResponseAnswer.get("surveyQuestionId"); - GenericValue surveyQuestion = delegator.findByPrimaryKey("SurveyQuestion", UtilMisc.toMap("surveyQuestionId", surveyQuestionId)); + GenericValue surveyQuestion = delegator.findOne("SurveyQuestion", UtilMisc.toMap("surveyQuestionId", surveyQuestionId), false); qAndA.add(UtilMisc.toMap("question", surveyQuestion, "response", surveyResponseAnswer)); } results.put("questionsAndAnswers", qAndA); @@ -518,14 +518,14 @@ public class PdfSurveyServices { try { String surveyId = null; if (UtilValidate.isNotEmpty(surveyResponseId)) { - GenericValue surveyResponse = delegator.findByPrimaryKey("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId)); + GenericValue surveyResponse = delegator.findOne("SurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId), false); if (surveyResponse != null) { surveyId = surveyResponse.getString("surveyId"); } } if (UtilValidate.isNotEmpty(surveyId)) { - GenericValue survey = delegator.findByPrimaryKey("Survey", UtilMisc.toMap("surveyId", surveyId)); + GenericValue survey = delegator.findOne("Survey", UtilMisc.toMap("surveyId", surveyId), false); if (survey != null) { acroFormContentId = survey.getString("acroFormContentId"); } @@ -536,7 +536,7 @@ public class PdfSurveyServices { String value = null; String surveyQuestionId = (String) surveyResponseAnswer.get("surveyQuestionId"); - GenericValue surveyQuestion = delegator.findByPrimaryKeyCache("SurveyQuestion", UtilMisc.toMap("surveyQuestionId", surveyQuestionId)); + GenericValue surveyQuestion = delegator.findOne("SurveyQuestion", UtilMisc.toMap("surveyQuestionId", surveyQuestionId), true); List<GenericValue> surveyQuestionApplList = EntityUtil.filterByDate(delegator.findByAndCache("SurveyQuestionAppl", UtilMisc.toMap("surveyId", surveyId, "surveyQuestionId", surveyQuestionId), UtilMisc.toList("-fromDate")), false); GenericValue surveyQuestionAppl = EntityUtil.getFirst(surveyQuestionApplList); @@ -619,7 +619,7 @@ public class PdfSurveyServices { String https = (String)context.get("https"); String webSiteId = (String)context.get("webSiteId"); String rootDir = (String)context.get("rootDir"); - GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue content = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), true); String dataResourceId = content.getString("dataResourceId"); inputByteBuffer = DataResourceWorker.getContentAsByteBuffer(delegator, dataResourceId, https, webSiteId, locale, rootDir); } catch (GenericEntityException e) { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java Sat May 12 21:18:36 2012 @@ -241,7 +241,7 @@ public class SurveyWrapper { public GenericValue getSurvey() { GenericValue survey = null; try { - survey = delegator.findByPrimaryKeyCache("Survey", UtilMisc.toMap("surveyId", surveyId)); + survey = delegator.findOne("Survey", UtilMisc.toMap("surveyId", surveyId), true); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get Survey : " + surveyId, module); } Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java?rev=1337665&r1=1337664&r2=1337665&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java Sat May 12 21:18:36 2012 @@ -53,7 +53,7 @@ public class LuceneTests extends OFBizTe @Override protected void setUp() throws Exception { - userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), false); } @Override |
Free forum by Nabble | Edit this page |