Author: deepak
Date: Wed Dec 13 10:42:32 2017 New Revision: 1817998 URL: http://svn.apache.org/viewvc?rev=1817998&view=rev Log: Reverted r#1817989, workign fine locally, reverted for now will check and commit again Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/FinAccountTrans.ftl ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/GlReconciledFinAccountTrans.ftl ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/ShowGlTransactions.ftl ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/FindFacility.groovy ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProdCatalog.groovy ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProductStoreAndWebSite.groovy ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentNav.ftl ofbiz/ofbiz-framework/trunk/applications/content/template/content/DisplayContentNav.ftl ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/bom/FindProductBom.groovy ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ShowProductionRun.groovy ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/reports/CuttingListReport.groovy ofbiz/ofbiz-framework/trunk/applications/manufacturing/template/mrp/FindInventoryEventPlan.ftl ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java ofbiz/ofbiz-framework/trunk/applications/order/template/order/EditOrderItems.ftl ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderItems.ftl ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderShippingInfo.ftl ofbiz/ofbiz-framework/trunk/applications/order/template/quote/ViewQuoteItemInfo.ftl ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnLinks.ftl ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContentUrlFilter.java ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogAltUrlSeoTransform.java ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogUrlSeoTransform.java ofbiz/ofbiz-framework/trunk/applications/product/template/category/CreateProductInCategoryStart.ftl ofbiz/ofbiz-framework/trunk/applications/product/template/facility/PrintPickSheets.fo.ftl ofbiz/ofbiz-framework/trunk/applications/product/template/imagemanagement/ShowPeopleApprove.ftl ofbiz/ofbiz-framework/trunk/applications/product/template/product/ViewProductOrders.ftl ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/VerifyPick.ftl ofbiz/ofbiz-framework/trunk/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/ical/IsCalOwner.groovy ofbiz/ofbiz-framework/trunk/applications/workeffort/template/calendar/CalendarEventContent.ftl ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GeoLocation.groovy ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GetParentPortalPageId.groovy ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/SetLocaleFromBrowser.groovy ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/test/PerformFindTests.java ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/test/EntityQueryTestSuite.java ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/eca/EntityEcaRule.java ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/test/ServiceEntityAutoTests.java ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ExternalLoginKeysManager.java ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/EntityPerformanceTest.groovy ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/ViewGeneric.groovy ofbiz/ofbiz-framework/trunk/themes/rainbowstone/template/includes/HomeMenu.ftl ofbiz/ofbiz-framework/trunk/themes/rainbowstone/template/includes/TopAppBar.ftl Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/reports/InvoiceAcctgTransEntryParameters.groovy Wed Dec 13 10:42:32 2017 @@ -20,15 +20,16 @@ import org.apache.ofbiz.base.util.UtilMisc import org.apache.ofbiz.entity.condition.EntityCondition import org.apache.ofbiz.entity.condition.EntityOperator +import org.apache.ofbiz.entity.util.EntityUtil invoiceId = parameters.invoiceId userLoginId = userLogin.userLoginId -userLogin = from("UserLogin").where("userLoginId", userLoginId).queryOne(); -userLoginNameView = from("PartyNameView").where("partyId", userLogin.get("partyId")).queryOne(); +userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", userLoginId), false) +userLoginNameView = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", userLogin.get("partyId")), false) userLoginName = userLoginNameView.getString("firstName") + " " + userLoginNameView.getString("lastName") dateFormatter = new java.text.SimpleDateFormat("dd MMMMM yyyy") -invoice = from("Invoice").where("invoiceId", invoiceId).queryOne(); +invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false) if (invoice) { context.invoiceDescription = invoice.get("description") context.invoiceTypeDescription = invoice.getRelatedOne("InvoiceType", false).get("description") @@ -43,7 +44,7 @@ if ("PURCHASE_INVOICE".equals(invoice.ge partyId = invoice.get("partyId") } partyName = "" -partyNameView = from("PartyNameView").where("partyId", partyId).queryOne(); +partyNameView = delegator.findOne("PartyNameView", UtilMisc.toMap("partyId", partyId), false) if (partyNameView.get("firstName")) { partyName += partyNameView.get("firstName") + " " } Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java Wed Dec 13 10:42:32 2017 @@ -597,10 +597,10 @@ public class InvoiceServices { to adjust tax amount in invoice item. */ BigDecimal otherInvoiceTaxAmount = BigDecimal.ZERO; - GenericValue orderAdjBilling = EntityQuery.use(delegator).from("OrderAdjustmentBilling").where("orderAdjustmentId", adj.getString("orderAdjustmentId")).queryFirst(); + GenericValue orderAdjBilling = EntityUtil.getFirst(delegator.findByAnd("OrderAdjustmentBilling", UtilMisc.toMap("orderAdjustmentId", adj.getString("orderAdjustmentId")), null, false)); if (UtilValidate.isNotEmpty(orderAdjBilling)) { - //FIXME: isTaxIncludedInPrice is passed to get data from cache, need to check why its done - List<GenericValue> invoiceItems = EntityQuery.use(delegator).from("InvoiceItem").where("invoiceId", orderAdjBilling.getString("invoiceId"), "invoiceItemTypeId", "ITM_SALES_TAX", "productId", originalOrderItem.getString("productId")).cache(isTaxIncludedInPrice).queryList(); + List<GenericValue> invoiceItems = delegator.findByAnd("InvoiceItem", + UtilMisc.toMap("invoiceId", orderAdjBilling.getString("invoiceId"), "invoiceItemTypeId", "ITM_SALES_TAX", "productId", originalOrderItem.getString("productId")), null, isTaxIncludedInPrice); for (GenericValue invoiceItem : invoiceItems) { otherInvoiceTaxAmount = otherInvoiceTaxAmount.add(invoiceItem.getBigDecimal("amount")); } Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/FinAccountTrans.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/FinAccountTrans.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/FinAccountTrans.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/FinAccountTrans.ftl Wed Dec 13 10:42:32 2017 @@ -95,7 +95,7 @@ function getFinAccountTransRunningTotalA <input name="reconciledBalance" type="hidden" value="${(glReconciliation.reconciledBalance)!}"/> <input name="reconciledBalanceWithUom" type="hidden" id="reconciledBalanceWithUom" value="<@ofbizCurrency amount=(glReconciliation.reconciledBalance)?default('0')/>"/> </#if> - <#assign glReconciliations = EntityQuery.use(delegator).from("GlReconciliation").where("glAccountId", finAccount.postToGlAccountId!, "statusId", "GLREC_CREATED").orderBy("reconciledDate DESC").queryList()!> + <#assign glReconciliations = delegator.findByAnd("GlReconciliation", {"glAccountId" : finAccount.postToGlAccountId!, "statusId" : "GLREC_CREATED"}, Static["org.apache.ofbiz.base.util.UtilMisc"].toList("reconciledDate DESC"), false)> <#if (glReconciliationId?has_content && ("_NA_" == glReconciliationId && finAccountTransList?has_content)) || !grandTotal??> <div align="right"> <#if grandTotal??> @@ -153,26 +153,26 @@ function getFinAccountTransRunningTotalA <#assign glReconciliation = ""> <#assign partyName = ""> <#if finAccountTrans.paymentId?has_content> - <#assign payment = EntityQuery.use(delegator).from("Payment").where("paymentId", finAccountTrans.paymentId!).cache().queryOne()!> + <#assign payment = delegator.findOne("Payment", {"paymentId" : finAccountTrans.paymentId}, true)> <#else> - <#assign payments = EntityQuery.use(delegator).from("Payment").where("finAccountTransId", finAccountTrans.finAccountTransId!).queryList()!> + <#assign payments = delegator.findByAnd("Payment", {"finAccountTransId" : finAccountTrans.finAccountTransId}, null, false)> </#if> - <#assign finAccountTransType = EntityQuery.use(delegator).from("FinAccountTransType").where("finAccountTransTypeId", finAccountTrans.finAccountTransTypeId!).cache().queryOne()!> + <#assign finAccountTransType = delegator.findOne("FinAccountTransType", {"finAccountTransTypeId" : finAccountTrans.finAccountTransTypeId}, true)> <#if finAccountTrans.statusId?has_content> - <#assign status = EntityQuery.use(delegator).from("StatusItem").where("statusId", finAccountTrans.statusId!).cache().queryOne()!> + <#assign status = delegator.findOne("StatusItem", {"statusId" : finAccountTrans.statusId}, true)> </#if> <#if payment?has_content && payment.paymentTypeId?has_content> - <#assign paymentType = EntityQuery.use(delegator).from("PaymentType").where("paymentTypeId", payment.paymentTypeId!).cache().queryOne()!> + <#assign paymentType = delegator.findOne("PaymentType", {"paymentTypeId" : payment.paymentTypeId}, true)> </#if> <#if payment?has_content && payment.paymentMethodTypeId?has_content> - <#assign paymentMethodType = EntityQuery.use(delegator).from("PaymentMethodType").where("paymentMethodTypeId", payment.paymentMethodTypeId!).cache().queryOne()!> + <#assign paymentMethodType = delegator.findOne("PaymentMethodType", {"paymentMethodTypeId" : payment.paymentMethodTypeId}, true)> </#if> <#if finAccountTrans.glReconciliationId?has_content> - <#assign glReconciliation = EntityQuery.use(delegator).from("GlReconciliation").where("glReconciliationId", finAccountTrans.glReconciliationId!).cache().queryOne()!> + <#assign glReconciliation = delegator.findOne("GlReconciliation", {"glReconciliationId" : finAccountTrans.glReconciliationId}, true)> <input name="openingBalance_o_${finAccountTrans_index}" type="hidden" value="${glReconciliation.openingBalance!}"/> </#if> <#if finAccountTrans.partyId?has_content> - <#assign partyName = EntityQuery.use(delegator).from("PartyNameView").where("partyId", finAccountTrans.partyId!).cache().queryOne()!!> + <#assign partyName = (delegator.findOne("PartyNameView", {"partyId" : finAccountTrans.partyId}, true))!> </#if> <tr valign="middle"<#if alt_row> class="alternate-row"</#if>> <td> @@ -191,17 +191,17 @@ function getFinAccountTransRunningTotalA </tr> <#list payments as payment> <#if payment?? && payment.paymentTypeId?has_content> - <#assign paymentType = EntityQuery.use(delegator).from("PaymentType").where("paymentTypeId", payment.paymentTypeId!).cache().queryOne()!> + <#assign paymentType = delegator.findOne("PaymentType", {"paymentTypeId" : payment.paymentTypeId}, true)> </#if> <#if payment?has_content && payment.paymentMethodTypeId?has_content> - <#assign paymentMethodType = EntityQuery.use(delegator).from("PaymentMethodType").where("paymentMethodTypeId", payment.paymentMethodTypeId!).cache().queryOne()!> + <#assign paymentMethodType = delegator.findOne("PaymentMethodType", {"paymentMethodTypeId" : payment.paymentMethodTypeId}, true)> </#if> <#if payment?has_content> <#assign paymentGroupMembers = Static["org.apache.ofbiz.entity.util.EntityUtil"].filterByDate(payment.getRelated("PaymentGroupMember", null, null, false)!) /> <#assign fromParty = payment.getRelatedOne("FromParty", false)! /> - <#assign fromPartyName = EntityQuery.use(delegator).from("PartyNameView").where("partyId", fromParty.partyId!).cache().queryOne()!/> + <#assign fromPartyName = delegator.findOne("PartyNameView", {"partyId" : fromParty.partyId}, true) /> <#assign toParty = payment.getRelatedOne("ToParty", false)! /> - <#assign toPartyName =EntityQuery.use(delegator).from("PartyNameView").where("partyId", toParty.partyId!).cache().queryOne()!/> + <#assign toPartyName = delegator.findOne("PartyNameView", {"partyId" : toParty.partyId}, true) /> <#if paymentGroupMembers?has_content> <#assign paymentGroupMember = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(paymentGroupMembers) /> </#if> Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/GlReconciledFinAccountTrans.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/GlReconciledFinAccountTrans.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/GlReconciledFinAccountTrans.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/GlReconciledFinAccountTrans.ftl Wed Dec 13 10:42:32 2017 @@ -30,7 +30,7 @@ under the License. </div> <div class="screenlet-body"> <a href="<@ofbizUrl>EditFinAccountReconciliations?finAccountId=${finAccountId}&glReconciliationId=${glReconciliationId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonEdit}</a> - <#assign finAcctTransCondList = EntityQuery.use(delegator).from("FinAccountTrans").where("glReconciliationId", glReconciliationId!, "statusId", "FINACT_TRNS_CREATED").queryList()!> + <#assign finAcctTransCondList = delegator.findByAnd("FinAccountTrans", {"glReconciliationId" : glReconciliationId, "statusId" : "FINACT_TRNS_CREATED"}, null, false)> <#if finAcctTransCondList?has_content> <a href="javascript:document.CancelBankReconciliationForm.submit();" class="buttontext">${uiLabelMap.AccountingCancelBankReconciliation}</a> </#if> @@ -152,20 +152,20 @@ under the License. <#assign paymentMethodType = ""> <#assign partyName = ""> <#if finAccountTrans.paymentId?has_content> - <#assign payment = EntityQuery.use(delegator).from("Payment").where("paymentId", finAccountTrans.paymentId!).cache().queryOne()!> + <#assign payment = delegator.findOne("Payment", {"paymentId" : finAccountTrans.paymentId}, true)> </#if> - <#assign finAccountTransType = EntityQuery.use(delegator).from("FinAccountTransType").where("finAccountTransTypeId", finAccountTrans.finAccountTransTypeId!).cache().queryOne()!> + <#assign finAccountTransType = delegator.findOne("FinAccountTransType", {"finAccountTransTypeId" : finAccountTrans.finAccountTransTypeId}, true)> <#if finAccountTrans.statusId?has_content> - <#assign status = EntityQuery.use(delegator).from("StatusItem").where("statusId", finAccountTrans.statusId!).cache().queryOne()!> + <#assign status = delegator.findOne("StatusItem", {"statusId" : finAccountTrans.statusId}, true)> </#if> <#if payment?has_content && payment.paymentTypeId?has_content> - <#assign paymentType = EntityQuery.use(delegator).from("PaymentType").where("paymentTypeId", payment.paymentTypeId!).cache().queryOne()!> + <#assign paymentType = delegator.findOne("PaymentType", {"paymentTypeId" : payment.paymentTypeId}, true)> </#if> <#if payment?has_content && payment.paymentMethodTypeId?has_content> - <#assign paymentMethodType = EntityQuery.use(delegator).from("PaymentMethodType").where("paymentMethodTypeId", payment.paymentMethodTypeId!).cache().queryOne()!> + <#assign paymentMethodType = delegator.findOne("PaymentMethodType", {"paymentMethodTypeId" : payment.paymentMethodTypeId}, true)> </#if> <#if finAccountTrans.partyId?has_content> - <#assign partyName = EntityQuery.use(delegator).from("PartyNameView").where("partyId", finAccountTrans.partyId!).cache().queryOne()!> + <#assign partyName = (delegator.findOne("PartyNameView", {"partyId" : finAccountTrans.partyId}, true))> </#if> <tr valign="middle"<#if alt_row> class="alternate-row"</#if>> <td> Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/ShowGlTransactions.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/ShowGlTransactions.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/ShowGlTransactions.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/template/finaccounttrans/ShowGlTransactions.ftl Wed Dec 13 10:42:32 2017 @@ -53,13 +53,13 @@ under the License. <td>${acctgTransEntry.isPosted!}</td> <td> <#if acctgTransEntry.glFiscalTypeId?has_content> - <#assign glFiscalType = EntityQuery.use(delegator).from("GlFiscalType").where("glFiscalTypeId", acctgTransEntry.glFiscalTypeId!).queryOne()!/> + <#assign glFiscalType = delegator.findOne("GlFiscalType", {"glFiscalTypeId" : acctgTransEntry.glFiscalTypeId}, false)/> ${glFiscalType.description!} </#if> </td> <td> <#if acctgTransEntry.acctgTransTypeId?has_content> - <#assign acctgTransType = EntityQuery.use(delegator).from("AcctgTransType").where("acctgTransTypeId", acctgTransEntry.acctgTransTypeId!).queryOne()!/> + <#assign acctgTransType = delegator.findOne("AcctgTransType", {"acctgTransTypeId" : acctgTransEntry.acctgTransTypeId}, false)/> ${acctgTransType.description!} </#if> </td> @@ -75,7 +75,7 @@ under the License. <td>${acctgTransEntry.origAmount!}</td> <td> <#if acctgTransEntry.organizationPartyId?has_content> - <#assign partyName = EntityQuery.use(delegator).from("PartyNameView").where("partyId", acctgTransEntry.organizationPartyId!).queryOne()!> + <#assign partyName = delegator.findOne("PartyNameView", {"partyId" : acctgTransEntry.organizationPartyId}, false)> <#if "PERSON" == partyName.partyTypeId> ${partyName.firstName!} ${partyName.lastName!} <#elseif (partyName.partyTypeId) != "PARTY_GROUP"> @@ -85,7 +85,7 @@ under the License. </td> <td> <#if (acctgTransEntry.glAccountTypeId)?has_content> - <#assign glAccountType = EntityQuery.use(delegator).from("GlAccountType").where("glAccountTypeId", acctgTransEntry.glAccountTypeId!).queryOne()!> + <#assign glAccountType = delegator.findOne("GlAccountType", {"glAccountTypeId" : acctgTransEntry.glAccountTypeId}, false)> ${glAccountType.description!} </#if> </td> @@ -93,20 +93,20 @@ under the License. <td>${acctgTransEntry.accountName!}</td> <td> <#if acctgTransEntry.glAccountClassId?has_content> - <#assign glAccountClass = EntityQuery.use(delegator).from("GlAccountClass").where("glAccountClassId", acctgTransEntry.glAccountClassId!).queryOne()!/> + <#assign glAccountClass = delegator.findOne("GlAccountClass", {"glAccountClassId" : acctgTransEntry.glAccountClassId}, false)/> ${glAccountClass.description!} </#if> </td> <td>${acctgTransEntry.partyId!}</td> <td> <#if acctgTransEntry.reconcileStatusId?has_content> - <#assign status =EntityQuery.use(delegator).from("StatusItem").where("statusId", finAccountTrans.statusId!).cache().queryOne()!> + <#assign status = delegator.findOne("StatusItem", {"statusId" : finAccountTrans.statusId}, true)> ${status.description!} </#if> </td> <td> <#if acctgTransEntry.acctgTransEntryTypeId?has_content> - <#assign acctgTransEntryType = EntityQuery.use(delegator).from("AcctgTransEntryType").where("acctgTransEntryTypeId", acctgTransEntry.acctgTransEntryTypeId!).cache().queryOne()!> + <#assign acctgTransEntryType = delegator.findOne("AcctgTransEntryType", {"acctgTransEntryTypeId" : acctgTransEntry.acctgTransEntryTypeId}, true)> ${acctgTransEntryType.description!} </#if> </td> Modified: ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/FindFacility.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/FindFacility.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/FindFacility.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/FindFacility.groovy Wed Dec 13 10:42:32 2017 @@ -18,7 +18,7 @@ */ import org.apache.ofbiz.entity.util.EntityUtil -findResult = from("Facility").where("ownerPartyId", partyId).queryList(); +findResult = delegator.findByAnd("Facility", [ownerPartyId: partyId], null, false) findResultSize = findResult.size() if (findResultSize == 1) { context.showScreen = "one" @@ -32,7 +32,7 @@ if ((findResultSize > 1 ) && (findResult context.showScreen = "more" } -listPartyPostalAddress = from("PartyAndPostalAddress").where("partyId", partyId).queryList(); +listPartyPostalAddress = delegator.findByAnd("PartyAndPostalAddress", [partyId: partyId], null, false) partyPostalAddress = EntityUtil.getFirst(EntityUtil.filterByDate(listPartyPostalAddress)) context.partyPostalAddress = partyPostalAddress @@ -49,7 +49,7 @@ if("productstore".equals(tabButtonItemTo if (!facilityId && request.getAttribute("facilityId")) { facilityId = request.getAttribute("facilityId") } - facility = from("Facility").where("facilityId", facilityId).queryOne(); + facility = delegator.findOne("Facility", [facilityId : facilityId], false) if(facility){ facilityType = facility.getRelatedOne("FacilityType", false) context.facilityType = facilityType Modified: ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProdCatalog.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProdCatalog.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProdCatalog.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProdCatalog.groovy Wed Dec 13 10:42:32 2017 @@ -25,7 +25,7 @@ showScreen = "origin" List errMsgList = [] - productStore = from("ProductStore").where("payToPartyId", partyId).queryFirst(); + productStore = EntityUtil.getFirst(delegator.findByAnd("ProductStore", [payToPartyId: partyId], null, false)) if(productStore){ context.productStoreId = productStore.productStoreId } @@ -33,8 +33,8 @@ errMsgList.add("Product Store not set!") showScreen = "message" } else { - facility =from("Facility").where("facilityId", productStore.inventoryFacilityId).queryOne(); - webSite = from("WebSite").where("productStoreId", productStore.productStoreId).queryFirst(); + facility = delegator.findOne("Facility", [facilityId : productStore.inventoryFacilityId], false) + webSite = EntityUtil.getFirst(delegator.findByAnd("WebSite", [productStoreId: productStore.productStoreId], null, false)) if(UtilValidate.isEmpty(facility)){ errMsgList.add("Facility not set!") @@ -50,7 +50,7 @@ return } - productStoreCatalog = from("ProductStoreCatalog").where("productStoreId", productStore.productStoreId).queryFirst(); + productStoreCatalog = EntityUtil.getFirst(delegator.findByAnd("ProductStoreCatalog", [productStoreId: productStore.productStoreId], null, false)) if(productStoreCatalog){ prodCatalog = productStoreCatalog.getRelatedOne("ProdCatalog", false) prodCatalogId = prodCatalog.prodCatalogId @@ -69,9 +69,9 @@ showErrorMsg = "Y" } - prodCatalogCategory = from("ProdCatalogCategory").where("prodCatalogId", prodCatalogId, "sequenceNum", new Long(1)).queryFirst(); + prodCatalogCategory = EntityUtil.getFirst(delegator.findByAnd("ProdCatalogCategory", [prodCatalogId: prodCatalogId, sequenceNum: new Long(1)], null, false)) if(prodCatalogCategory){ - productCategory = from("ProductCategory").where("primaryParentCategoryId", prodCatalogCategory.productCategoryId).queryFirst(); + productCategory = EntityUtil.getFirst(delegator.findByAnd("ProductCategory", [primaryParentCategoryId : prodCatalogCategory.productCategoryId], null, false)) if(productCategory){ productCategoryId = productCategory.productCategoryId } @@ -88,12 +88,12 @@ showErrorMsg = "Y" } /**************** get product from ProductCategory ******************/ - productCategoryMember = from("ProductCategoryMember").where("productCategoryId", productCategoryId).queryFirst(); + productCategoryMember = EntityUtil.getFirst(delegator.findByAnd("ProductCategoryMember", [productCategoryId: productCategoryId], null, false)) if(productCategoryMember){ product = productCategoryMember.getRelatedOne("Product", false) productId = product.productId // Average cost - averageCostValues = from("ProductPrice").where("productId", productId, "productPricePurposeId", "PURCHASE", "productPriceTypeId", "AVERAGE_COST").queryList() + averageCostValues = delegator.findByAnd("ProductPrice", [productId : productId, productPricePurposeId : "PURCHASE", productPriceTypeId : "AVERAGE_COST"], null, false) if(averageCostValues){ averageCostValue = EntityUtil.getFirst(EntityUtil.filterByDate(averageCostValues)) if (averageCostValue?.price != null) { @@ -101,7 +101,7 @@ } } // Default cost - defaultPriceValues = from("ProductPrice").where("productId", productId, "productPricePurposeId", "PURCHASE", "productPriceTypeId", "DEFAULT_PRICE").queryList(); + defaultPriceValues = delegator.findByAnd("ProductPrice", [productId : productId, productPricePurposeId : "PURCHASE", productPriceTypeId : "DEFAULT_PRICE"], null, false) if(defaultPriceValues){ defaultPrice = EntityUtil.getFirst(EntityUtil.filterByDate(defaultPriceValues)) if (defaultPrice?.price != null) { Modified: ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProductStoreAndWebSite.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProductStoreAndWebSite.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProductStoreAndWebSite.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/commonext/groovyScripts/ofbizsetup/GetProductStoreAndWebSite.groovy Wed Dec 13 10:42:32 2017 @@ -20,7 +20,7 @@ productStoreId = null -productStore = from("ProductStore").where("payToPartyId", partyId).queryFirst(); +productStore = EntityUtil.getFirst(delegator.findByAnd("ProductStore", [payToPartyId: partyId], null, false)) if(productStore){ productStoreId = productStore.productStoreId } @@ -29,7 +29,7 @@ context.productStore = productStore if("website".equals(tabButtonItemTop)){ if(productStoreId != null){ - webSite = from("WebSite").where("productStoreId", productStoreId).queryFirst(); + webSite = EntityUtil.getFirst(delegator.findByAnd("WebSite", [productStoreId: productStoreId], null, false)) context.showScreen = "origin" }else{ request.setAttribute("_ERROR_MESSAGE_", "Product Store not set!") Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java Wed Dec 13 10:42:32 2017 @@ -44,7 +44,6 @@ import org.apache.ofbiz.entity.GenericVa import org.apache.ofbiz.entity.condition.EntityCondition; import org.apache.ofbiz.entity.transaction.TransactionUtil; import org.apache.ofbiz.entity.util.EntityUtil; -import org.apache.ofbiz.entity.util.EntityQuery; public class ContentJsonEvents { @@ -104,7 +103,7 @@ public class ContentJsonEvents { GenericValue assoc = TransactionUtil.inTransaction(new Callable<GenericValue>() { @Override public GenericValue call() throws Exception { - GenericValue oldAssoc = EntityQuery.use(delegator).from("ContentAssoc").where("contentIdTo", contentIdTo, "contentId", contentIdFrom, "contentAssocTypeId", contentAssocTypeId, "fromDate", fromDate).queryOne(); + GenericValue oldAssoc = delegator.findOne("ContentAssoc", UtilMisc.toMap("contentIdTo", contentIdTo, "contentId", contentIdFrom, "contentAssocTypeId", contentAssocTypeId, "fromDate", fromDate), false); if (oldAssoc == null) { throw new GenericEntityNotFoundException("Could not find ContentAssoc by primary key [contentIdTo: $contentIdTo, contentId: $contentIdFrom, contentAssocTypeId: $contentAssocTypeId, fromDate: $fromDate]"); } Modified: ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentNav.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentNav.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentNav.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/template/content/ContentNav.ftl Wed Dec 13 10:42:32 2017 @@ -37,7 +37,7 @@ var rawdata = [ <#assign content = delegator.findOne("Content",Static["org.apache.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 = EntityQuery.use(delegator).from("ContentAssoc").where("contentId", assoc.contentIdTo!, "contentAssocTypeId", "TREE_CHILD").queryList()!/> + <#assign assocChilds = delegator.findByAnd("ContentAssoc",Static["org.apache.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/ofbiz-framework/trunk/applications/content/template/content/DisplayContentNav.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/template/content/DisplayContentNav.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/template/content/DisplayContentNav.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/template/content/DisplayContentNav.ftl Wed Dec 13 10:42:32 2017 @@ -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 = EntityQuery.use(delegator).from("ContentAssoc").where("contentId", assoc.contentIdTo!, "contentAssocTypeId", "TREE_CHILD").orderBy("sequenceNum").queryList()!/> + <#assign assocChilds = delegator.findByAnd("ContentAssoc",Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD"), Static["org.apache.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": [ Modified: ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/bom/FindProductBom.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/bom/FindProductBom.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/bom/FindProductBom.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/bom/FindProductBom.groovy Wed Dec 13 10:42:32 2017 @@ -17,6 +17,7 @@ * under the License. */ +import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.entity.condition.EntityCondition import org.apache.ofbiz.entity.condition.EntityOperator Modified: ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ShowProductionRun.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ShowProductionRun.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ShowProductionRun.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/jobshopmgt/ShowProductionRun.groovy Wed Dec 13 10:42:32 2017 @@ -31,11 +31,11 @@ if (UtilValidate.isEmpty(productionRunId } if (UtilValidate.isNotEmpty(productionRunId)) { - GenericValue productionRun = from("WorkEffort").where("workEffortId", productionRunId).queryOne(); + GenericValue productionRun = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId), false) if (UtilValidate.isNotEmpty(productionRun)) { // If this is a task, get the parent production run if (productionRun.getString("workEffortTypeId") != null && "PROD_ORDER_TASK".equals(productionRun.getString("workEffortTypeId"))) { - productionRun = from("WorkEffort").where("workEffortId", productionRun.getString("workEffortParentId")).queryOne(); + productionRun = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", productionRun.getString("workEffortParentId")), false) } } Modified: ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/reports/CuttingListReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/reports/CuttingListReport.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/reports/CuttingListReport.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/manufacturing/groovyScripts/reports/CuttingListReport.groovy Wed Dec 13 10:42:32 2017 @@ -37,7 +37,7 @@ selectPrimaryCategoryIdParameter = "CABI shipmentId = request.getParameter("shipmentId") context.shipmentId = shipmentId -shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); +shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false) context.shipment = shipment // dimensionsByFeatureMap [key=feature; value=productsByShapeMap] Modified: ofbiz/ofbiz-framework/trunk/applications/manufacturing/template/mrp/FindInventoryEventPlan.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/manufacturing/template/mrp/FindInventoryEventPlan.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/manufacturing/template/mrp/FindInventoryEventPlan.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/manufacturing/template/mrp/FindInventoryEventPlan.ftl Wed Dec 13 10:42:32 2017 @@ -152,8 +152,8 @@ document.lookupinventory.productId.focus </#if> <#if !(product == productTmp)> <#assign quantityAvailableAtDate = 0> - <#assign errorEvents = EntityQuery.use(delegator).from("MrpEvent").where("mrpEventTypeId", "ERROR", "productId", inven.productId!).queryList()!> - <#assign qohEvents = EntityQuery.use(delegator).from("MrpEvent").where("mrpEventTypeId", "INITIAL_QOH", "productId", inven.productId!).queryList()!> + <#assign errorEvents = delegator.findByAnd("MrpEvent", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("mrpEventTypeId", "ERROR", "productId", inven.productId), null, false)> + <#assign qohEvents = delegator.findByAnd("MrpEvent", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("mrpEventTypeId", "INITIAL_QOH", "productId", inven.productId), null, false)> <#assign additionalErrorMessage = ""> <#assign initialQohEvent = ""> <#assign productFacility = ""> Modified: ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/entry/catalog/ProductSummary.groovy Wed Dec 13 10:42:32 2017 @@ -24,6 +24,7 @@ import org.apache.ofbiz.base.util.UtilMisc import org.apache.ofbiz.base.util.UtilProperties +import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.product.product.ProductContentWrapper import org.apache.ofbiz.product.config.ProductConfigWorker import org.apache.ofbiz.product.catalog.CatalogWorker @@ -52,7 +53,7 @@ if (cart.isSalesOrder()) { } if (!facilityId) { - productStoreFacility = select("facilityId").from("ProductStoreFacility").where("productStoreId", productStoreId).queryFirst() + productStoreFacility = EntityQuery.use(delegator).select("facilityId").from("ProductStoreFacility").where("productStoreId", productStoreId).queryFirst() if (productStoreFacility) { facilityId = productStoreFacility.facilityId } Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java Wed Dec 13 10:42:32 2017 @@ -4956,7 +4956,7 @@ public class OrderServices { // This ship group is a drop shipment: we create a purchase order for it String supplierPartyId = shipGroup.getString("supplierPartyId"); // Set supplier preferred currency for drop-ship (PO) order to support multi currency - GenericValue supplierParty = EntityQuery.use(delegator).from("Party").where("partyId", supplierPartyId).queryOne(); + GenericValue supplierParty = delegator.findOne("Party", UtilMisc.toMap("partyId", supplierPartyId), false); String currencyUomId = supplierParty.getString("preferredCurrencyUomId"); // If supplier currency not found then set currency of sales order if (UtilValidate.isEmpty(currencyUomId)) { @@ -6378,8 +6378,8 @@ public class OrderServices { String newShipMethTypeDesc =null; String shipMethTypeDesc=null; try { - shipMethTypeDesc = EntityQuery.use(delegator).from("ShipmentMethodType").where("shipmentMethodTypeId", shipmentMethodTypeId).queryOne().getString("description"); - newShipMethTypeDesc = EntityQuery.use(delegator).from("ShipmentMethodType").where("shipmentMethodTypeId", shippingMethods.get(0).getString("shipmentMethodTypeId")).queryOne().getString("description"); + shipMethTypeDesc = delegator.findOne("ShipmentMethodType", UtilMisc.toMap("shipmentMethodTypeId", shipmentMethodTypeId), false).getString("description"); + newShipMethTypeDesc = delegator.findOne("ShipmentMethodType", UtilMisc.toMap("shipmentMethodTypeId", shippingMethods.get(0).getString("shipmentMethodTypeId")), false).getString("description"); } catch(GenericEntityException e) { Debug.logError(e, module); } Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/order/EditOrderItems.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/order/EditOrderItems.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/template/order/EditOrderItems.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/template/order/EditOrderItems.ftl Wed Dec 13 10:42:32 2017 @@ -137,7 +137,7 @@ under the License. </td> <td class="align-text" valign="top" nowrap="nowrap"> <#assign shippedQuantity = orderReadHelper.getItemShippedQuantity(orderItem)> - <#assign shipmentReceipts = EntityQuery.use(delegator).from("ShipmentReceipt").where("orderId", orderHeader.getString("orderId")!, "orderItemSeqId", orderItem.orderItemSeqId!).queryList()!/> + <#assign shipmentReceipts = delegator.findByAnd("ShipmentReceipt", {"orderId" : orderHeader.getString("orderId"), "orderItemSeqId" : orderItem.orderItemSeqId}, null, false)/> <#assign totalReceived = 0.0> <#if shipmentReceipts?? && shipmentReceipts?has_content> <#list shipmentReceipts as shipmentReceipt> @@ -302,7 +302,7 @@ under the License. <#assign productPromoCodeId = ''> <#if "PROMOTION_ADJUSTMENT" == adjustmentType.get("orderAdjustmentTypeId") && orderHeaderAdjustment.get("productPromoId")?has_content> <#assign productPromo = orderHeaderAdjustment.getRelatedOne("ProductPromo", false)> - <#assign productPromoCodes = EntityQuery.use(delegator).from("ProductPromoCode").where("productPromoId", productPromo.productPromoId!).queryList()!> + <#assign productPromoCodes = delegator.findByAnd("ProductPromoCode", {"productPromoId":productPromo.productPromoId}, null, false)> <#assign orderProductPromoCode = ''> <#list productPromoCodes as productPromoCode> <#if !(orderProductPromoCode?has_content)> Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderItems.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderItems.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderItems.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderItems.ftl Wed Dec 13 10:42:32 2017 @@ -81,7 +81,13 @@ under the License. </#if> </div> <div style="float:right;"> - <#assign downloadContents = EntityQuery.use(delegator).from("OrderItemAndProductContentInfo").where( "orderId", orderItem.orderId!, "orderItemSeqId", orderItem.orderItemSeqId!, "productContentTypeId", "DIGITAL_DOWNLOAD", "statusId", "ITEM_COMPLETED").queryList()!/> + <#assign downloadContents = delegator.findByAnd("OrderItemAndProductContentInfo", { + "orderId" : orderItem.orderId, + "orderItemSeqId" : orderItem.orderItemSeqId, + "productContentTypeId" : "DIGITAL_DOWNLOAD", + "statusId" : "ITEM_COMPLETED"}, + null, + false)/> <#if downloadContents?has_content> <#list downloadContents as downloadContent> <a href="/content/control/ViewSimpleContent?contentId=${downloadContent.contentId}" class="buttontext" target="_blank">${uiLabelMap.ContentDownload}</a> @@ -222,7 +228,7 @@ under the License. <table> <tr valign="top"> <#assign shippedQuantity = orderReadHelper.getItemShippedQuantity(orderItem)> - <#assign shipmentReceipts = EntityQuery.use(delegator).from("ShipmentReceipt").where("orderId", orderHeader.getString("orderId")!, "orderItemSeqId", orderItem.orderItemSeqId!).queryList()!/> + <#assign shipmentReceipts = delegator.findByAnd("ShipmentReceipt", {"orderId" : orderHeader.getString("orderId"), "orderItemSeqId" : orderItem.orderItemSeqId}, null, false)/> <#assign totalReceived = 0.0> <#if shipmentReceipts?? && shipmentReceipts?has_content> <#list shipmentReceipts as shipmentReceipt> @@ -352,8 +358,8 @@ under the License. </#list> </#if> <#-- show linked order lines --> - <#assign linkedOrderItemsTo = EntityQuery.use(delegator).from("OrderItemAssoc").where("orderId", orderItem.getString("orderId"), "orderItemSeqId", orderItem.getString("orderItemSeqId")).queryList()!> - <#assign linkedOrderItemsFrom = EntityQuery.use(delegator).from("OrderItemAssoc").where("toOrderId", orderItem.getString("orderId")!, "toOrderItemSeqId", orderItem.getString("orderItemSeqId")!).queryList()!> + <#assign linkedOrderItemsTo = delegator.findByAnd("OrderItemAssoc", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("orderId", orderItem.getString("orderId"), "orderItemSeqId", orderItem.getString("orderItemSeqId")), null, false)> + <#assign linkedOrderItemsFrom = delegator.findByAnd("OrderItemAssoc", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("toOrderId", orderItem.getString("orderId"), "toOrderItemSeqId", orderItem.getString("orderItemSeqId")), null, false)> <#if linkedOrderItemsTo?has_content> <#list linkedOrderItemsTo as linkedOrderItem> <#assign linkedOrderId = linkedOrderItem.toOrderId> Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderShippingInfo.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderShippingInfo.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderShippingInfo.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/template/order/OrderShippingInfo.ftl Wed Dec 13 10:42:32 2017 @@ -757,7 +757,7 @@ under the License. ${uiLabelMap.CommonNbr}<a href="/facility/control/ViewShipment?shipmentId=${shipment.shipmentId}${StringUtil.wrapString(externalKeyParam)}" class="buttontext">${shipment.shipmentId}</a> <a target="_BLANK" href="/facility/control/PackingSlip.pdf?shipmentId=${shipment.shipmentId}${StringUtil.wrapString(externalKeyParam)}" class="buttontext">${uiLabelMap.ProductPackingSlip}</a> <#if "SALES_ORDER" == orderHeader.orderTypeId && "ORDER_COMPLETED" == orderHeader.statusId> - <#assign shipmentRouteSegments = EntityQuery.use(delegator).from("ShipmentRouteSegment").where("shipmentId", shipment.shipmentId!).queryList()!> + <#assign shipmentRouteSegments = delegator.findByAnd("ShipmentRouteSegment", {"shipmentId" : shipment.shipmentId}, null, false)> <#if shipmentRouteSegments?has_content> <#assign shipmentRouteSegment = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(shipmentRouteSegments)> <#if "UPS" == (shipmentRouteSegment.carrierPartyId)!> Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/quote/ViewQuoteItemInfo.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/quote/ViewQuoteItemInfo.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/template/quote/ViewQuoteItemInfo.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/template/quote/ViewQuoteItemInfo.ftl Wed Dec 13 10:42:32 2017 @@ -74,7 +74,7 @@ under the License. ${quoteItem.quoteItemSeqId} </#if> </div> - <#assign quoteTerms = EntityQuery.use(delegator).from("QuoteTerm").where("quoteId", quoteItem.quoteId!, "quoteItemSeqId", quoteItem.quoteItemSeqId!).queryList()!> + <#assign quoteTerms = delegator.findByAnd("QuoteTerm", {"quoteId" : quoteItem.quoteId, "quoteItemSeqId" : quoteItem.quoteItemSeqId}, null, false)> </td> <td valign="top"> <div> Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnLinks.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnLinks.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnLinks.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnLinks.ftl Wed Dec 13 10:42:32 2017 @@ -37,22 +37,22 @@ under the License. <ul> <li><a href="<@ofbizUrl>return.pdf?returnId=${returnId!}</@ofbizUrl>" target="_BLANK" >PDF</a></li> <#if returnId??> - <#assign returnItems = EntityQuery.use(delegator).from("ReturnItem").where("returnId", returnId!, "returnTypeId", "RTN_REFUND").queryList()!/> + <#assign returnItems = delegator.findByAnd("ReturnItem", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("returnId", returnId, "returnTypeId", "RTN_REFUND"), null, false)/> <#if returnItems?has_content> <#assign orderId = (Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(returnItems)).getString("orderId")/> <#assign partyId = "${(returnHeader.fromPartyId)!}"/> <a href="<@ofbizUrl>setOrderCurrencyAgreementShipDates?partyId=${partyId!}&originOrderId=${orderId!}</@ofbizUrl>" class="buttontext">${uiLabelMap.OrderCreateExchangeOrder} ${uiLabelMap.CommonFor} ${orderId!}</a> </#if> <#if returnHeader.statusId?has_content && "RETURN_ACCEPTED" == returnHeader.statusId> - <#assign returnItems = EntityQuery.use(delegator).from("ReturnItem").where("returnId", returnId!).queryList()!/> + <#assign returnItems = delegator.findByAnd("ReturnItem", {"returnId" : returnId}, null, false)/> <#if returnItems?has_content> <#assign orderId = (Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(returnItems)).getString("orderId")/> - <#assign shipGroupAssoc = EntityQuery.use(delegator).from("OrderItemShipGroupAssoc").where("orderId", orderId!).queryFirst()!/> + <#assign shipGroupAssoc = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(delegator.findByAnd("OrderItemShipGroupAssoc", {"orderId" : orderId}, null, false))/> <#assign shipGroup = delegator.findOne("OrderItemShipGroup", {"orderId" : orderId, "shipGroupSeqId" : shipGroupAssoc.shipGroupSeqId}, false)> <#if shipGroup?? && shipGroup.shipmentMethodTypeId != "NO_SHIPPING"> - <#assign shipGroupShipment = EntityQuery.use(delegator).from("Shipment").where("primaryOrderId", shipGroup.orderId!, "primaryShipGroupSeqId", shipGroup.shipGroupSeqId!).queryFirst()! /> + <#assign shipGroupShipment = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(delegator.findByAnd("Shipment", {"primaryOrderId" : shipGroup.orderId, "primaryShipGroupSeqId" : shipGroup.shipGroupSeqId}, null, false))/> <#if shipGroupShipment??> - <#assign shipmentRouteSegment = EntityQuery.use(delegator).from("ShipmentRouteSegment").where("shipmentId", shipGroupShipment.shipmentId!).queryFirst()!> + <#assign shipmentRouteSegment = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(delegator.findByAnd("ShipmentRouteSegment", {"shipmentId" : shipGroupShipment.shipmentId}, null, false))!> <#if shipmentRouteSegment??> <#if "UPS" == shipmentRouteSegment.carrierPartyId!> <li><a href="javascript:document.upsEmailReturnLabel.submit();" class="buttontext">${uiLabelMap.ProductEmailReturnShippingLabelUPS}</a></li> Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java Wed Dec 13 10:42:32 2017 @@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletRes import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.StringUtil; -import org.apache.ofbiz.entity.util.EntityQuery; +import org.apache.ofbiz.base.util.UtilMisc; import org.apache.ofbiz.base.util.UtilValidate; import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericEntityException; @@ -73,7 +73,7 @@ public class SeoCatalogUrlServlet extend String productId = null; try { String lastPathElement = pathElements.get(pathElements.size() - 1); - if (lastPathElement.startsWith("p_") || EntityQuery.use(delegator).from("Product").where("productId", lastPathElement).cache().queryOne() != null) { + if (lastPathElement.startsWith("p_") || delegator.findOne("Product", UtilMisc.toMap("productId", lastPathElement), true) != null) { if (lastPathElement.startsWith("p_")) { productId = lastPathElement.substring(2); } else { Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContentUrlFilter.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContentUrlFilter.java?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContentUrlFilter.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContentUrlFilter.java Wed Dec 13 10:42:32 2017 @@ -40,7 +40,6 @@ import org.apache.ofbiz.common.UrlServle import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.entity.util.EntityUtil; -import org.apache.ofbiz.entity.util.EntityQuery; public class SeoContentUrlFilter implements Filter { public final static String module = SeoContentUrlFilter.class.getName(); @@ -65,11 +64,12 @@ public class SeoContentUrlFilter impleme String alternativeUrl = pathInfo.substring(pathInfo.lastIndexOf('/')); if (alternativeUrl.endsWith("-content")) { try { - List<GenericValue> contentDataResourceViews = EntityQuery.use(delegator).from("ContentDataResourceView").where("drObjectInfo", alternativeUrl).queryList(); + 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 = EntityQuery.use(delegator).from("ContentAssoc").where("contentAssocTypeId", "ALTERNATIVE_URL", "contentIdTo", contentDataResourceView.getString("contentId")).filterByDate().queryList(); + 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/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogAltUrlSeoTransform.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogAltUrlSeoTransform.java?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogAltUrlSeoTransform.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogAltUrlSeoTransform.java Wed Dec 13 10:42:32 2017 @@ -26,12 +26,12 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.ofbiz.base.util.Debug; +import org.apache.ofbiz.base.util.UtilMisc; import org.apache.ofbiz.base.util.UtilValidate; import org.apache.ofbiz.base.util.template.FreeMarkerWorker; import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericEntityException; import org.apache.ofbiz.entity.GenericValue; -import org.apache.ofbiz.entity.util.EntityQuery; import org.apache.ofbiz.entity.util.EntityUtilProperties; import org.apache.ofbiz.product.category.CatalogUrlFilter; import org.apache.ofbiz.product.category.CategoryContentWrapper; @@ -149,7 +149,7 @@ public class CatalogAltUrlSeoTransform i contextPath = prefixString.substring(prefixString.lastIndexOf('/')); } if (UtilValidate.isNotEmpty(productId)) { - GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne(); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); ProductContentWrapper wrapper = new ProductContentWrapper(dispatcher, product, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator)); if (SeoConfigUtil.isCategoryUrlEnabled(contextPath)) { url = CatalogUrlSeoTransform.makeProductUrl(delegator, wrapper, prefixString, contextPath, productCategoryId, previousCategoryId, productId); @@ -157,7 +157,7 @@ public class CatalogAltUrlSeoTransform i url = CatalogUrlFilter.makeProductUrl(wrapper, null, prefixString, previousCategoryId, productCategoryId, productId); } } else { - GenericValue productCategory = EntityQuery.use(delegator).from("ProductCategory").where("productCategoryId", productCategoryId).queryOne(); + GenericValue productCategory = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryId), false); CategoryContentWrapper wrapper = new CategoryContentWrapper(dispatcher, productCategory, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator)); if (SeoConfigUtil.isCategoryUrlEnabled(contextPath)) { url = CatalogUrlSeoTransform.makeCategoryUrl(delegator, wrapper, prefixString, productCategoryId, previousCategoryId, productId, viewSize, viewIndex, viewSort, searchString); Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogUrlSeoTransform.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogUrlSeoTransform.java?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogUrlSeoTransform.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/CatalogUrlSeoTransform.java Wed Dec 13 10:42:32 2017 @@ -44,7 +44,6 @@ import org.apache.ofbiz.entity.GenericVa import org.apache.ofbiz.entity.condition.EntityCondition; import org.apache.ofbiz.entity.condition.EntityExpr; import org.apache.ofbiz.entity.condition.EntityOperator; -import org.apache.ofbiz.entity.util.EntityQuery; import org.apache.ofbiz.product.category.CatalogUrlServlet; import org.apache.ofbiz.product.category.CategoryContentWrapper; import org.apache.ofbiz.product.category.CategoryWorker; @@ -209,7 +208,7 @@ public class CatalogUrlSeoTransform impl categoryNameId = categoryIdName; } } else { - GenericValue productCategory = EntityQuery.use(delegator).from("ProductCategory").where("productCategoryId", categoryId).cache().queryOne(); + GenericValue productCategory = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", categoryId), true); CategoryContentWrapper wrapper = new CategoryContentWrapper(productCategory, request); StringWrapper alternativeUrl = wrapper.get("ALTERNATIVE_URL", "url"); if (UtilValidate.isNotEmpty(alternativeUrl) && UtilValidate.isNotEmpty(alternativeUrl.toString())) { @@ -257,7 +256,7 @@ public class CatalogUrlSeoTransform impl } if (UtilValidate.isNotEmpty(productId)) { try { - product = EntityQuery.use(delegator).from("Product").where("productId", productId).cache().queryOne(); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up product info for productId [" + productId + "]: " + e.toString(), module); } @@ -547,7 +546,7 @@ public class CatalogUrlSeoTransform impl List<String> urlElements = StringUtil.split(lastPathElement, URL_HYPHEN); if (UtilValidate.isEmpty(urlElements)) { try { - if (EntityQuery.use(delegator).from("Product").where("productId", lastPathElement).cache().queryOne() != null) { + if (delegator.findOne("Product", UtilMisc.toMap("productId", lastPathElement), true) != null) { productId = lastPathElement; } } catch (GenericEntityException e) { @@ -689,7 +688,7 @@ public class CatalogUrlSeoTransform impl } if (UtilValidate.isNotEmpty(productId)) { try { - product = EntityQuery.use(delegator).from("Product").where("productId", productId).cache().queryOne(); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up product info for productId [" + productId + "]: " + e.toString(), module); } Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/category/CreateProductInCategoryStart.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/category/CreateProductInCategoryStart.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/template/category/CreateProductInCategoryStart.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/template/category/CreateProductInCategoryStart.ftl Wed Dec 13 10:42:32 2017 @@ -67,7 +67,7 @@ under the License. <td width="15%">${uiLabelMap.ProductDefaultPrice}:</td> <td><input type="text" name="defaultPrice" size="8"/> <#assign findCurrenciesMap = Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("uomTypeId", "CURRENCY_MEASURE")> - <#assign currencies = EntityQuery.use(delegator).from("Uom").where(findCurrenciesMap!).cache().queryList()! /> + <#assign currencies = delegator.findByAnd('Uom', findCurrenciesMap, null, true) /> <#if currencies?has_content && (currencies?size > 0)> <select name="currencyUomId"> <option value=""></option> Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/facility/PrintPickSheets.fo.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/facility/PrintPickSheets.fo.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/template/facility/PrintPickSheets.fo.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/template/facility/PrintPickSheets.fo.ftl Wed Dec 13 10:42:32 2017 @@ -205,7 +205,7 @@ under the License. <#if workOrderItemFulfillment?has_content> <#assign workEffort = workOrderItemFulfillment.getRelatedOne("WorkEffort", false)/> <#if workEffort?has_content> - <#assign workEffortTask = EntityQuery.use(delegator).from("WorkEffort").where("workEffortParentId", workEffort.workEffortId!).queryFirst()!/> + <#assign workEffortTask = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(delegator.findByAnd("WorkEffort", {"workEffortParentId" : workEffort.workEffortId}, null, false))/> <#if workEffortTask?has_content> <#assign workEffortInventoryAssigns = workEffortTask.getRelated("WorkEffortInventoryAssign", null, null, false)/> <#if workEffortInventoryAssigns?has_content> Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/imagemanagement/ShowPeopleApprove.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/imagemanagement/ShowPeopleApprove.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/template/imagemanagement/ShowPeopleApprove.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/template/imagemanagement/ShowPeopleApprove.ftl Wed Dec 13 10:42:32 2017 @@ -38,11 +38,11 @@ jQuery(document).ready(function(){ <#list partyRoles as partyRole> <td> <table> - <#assign userLoginApprovers = EntityQuery.use(delegator).from("UserLogin").where("partyId", partyRole.partyId!).queryList()!/> + <#assign userLoginApprovers = delegator.findByAnd("UserLogin",Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("partyId", partyRole.partyId), null, false)/> <#assign userLoginApprover = userLoginApprovers[0]> <#assign userLoginAndPartyDetails = delegator.findOne("UserLoginAndPartyDetails", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("partyId", userLoginApprover.partyId, "userLoginId", userLoginApprover.userLoginId), false)!> <#if userLoginAndPartyDetails?has_content> - <#assign partyContentDetail = EntityQuery.use(delegator).from("ContentApproval").where("roleTypeId", "IMAGEAPPROVER", "approvalStatusId", "IM_PENDING", "partyId", userLoginAndPartyDetails.partyId!).queryList()!/> + <#assign partyContentDetail = delegator.findByAnd("ContentApproval",Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("roleTypeId", "IMAGEAPPROVER", "approvalStatusId", "IM_PENDING", "partyId", userLoginAndPartyDetails.partyId), null, false)/> <#assign imageApproveSize = partyContentDetail.size()> <#if userLoginAndPartyDetails.userLoginId == userLogin.userLoginId> <#if userMap.checkUser == userLoginAndPartyDetails.userLoginId> Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/product/ViewProductOrders.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/product/ViewProductOrders.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/template/product/ViewProductOrders.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/template/product/ViewProductOrders.ftl Wed Dec 13 10:42:32 2017 @@ -72,7 +72,7 @@ under the License. </tr> <#if orderList?has_content && productId??> <#list orderList as order> - <#assign orderItems = EntityQuery.use(delegator).from("OrderItem").where("orderId", order.orderId!, "productId", productId!).queryList()!/> + <#assign orderItems = delegator.findByAnd("OrderItem", {"orderId" : order.orderId, "productId" : productId}, null, false)/> <#list orderItems as orderItem> <tr> <td><a href="/ordermgr/control/orderview?orderId=${orderItem.orderId}" class='buttontext'>${orderItem.orderId}</a></td> Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/VerifyPick.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/VerifyPick.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/VerifyPick.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/VerifyPick.ftl Wed Dec 13 10:42:32 2017 @@ -208,10 +208,10 @@ under the License. <#assign readyToVerify = verifyPickSession.getReadyToVerifyQuantity(orderId,orderItemSeqId)> <#assign orderItemQuantity = orderItem.getBigDecimal("quantity")> <#assign verifiedQuantity = 0.000000> - <#assign shipments = EntityQuery.use(delegator).from("Shipment").where("primaryOrderId", orderItem.getString("orderId")!, "statusId", "SHIPMENT_PICKED").queryList()!/> + <#assign shipments = delegator.findByAnd("Shipment", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("primaryOrderId", orderItem.getString("orderId"), "statusId", "SHIPMENT_PICKED"), null, false)/> <#if (shipments?has_content)> <#list shipments as shipment> - <#assign itemIssuances = EntityQuery.use(delegator).from("ItemIssuance").where("shipmentId", shipment.getString("shipmentId")!, "orderItemSeqId", orderItemSeqId!).queryList()!/> + <#assign itemIssuances = delegator.findByAnd("ItemIssuance", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("shipmentId", shipment.getString("shipmentId"), "orderItemSeqId", orderItemSeqId), null, false)/> <#if itemIssuances?has_content> <#list itemIssuances as itemIssuance> <#assign verifiedQuantity = verifiedQuantity + itemIssuance.getBigDecimal("quantity")> @@ -267,7 +267,7 @@ under the License. <#if workOrderItemFulfillment?has_content> <#assign workEffort = workOrderItemFulfillment.getRelatedOne("WorkEffort", false)/> <#if workEffort?has_content> - <#assign workEffortTask = EntityQuery.use(delegator).from("WorkEffort").where("workEffortParentId", workEffort.workEffortId!).queryFirst()!/> + <#assign workEffortTask = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(delegator.findByAnd("WorkEffort", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("workEffortParentId", workEffort.workEffortId), null, false))/> <#if workEffortTask?has_content> <#assign workEffortInventoryAssigns = workEffortTask.getRelated("WorkEffortInventoryAssign", null, null, false)/> <#if workEffortInventoryAssigns?has_content> Modified: ofbiz/ofbiz-framework/trunk/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java Wed Dec 13 10:42:32 2017 @@ -127,7 +127,7 @@ public class LoginEvents { String errMsg = null; try { - GenericValue userLoginSecurityQuestion = EntityQuery.use(delegator).from("UserLoginSecurityQuestion").where("questionEnumId", questionEnumId, "userLoginId", userLoginId).cache().queryOne(); + GenericValue userLoginSecurityQuestion = delegator.findOne("UserLoginSecurityQuestion", UtilMisc.toMap("questionEnumId", questionEnumId, "userLoginId", userLoginId), true); if (userLoginSecurityQuestion != null) { if (UtilValidate.isEmpty(securityAnswer)) { errMsg = UtilProperties.getMessage(resource, "loginservices.security_answer_empty", UtilHttp.getLocale(request)); Modified: ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/ical/IsCalOwner.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/ical/IsCalOwner.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/ical/IsCalOwner.groovy (original) +++ ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/ical/IsCalOwner.groovy Wed Dec 13 10:42:32 2017 @@ -21,7 +21,7 @@ import java.util.* import org.apache.ofbiz.entity.util.* boolean isCalOwner = false -List partyAssignments = from("WorkEffortPartyAssignment").where("workEffortId", parameters.workEffortId, "partyId", parameters.userLogin.partyId).filterByDate().queryFirst(); +List partyAssignments = EntityUtil.filterByDate(delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : parameters.workEffortId, "partyId" : parameters.userLogin.partyId], null, false)) for (partyAssign in partyAssignments) { if ("CAL_OWNER".equals(partyAssign.roleTypeId) || "CAL_DELEGATE".equals(partyAssign.roleTypeId)) { isCalOwner = true Modified: ofbiz/ofbiz-framework/trunk/applications/workeffort/template/calendar/CalendarEventContent.ftl URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/workeffort/template/calendar/CalendarEventContent.ftl?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/workeffort/template/calendar/CalendarEventContent.ftl (original) +++ ofbiz/ofbiz-framework/trunk/applications/workeffort/template/calendar/CalendarEventContent.ftl Wed Dec 13 10:42:32 2017 @@ -25,7 +25,7 @@ under the License. <#if workOrderItemFulfillments?has_content> <#list workOrderItemFulfillments as workOrderItemFulfillment> <br/>${uiLabelMap.OrderOrderId}: <a href="/ordermgr/control/orderview?orderId=${workOrderItemFulfillment.orderId}" class="event">${workOrderItemFulfillment.orderId} / ${workOrderItemFulfillment.orderItemSeqId}</a> - <#assign orderItemAndShipGroupAssocs = EntityQuery.use(delegator).from("OrderHeaderItemAndShipGroup").where("orderId", workOrderItemFulfillment.orderId!, "orderItemSeqId", workOrderItemFulfillment.orderItemSeqId!).queryList()!/> + <#assign orderItemAndShipGroupAssocs = delegator.findByAnd("OrderHeaderItemAndShipGroup", {"orderId", workOrderItemFulfillment.orderId, "orderItemSeqId", workOrderItemFulfillment.orderItemSeqId}, null, false)!/> <#list orderItemAndShipGroupAssocs as orderItemAndShipGroupAssoc> <#if orderItemAndShipGroupAssoc.shipByDate?has_content> ${uiLabelMap.OrderShipBeforeDate}: ${orderItemAndShipGroupAssoc.shipByDate} @@ -41,7 +41,7 @@ under the License. <#if parentWorkOrderItemFulfillments?has_content> <#list parentWorkOrderItemFulfillments as parentWorkOrderItemFulfillment> <br/>${uiLabelMap.OrderOrderId}: <a href="/ordermgr/control/orderview?orderId=${parentWorkOrderItemFulfillment.orderId}" class="event">${parentWorkOrderItemFulfillment.orderId} / ${parentWorkOrderItemFulfillment.orderItemSeqId}</a> - <#assign orderItemAndShipGroupAssocs = EntityQuery.use(delegator).from("OrderHeaderItemAndShipGroup").where("orderId", parentWorkOrderItemFulfillment.orderId!, "orderItemSeqId", parentWorkOrderItemFulfillment.orderItemSeqId!).queryList()!/> + <#assign orderItemAndShipGroupAssocs = delegator.findByAnd("OrderHeaderItemAndShipGroup", {"orderId", parentWorkOrderItemFulfillment.orderId, "orderItemSeqId", parentWorkOrderItemFulfillment.orderItemSeqId}, null, false)!/> <#list orderItemAndShipGroupAssocs as orderItemAndShipGroupAssoc> <#if orderItemAndShipGroupAssoc.shipByDate?has_content> ${uiLabelMap.OrderShipBeforeDate}: ${orderItemAndShipGroupAssoc.shipByDate} Modified: ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GeoLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GeoLocation.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GeoLocation.groovy (original) +++ ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GeoLocation.groovy Wed Dec 13 10:42:32 2017 @@ -18,6 +18,6 @@ */ if (geoPoint && geoPoint.elevationUomId) { - elevationUom = from("Uom").where("uomId", geoPoint.elevationUomId).queryList(); + elevationUom = delegator.findOne("Uom", [uomId : geoPoint.elevationUomId], false) context.elevationUomAbbr = elevationUom.abbreviation } Modified: ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GetParentPortalPageId.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GetParentPortalPageId.groovy?rev=1817998&r1=1817997&r2=1817998&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GetParentPortalPageId.groovy (original) +++ ofbiz/ofbiz-framework/trunk/framework/common/groovyScripts/GetParentPortalPageId.groovy Wed Dec 13 10:42:32 2017 @@ -43,7 +43,7 @@ if (userLogin && parameters.parentPortal if (portalMainPages) { portalPageId = portalMainPages.get(0).portalPageId // check if overridden with a privat page - privatMainPages = from("PortalPage").where("originalPortalPageId", portalPageId, "ownerUserLoginId", userLogin.userLoginId).queryList(); + privatMainPages = delegator.findByAnd("PortalPage", [originalPortalPageId : portalPageId, ownerUserLoginId : userLogin.userLoginId], null, false) if (privatMainPages) { context.parameters.portalPageId = privatMainPages.get(0).portalPageId } else { @@ -53,7 +53,7 @@ if (userLogin && parameters.parentPortal } // Debug.log('======portalPageId: ' + parameters.portalPageId) if (userLogin && parameters.portalPageId) { - portalPage = from("PortalPage").where("portalPageId", parameters.portalPageId).queryOne(); + portalPage = delegator.findOne("PortalPage", [portalPageId : parameters.portalPageId], false) if (portalPage) { if (portalPage.parentPortalPageId) { context.parameters.parentPortalPageId = portalPage.parentPortalPageId |
Free forum by Nabble | Edit this page |