|
Author: doogie
Date: Tue May 29 04:17:44 2012 New Revision: 1343511 URL: http://svn.apache.org/viewvc?rev=1343511&view=rev Log: DEPRECATION: applications/content: GenericValue.getRelated/getRelatedCache variants replaced with a single getRelated variant that takes a boolean useCache parameter. Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentKeywordIndex.java ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/search/ContentDocument.java ofbiz/trunk/applications/content/template/survey/genericsurvey.ftl ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/survey/EditSurveyQuestions.groovy ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/EditWebSiteParties.groovy ofbiz/trunk/applications/content/webapp/content/content/nav.ftl ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl ofbiz/trunk/applications/content/webapp/content/survey/ViewSurveyResponses.ftl ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl 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=1343511&r1=1343510&r2=1343511&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Tue May 29 04:17:44 2012 @@ -1634,7 +1634,7 @@ public class ContentManagementServices { } Timestamp orderCreatedDate = (Timestamp) orderHeader.get("orderDate"); context.put("orderCreatedDate", orderCreatedDate); - List<GenericValue> orderItemList = orderHeader.getRelated("OrderItem"); + List<GenericValue> orderItemList = orderHeader.getRelated("OrderItem", null, null, false); ModelService subscriptionModel = dispatcher.getDispatchContext().getModelService("updateContentSubscriptionByProduct"); for(GenericValue orderItem : orderItemList) { BigDecimal qty = orderItem.getBigDecimal("quantity"); 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=1343511&r1=1343510&r2=1343511&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 Tue May 29 04:17:44 2012 @@ -183,7 +183,7 @@ public class ContentKeywordIndex { int weight = 1; addWeightedDataResourceString(contentDataResourceView, weight, strings, delegator, content); - List<GenericValue> alternateViews = contentDataResourceView.getRelated("ContentAssocDataResourceViewTo", UtilMisc.toMap("caContentAssocTypeId", "ALTERNATE_LOCALE"), UtilMisc.toList("-caFromDate")); + List<GenericValue> alternateViews = contentDataResourceView.getRelated("ContentAssocDataResourceViewTo", UtilMisc.toMap("caContentAssocTypeId", "ALTERNATE_LOCALE"), UtilMisc.toList("-caFromDate"), false); alternateViews = EntityUtil.filterByDate(alternateViews, UtilDateTime.nowTimestamp(), "caFromDate", "caThruDate", true); for (GenericValue thisView: alternateViews) { addWeightedDataResourceString(thisView, weight, strings, delegator, content); 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=1343511&r1=1343510&r2=1343511&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 Tue May 29 04:17:44 2012 @@ -153,7 +153,7 @@ public class ContentWorker implements or if (partyId != null && roleTypeId != null) { List<GenericValue> alternateViews = null; try { - alternateViews = content.getRelatedCache("ContentAssocDataResourceViewTo", UtilMisc.toMap("caContentAssocTypeId", "ALTERNATE_ROLE"), UtilMisc.toList("-caFromDate")); + alternateViews = content.getRelated("ContentAssocDataResourceViewTo", UtilMisc.toMap("caContentAssocTypeId", "ALTERNATE_ROLE"), UtilMisc.toList("-caFromDate"), true); } catch (GenericEntityException e) { Debug.logError(e, "Error finding alternate content: " + e.toString(), module); } @@ -375,7 +375,7 @@ public class ContentWorker implements or List<GenericValue> alternateViews = null; try { - alternateViews = view.getRelatedCache("ContentAssocDataResourceViewTo", UtilMisc.toMap("caContentAssocTypeId", "ALTERNATE_LOCALE"), UtilMisc.toList("-caFromDate")); + alternateViews = view.getRelated("ContentAssocDataResourceViewTo", UtilMisc.toMap("caContentAssocTypeId", "ALTERNATE_LOCALE"), UtilMisc.toList("-caFromDate"), true); } catch (GenericEntityException e) { Debug.logError(e, "Error finding alternate locale content: " + e.toString(), module); return contentAssocDataResourceViewFrom; @@ -445,7 +445,7 @@ public class ContentWorker implements or GenericValue assoc = keywordList.get(i); keywords.add(assoc.getString("contentId")); } - List<GenericValue> purposeValueList = content.getRelatedCache("ContentPurpose"); + List<GenericValue> purposeValueList = content.getRelated("ContentPurpose", null, null, true); List<String> purposes = FastList.newInstance(); for (int i = 0; i < purposeValueList.size(); i++) { GenericValue purposeValue = purposeValueList.get(i); @@ -608,7 +608,7 @@ public class ContentWorker implements or public static List<Object> getPurposes(GenericValue content) { List<Object> purposes = FastList.newInstance(); try { - List<GenericValue> purposeValueList = content.getRelatedCache("ContentPurpose"); + List<GenericValue> purposeValueList = content.getRelated("ContentPurpose", null, null, true); for (int i = 0; i < purposeValueList.size(); i++) { GenericValue purposeValue = purposeValueList.get(i); purposes.add(purposeValue.get("contentPurposeTypeId")); @@ -622,7 +622,7 @@ public class ContentWorker implements or public static List<Object> getSections(GenericValue content) { List<Object> sections = FastList.newInstance(); try { - List<GenericValue> sectionValueList = content.getRelatedCache("FromContentAssoc"); + List<GenericValue> sectionValueList = content.getRelated("FromContentAssoc", null, null, true); for (int i = 0; i < sectionValueList.size(); i++) { GenericValue sectionValue = sectionValueList.get(i); String contentAssocPredicateId = (String)sectionValue.get("contentAssocPredicateId"); @@ -639,7 +639,7 @@ public class ContentWorker implements or public static List<Object> getTopics(GenericValue content) { List<Object> topics = FastList.newInstance(); try { - List<GenericValue> topicValueList = content.getRelatedCache("FromContentAssoc"); + List<GenericValue> topicValueList = content.getRelated("FromContentAssoc", null, null, true); for (int i = 0; i < topicValueList.size(); i++) { GenericValue topicValue = topicValueList.get(i); String contentAssocPredicateId = (String)topicValue.get("contentAssocPredicateId"); 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=1343511&r1=1343510&r2=1343511&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 Tue May 29 04:17:44 2012 @@ -169,7 +169,7 @@ public class ContentDocument { } List<GenericValue> featureDataResourceList; try { - featureDataResourceList = content.getRelatedCache("ProductFeatureDataResource"); + featureDataResourceList = content.getRelated("ProductFeatureDataResource", null, null, true); } catch (GenericEntityException e) { Debug.logError(e, module); List<String> badIndexList = UtilGenerics.checkList(context.get("badIndexList")); Modified: ofbiz/trunk/applications/content/template/survey/genericsurvey.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/template/survey/genericsurvey.ftl?rev=1343511&r1=1343510&r2=1343511&view=diff ============================================================================== --- ofbiz/trunk/applications/content/template/survey/genericsurvey.ftl (original) +++ ofbiz/trunk/applications/content/template/survey/genericsurvey.ftl Tue May 29 04:17:44 2012 @@ -73,7 +73,7 @@ under the License. </#if> <input type="file" size="15" name="${questionFieldName}" class="inputBox"/> <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION"/> - <#assign options = surveyQuestionAndAppl.getRelated("SurveyQuestionOption", sequenceSort)?if_exists/> + <#assign options = surveyQuestionAndAppl.getRelated("SurveyQuestionOption", null, sequenceSort, false)?if_exists/> <#assign selectedOption = (answer.surveyOptionSeqId)?default("_NA_")/> <select name="${questionFieldName}"> <#if surveyQuestionAndAppl.requiredField?default("N") != "Y"> @@ -90,7 +90,7 @@ under the License. <#elseif surveyQuestionAndAppl.surveyQuestionTypeId == "ENUMERATION"/> <select name="${questionFieldName}"> <#assign formatString = surveyQuestionAndAppl.get("formatString")?if_exists/> - <#assign enums = surveyQuestionAndAppl.getRelated("Enumeration")/> + <#assign enums = surveyQuestionAndAppl.getRelated("Enumeration", null, null, false)/> <#list enums as enum> <#if (((answer.textResponse)?has_content && answer.textResponse == enum.enumId) || (defValue == enum.enumId))> <#assign selected = 'selected'/> @@ -178,7 +178,7 @@ under the License. <#assign closeMultiRespHeader = false/> <#assign surveyMultiResp = surveyQuestionAndAppl.getRelatedOne("SurveyMultiResp", true)?if_exists/> <#if surveyMultiResp?has_content> - <#assign surveyMultiRespColumnList = surveyMultiResp.getRelatedCache("SurveyMultiRespColumn", Static["org.ofbiz.base.util.UtilMisc"].toList("sequenceNum"))/> + <#assign surveyMultiRespColumnList = surveyMultiResp.getRelated("SurveyMultiRespColumn", null, Static["org.ofbiz.base.util.UtilMisc"].toList("sequenceNum"), true)/> <#if lastSurveyMultiRespId == ""> <#assign openMultiRespHeader = true/> Modified: ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/survey/EditSurveyQuestions.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/survey/EditSurveyQuestions.groovy?rev=1343511&r1=1343510&r2=1343511&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/survey/EditSurveyQuestions.groovy (original) +++ ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/survey/EditSurveyQuestions.groovy Tue May 29 04:17:44 2012 @@ -65,7 +65,7 @@ categoryQuestions = null; if (surveyQuestionCategoryId) { surveyQuestionCategory = delegator.findOne("SurveyQuestionCategory", [surveyQuestionCategoryId : surveyQuestionCategoryId], false); if (surveyQuestionCategory) { - categoryQuestions = surveyQuestionCategory.getRelated("SurveyQuestion"); + categoryQuestions = surveyQuestionCategory.getRelated("SurveyQuestion", null, null, false); } } questionCategories = delegator.findList("SurveyQuestionCategory", null, null, ['description'], null, false); Modified: ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/EditWebSiteParties.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/EditWebSiteParties.groovy?rev=1343511&r1=1343510&r2=1343511&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/EditWebSiteParties.groovy (original) +++ ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/EditWebSiteParties.groovy Tue May 29 04:17:44 2012 @@ -19,7 +19,7 @@ webSiteRoleDatas = [] as LinkedList; if (webSite) { - webSiteRoles = webSite.getRelated("WebSiteRole", null, ['sequenceNum', 'partyId']); + webSiteRoles = webSite.getRelated("WebSiteRole", null, ['sequenceNum', 'partyId'], false); webSiteRoles.each { webSiteRole -> Map webSiteRoleData = [:]; webSiteRoleData.webSiteRole = webSiteRole; Modified: ofbiz/trunk/applications/content/webapp/content/content/nav.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/nav.ftl?rev=1343511&r1=1343510&r2=1343511&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/content/nav.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/content/nav.ftl Tue May 29 04:17:44 2012 @@ -37,7 +37,7 @@ var rawdata = [ <#list assocList as assoc> { "data": {"title" : unescapeHtmlText("${assoc.categoryName!assoc.dataCategoryId!}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.dataCategoryId!}');"}} - <#assign assocs = assoc.getRelated("ChildDataCategory")?if_exists/> + <#assign assocs = assoc.getRelated("ChildDataCategory", null, null, false)?if_exists/> <#if assocChilds?has_content> ,"children": [ <@fillTree assocList = assocChilds/> Modified: ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl?rev=1343511&r1=1343510&r2=1343511&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/survey/EditSurveyQuestions.ftl Tue May 29 04:17:44 2012 @@ -49,7 +49,7 @@ under the License. <#assign currentSurveyPage = surveyQuestionAndAppl.getRelatedOne("SurveyPage", true)?if_exists/> <#assign currentSurveyMultiResp = surveyQuestionAndAppl.getRelatedOne("SurveyMultiResp", true)?if_exists/> <#if currentSurveyMultiResp?has_content> - <#assign currentSurveyMultiRespColumns = currentSurveyMultiResp.getRelated("SurveyMultiRespColumn")/> + <#assign currentSurveyMultiRespColumns = currentSurveyMultiResp.getRelated("SurveyMultiRespColumn", null, null, false)/> <#else/> <#assign currentSurveyMultiRespColumns = []/> </#if> Modified: ofbiz/trunk/applications/content/webapp/content/survey/ViewSurveyResponses.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/survey/ViewSurveyResponses.ftl?rev=1343511&r1=1343510&r2=1343511&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/survey/ViewSurveyResponses.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/survey/ViewSurveyResponses.ftl Tue May 29 04:17:44 2012 @@ -57,7 +57,7 @@ under the License. <span style="white-space: nowrap;">${uiLabelMap.CommonN} [${results._no_total?default(0)?string("#")} / ${results._no_percent?default(0)?string("#")}%]</span> </div> <#elseif question.surveyQuestionTypeId == "OPTION"> - <#assign options = question.getRelated("SurveyQuestionOption", sequenceSort)?if_exists> + <#assign options = question.getRelated("SurveyQuestionOption", null, sequenceSort, false)?if_exists> <#if options?has_content> <#list options as option> <#assign optionResults = results.get(option.surveyOptionSeqId)?if_exists> Modified: ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl?rev=1343511&r1=1343510&r2=1343511&view=diff ============================================================================== --- ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl (original) +++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl Tue May 29 04:17:44 2012 @@ -53,7 +53,7 @@ { "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', jQuery('#${assoc.contentIdTo}'), '');"}}, - <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> + <#assign assocChilds = content.getRelated("FromContentAssoc", null, null, false)?if_exists/> "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}", "contentAssocTypeId" : "${assoc.contentAssocTypeId}"} <#if assocChilds?has_content> ,"children": [ @@ -74,7 +74,7 @@ <#assign content = assoc.getRelatedOne("ToContent", false)/> { "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}}, - <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> + <#assign assocChilds = content.getRelated("FromContentAssoc", null, null, false)?if_exists/> "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"} <#if assocChilds?has_content> ,"children": [ @@ -96,7 +96,7 @@ <#assign content = assoc.getRelatedOne("ToContent", false)/> { "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', '', '');"}}, - <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> + <#assign assocChilds = content.getRelated("FromContentAssoc", null, null, false)?if_exists/> "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"} <#if assocChilds?has_content> ,"children": [ |
| Free forum by Nabble | Edit this page |
