Author: doogie
Date: Mon May 14 21:00:34 2012 New Revision: 1338406 URL: http://svn.apache.org/viewvc?rev=1338406&view=rev Log: DEPRECATION: applications/content: findByAnd variants replaced with findByAnd that takes a boolean useCache parameter. 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/cms/CmsEvents.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/ContentSearch.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.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/survey/PdfSurveyServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.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=1338406&r1=1338405&r2=1338406&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java Mon May 14 21:00:34 2012 @@ -255,7 +255,7 @@ public class ContentManagementEvents { if (!currentSubContentId.equals(origSubContentId)) { // disable existing link if (UtilValidate.isNotEmpty(origSubContentId) && origFromDate != null) { - List<GenericValue> oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", origSubContentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null)); + List<GenericValue> oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", origSubContentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null), null, false); for(GenericValue cAssoc : oldActiveValues) { cAssoc.set("thruDate", nowTimestamp); cAssoc.store(); @@ -309,12 +309,12 @@ public class ContentManagementEvents { } } else if (UtilValidate.isNotEmpty(origSubContentId)) { // if no current link is passed in, look to see if there is an existing link(s) that must be disabled - List<GenericValue> oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", origSubContentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null)); + List<GenericValue> oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", origSubContentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null), null, false); for(GenericValue cAssoc : oldActiveValues) { cAssoc.set("thruDate", nowTimestamp); cAssoc.store(); } - oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", contentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null)); + oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", contentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null), null, false); for(GenericValue cAssoc : oldActiveValues) { cAssoc.set("thruDate", nowTimestamp); cAssoc.store(); 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=1338406&r1=1338405&r2=1338406&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Mon May 14 21:00:34 2012 @@ -490,7 +490,7 @@ public class ContentManagementServices { List<GenericValue> siteRoles = null; try { - siteRoles = delegator.findByAndCache("RoleType", UtilMisc.toMap("parentTypeId", "BLOG")); + siteRoles = delegator.findByAnd("RoleType", UtilMisc.toMap("parentTypeId", "BLOG"), null, true); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.toString()); } @@ -792,7 +792,7 @@ public class ContentManagementServices { public static void addRoleToUser(Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> serviceContext) throws GenericServiceException, GenericEntityException { String partyId = (String)serviceContext.get("partyId"); Map<String, Object> findMap = UtilMisc.<String, Object>toMap("partyId", partyId); - List<GenericValue> userLoginList = delegator.findByAnd("UserLogin", findMap); + List<GenericValue> userLoginList = delegator.findByAnd("UserLogin", findMap, null, false); for(GenericValue partyUserLogin : userLoginList) { String partyUserLoginId = partyUserLogin.getString("userLoginId"); serviceContext.put("contentId", partyUserLoginId); // author contentId @@ -819,7 +819,7 @@ public class ContentManagementServices { List<GenericValue> siteRoles = null; try { - siteRoles = delegator.findByAndCache("RoleType", UtilMisc.toMap("parentTypeId", "BLOG")); + siteRoles = delegator.findByAnd("RoleType", UtilMisc.toMap("parentTypeId", "BLOG"), null, true); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.toString()); } @@ -1492,7 +1492,7 @@ public class ContentManagementServices { boolean hasExistingContentRole = false; GenericValue contentRole = null; try { - List<GenericValue> contentRoleList = delegator.findByAndCache("ContentRole", UtilMisc.toMap("partyId", partyId, "contentId", webPubPt, "roleTypeId", roleTypeId)); + List<GenericValue> contentRoleList = delegator.findByAnd("ContentRole", UtilMisc.toMap("partyId", partyId, "contentId", webPubPt, "roleTypeId", roleTypeId), null, true); List<GenericValue> listFiltered = EntityUtil.filterByDate(contentRoleList, true); List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("fromDate DESC")); if (listOrdered.size() > 0) { @@ -1573,7 +1573,7 @@ public class ContentManagementServices { } GenericValue productContent = null; try { - List<GenericValue> lst = delegator.findByAndCache("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS")); + List<GenericValue> lst = delegator.findByAnd("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS"), null, true); List<GenericValue> listFiltered = EntityUtil.filterByDate(lst, orderCreatedDate, "purchaseFromDate", "purchaseThruDate", true); List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("purchaseFromDate", "purchaseThruDate")); List<GenericValue> listThrusOnly = EntityUtil.filterOutByCondition(listOrdered, EntityCondition.makeCondition("purchaseThruDate", EntityOperator.EQUALS, null)); @@ -1617,7 +1617,7 @@ public class ContentManagementServices { GenericValue orderHeader = null; try { - List<GenericValue> orderRoleList = delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "END_USER_CUSTOMER")); + List<GenericValue> orderRoleList = delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "END_USER_CUSTOMER"), null, false); if (orderRoleList.size() > 0) { GenericValue orderRole = orderRoleList.get(0); String partyId = (String) orderRole.get("partyId"); @@ -1639,7 +1639,7 @@ public class ContentManagementServices { for(GenericValue orderItem : orderItemList) { BigDecimal qty = orderItem.getBigDecimal("quantity"); String productId = (String) orderItem.get("productId"); - List<GenericValue> productContentList = delegator.findByAnd("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS")); + List<GenericValue> productContentList = delegator.findByAnd("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS"), null, false); List<GenericValue> productContentListFiltered = EntityUtil.filterByDate(productContentList); if (productContentListFiltered.size() > 0) { context.put("productId", productId); 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=1338406&r1=1338405&r2=1338406&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java Mon May 14 21:00:34 2012 @@ -338,7 +338,7 @@ public class ContentManagementWorker { public static List<GenericValue> getAllPublishPoints(Delegator delegator, String parentPubPt) throws GeneralException { List<GenericValue> relatedPubPts = null; try { - relatedPubPts = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap("contentIdTo", parentPubPt, "contentAssocTypeId", "SUBSITE")); + relatedPubPts = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentIdTo", parentPubPt, "contentAssocTypeId", "SUBSITE"), null, true); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); } @@ -385,7 +385,7 @@ public class ContentManagementWorker { public static List<Map<String, Object>> getStaticValues(Delegator delegator, String parentPlaceholderId, List<String []> permittedPublishPointList) throws GeneralException { List<GenericValue> assocValueList = null; try { - assocValueList = delegator.findByAndCache("Content", UtilMisc.toMap("contentTypeId", parentPlaceholderId)); + assocValueList = delegator.findByAnd("Content", UtilMisc.toMap("contentTypeId", parentPlaceholderId), null, true); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); } @@ -469,7 +469,7 @@ public class ContentManagementWorker { public static String getParentWebSitePublishPointId(Delegator delegator, String contentId) throws GenericEntityException { String contentIdTo = null; - List<GenericValue> contentAssocList = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentAssocTypeId", "SUBSITE")); + List<GenericValue> contentAssocList = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentAssocTypeId", "SUBSITE"), null, true); List<GenericValue> filteredContentAssocList = EntityUtil.filterByDate(contentAssocList); if (filteredContentAssocList.size() > 0) { GenericValue contentAssoc = filteredContentAssocList.get(0); @@ -540,7 +540,7 @@ public class ContentManagementWorker { /* */ List<GenericValue> assocValueList = null; try { - List<GenericValue> rawAssocValueList = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentAssocTypeId", "PUBLISH_LINK")); + List<GenericValue> rawAssocValueList = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentAssocTypeId", "PUBLISH_LINK"), null, true); assocValueList = EntityUtil.filterByDate(rawAssocValueList); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); @@ -639,7 +639,7 @@ public class ContentManagementWorker { public static List<GenericValue> getAllDepartmentContent(Delegator delegator, String parentPubPt) throws GeneralException { List<GenericValue> relatedPubPts = null; try { - relatedPubPts = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap("contentIdTo", parentPubPt, "contentAssocTypeId", "DEPARTMENT")); + relatedPubPts = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentIdTo", parentPubPt, "contentAssocTypeId", "DEPARTMENT"), null, true); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); 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=1338406&r1=1338405&r2=1338406&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java Mon May 14 21:00:34 2012 @@ -135,7 +135,7 @@ In order ta make this service active add contentName = contentName.substring(0, 100); } //check duplicate folder - contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName)); + contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName), null, false); if (contents.size() > 0) { GenericValue contentResult = contents.get(0); contentId = contentResult.get("contentId").toString(); @@ -144,8 +144,8 @@ In order ta make this service active add GenericValue contentResult = contents.get(0); contentId = contentResult.get("contentId").toString(); if (rootContent != null) { - contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent)); - List<GenericValue> contentAssocCheck = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentIdTo", rootContent)); + contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent), null, false); + List<GenericValue> contentAssocCheck = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentIdTo", rootContent), null, false); Iterator<GenericValue> contentAssChecks = contentAssocCheck.iterator(); while (contentAssChecks.hasNext() && contentNameMatch == false) { GenericValue contentAss = contentAssChecks.next(); @@ -159,7 +159,7 @@ In order ta make this service active add } } else { rootContent = "HOME_DUCUMENT"; - contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent)); + contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent), null, false); } contentAssocSize = contentAssocs.size(); } @@ -188,7 +188,7 @@ In order ta make this service active add if (rootContent == null) { rootContent = "HOME_DUCUMENT"; } - contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent, "contentAssocTypeId", "TREE_CHILD")); + contentAssocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", rootContent, "contentAssocTypeId", "TREE_CHILD"), null, false); if (contentAssocs.size() == 0) { contentAssoc = FastMap.newInstance(); contentAssoc.put("contentId", contentId); @@ -263,13 +263,13 @@ In order ta make this service active add if (contentName.length()>100) { contentName = contentName.substring(0,100); } - List<GenericValue> contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName), UtilMisc.toList("-contentId")); + List<GenericValue> contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName), UtilMisc.toList("-contentId"), false); if (contents != null) { Iterator<GenericValue> contentCheck = contents.iterator(); while (contentCheck.hasNext() && contentNameMatch == false) { GenericValue contentch = contentCheck.next(); if (contentch != null) { - List<GenericValue> contentAssocsChecks = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentch.get("contentId"), "contentIdTo", rootContent)); + List<GenericValue> contentAssocsChecks = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentch.get("contentId"), "contentIdTo", rootContent), null, false); if (contentAssocsChecks.size() > 0) { contentNameMatch = true; } @@ -323,13 +323,13 @@ In order ta make this service active add //lastItem if (index == size - 1) { contentNameMatch = false; - List<GenericValue> contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName)); + List<GenericValue> contents = delegator.findByAnd("Content", UtilMisc.toMap("contentName", contentName), null, false); if (contents != null) { Iterator<GenericValue> contentCheck = contents.iterator(); while (contentCheck.hasNext() && contentNameMatch == false) { GenericValue contentch = contentCheck.next(); if (contentch != null) { - List<GenericValue> contentAssocsChecks = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentch.get("contentId"), "contentIdTo", rootContent)); + List<GenericValue> contentAssocsChecks = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentch.get("contentId"), "contentIdTo", rootContent), null, false); if (contentAssocsChecks.size() > 0) { contentNameMatch = true; } 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -120,8 +120,8 @@ public class CmsEvents { if (pathInfo == null) { List<GenericValue> defaultContents = null; try { - defaultContents = delegator.findByAndCache("WebSiteContent", UtilMisc.toMap("webSiteId", webSiteId, - "webSiteContentTypeId", "DEFAULT_PAGE"), UtilMisc.toList("-fromDate")); + defaultContents = delegator.findByAnd("WebSiteContent", UtilMisc.toMap("webSiteId", webSiteId, + "webSiteContentTypeId", "DEFAULT_PAGE"), UtilMisc.toList("-fromDate"), true); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -203,9 +203,9 @@ public class CmsEvents { if (statusCode != HttpServletResponse.SC_OK) { List<GenericValue> errorContainers = null; try { - errorContainers = delegator.findByAndCache("WebSiteContent", + errorContainers = delegator.findByAnd("WebSiteContent", UtilMisc.toMap("webSiteId", webSiteId, "webSiteContentTypeId", "ERROR_ROOT"), - UtilMisc.toList("-fromDate")); + UtilMisc.toList("-fromDate"), true); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -217,7 +217,7 @@ public class CmsEvents { List<GenericValue> errorPages = null; try { - errorPages = delegator.findByAnd("ContentAssocViewTo", UtilMisc.toMap("contentIdStart", errorContainer.getString("contentId"), "caContentAssocTypeId", "TREE_CHILD", "contentTypeId", "DOCUMENT", "caMapKey", String.valueOf(statusCode))); + errorPages = delegator.findByAnd("ContentAssocViewTo", UtilMisc.toMap("contentIdStart", errorContainer.getString("contentId"), "caContentAssocTypeId", "TREE_CHILD", "contentTypeId", "DOCUMENT", "caMapKey", String.valueOf(statusCode)), null, false); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -286,7 +286,7 @@ public class CmsEvents { writer.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); // if use web analytics - List<GenericValue> webAnalytics = delegator.findByAnd("WebAnalyticsConfig", UtilMisc.toMap("webSiteId", webSiteId)); + List<GenericValue> webAnalytics = delegator.findByAnd("WebAnalyticsConfig", UtilMisc.toMap("webSiteId", webSiteId), null, false); // render if (UtilValidate.isNotEmpty(webAnalytics) && hasErrorPage) { @@ -351,9 +351,9 @@ public class CmsEvents { List<GenericValue> publishPoints = null; boolean hadContent = false; try { - publishPoints = delegator.findByAndCache("WebSiteContent", + publishPoints = delegator.findByAnd("WebSiteContent", UtilMisc.toMap("webSiteId", webSiteId, "contentId", contentId, "webSiteContentTypeId", "PUBLISH_POINT"), - UtilMisc.toList("-fromDate")); + UtilMisc.toList("-fromDate"), true); } catch (GenericEntityException e) { throw e; } @@ -367,8 +367,8 @@ public class CmsEvents { } else { // the passed in contentId is not a publish point for the web site; // however we will publish its content if it is a node of one of the trees that have a publish point as the root - List<GenericValue> topLevelContentValues = delegator.findByAndCache("WebSiteContent", - UtilMisc.toMap("webSiteId", webSiteId, "webSiteContentTypeId", "PUBLISH_POINT"), UtilMisc.toList("-fromDate")); + List<GenericValue> topLevelContentValues = delegator.findByAnd("WebSiteContent", + UtilMisc.toMap("webSiteId", webSiteId, "webSiteContentTypeId", "PUBLISH_POINT"), UtilMisc.toList("-fromDate"), true); topLevelContentValues = EntityUtil.filterByDate(topLevelContentValues); if (topLevelContentValues != null) { @@ -393,14 +393,14 @@ public class CmsEvents { } protected static int verifySubContent(Delegator delegator, String contentId, String contentIdFrom) throws GeneralException { - List<GenericValue> contentAssoc = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap("contentId", contentIdFrom, "contentIdTo", contentId, "contentAssocTypeId", "SUB_CONTENT")); + List<GenericValue> contentAssoc = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentIdFrom, "contentIdTo", contentId, "contentAssocTypeId", "SUB_CONTENT"), null, true); boolean hadContent = false; if (UtilValidate.isNotEmpty(contentAssoc)) { hadContent = true; } contentAssoc = EntityUtil.filterByDate(contentAssoc); if (UtilValidate.isEmpty(contentAssoc)) { - List<GenericValue> assocs = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap("contentId", contentIdFrom)); + List<GenericValue> assocs = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentIdFrom), null, true); assocs = EntityUtil.filterByDate(assocs); if (assocs != null) { for (GenericValue assoc : assocs) { 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -77,20 +77,20 @@ public class ContentKeywordIndex { addWeightedKeywordSourceString(content, "description", strings); // ContentAttribute - List<GenericValue> contentAttributes = delegator.findByAnd("ContentAttribute", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> contentAttributes = delegator.findByAnd("ContentAttribute", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue contentAttribute: contentAttributes) { addWeightedKeywordSourceString(contentAttribute, "attrName", strings); addWeightedKeywordSourceString(contentAttribute, "attrValue", strings); } // ContentMetaData - List<GenericValue> contentMetaDatas = delegator.findByAnd("ContentMetaData", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> contentMetaDatas = delegator.findByAnd("ContentMetaData", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue contentMetaData: contentMetaDatas) { addWeightedKeywordSourceString(contentMetaData, "metaDataValue", strings); } // ContentRole - List<GenericValue> contentRoles = delegator.findByAnd("ContentRole", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> contentRoles = delegator.findByAnd("ContentRole", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue contentRole: contentRoles) { GenericValue party = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", contentRole.getString("partyId")), false); if (party != null) { @@ -103,7 +103,7 @@ public class ContentKeywordIndex { } // DataResourceRole - List<GenericValue> dataResourceRoles = delegator.findByAnd("DataResourceRole", UtilMisc.toMap("dataResourceId", content.getString("dataResourceId"))); + List<GenericValue> dataResourceRoles = delegator.findByAnd("DataResourceRole", UtilMisc.toMap("dataResourceId", content.getString("dataResourceId")), null, false); for (GenericValue dataResourceRole: dataResourceRoles) { GenericValue party = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", dataResourceRole.getString("partyId")), false); if (party != null) { @@ -116,7 +116,7 @@ public class ContentKeywordIndex { } // Product - List<GenericValue> productContentList = delegator.findByAnd("ProductContent", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> productContentList = delegator.findByAnd("ProductContent", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue productContent: productContentList) { GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productContent.getString("productId")), false); if (product != null) { @@ -129,7 +129,7 @@ public class ContentKeywordIndex { } // ProductCategory - List<GenericValue> productCategoryContentList = delegator.findByAnd("ProductCategoryContent", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> productCategoryContentList = delegator.findByAnd("ProductCategoryContent", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue productCategoryContent: productCategoryContentList) { GenericValue productCategory = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryContent.getString("productCategoryId")), false); if (productCategory != null) { @@ -140,7 +140,7 @@ public class ContentKeywordIndex { } // PartyContent - List<GenericValue> partyContents = delegator.findByAnd("PartyContent", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> partyContents = delegator.findByAnd("PartyContent", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue partyContent: partyContents) { GenericValue party = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", partyContent.getString("partyId")), false); if (party != null) { @@ -153,7 +153,7 @@ public class ContentKeywordIndex { } // WebSiteContent - List<GenericValue> webSiteContents = delegator.findByAnd("WebSiteContent", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> webSiteContents = delegator.findByAnd("WebSiteContent", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue webSiteContent: webSiteContents) { GenericValue webSite = delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteContent.getString("webSiteId")), false); if (webSite != null) { @@ -164,7 +164,7 @@ public class ContentKeywordIndex { } // WorkEffortContent - List<GenericValue> workEffortContents = delegator.findByAnd("WorkEffortContent", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> workEffortContents = delegator.findByAnd("WorkEffortContent", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue workEffortContent: workEffortContents) { GenericValue workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortContent.getString("workEffortId")), false); if (workEffort != null) { @@ -178,7 +178,7 @@ public class ContentKeywordIndex { addWeightedKeywordSourceString(dataResource, "dataResourceName", strings); addWeightedKeywordSourceString(dataResource, "objectInfo", strings); } - /*List<GenericValue> contentDataResourceViews = delegator.findByAnd("ContentDataResourceView", UtilMisc.toMap("contentId", contentId), null); + /*List<GenericValue> contentDataResourceViews = delegator.findByAnd("ContentDataResourceView", UtilMisc.toMap("contentId", contentId), null, false); for (GenericValue contentDataResourceView: contentDataResourceViews) { int weight = 1; addWeightedDataResourceString(contentDataResourceView, weight, strings, delegator, content); 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -297,11 +297,7 @@ public class ContentMapFacade implements expressions.put("statusId", this.statusFilter); } - if (cache) { - subs = delegator.findByAndCache("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); - } else { - subs = delegator.findByAnd("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); - } + subs = delegator.findByAnd("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder), cache); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -471,11 +467,7 @@ public class ContentMapFacade implements if(!this.statusFilter.equals("")) { expressions.put("statusId", this.statusFilter); } - if (cache) { - subs = delegator.findByAndCache("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); - } else { - subs = delegator.findByAnd("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); - } + subs = delegator.findByAnd("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder), cache); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -515,11 +507,7 @@ public class ContentMapFacade implements String name = (String) key; List<GenericValue> metaData = null; try { - if (cache) { - metaData = delegator.findByAndCache("ContentMetaData", UtilMisc.toMap("contentId", contentId, "metaDataPredicateId", name)); - } else { - metaData = delegator.findByAnd("ContentMetaData", UtilMisc.toMap("contentId", contentId, "metaDataPredicateId", name)); - } + metaData = delegator.findByAnd("ContentMetaData", UtilMisc.toMap("contentId", contentId, "metaDataPredicateId", name), null, cache); } catch (GenericEntityException e) { Debug.logError(e, module); } 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -79,7 +79,7 @@ public class ContentSearch { // now find all sub-categories, filtered by effective dates, and call this routine for them try { - List<GenericValue> contentAssocList = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap("contentIdFrom", contentId)); + List<GenericValue> contentAssocList = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentIdFrom", contentId), null, true); for (GenericValue contentAssoc: contentAssocList) { String subContentId = contentAssoc.getString("contentIdTo"); if (contentIdSet.contains(subContentId)) { 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -278,7 +278,7 @@ public class ContentServices { // get first statusId for content out of the statusItem table if not provided if (UtilValidate.isEmpty(context.get("statusId"))) { try { - List<GenericValue> statusItems = delegator.findByAnd("StatusItem",UtilMisc.toMap("statusTypeId", "CONTENT_STATUS"), UtilMisc.toList("sequenceId")); + List<GenericValue> statusItems = delegator.findByAnd("StatusItem",UtilMisc.toMap("statusTypeId", "CONTENT_STATUS"), UtilMisc.toList("sequenceId"), false); if (!UtilValidate.isEmpty(statusItems)) { content.put("statusId", (statusItems.get(0)).getString("statusId")); } 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -244,7 +244,7 @@ public class ContentServicesComplex { List<GenericValue> contentAssocsUnfiltered = null; //if (Debug.infoOn()) Debug.logInfo("in getAssocAndContent...Cache, fieldMap:" + fieldMap, module); - contentAssocsUnfiltered = delegator.findByAndCache("ContentAssoc", fieldMap, UtilMisc.toList("-fromDate")); + contentAssocsUnfiltered = delegator.findByAnd("ContentAssoc", fieldMap, UtilMisc.toList("-fromDate"), true); //if (Debug.infoOn()) Debug.logInfo("in getAssocAndContent...Cache, contentAssocsUnfiltered:" + contentAssocsUnfiltered, module); if (fromDate == null && fromDateStr != null) { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java?rev=1338406&r1=1338405&r2=1338406&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java Mon May 14 21:00:34 2012 @@ -72,11 +72,11 @@ public class ContentUrlFilter extends Co String alternativeUrl = pathInfo.substring(pathInfo.lastIndexOf("/")); if (alternativeUrl.endsWith("-content")) { try { - List<GenericValue> contentDataResourceViews = delegator.findByAnd("ContentDataResourceView", UtilMisc.toMap("drObjectInfo", alternativeUrl)); + List<GenericValue> contentDataResourceViews = delegator.findByAnd("ContentDataResourceView", UtilMisc.toMap("drObjectInfo", alternativeUrl), null, false); if (contentDataResourceViews.size() > 0) { contentDataResourceViews = EntityUtil.orderBy(contentDataResourceViews, UtilMisc.toList("createdDate DESC")); GenericValue contentDataResourceView = EntityUtil.getFirst(contentDataResourceViews); - List<GenericValue> contents = EntityUtil.filterByDate(delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentAssocTypeId", "ALTERNATIVE_URL", "contentIdTo", contentDataResourceView.getString("contentId")))); + List<GenericValue> contents = EntityUtil.filterByDate(delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentAssocTypeId", "ALTERNATIVE_URL", "contentIdTo", contentDataResourceView.getString("contentId")), null, false)); if (contents.size() > 0) { GenericValue content = EntityUtil.getFirst(contents); urlContentId = content.getString("contentId"); 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -121,9 +121,9 @@ public class ContentWorker implements or // if the content is a PUBLISH_POINT and the data resource is not defined; get the related content if ("WEB_SITE_PUB_PT".equals(content.get("contentTypeId")) && content.get("dataResourceId") == null) { - List<GenericValue> relContentIds = delegator.findByAndCache("ContentAssocDataResourceViewTo", + List<GenericValue> relContentIds = delegator.findByAnd("ContentAssocDataResourceViewTo", UtilMisc.toMap("contentIdStart", content.get("contentId"),"statusId","CTNT_PUBLISHED", - "caContentAssocTypeId", "PUBLISH_LINK"), UtilMisc.toList("caFromDate")); + "caContentAssocTypeId", "PUBLISH_LINK"), UtilMisc.toList("caFromDate"), true); relContentIds = EntityUtil.filterByDate(relContentIds, UtilDateTime.nowTimestamp(), "caFromDate", "caThruDate", true); if (UtilValidate.isNotEmpty(relContentIds)) { @@ -919,7 +919,7 @@ public class ContentWorker implements or andMap = UtilMisc.<String, Object>toMap(contentIdField, contentId, "contentAssocTypeId", contentAssocTypeId); } try { - List<GenericValue> lst = delegator.findByAndCache("ContentAssoc", andMap); + List<GenericValue> lst = delegator.findByAnd("ContentAssoc", andMap, null, true); //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst:" + lst, ""); List<GenericValue> lst2 = EntityUtil.filterByDate(lst); //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, ""); @@ -948,7 +948,7 @@ public class ContentWorker implements or if (Debug.infoOn()) Debug.logInfo("getContentAncestry, contentId:" + contentId, ""); Map<String, Object> andMap = UtilMisc.<String, Object>toMap(contentIdField, contentId); try { - List<GenericValue> lst = delegator.findByAndCache("ContentAssoc", andMap); + List<GenericValue> lst = delegator.findByAnd("ContentAssoc", andMap, null, true); //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst:" + lst, ""); List<GenericValue> lst2 = EntityUtil.filterByDate(lst); //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, ""); @@ -1001,7 +1001,7 @@ public class ContentWorker implements or //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, contentId:" + contentId, ""); try { - List<GenericValue> lst = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap(contentIdField, contentId, "contentAssocTypeId", contentAssocTypeId)); + List<GenericValue> lst = delegator.findByAnd("ContentAssoc", UtilMisc.toMap(contentIdField, contentId, "contentAssocTypeId", contentAssocTypeId), null, true); //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst:" + lst, ""); List<GenericValue> lst2 = EntityUtil.filterByDate(lst); //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, ""); @@ -1079,7 +1079,7 @@ public class ContentWorker implements or view = entityList.get(0); } } else { - List<GenericValue> lst = delegator.findByAnd("ContentDataResourceView", UtilMisc.toMap("contentId", subContentId)); + List<GenericValue> lst = delegator.findByAnd("ContentDataResourceView", UtilMisc.toMap("contentId", subContentId), null, false); if (UtilValidate.isEmpty(lst)) { throw new IOException("No subContent found for subContentId=." + subContentId); } @@ -1129,7 +1129,7 @@ public class ContentWorker implements or public static GenericValue getContentCache(Delegator delegator, String contentId) throws GenericEntityException { GenericValue view = null; - List<GenericValue> lst = delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", contentId)); + List<GenericValue> lst = delegator.findByAnd("ContentDataResourceView", UtilMisc.toMap("contentId", contentId), null, true); //if (Debug.infoOn()) Debug.logInfo("getContentCache, lst(2):" + lst, ""); if (UtilValidate.isNotEmpty(lst)) { view = lst.get(0); 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -297,7 +297,7 @@ public class UploadContentAndImage { String userLoginId = userLogin.getString("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> authorAssocList = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", ftlContentId, "contentIdTo", userLoginId, "contentAssocTypeId", "AUTHOR"), null, false); List<GenericValue> currentAuthorAssocList = EntityUtil.filterByDate(authorAssocList); //if (Debug.infoOn()) Debug.logInfo("[UploadContentAndImage]currentAuthorAssocList " + currentAuthorAssocList, module); if (currentAuthorAssocList.size() == 0) { 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -255,7 +255,7 @@ public class DataEvents { // make sure the logged in user can download this content; otherwise is a pretty big security hole for DataResource records... // TODO: should we restrict the roleTypeId? List<GenericValue> contentAndRoleList = delegator.findByAnd("ContentAndRole", - UtilMisc.toMap("partyId", userLogin.get("partyId"), "dataResourceId", dataResourceId)); + UtilMisc.toMap("partyId", userLogin.get("partyId"), "dataResourceId", dataResourceId), null, false); if (contentAndRoleList.size() == 0) { String errorMsg = "You do not have permission to download the Data Resource with ID [" + dataResourceId + "], ie you are not associated with it."; Debug.logError(errorMsg, module); 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -118,7 +118,7 @@ public class DataResourceWorker impleme if (parentCategoryId != null) { matchValue = parentCategoryId; } - List<GenericValue> categoryValues = delegator.findByAndCache("DataCategory", UtilMisc.toMap("parentCategoryId", matchValue)); + List<GenericValue> categoryValues = delegator.findByAnd("DataCategory", UtilMisc.toMap("parentCategoryId", matchValue), null, true); categoryNode.put("count", Integer.valueOf(categoryValues.size())); List<Map<String, Object>> subCategoryIds = FastList.newInstance(); for (int i = 0; i < categoryValues.size(); i++) { 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -137,7 +137,7 @@ public class DataServices { // get first statusId for content out of the statusItem table if not provided if (UtilValidate.isEmpty(dataResource.get("statusId"))) { try { - List<GenericValue> statusItems = delegator.findByAnd("StatusItem",UtilMisc.toMap("statusTypeId", "CONTENT_STATUS"), UtilMisc.toList("sequenceId")); + List<GenericValue> statusItems = delegator.findByAnd("StatusItem",UtilMisc.toMap("statusTypeId", "CONTENT_STATUS"), UtilMisc.toList("sequenceId"), false); if (!UtilValidate.isEmpty(statusItems)) { dataResource.put("statusId", statusItems.get(0).getString("statusId")); } 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -271,7 +271,7 @@ public class PdfSurveyServices { //AcroFields.Item item = fs.getFieldItem(fieldName); //int type = fs.getFieldType(fieldName); String value = fs.getField(fieldName); - List<GenericValue> questions = delegator.findByAnd("SurveyQuestionAndAppl", UtilMisc.toMap("surveyId", surveyId, "externalFieldRef", fieldName)); + List<GenericValue> questions = delegator.findByAnd("SurveyQuestionAndAppl", UtilMisc.toMap("surveyId", surveyId, "externalFieldRef", fieldName), null, false); if (questions.size() == 0) { Debug.logInfo("No question found for surveyId:" + surveyId + " and externalFieldRef:" + fieldName, module); continue; @@ -441,7 +441,7 @@ public class PdfSurveyServices { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter.getInstance(document, baos); - List<GenericValue> responses = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId)); + List<GenericValue> responses = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId), null, false); for(GenericValue surveyResponseAnswer : responses) { String value = null; String surveyQuestionId = (String) surveyResponseAnswer.get("surveyQuestionId"); @@ -490,7 +490,7 @@ public class PdfSurveyServices { List<Object> qAndA = FastList.newInstance(); try { - List<GenericValue> responses = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId)); + List<GenericValue> responses = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId), null, false); for(GenericValue surveyResponseAnswer : responses) { String surveyQuestionId = (String) surveyResponseAnswer.get("surveyQuestionId"); GenericValue surveyQuestion = delegator.findOne("SurveyQuestion", UtilMisc.toMap("surveyQuestionId", surveyQuestionId), false); @@ -531,14 +531,14 @@ public class PdfSurveyServices { } } - List<GenericValue> responses = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId)); + List<GenericValue> responses = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId), null, false); for(GenericValue surveyResponseAnswer : responses) { String value = null; String surveyQuestionId = (String) surveyResponseAnswer.get("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); + List<GenericValue> surveyQuestionApplList = EntityUtil.filterByDate(delegator.findByAnd("SurveyQuestionAppl", UtilMisc.toMap("surveyId", surveyId, "surveyQuestionId", surveyQuestionId), UtilMisc.toList("-fromDate"), true), false); GenericValue surveyQuestionAppl = EntityUtil.getFirst(surveyQuestionApplList); String questionType = surveyQuestion.getString("surveyQuestionTypeId"); 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=1338406&r1=1338405&r2=1338406&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 Mon May 14 21:00:34 2012 @@ -288,8 +288,8 @@ public class SurveyWrapper { try { Map<String, Object> fields = UtilMisc.<String, Object>toMap("surveyId", surveyId); - List<String> order = UtilMisc.<String>toList("sequenceNum", "surveyMultiRespColId"); - questions = delegator.findByAndCache("SurveyQuestionAndAppl", fields, order); + List<String> order = UtilMisc.toList("sequenceNum", "surveyMultiRespColId"); + questions = delegator.findByAnd("SurveyQuestionAndAppl", fields, order, true); if (questions != null) { questions = EntityUtil.filterByDate(questions); } @@ -313,7 +313,7 @@ public class SurveyWrapper { String responseId = null; List<GenericValue> responses = null; try { - responses = delegator.findByAnd("SurveyResponse", UtilMisc.toMap("surveyId", surveyId, "partyId", partyId), UtilMisc.toList("-lastModifiedDate")); + responses = delegator.findByAnd("SurveyResponse", UtilMisc.toMap("surveyId", surveyId, "partyId", partyId), UtilMisc.toList("-lastModifiedDate"), false); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -346,7 +346,7 @@ public class SurveyWrapper { public List<GenericValue> getSurveyResponses(GenericValue question) throws SurveyWrapperException { List<GenericValue> responses = null; try { - responses = delegator.findByAnd("SurveyResponse", UtilMisc.toMap("surveyQuestionId", question.getString("surveyQuestionId"))); + responses = delegator.findByAnd("SurveyResponse", UtilMisc.toMap("surveyQuestionId", question.getString("surveyQuestionId")), null, false); } catch (GenericEntityException e) { throw new SurveyWrapperException(e); } @@ -360,7 +360,7 @@ public class SurveyWrapper { if (responseId != null) { List<GenericValue> answers = null; try { - answers = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", responseId)); + answers = delegator.findByAnd("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", responseId), null, false); } catch (GenericEntityException e) { Debug.logError(e, module); } 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=1338406&r1=1338405&r2=1338406&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/content/ContentNav.ftl Mon May 14 21:00:34 2012 @@ -38,7 +38,7 @@ var rawdata = [ <#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"))/> + <#assign assocChilds = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD", null, false))/> "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "AssocType" : "${assoc.contentAssocTypeId}", "fromDate" : "${assoc.fromDate}"} <#if assocChilds?has_content> ,"children": [ Modified: ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.ftl?rev=1338406&r1=1338405&r2=1338406&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/content/DisplayContentNav.ftl Mon May 14 21:00:34 2012 @@ -42,7 +42,7 @@ var rawdata = [ </#if> { "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"), Static["org.ofbiz.base.util.UtilMisc"].toList("sequenceNum"))/> + <#assign assocChilds = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD"), Static["org.ofbiz.base.util.UtilMisc"].toList("sequenceNum"), false)/> "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "AssocType" : "${assoc.contentAssocTypeId}", "fromDate" : "${assoc.fromDate}"} <#if assocChilds?has_content> ,"children": [ |
Free forum by Nabble | Edit this page |