Author: doogie
Date: Sat May 12 21:20:31 2012 New Revision: 1337673 URL: http://svn.apache.org/viewvc?rev=1337673&view=rev Log: DEPRECATION: applications/workeffort: findByPrimaryKey variants replaced with findOne Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy ofbiz/trunk/applications/workeffort/webapp/workeffort/find/WorkEffortSearchResults.ftl ofbiz/trunk/applications/workeffort/webapp/workeffort/task/mytasks.ftl Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java?rev=1337673&r1=1337672&r2=1337673&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java Sat May 12 21:20:31 2012 @@ -183,7 +183,7 @@ public class WorkEffortContentWrapper im if (delegator != null) { GenericValue contentType = null; try { - contentType = delegator.findByPrimaryKeyCache("WorkEffortContentType", UtilMisc.toMap("workEffortContentTypeId", contentTypeId)); + contentType = delegator.findOne("WorkEffortContentType", UtilMisc.toMap("workEffortContentTypeId", contentTypeId), true); } catch (GeneralException e) { Debug.logError(e, module); } @@ -285,7 +285,7 @@ public class WorkEffortContentWrapper im ModelEntity workEffortModel = delegator.getModelEntity("WorkEffort"); if (workEffortModel != null && workEffortModel.isField(candidateFieldName)) { if (workEffort == null) { - workEffort = delegator.findByPrimaryKeyCache("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId)); + workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), true); } if (workEffort != null) { String candidateValue = workEffort.getString(candidateFieldName); @@ -299,7 +299,7 @@ public class WorkEffortContentWrapper im // otherwise check content record GenericValue workEffortContent; if (contentId != null) { - workEffortContent = delegator.findByPrimaryKeyCache("WorkEffortContent", UtilMisc.toMap("workEffortId", workEffortId, "contentId", contentId)); + workEffortContent = delegator.findOne("WorkEffortContent", UtilMisc.toMap("workEffortId", workEffortId, "contentId", contentId), true); } else { workEffortContent = getFirstWorkEffortContentByType(workEffortId, workEffort, workEffortContentTypeId, delegator); } Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java?rev=1337673&r1=1337672&r2=1337673&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java Sat May 12 21:20:31 2012 @@ -578,8 +578,8 @@ public class WorkEffortSearch { GenericValue workEffort = null; GenericValue workEffortAssocType = null; try { - workEffort = delegator.findByPrimaryKeyCache("WorkEffort", UtilMisc.toMap("workEffortId", this.workEffortId)); - workEffortAssocType = delegator.findByPrimaryKeyCache("WorkEffortAssocType", UtilMisc.toMap("workEffortAssocTypeId", this.workEffortAssocTypeId)); + workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", this.workEffortId), true); + workEffortAssocType = delegator.findOne("WorkEffortAssocType", UtilMisc.toMap("workEffortAssocTypeId", this.workEffortAssocTypeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up WorkEffortAssocConstraint pretty print info: " + e.toString(), module); } @@ -738,8 +738,8 @@ public class WorkEffortSearch { GenericValue partyNameView = null; GenericValue roleType = null; try { - partyNameView = delegator.findByPrimaryKeyCache("PartyNameView", UtilMisc.toMap("partyId", partyId)); - roleType = delegator.findByPrimaryKeyCache("RoleType", UtilMisc.toMap("roleTypeId", roleTypeId)); + partyNameView = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", partyId), true); + roleType = delegator.findOne("RoleType", UtilMisc.toMap("roleTypeId", roleTypeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error finding PartyAssignmentConstraint information for constraint pretty print", module); } @@ -855,7 +855,7 @@ public class WorkEffortSearch { Iterator<String> productIdIter = this.productIdSet.iterator(); while (productIdIter.hasNext()) { String productId = productIdIter.next(); - GenericValue product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); if (product == null) { infoOut.append("["); infoOut.append(productId); Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=1337673&r1=1337672&r2=1337673&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Sat May 12 21:20:31 2012 @@ -327,7 +327,7 @@ public class WorkEffortServices { if (UtilValidate.isNotEmpty(statusId)) { try { - currentStatus = delegator.findByPrimaryKeyCache("StatusItem", UtilMisc.toMap("statusId", statusId)); + currentStatus = delegator.findOne("StatusItem", UtilMisc.toMap("statusId", statusId), true); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -350,7 +350,7 @@ public class WorkEffortServices { if (workEffort.get("currentStatusId") != null) { try { - currentStatus = delegator.findByPrimaryKeyCache("StatusItem", UtilMisc.toMap("statusId", workEffort.get("currentStatusId"))); + currentStatus = delegator.findOne("StatusItem", UtilMisc.toMap("statusId", workEffort.get("currentStatusId")), true); } catch (GenericEntityException e) { Debug.logWarning(e, module); } Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy?rev=1337673&r1=1337672&r2=1337673&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy (original) +++ ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy Sat May 12 21:20:31 2012 @@ -24,7 +24,7 @@ workEffort = context.get("workEffort"); if (workEffort == null && workEffortId != null) { - workEffort = delegator.findByPrimaryKeyCache("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId)); + workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), true); } if (workEffort != null) { Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/find/WorkEffortSearchResults.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/find/WorkEffortSearchResults.ftl?rev=1337673&r1=1337672&r2=1337673&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/webapp/workeffort/find/WorkEffortSearchResults.ftl (original) +++ ofbiz/trunk/applications/workeffort/webapp/workeffort/find/WorkEffortSearchResults.ftl Sat May 12 21:20:31 2012 @@ -55,7 +55,7 @@ under the License. <table width="100%" cellpadding="0" cellspacing="0"> <#assign listIndex = lowIndex> <#list workEffortIds as workEffortId><#-- note that there is no boundary range because that is being done before the list is put in the content --> - <#assign workEffort = delegator.findByPrimaryKey("WorkEffort", Static["org.ofbiz.base.util.UtilMisc"].toMap("workEffortId", workEffortId))> + <#assign workEffort = delegator.findOne("WorkEffort", Static["org.ofbiz.base.util.UtilMisc"].toMap("workEffortId", workEffortId), false)> <tr> <td> <a href="<@ofbizUrl>EditWorkEffort?workEffortId=${workEffortId}</@ofbizUrl>" class="buttontext">${workEffortId} ${(workEffort.workEffortName)?if_exists}</a> Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/task/mytasks.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/task/mytasks.ftl?rev=1337673&r1=1337672&r2=1337673&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/webapp/workeffort/task/mytasks.ftl (original) +++ ofbiz/trunk/applications/workeffort/webapp/workeffort/task/mytasks.ftl Sat May 12 21:20:31 2012 @@ -35,7 +35,7 @@ under the License. <td>${(workEffort.estimatedStartDate)?if_exists}</td> <td><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${workEffort.workEffortId}</@ofbizUrl>">${workEffort.workEffortName}</a></td> <td>${workEffort.priority?if_exists}</td> - <td>${(delegator.findByPrimaryKeyCache("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("currentStatusId"))).get("description",locale))?if_exists}</td> + <td>${(delegator.findOne("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("currentStatusId")), true).get("description",locale))?if_exists}</td> </tr> <#assign alt_row = !alt_row> </#list> @@ -59,8 +59,8 @@ under the License. <tr<#if alt_row> class="alternate-row"</#if>> <td>${(workEffort.estimatedStartDate)?if_exists}</td> <td>${workEffort.priority?if_exists}</td> - <td>${(delegator.findByPrimaryKeyCache("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("currentStatusId"))).get("description",locale))?if_exists}</td> - <td>${(delegator.findByPrimaryKeyCache("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("statusId"))).get("description",locale))?if_exists}</td> + <td>${(delegator.findOne("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("currentStatusId")), true).get("description",locale))?if_exists}</td> + <td>${(delegator.findOne("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("statusId")), true).get("description",locale))?if_exists}</td> <#-- <td>${workEffort.partyId}</td> --> <td>${workEffort.roleTypeId}</td> <td><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${workEffort.workEffortId}</@ofbizUrl>">${workEffort.workEffortName}</a></td> @@ -89,8 +89,8 @@ under the License. <tr<#if alt_row> class="alternate-row"</#if>> <td>${(workEffort.estimatedStartDate)?if_exists}</td> <td>${workEffort.priority?if_exists}</td> - <td>${(delegator.findByPrimaryKeyCache("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("currentStatusId"))).get("description",locale))?if_exists}</td> - <td>${(delegator.findByPrimaryKeyCache("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("statusId"))).get("description",locale))?if_exists}</td> + <td>${(delegator.findOne("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("currentStatusId")), true).get("description",locale))?if_exists}</td> + <td>${(delegator.findOne("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("statusId")), true).get("description",locale))?if_exists}</td> <#-- <td>${workEffort.partyId}</td> --> <td>${workEffort.roleTypeId}</td> <td><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${workEffort.workEffortId}</@ofbizUrl>">${workEffort.workEffortName}</a></td> @@ -119,8 +119,8 @@ under the License. <tr<#if alt_row> class="alternate-row"</#if>> <td>${(workEffort.estimatedStartDate)?if_exists}</td> <td>${workEffort.priority?if_exists}</td> - <td>${(delegator.findByPrimaryKeyCache("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("currentStatusId"))).get("description",locale))?if_exists}</td> - <td>${(delegator.findByPrimaryKeyCache("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("statusId"))).get("description",locale))?if_exists}</td> + <td>${(delegator.findOne("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("currentStatusId")), true).get("description",locale))?if_exists}</td> + <td>${(delegator.findOne("StatusItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("statusId", workEffort.getString("statusId")), true).get("description",locale))?if_exists}</td> <td>${workEffort.groupPartyId}</td> <#-- <td>${workEffort.roleTypeId}</td> --> <td><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${workEffort.workEffortId}</@ofbizUrl>">${workEffort.workEffortName}</a></td> |
Free forum by Nabble | Edit this page |