Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyGeoLocation.groovy Mon Jan 5 08:50:30 2015 @@ -27,7 +27,7 @@ partyId = parameters.partyId ?: paramete userLoginId = parameters.userlogin_id ?: parameters.userLoginId; if (!partyId && userLoginId) { - thisUserLogin = delegator.findOne("UserLogin", [userLoginId : userLoginId], false); + thisUserLogin = from("UserLogin").where("userLoginId", userLoginId).queryOne(); if (thisUserLogin) { partyId = thisUserLogin.partyId; } @@ -38,7 +38,7 @@ context.partyId = partyId; if (!geoPointId) { latestGeoPoint = GeoWorker.findLatestGeoPoint(delegator, "PartyAndGeoPoint", "partyId", partyId, null, null); } else { - latestGeoPoint = delegator.findOne("GeoPoint", [geoPointId : geoPointId], false); + latestGeoPoint = from("GeoPoint").where("geoPointId", geoPointId).queryOne(); } if (latestGeoPoint) { context.latestGeoPoint = latestGeoPoint; @@ -53,7 +53,7 @@ if (latestGeoPoint) { context.geoChart = geoChart; } if (latestGeoPoint && latestGeoPoint.elevationUomId) { - elevationUom = delegator.findOne("Uom", [uomId : latestGeoPoint.elevationUomId], false); + elevationUom = from("Uom").where("uomId", latestGeoPoint.elevationUomId).queryOne(); context.elevationUomAbbr = elevationUom.abbreviation; } } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/SetRoleVars.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/SetRoleVars.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/SetRoleVars.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/SetRoleVars.groovy Mon Jan 5 08:50:30 2015 @@ -19,28 +19,28 @@ import org.ofbiz.entity.*; import org.ofbiz.entity.util.EntityUtil; - roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT'], null, false); + roleTypeAndParty = from("RoleTypeAndParty").where("partyId", parameters.partyId, "roleTypeId", "ACCOUNT").queryList(); if (roleTypeAndParty) { context.accountDescription = roleTypeAndParty[0].description; } - roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'CONTACT'], null, false); + roleTypeAndParty = from("RoleTypeAndParty").where("partyId", parameters.partyId, "roleTypeId", "CONTACT").queryList(); if (roleTypeAndParty) { context.contactDescription = roleTypeAndParty.get(0).description; } - roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'LEAD'], null, false); + roleTypeAndParty = from("RoleTypeAndParty").where("partyId", parameters.partyId, "roleTypeId", "LEAD").queryList(); if (roleTypeAndParty) { context.leadDescription = roleTypeAndParty.get(0).description; - partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdTo": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"], null, false)); + partyRelationships = from("PartyRelationship").where("partyIdTo", parameters.partyId, "roleTypeIdFrom", "ACCOUNT_LEAD", "roleTypeIdTo", "LEAD", "partyRelationshipTypeId", "EMPLOYMENT").filterByDate().queryList(); if (partyRelationships) { context.partyGroupId = partyRelationships.get(0).partyIdFrom; context.partyId = parameters.partyId; } } - roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT_LEAD'], null, false); + roleTypeAndParty = from("RoleTypeAndParty").where("partyId", parameters.partyId, "roleTypeId", "ACCOUNT_LEAD").queryList(); if (roleTypeAndParty) { context.leadDescription = roleTypeAndParty.get(0).description; - partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdFrom": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"], null, false)); + partyRelationships = from("PartyRelationship").where("partyIdFrom", parameters.partyId, "roleTypeIdFrom", "ACCOUNT_LEAD", "roleTypeIdTo", "LEAD", "partyRelationshipTypeId", "EMPLOYMENT").filterByDate().queryList(); if (partyRelationships) { context.partyGroupId = parameters.partyId; context.partyId = partyRelationships.get(0).partyIdTo; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/UnAppliedInvoicesForParty.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/UnAppliedInvoicesForParty.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/UnAppliedInvoicesForParty.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/UnAppliedInvoicesForParty.groovy Mon Jan 5 08:50:30 2015 @@ -31,7 +31,6 @@ Boolean actualCurrency = new Boolean(con if (actualCurrency == null) { actualCurrency = true; } -findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); invExprs = EntityCondition.makeCondition([ @@ -50,7 +49,7 @@ invExprs = ],EntityOperator.OR) ],EntityOperator.AND); -invIterator = delegator.find("InvoiceAndType", invExprs, null, null, null, findOpts); +invIterator = from("InvoiceAndType").where(invExprs).cursorScrollInsensitive().distinct().queryIterator(); invoiceList = []; while (invoice = invIterator.next()) { unAppliedAmount = InvoiceWorker.getInvoiceNotApplied(invoice, actualCurrency).setScale(2,BigDecimal.ROUND_HALF_UP); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/UnAppliedPaymentsForParty.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/UnAppliedPaymentsForParty.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/UnAppliedPaymentsForParty.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/UnAppliedPaymentsForParty.groovy Mon Jan 5 08:50:30 2015 @@ -50,7 +50,7 @@ payExprs = ], EntityOperator.AND); paymentList = []; -payIterator = delegator.find("PaymentAndType", payExprs, null, null, null, findOpts); +payIterator = from("PaymentAndType").where(payExprs).cursorScrollInsensitive().distinct().queryIterator(); while (payment = payIterator.next()) { unAppliedAmount = PaymentWorker.getPaymentNotApplied(payment, actualCurrency).setScale(2,BigDecimal.ROUND_HALF_UP); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy Mon Jan 5 08:50:30 2015 @@ -23,7 +23,7 @@ partyId = parameters.partyId ?: paramete userLoginId = parameters.userlogin_id ?: parameters.userLoginId; if (!partyId && userLoginId) { - thisUserLogin = delegator.findOne("UserLogin", [userLoginId : userLoginId], false); + thisUserLogin = from("UserLogin").where("userLoginId", userLoginId).queryOne(); if (thisUserLogin) { partyId = thisUserLogin.partyId; parameters.partyId = partyId; @@ -32,5 +32,5 @@ if (!partyId && userLoginId) { context.showOld = "true".equals(parameters.SHOW_OLD); context.partyId = partyId; -context.party = delegator.findOne("Party", [partyId : partyId], false); +context.party = from("Party").where("partyId", partyId).queryOne(); context.nowStr = UtilDateTime.nowTimestamp().toString(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/ShowVisits.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/ShowVisits.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/ShowVisits.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/ShowVisits.groovy Mon Jan 5 08:50:30 2015 @@ -52,12 +52,12 @@ try { highIndex = viewIndex * viewSize; if (partyId) { - visitListIt = delegator.find("Visit", EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId), null, null, sortList, new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, -1, highIndex, true)); + visitListIt = from("Visit").where("partyId", partyId).orderBy(sortList).cursorScrollInsensitive().maxRows(highIndex).distinct().queryIterator(); } else if (showAll.equalsIgnoreCase("true")) { - visitListIt = delegator.find("Visit", null, null, null, sortList, new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, -1, highIndex, true)); + visitListIt = from("Visit").orderBy(sortList).cursorScrollInsensitive().maxRows(highIndex).distinct().queryIterator(); } else { // show active visits - visitListIt = delegator.find("Visit", EntityCondition.makeCondition("thruDate", EntityOperator.EQUALS, null), null, null, sortList, new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, -1, highIndex, true)); + visitListIt = from("Visit").where("thruDate", null).orderBy(sortList).cursorScrollInsensitive().maxRows(highIndex).distinct().queryIterator(); } // get the partial list for this page Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/VisitDetails.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/VisitDetails.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/VisitDetails.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/VisitDetails.groovy Mon Jan 5 08:50:30 2015 @@ -23,9 +23,9 @@ visitId = parameters.visitId; visit = null; serverHits = null; if (visitId) { - visit = delegator.findOne("Visit", [visitId : visitId], false); + visit = from("Visit").where("visitId", visitId).queryOne(); if (visit) { - serverHits = delegator.findByAnd("ServerHit", [visitId : visitId], ["-hitStartDateTime"], false); + serverHits = from("ServerHit").where("visitId", visitId).orderBy("-hitStartDateTime").queryList(); } } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/widget/partymgr/CommunicationEventForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/widget/partymgr/CommunicationEventForms.xml?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/widget/partymgr/CommunicationEventForms.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/widget/partymgr/CommunicationEventForms.xml Mon Jan 5 08:50:30 2015 @@ -789,7 +789,7 @@ under the License. <field name="communicationEventId"><display/></field> <field name="contentId"><display/></field> <field name="contentTypeId"><hidden/></field> - <field name="dataResourceId"><display/></field> + <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}"><display/></field> <field name="contentName"><text/></field> <field name="fromDate"><display/></field> <field name="thruDate"><date-time/></field> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/widget/partymgr/PartyForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/widget/partymgr/PartyForms.xml?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/widget/partymgr/PartyForms.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/widget/partymgr/PartyForms.xml Mon Jan 5 08:50:30 2015 @@ -586,7 +586,7 @@ under the License. </field> <!-- note sure if these two are necessray, but they are kind of confusing in this context: <field name="ownerContentId"><lookup target-form-name="LookupContent"/></field> - <field name="dataResourceId"><lookup target-form-name="LookupDataResource"/></field> + <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}"><lookup target-form-name="LookupDataResource"/></field> --> <field name="contentTypeId"> <drop-down allow-empty="false" no-current-selected-key="DOCUMENT"> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/config/ProductUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/config/ProductUiLabels.xml?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/config/ProductUiLabels.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/config/ProductUiLabels.xml Mon Jan 5 08:50:30 2015 @@ -3632,7 +3632,7 @@ <value xml:lang="zh_TW">åæ¶æ¸é</value> </property> <property key="FormFieldTitle_canclAutmExtTime"> - <value xml:lang="en">The time period (before the end of the thrudate) after which the automatic extension of the subscription will be executed</value> + <value xml:lang="en">Time period (before the end of the thrudate) for automatic extension of the subscription</value> <value xml:lang="fr">Durée durant laquelle l'abonnement sera automatiquement étendu (avant la date de fin)</value> <value xml:lang="it">Il periodo di tempo (prima della data di termine) dopo che l'estensione automatica dell'abbonamento verrà eseguita</value> <value xml:lang="ja">(çµäºæ¥åã«)ç³è¾¼ãèªåç¶ç¶ããæé</value> @@ -13616,7 +13616,7 @@ <value xml:lang="zh_TW">åé管ç</value> </property> <property key="ProductCatalogEmptyWarning"> - <value xml:lang="en">If you don't populate a Catalog with Categories, it will not shown in the Browse Catalogs/Categories tree</value> + <value xml:lang="en">If you don't populate a Catalog with Categories, it will not be shown in the Browse Catalogs/Categories tree</value> <value xml:lang="fr">Si vous ne créez pas de catégories pour un catalogue, il n'apparaitra pas dans l'arbre des Catalogues/catégories</value> <value xml:lang="it">Se un catalogo non viene valorizzato con delle categorie, questo non verrà mostrato nell'albero Sfoglia cataloghi/categorie</value> <value xml:lang="ja">ã«ã¿ãã°ãã«ãã´ãªã«å±ãã¦ããªãå ´åãã«ã¿ãã°/ã«ãã´ãªããªã¼ã¯è¡¨ç¤ºããã¾ãã</value> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/entitydef/entitymodel.xml?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/entitydef/entitymodel.xml Mon Jan 5 08:50:30 2015 @@ -2159,9 +2159,6 @@ under the License. <prim-key field="visitId"/> <prim-key field="productId"/> <prim-key field="productStoreId"/> - <relation type="one" fk-name="INV_ITEM_TR_VIS" rel-entity-name="Visit"> - <key-map field-name="visitId"/> - </relation> <relation type="one" fk-name="INV_ITEM_TR_PROD" rel-entity-name="Product"> <key-map field-name="productId"/> </relation> @@ -3244,9 +3241,6 @@ under the License. <field name="secondsTotal" type="floating-point"></field> <field name="searchDate" type="date-time"></field> <prim-key field="productSearchResultId"/> - <relation type="one" fk-name="PROD_SCHRES_VST" rel-entity-name="Visit"> - <key-map field-name="visitId"/> - </relation> </entity> <entity entity-name="ProductType" package-name="org.ofbiz.product.product" Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/entitydef/entitymodel_old.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/entitydef/entitymodel_old.xml?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/entitydef/entitymodel_old.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/entitydef/entitymodel_old.xml Mon Jan 5 08:50:30 2015 @@ -85,9 +85,6 @@ under the License. <field name="removeStems" type="indicator"></field> <field name="numResults" type="numeric"></field> <prim-key field="productKeywordResultId"/> - <relation type="one" fk-name="PROD_KWDRES_VST" rel-entity-name="Visit"> - <key-map field-name="visitId"/> - </relation> <relation type="one-nofk" rel-entity-name="ProductCategory"> <key-map field-name="productCategoryId"/> </relation> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml Mon Jan 5 08:50:30 2015 @@ -270,6 +270,30 @@ under the License. </calculate> <call-service service-name="createInventoryItemDetail" in-map-name="createDetailMap"/> <clear-field field="createDetailMap"/> + <entity-and list="oisgirs" entity-name="OrderItemShipGrpInvRes"> + <field-map field-name="orderId" from-field="orderItemShipGrpInvRes.orderId"/> + <field-map field-name="orderItemSeqId" from-field="orderItemShipGrpInvRes.orderItemSeqId"/> + </entity-and> + <!-- Need to Cancel and re-reserve oisgir to fix OFBIZ-5364 issue, while there are multiple ship groups for an order item associated with same inventory and you are issuing items from one ship group to another, then quantityNotAvailable will be incorrect if we do not cancel and reserve all oisgir of order item --> + <iterate entry="oisgir" list="oisgirs"> + <set field="cancelOrderItemShipGrpInvResMap.orderId" from-field="oisgir.orderId"/> + <set field="cancelOrderItemShipGrpInvResMap.orderItemSeqId" from-field="oisgir.orderItemSeqId"/> + <set field="cancelOrderItemShipGrpInvResMap.shipGroupSeqId" from-field="oisgir.shipGroupSeqId"/> + <set field="cancelOrderItemShipGrpInvResMap.inventoryItemId" from-field="oisgir.inventoryItemId"/> + <set field="cancelOrderItemShipGrpInvResMap.cancelQuantity" from-field="oisgir.quantity"/> + <call-service service-name="cancelOrderItemShipGrpInvRes" in-map-name="cancelOrderItemShipGrpInvResMap"/> + </iterate> + <!-- Re-reserve cancelled oisgirs again so that shipped quantity will be subtract from oisgir.quantity and oisgir.quantityNotAvailable will be calculated accordingly --> + <iterate entry="oisgir" list="oisgirs"> + <set field="reserveProductInventoryByFacilityMap.quantity" from-field="oisgir.quantity"/> + <set field="reserveProductInventoryByFacilityMap.facilityId" from-field="orderHeader.originFacilityId"/> + <set field="reserveProductInventoryByFacilityMap.orderId" from-field="oisgir.orderId"/> + <set field="reserveProductInventoryByFacilityMap.orderItemSeqId" from-field="oisgir.orderItemSeqId"/> + <set field="reserveProductInventoryByFacilityMap.productId" from-field="orderItem.productId"/> + <set field="reserveProductInventoryByFacilityMap.shipGroupSeqId" from-field="oisgir.shipGroupSeqId"/> + <set field="reserveProductInventoryByFacilityMap.requireInventory" value="N"/><!-- requireInventory should be N to create backordered oisgir if ATP is negative --> + <call-service service-name="reserveProductInventoryByFacility" in-map-name="reserveProductInventoryByFacilityMap" /> + </iterate> </simple-method> <!-- some inline methods for the issuance process --> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductWorker.java?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductWorker.java Mon Jan 5 08:50:30 2015 @@ -1119,6 +1119,7 @@ nextProd: // copy the supplier List<GenericValue> supplierProducts = EntityQuery.use(delegator).from("SupplierProduct").where("productId", productId).cache(true).queryList(); for (GenericValue supplierProduct: supplierProducts) { + supplierProduct = (GenericValue) supplierProduct.clone(); supplierProduct.set("productId", product.getString("productId")); supplierProduct.create(); } @@ -1126,6 +1127,7 @@ nextProd: // copy the content List<GenericValue> productContents = EntityQuery.use(delegator).from("ProductContent").where("productId", productId).cache(true).queryList(); for (GenericValue productContent: productContents) { + productContent = (GenericValue) productContent.clone(); productContent.set("productId", product.getString("productId")); productContent.create(); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java Mon Jan 5 08:50:30 2015 @@ -432,22 +432,26 @@ public class ShipmentServices { if (shippableItemInfo != null) { for (Map<String, Object> itemMap: shippableItemInfo) { // add the item sizes - BigDecimal itemSize = (BigDecimal) itemMap.get("size"); - if (itemSize != null) { - shippableItemSizes.add(itemSize); + if (itemMap.containsKey("size")) { + BigDecimal itemSize = (BigDecimal) itemMap.get("size"); + if (itemSize != null) { + shippableItemSizes.add(itemSize); + } } // add the feature quantities BigDecimal quantity = (BigDecimal) itemMap.get("quantity"); - Set<String> featureSet = UtilGenerics.checkSet(itemMap.get("featureSet")); - if (UtilValidate.isNotEmpty(featureSet)) { - for (String featureId: featureSet) { - BigDecimal featureQuantity = shippableFeatureMap.get(featureId); - if (featureQuantity == null) { - featureQuantity = BigDecimal.ZERO; + if (itemMap.containsKey("featureSet")) { + Set<String> featureSet = UtilGenerics.checkSet(itemMap.get("featureSet")); + if (UtilValidate.isNotEmpty(featureSet)) { + for (String featureId: featureSet) { + BigDecimal featureQuantity = shippableFeatureMap.get(featureId); + if (featureQuantity == null) { + featureQuantity = BigDecimal.ZERO; + } + featureQuantity = featureQuantity.add(quantity); + shippableFeatureMap.put(featureId, featureQuantity); } - featureQuantity = featureQuantity.add(quantity); - shippableFeatureMap.put(featureId, featureQuantity); } } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/FastLoadCache.groovy Mon Jan 5 08:50:30 2015 @@ -26,7 +26,7 @@ messageList = []; messageList.add("Loading Categories..."); UtilTimer ctimer = new UtilTimer(); messageList.add(ctimer.timerString("Before category find")); -categories = delegator.find("ProductCategory", null, null, null, null, null); +categories = from("ProductCategory").queryIterator(); messageList.add(ctimer.timerString("Before load all categories into cache")); category = null; @@ -45,7 +45,7 @@ messageList.add(" "); messageList.add("Loading Products..."); UtilTimer ptimer = new UtilTimer(); messageList.add(ptimer.timerString("Before product find")); -products = delegator.find("Product", null, null, null, null, null); +products = from("Product").queryIterator(); messageList.add(ptimer.timerString("Before load all products into cache")); product = null; long numProducts = 0; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/CategoryTree.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/CategoryTree.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/CategoryTree.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/CategoryTree.groovy Mon Jan 5 08:50:30 2015 @@ -47,7 +47,7 @@ List separateRootType(roots) { completedTree = []; // Get the Catalogs -prodCatalogs = delegator.findList("ProdCatalog", null, null, null, null, false); +prodCatalogs = from("ProdCatalog").queryList(); if (prodCatalogs) { prodCatalogs.each { prodCatalog -> prodCatalogMap = [:]; @@ -55,7 +55,7 @@ if (prodCatalogs) { prodCatalogMap.categoryName = prodCatalog.getString("catalogName"); prodCatalogMap.isCatalog = true; prodCatalogMap.isCategoryType = false; - prodCatalogCategories = EntityUtil.filterByDate(delegator.findByAnd("ProdCatalogCategory", ["prodCatalogId" : prodCatalog.prodCatalogId], null, false)); + prodCatalogCategories = from("ProdCatalogCategory").where("prodCatalogId", prodCatalog.prodCatalogId).filterByDate().queryList(); if (prodCatalogCategories) { prodCatalogMap.child = separateRootType(prodCatalogCategories); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/CreateProductInCategoryCheckExisting.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/CreateProductInCategoryCheckExisting.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/CreateProductInCategoryCheckExisting.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/CreateProductInCategoryCheckExisting.groovy Mon Jan 5 08:50:30 2015 @@ -36,14 +36,14 @@ productIds = ProductSearch.parametricKey // get the product for each ID products = new ArrayList(productIds.size()); productIds.each { productId -> - product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); + product = from("Product").where("productId", productId).cache(true).queryOne(); products.add(product); } productFeatureAndTypeDatas = new ArrayList(featureIdByType.size()); featureIdByType.each { featureIdByTypeEntry -> - productFeatureType = delegator.findOne("ProductFeatureType", UtilMisc.toMap("productFeatureTypeId", featureIdByTypeEntry.key), true); - productFeature = delegator.findOne("ProductFeature", UtilMisc.toMap("productFeatureId", featureIdByTypeEntry.value), true); + productFeatureType = from("ProductFeatureType").where("productFeatureTypeId", featureIdByTypeEntry.key).cache(true).queryOne(); + productFeature = from("ProductFeature").where("productFeatureId", featureIdByTypeEntry.value).cache(true).queryOne(); productFeatureAndTypeData = [:]; productFeatureAndTypeData.productFeatureType = productFeatureType; productFeatureAndTypeData.productFeature = productFeature; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategory.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategory.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategory.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategory.groovy Mon Jan 5 08:50:30 2015 @@ -30,7 +30,7 @@ primParentCatIdParam = request.getParame if (productCategory) { primaryParentCategory = productCategory.getRelatedOne("PrimaryParentProductCategory", false); } else if (primParentCatIdParam) { - primaryParentCategory = delegator.findOne("ProductCategory", [productCategoryId : primParentCatIdParam], false); + primaryParentCategory = from("ProductCategory").where("productCategoryId", primParentCatIdParam).queryOne(); } context.primaryParentCategory = primaryParentCategory; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryContentContent.groovy Mon Jan 5 08:50:30 2015 @@ -38,7 +38,7 @@ if (("PAGE_TITLE".equals(prodCatContentT context.contentFormTitle = "${uiLabelMap.ProductUpdateSEOContentCategory}"; } if ("RELATED_URL".equals(prodCatContentTypeId)) { - contentList = delegator.findByAnd("ContentDataResourceView", UtilMisc.toMap("contentId", contentId), null, false); + contentList = from("ContentDataResourceView").where("contentId", contentId).queryList(); if (contentList) { context.contentId = contentList.get(0).contentId; context.dataResourceId = contentList.get(0).dataResourceId; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryProducts.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryProducts.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategoryProducts.groovy Mon Jan 5 08:50:30 2015 @@ -34,7 +34,7 @@ paramInMap.viewIndexString = parameters. paramInMap.viewSizeString = parameters.get("VIEW_SIZE"); // Returns: viewIndex, viewSize, lowIndex, highIndex, listSize, productCategory, productCategoryMembers -outMap = dispatcher.runSync("getProductCategoryAndLimitedMembers", paramInMap); +outMap = runService('getProductCategoryAndLimitedMembers', paramInMap); context.viewIndex = outMap.viewIndex; context.viewSize = outMap.viewSize; context.lowIndex = outMap.lowIndex; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategorySEO.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategorySEO.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategorySEO.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategorySEO.groovy Mon Jan 5 08:50:30 2015 @@ -19,21 +19,21 @@ productCategoryId = parameters.productCategoryId; if (productCategoryId) { - productCategoryContents = delegator.findByAnd("ProductCategoryContent", ["productCategoryId" : productCategoryId], null, false); + productCategoryContents = from("ProductCategoryContent").where("productCategoryId", productCategoryId).queryList(); productCategoryContents.each{ productCategoryContent-> if (productCategoryContent.prodCatContentTypeId == "PAGE_TITLE") { - contentTitle = delegator.findOne("Content", ["contentId" : productCategoryContent.contentId], false); - dataTextTitle = delegator.findOne("ElectronicText", ["dataResourceId" : contentTitle.dataResourceId], false); + contentTitle = from("Content").where("contentId", productCategoryContent.contentId).queryOne(); + dataTextTitle = from("ElectronicText").where("dataResourceId", contentTitle.dataResourceId).queryOne(); context.title = dataTextTitle.textData; } if (productCategoryContent.prodCatContentTypeId == "META_KEYWORD") { - contentMetaKeyword = delegator.findOne("Content", ["contentId" : productCategoryContent.contentId], false); - dataTextMetaKeyword = delegator.findOne("ElectronicText", ["dataResourceId" : contentMetaKeyword.dataResourceId], false); + contentMetaKeyword = from("Content").where("contentId", productCategoryContent.contentId).queryOne(); + dataTextMetaKeyword = from("ElectronicText").where("dataResourceId", contentMetaKeyword.dataResourceId).queryOne(); context.metaKeyword = dataTextMetaKeyword.textData; } if (productCategoryContent.prodCatContentTypeId == "META_DESCRIPTION") { - contentMetaDescription = delegator.findOne("Content", ["contentId" : productCategoryContent.contentId], false); - dataTextMetaDescription = delegator.findOne("ElectronicText", ["dataResourceId" : contentMetaDescription.dataResourceId], false); + contentMetaDescription = from("Content").where("contentId", productCategoryContent.contentId).queryOne(); + dataTextMetaDescription = from("ElectronicText").where("dataResourceId", contentMetaDescription.dataResourceId).queryOne(); context.metaDescription = dataTextMetaDescription.textData; } } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/config/EditProductConfigItemContentContent.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/config/EditProductConfigItemContentContent.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/config/EditProductConfigItemContentContent.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/config/EditProductConfigItemContentContent.groovy Mon Jan 5 08:50:30 2015 @@ -28,7 +28,7 @@ confItemContentTypeId = request.getParam description = request.getParameter("description") ?: null; -productContent = delegator.findOne("ProdConfItemContent", [contentId : contentId, configItemId : configItemId, confItemContentTypeId : confItemContentTypeId, fromDate : fromDate], false); +productContent = from("ProdConfItemContent").where("contentId", contentId, "configItemId", configItemId, "confItemContentTypeId", confItemContentTypeId, "fromDate", fromDate).queryOne(); if (!productContent) { productContent = [:]; productContent.configItemId = configItemId; @@ -45,7 +45,7 @@ Map content = null; context.contentId = contentId; if (contentId) { - content = delegator.findOne("Content", [contentId : contentId], false); + content = from("Content").where("contentId", contentId).queryOne(); context.content = content; } else { content = [:]; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/EditFeatureCategoryFeatures.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/EditFeatureCategoryFeatures.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/EditFeatureCategoryFeatures.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/EditFeatureCategoryFeatures.groovy Mon Jan 5 08:50:30 2015 @@ -35,18 +35,18 @@ context.productId = productId; productFeatureCategoryId = parameters.get("productFeatureCategoryId"); context.productFeatureCategoryId = productFeatureCategoryId; -context.curProductFeatureCategory = delegator.findOne("ProductFeatureCategory", [productFeatureCategoryId : productFeatureCategoryId], false); +context.curProductFeatureCategory = from("ProductFeatureCategory").where("productFeatureCategoryId", productFeatureCategoryId).queryOne(); -context.productFeatureTypes = delegator.findList("ProductFeatureType", null, null, ['description'], null, false); +context.productFeatureTypes = from("ProductFeatureType").orderBy("description").queryList(); -context.productFeatureCategories = delegator.findList("ProductFeatureCategory", null, null, ['description'], null, false); +context.productFeatureCategories = from("ProductFeatureCategory").orderBy("description").queryList(); //we only need these if we will be showing the apply feature to category forms if (productId) { - context.productFeatureApplTypes = delegator.findList("ProductFeatureApplType", null, null, ['description'], null, false); + context.productFeatureApplTypes = from("ProductFeatureApplType").orderBy("description").queryList(); } -productFeaturesSize = delegator.findCountByCondition("ProductFeature", EntityCondition.makeCondition("productFeatureCategoryId", EntityOperator.EQUALS, productFeatureCategoryId), null, null); +productFeaturesSize = from("ProductFeature").where("productFeatureCategoryId", productFeatureCategoryId).queryCount(); highIndex = 0; lowIndex = 0; @@ -66,17 +66,17 @@ context.listSize = listSize; context.lowIndex = lowIndex; context.highIndex = highIndex; -whereCondition = EntityCondition.makeCondition([productFeatureCategoryId : productFeatureCategoryId], EntityOperator.AND); -EntityFindOptions efo = new EntityFindOptions(); -efo.setDistinct(true); -efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); -efo.setMaxRows(highIndex); - boolean beganTransaction = false; try { beganTransaction = TransactionUtil.begin(); - productFeaturesEli = delegator.find("ProductFeature", whereCondition, null, null, ['productFeatureTypeId', 'defaultSequenceNum', 'description'], efo); + productFeaturesEli = from("ProductFeature") + .where("productFeatureCategoryId", productFeatureCategoryId) + .orderBy("productFeatureTypeId", "defaultSequenceNum", "description") + .distinct() + .cursorScrollInsensitive() + .maxRows(highIndex) + .queryIterator(); productFeatures = productFeaturesEli.getPartialList(lowIndex + 1, highIndex - lowIndex); productFeaturesEli.close(); } catch (GenericEntityException e) { @@ -103,7 +103,7 @@ productFeatureIter = productFeatures.ite productFeatureApplIter = null; while (productFeatureIter) { productFeature = productFeatureIter.next(); - productFeatureAppls = delegator.findList("ProductFeatureAppl", EntityCondition.makeCondition([productId : productId, productFeatureId : productFeature.productFeatureId]), null, null, null, false); + productFeatureAppls = from("ProductFeatureAppl").where("productId", productId, "productFeatureId", productFeature.productFeatureId).queryList(); productFeatureApplIter = productFeatureAppls.iterator(); while (productFeatureApplIter) { productFeatureAppl = productFeatureApplIter.next(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/EditFeatureGroups.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/EditFeatureGroups.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/EditFeatureGroups.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/EditFeatureGroups.groovy Mon Jan 5 08:50:30 2015 @@ -19,4 +19,4 @@ context.hasPermission = security.hasEntityPermission("CATALOG", "_VIEW", session) -context.productFeatureGroups = delegator.findList("ProductFeatureGroup", null, null, null, null, false); +context.productFeatureGroups = from("ProductFeatureGroup").queryList(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/QuickAddProductFeatures.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/QuickAddProductFeatures.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/QuickAddProductFeatures.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/feature/QuickAddProductFeatures.groovy Mon Jan 5 08:50:30 2015 @@ -17,6 +17,6 @@ * under the License. */ -context.productFeatureTypes = delegator.findList("ProductFeatureType", null, null, ['description'], null, true); +context.productFeatureTypes = from("ProductFeatureType").orderBy("description").cache(true).queryList(); -context.featureCategory = delegator.findOne("ProductFeatureCategory", [productFeatureCategoryId : parameters.productFeatureCategoryId], false); +context.featureCategory = from("ProductFeatureCategory").where("productFeatureCategoryId", parameters.productFeatureCategoryId).queryOne(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.groovy Mon Jan 5 08:50:30 2015 @@ -28,7 +28,7 @@ if ((!searchCategoryId || searchCategory currentCatalogId = CatalogWorker.getCurrentCatalogId(request); searchCategoryId = CatalogWorker.getCatalogSearchCategoryId(request, currentCatalogId); } -searchCategory = delegator.findOne("ProductCategory", [productCategoryId : searchCategoryId], false); +searchCategory = from("ProductCategory").where("productCategoryId", searchCategoryId).queryOne(); if (searchCategoryId) { productFeaturesByTypeMap = ParametricSearch.makeCategoryFeatureLists(searchCategoryId, delegator, 2000); @@ -46,10 +46,10 @@ searchConstraintStrings = ProductSearchS searchSortOrderString = ProductSearchSession.searchGetSortOrderString(false, request); // get suppliers in system -supplerPartyRoleAndPartyDetails = delegator.findList("PartyRoleAndPartyDetail", EntityCondition.makeCondition([roleTypeId : 'SUPPLIER']), null, ['groupName', 'firstName'], null, false); +supplerPartyRoleAndPartyDetails = from("PartyRoleAndPartyDetail").where(roleTypeId : "SUPPLIER").orderBy("groupName", "firstName").queryList(); // get the GoodIdentification types -goodIdentificationTypes = delegator.findList("GoodIdentificationType", null, null, ['description'], null, false); +goodIdentificationTypes = from("GoodIdentificationType").orderBy("description").queryList(); context.searchCategoryId = searchCategoryId; context.searchCategory = searchCategory; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy Mon Jan 5 08:50:30 2015 @@ -28,12 +28,12 @@ ProductSearchSession.processSearchParame prodCatalogId = CatalogWorker.getCurrentCatalogId(request); result = ProductSearchSession.getProductSearchResult(request, delegator, prodCatalogId); -applicationTypes = delegator.findList("ProductFeatureApplType", null, null, ['description'], null, false); +applicationTypes = from("ProductFeatureApplType").orderBy("description").queryList(); expr = EntityCondition.makeCondition(EntityCondition.makeCondition("showInSelect", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("showInSelect", EntityOperator.NOT_EQUAL, "N")); -productCategories = delegator.findList("ProductCategory", expr, null, ['description'], null, false); +productCategories = from("ProductCategory").where(expr).orderBy("description").queryList(); context.applicationTypes = applicationTypes; context.productCategories = productCategories; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/miniproductlist.groovy Mon Jan 5 08:50:30 2015 @@ -42,7 +42,7 @@ if (isOpen) { paramInMap.checkViewAllow = false; // Returns: viewIndex, viewSize, lowIndex, highIndex, listSize, productCategory, productCategoryMembers - outMap = dispatcher.runSync("getProductCategoryAndLimitedMembers", paramInMap); + outMap = runService('getProductCategoryAndLimitedMembers', paramInMap); context.viewIndex = outMap.viewIndex; context.viewSize = outMap.viewSize; context.lowIndex = outMap.lowIndex; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/sidecatalogs.groovy Mon Jan 5 08:50:30 2015 @@ -32,7 +32,7 @@ context.isOpen = isOpen; //prodCatalogs if (isOpen) { - prodCatalogs = delegator.findList("ProdCatalog", null, null, null, null, false); + prodCatalogs = from("ProdCatalog").queryList(); context.prodCatalogs = prodCatalogs; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy Mon Jan 5 08:50:30 2015 @@ -41,7 +41,7 @@ currentTopCategoryId = CategoryWorker.ge currentTopCategory = null; if (isOpen) { CategoryWorker.getRelatedCategories(request, "topLevelList", currentTopCategoryId, false); - currentTopCategory = delegator.findOne("ProductCategory", [productCategoryId : currentTopCategoryId], true); + currentTopCategory = from("ProductCategory").where("productCategoryId", currentTopCategoryId).cache(true).queryOne(); context.topLevelList = request.getAttribute("topLevelList"); } curCategoryId = UtilFormatOut.checkNull(requestParameters.productCategoryId); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy Mon Jan 5 08:50:30 2015 @@ -28,15 +28,14 @@ import org.ofbiz.entity.condition.*; import org.ofbiz.entity.util.*; productImageList = []; -productContentAndInfoImageManamentList = delegator.findByAnd("ProductContentAndInfo", ["productId": productId, productContentTypeId : "IMAGE", "statusId" : "IM_APPROVED"], ["sequenceNum"], false); +productContentAndInfoImageManamentList = from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", "IMAGE", "statusId", "IM_APPROVED").orderBy("sequenceNum").queryList(); if(productContentAndInfoImageManamentList) { productContentAndInfoImageManamentList.each { productContentAndInfoImageManament -> - contentAssocThumbList = delegator.findByAnd("ContentAssoc", [contentId : productContentAndInfoImageManament.contentId, contentAssocTypeId : "IMAGE_THUMBNAIL"], null, false); - contentAssocThumb = EntityUtil.getFirst(contentAssocThumbList); + contentAssocThumb = from("ContentAssoc").where("contentId", productContentAndInfoImageManament.contentId, "contentAssocTypeId", "IMAGE_THUMBNAIL").queryFirst(); if(contentAssocThumb) { - imageContentThumb = delegator.findOne("Content", [contentId : contentAssocThumb.contentIdTo], false); + imageContentThumb = from("Content").where("contentId", contentAssocThumb.contentIdTo).queryOne(); if(imageContentThumb) { - productImageThumb = delegator.findOne("ContentDataResourceView", [contentId : imageContentThumb.contentId, drDataResourceId : imageContentThumb.dataResourceId], false); + productImageThumb = from("ContentDataResourceView").where("contentId", imageContentThumb.contentId, "drDataResourceId", imageContentThumb.dataResourceId).queryOne(); productImageMap = [:]; productImageMap.contentId = productContentAndInfoImageManament.contentId; productImageMap.dataResourceId = productContentAndInfoImageManament.dataResourceId; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageRecentlyApproved.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageRecentlyApproved.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageRecentlyApproved.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageRecentlyApproved.groovy Mon Jan 5 08:50:30 2015 @@ -45,15 +45,11 @@ for(i in 0..limit){ exprs.add(EntityCondition.makeCondition("statusId",EntityOperator.EQUALS, "IM_APPROVED")) exprs.add(EntityCondition.makeCondition("purchaseFromDate", EntityOperator.GREATER_THAN_EQUAL_TO, timeStampDate1)) exprs.add(EntityCondition.makeCondition("purchaseFromDate", EntityOperator.LESS_THAN, timeStampDate2)) - def fieldsToSelect = UtilMisc.toSet("productId") - def findOptions = new EntityFindOptions() - findOptions.setDistinct(true) // query result - def productContentAndInfoList = delegator.findList("ProductContentAndInfo", EntityCondition.makeCondition(exprs, EntityOperator.AND), fieldsToSelect, null, findOptions, false) + def productContentAndInfoList = select("productId").from("ProductContentAndInfo").where(exprs).distinct().queryList(); // finding time - def orderBy = UtilMisc.toList("productId") - def timeList = delegator.findList("ProductContentAndInfo", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, orderBy, null, false) + def timeList = from("ProductContentAndInfo").where(exprs).orderBy("productId").queryList(); def groupByTimeList = timeList.groupBy{it.productId} def tempTimeList = [] groupByTimeList.each() { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy Mon Jan 5 08:50:30 2015 @@ -143,4 +143,4 @@ if (fileType) { } } -context.productFeatures = delegator.findList("ProductFeature", EntityCondition.makeCondition([productFeatureTypeId : "SIZE", productFeatureCategoryId : "IMAGE"]), null, null, null, false); +context.productFeatures = from("ProductFeature").where("productFeatureTypeId", "SIZE", "productFeatureCategoryId", "IMAGE").queryList(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy Mon Jan 5 08:50:30 2015 @@ -38,7 +38,7 @@ imageManagementPath = FlexibleStringExpa String fileType = "original"; String productId = request.getParameter("productId"); -productContentList = delegator.findByAnd("ProductContentAndInfo", UtilMisc.toMap("productId", productId, "productContentTypeId", "DEFAULT_IMAGE"), null, false); +productContentList = from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", "DEFAULT_IMAGE").queryList(); if (productContentList) { dataResourceName = productContentList.get(0).drDataResourceName } @@ -60,7 +60,7 @@ context.imageNameOriginal = imageUrlPref // Start ProductContent stuff if (productId) { - product = delegator.findOne("Product",["productId" : productId], false); + product = from("Product").where("productId", productId).queryOne(); context.productId = productId; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/seoLocales.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/seoLocales.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/seoLocales.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/seoLocales.groovy Mon Jan 5 08:50:30 2015 @@ -32,7 +32,7 @@ def nameLocal; def productTextData; contentAssocs.each { contentAssoc -> -content = delegator.findOne("Content",[contentId : contentAssoc.contentIdTo], false); +content = from("Content").where("contentId", contentAssoc.contentIdTo).queryOne(); localeString = content.localeString; if (serverLocal == "au") { @@ -58,7 +58,7 @@ localeString = content.localeString; } if (localeString == nameLocal) { - electronicText = delegator.findOne("ElectronicText",[dataResourceId : content.dataResourceId], false); + electronicText = from("ElectronicText").where("dataResourceId", content.dataResourceId).queryOne(); productTextData = electronicText.textData; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/sortSequenceNum.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/sortSequenceNum.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/sortSequenceNum.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/sortSequenceNum.groovy Mon Jan 5 08:50:30 2015 @@ -20,12 +20,12 @@ import org.ofbiz.entity.* import org.ofbiz.base.util.* -allSequenceNums = delegator.findByAnd("ProductContent", ["productId":parameters.productId, "productContentTypeId":"IMAGE"], ["sequenceNum"], false) -nullSequenceNums = delegator.findByAnd("ProductContent", ["productId":parameters.productId, "productContentTypeId":"IMAGE", "sequenceNum":null], null, false) +allSequenceNums = from("ProductContent").where("productId", parameters.productId, "productContentTypeId", "IMAGE").queryList(); +nullSequenceNums = from("ProductContent").where("productId", parameters.productId, "productContentTypeId", "IMAGE", "sequenceNum", null).queryList(); productContents = allSequenceNums - nullSequenceNums def duplicate = 0 if(parameters.sequenceNum){ - findExisted = delegator.findByAnd("ProductContent", ["productId":parameters.productId, "productContentTypeId":"IMAGE", "sequenceNum":(Long)parameters.sequenceNum], null, false) + findExisted = from("ProductContent").where("productId", parameters.productId, "productContentTypeId", "IMAGE", "sequenceNum", (Long)parameters.sequenceNum).queryList(); duplicate = findExisted.size() } if(duplicate > 1){ Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/lookup/LookupVariantProduct.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/lookup/LookupVariantProduct.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/lookup/LookupVariantProduct.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/lookup/LookupVariantProduct.groovy Mon Jan 5 08:50:30 2015 @@ -22,9 +22,9 @@ import org.ofbiz.base.util.*; productId = request.getParameter("productId"); productVariantId = productId + "_"; productFeatureIds = ""; -product = delegator.findOne("Product", [productId : productId], false); +product = from("Product").where("productId", productId).queryOne(); -result = dispatcher.runSync("getProductFeaturesByType", [productId : productId, productFeatureApplTypeId : "SELECTABLE_FEATURE"]); +result = runService('getProductFeaturesByType', [productId : productId, productFeatureApplTypeId : "SELECTABLE_FEATURE"]); featureTypes = result.productFeatureTypes; featuresByTypes = result.productFeaturesByType; searchFeatures = []; @@ -39,7 +39,7 @@ if (featureTypes) { if (selectedFeatureTypeValue) { featureTypeAndValues.selectedFeatureId = selectedFeatureTypeValue; selectedFeatureTypeValues.add(selectedFeatureTypeValue); - feature = delegator.findOne("ProductFeature", [productFeatureId : selectedFeatureTypeValue], true); + feature = from("ProductFeature").where("productFeatureId", selectedFeatureTypeValue).cache(true).queryOne(); productVariantId += feature.getString("idCode") ?: ""; productFeatureIds += "|" + selectedFeatureTypeValue; } @@ -48,7 +48,7 @@ if (featureTypes) { variants = []; //if (selectedFeatureTypeValues) { - result = dispatcher.runSync("getAllExistingVariants", [productId : productId, productFeatureAppls : selectedFeatureTypeValues]); + result = runService('getAllExistingVariants', [productId : productId, productFeatureAppls : selectedFeatureTypeValues]); variants = result.variantProductIds; //} @@ -56,7 +56,7 @@ variants = []; productFeatureIdsPar = request.getParameter("productFeatureIds"); productVariantIdPar = request.getParameter("productVariantId"); if (productVariantIdPar && productFeatureIdsPar) { - result = dispatcher.runSync("quickAddVariant", [productId : productId, productFeatureIds : productFeatureIdsPar, productVariantId : productVariantIdPar]); + result = runService('quickAddVariant', [productId : productId, productFeatureIds : productFeatureIdsPar, productVariantId : productVariantIdPar]); } context.product = product; @@ -66,7 +66,7 @@ context.variants = variants; // also need the variant products themselves variantProducts = []; variants.each { variantId -> - variantProducts.add(delegator.findOne("Product", [productId : variantId], true)); + variantProducts.add(from("Product").where("productId", variantId).cache(true).queryOne()); } context.variantProducts = variantProducts; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules.groovy Mon Jan 5 08:50:30 2015 @@ -21,9 +21,9 @@ import org.ofbiz.entity.condition.* import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.base.util.UtilMisc; -context.inputParamEnums = delegator.findList("Enumeration", EntityCondition.makeCondition([enumTypeId : 'PROD_PRICE_IN_PARAM']), null, ['sequenceId'], null, true); -context.condOperEnums = delegator.findList("Enumeration", EntityCondition.makeCondition([enumTypeId : 'PROD_PRICE_COND']), null, ['sequenceId'], null, true); -context.productPriceActionTypes = delegator.findList("ProductPriceActionType", null, null, ['description'], null, true); +context.inputParamEnums = from("Enumeration").where("enumTypeId", "PROD_PRICE_IN_PARAM").orderBy("sequenceId").cache(true).queryList(); +context.condOperEnums = from("Enumeration").where("enumTypeId", "PROD_PRICE_COND").orderBy("sequenceId").cache(true).queryList(); +context.productPriceActionTypes = from("ProductPriceActionType").orderBy("description").cache(true).queryList(); String priceRuleId = request.getParameter("productPriceRuleId"); @@ -33,7 +33,7 @@ if (!priceRuleId) { if (priceRuleId) { productPriceRules = []; - productPriceRules.add(delegator.findOne("ProductPriceRule", [productPriceRuleId : priceRuleId], false)); + productPriceRules.add(from("ProductPriceRule").where("productPriceRuleId", priceRuleId).queryOne()); productPriceConds = productPriceRules[0].getRelated("ProductPriceCond", null, ["productPriceCondSeqId"], true); productPriceActions = productPriceRules[0].getRelated("ProductPriceAction", null, ["productPriceActionSeqId"], true); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules_old.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules_old.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules_old.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/price/EditProductPriceRules_old.groovy Mon Jan 5 08:50:30 2015 @@ -21,11 +21,11 @@ import org.ofbiz.entity.condition.* String priceRuleId = request.getParameter("productPriceRuleId"); if (priceRuleId) { - context.productPriceRule = delegator.findOne("ProductPriceRule", [productPriceRuleId : priceRuleId], false); + context.productPriceRule = from("ProductPriceRule").where("productPriceRuleId", priceRuleId).queryOne(); } -context.inputParamEnums = delegator.findList("Enumeration", EntityCondition.makeCondition([enumTypeId : 'PROD_PRICE_IN_PARAM']), null, ['sequenceId'], null, true); +context.inputParamEnums = from("Enumeration").where("enumTypeId", 'PROD_PRICE_IN_PARAM').orderBy("sequenceId").cache(true).queryList(); -context.condOperEnums = delegator.findList("Enumeration", EntityCondition.makeCondition([enumTypeId : 'PROD_PRICE_COND']), null, ['sequenceId'], null, true); +context.condOperEnums = from("Enumeration").where("enumTypeId", "PROD_PRICE_COND").orderBy("sequenceId").cache(true).queryList(); -context.productPriceActionTypes = delegator.findList("ProductPriceActionType", null, null, ['description'], null, true); +context.productPriceActionTypes = from("ProductPriceActionType").orderBy("description").cache(true).queryList(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromCategory.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromCategory.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromCategory.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromCategory.groovy Mon Jan 5 08:50:30 2015 @@ -32,18 +32,18 @@ context.productFeatureCategoryId = produ context.selFeatureApplTypeId = request.getParameter("productFeatureApplTypeId"); -context.curProductFeatureCategory = delegator.findOne("ProductFeatureCategory", [productFeatureCategoryId : productFeatureCategoryId], false); +context.curProductFeatureCategory = from("ProductFeatureCategory").where("productFeatureCategoryId", productFeatureCategoryId).queryOne(); -context.productFeatureTypes = delegator.findList("ProductFeatureType", null, null, ['description'], null, false); +context.productFeatureTypes = from("ProductFeatureType").orderBy("description").queryList(); -context.productFeatureCategories = delegator.findList("ProductFeatureCategory", null, null, ['description'], null, false); +context.productFeatureCategories = from("ProductFeatureCategory").orderBy("description").queryList(); //we only need these if we will be showing the apply feature to category forms if (productId) { - context.productFeatureApplTypes = delegator.findList("ProductFeatureApplType", null, null, ['description'], null, false); + context.productFeatureApplTypes = from("ProductFeatureApplType").orderBy("description").queryList(); } -productFeaturesSize = delegator.findCountByCondition("ProductFeature", EntityCondition.makeCondition("productFeatureCategoryId", EntityOperator.EQUALS, productFeatureCategoryId), null, null); +productFeaturesSize = from("ProductFeature").where("productFeatureCategoryId", productFeatureCategoryId).queryCount(); highIndex = 0; lowIndex = 0; @@ -64,17 +64,17 @@ context.listSize = listSize; context.lowIndex = lowIndex; context.highIndex = highIndex; -whereCondition = EntityCondition.makeCondition([productFeatureCategoryId : productFeatureCategoryId], EntityOperator.AND); -EntityFindOptions efo = new EntityFindOptions(); -efo.setDistinct(true); -efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); -efo.setMaxRows(highIndex); - boolean beganTransaction = false; try { beganTransaction = TransactionUtil.begin(); - productFeaturesEli = delegator.find("ProductFeature", whereCondition, null, null, ['productFeatureTypeId', 'defaultSequenceNum', 'description'], efo); + productFeaturesEli = from("ProductFeature") + .where("productFeatureCategoryId", productFeatureCategoryId) + .orderBy("productFeatureTypeId", "defaultSequenceNum", "description") + .distinct() + .cursorScrollInsensitive() + .maxRows(highIndex) + .queryIterator(); productFeatures = productFeaturesEli.getPartialList(lowIndex + 1, highIndex - lowIndex); productFeaturesEli.close(); } catch (GenericEntityException e) { @@ -101,7 +101,7 @@ productFeatureIter = productFeatures.ite productFeatureApplIter = null; while (productFeatureIter) { productFeature = productFeatureIter.next(); - productFeatureAppls = delegator.findList("ProductFeatureAppl", EntityCondition.makeCondition([productId : productId, productFeatureId : productFeature.productFeatureId]), null, null, null, false); + productFeatureAppls = from("ProductFeatureAppl").where("productId", productId, "productFeatureId", productFeature.productFeatureId).queryList(); productFeatureApplIter = productFeatureAppls.iterator(); while (productFeatureApplIter) { productFeatureAppl = productFeatureApplIter.next(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromGroup.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromGroup.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromGroup.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/ApplyFeaturesFromGroup.groovy Mon Jan 5 08:50:30 2015 @@ -26,7 +26,7 @@ import org.ofbiz.entity.* productFeatureGroupId = parameters.get("productFeatureGroupId"); if (productFeatureGroupId) { - productFeatureGroup = delegator.findOne("ProductFeatureGroup", [productFeatureGroupId : productFeatureGroupId], false); + productFeatureGroup = from("ProductFeatureGroup").where("productFeatureGroupId", productFeatureGroupId).queryOne(); productFeatures = []; productFeatureGroupAppls = productFeatureGroup.getRelated("ProductFeatureGroupAppl", null, ['sequenceNum'], false); for (pFGAi = productFeatureGroupAppls.iterator(); pFGAi;) { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy Mon Jan 5 08:50:30 2015 @@ -28,14 +28,10 @@ exprList.add(EntityCondition.makeConditi exprList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, UtilDateTime.getDayEnd(filterDate))); exprList.add(EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER")); -orderHeaderList = delegator.findList("OrderHeader", EntityCondition.makeCondition(exprList, EntityOperator.AND), null, null, null, false); +orderHeaderList = from("OrderHeader").where(exprList).queryList(); orderHeaderList.each { orderHeader -> - exprList = []; - exprList.add(EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderHeader.orderId)); - exprList.add(EntityCondition.makeCondition("orderItemTypeId", EntityOperator.EQUALS, "PRODUCT_ORDER_ITEM")); - exprList.add(EntityCondition.makeCondition("isPromo", EntityOperator.EQUALS, "N")); - orderItemList = delegator.findList("OrderItem", EntityCondition.makeCondition(exprList, EntityOperator.AND), null, null, null, false); + orderItemList = from("OrderItem").where("orderId", orderHeader.orderId, "orderItemTypeId", "PRODUCT_ORDER_ITEM", "isPromo", "N").queryList(); orderItemList.each { orderItem -> orderItemDetail = [:]; @@ -58,7 +54,7 @@ orderHeaderList.each { orderHeader -> if (inListFlag == false) { orderItemDetail.productId = orderItem.productId; - product = delegator.findOne("Product", [productId : orderItem.productId], false); + product = from("Product").where("productId", orderItem.productId).queryOne() contentWrapper = new ProductContentWrapper(product, request); orderItemDetail.productName = contentWrapper.get("PRODUCT_NAME"); orderItemDetail.amount = amount; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductAssoc.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductAssoc.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductAssoc.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductAssoc.groovy Mon Jan 5 08:50:30 2015 @@ -57,12 +57,12 @@ if (!fromDate) { context.fromDate = fromDate; } -product = delegator.findOne("Product", [productId : productId], false); +product = from("Product").where("productId", productId).queryOne(); if (product) { context.product = product; } -productAssoc = delegator.findOne("ProductAssoc", [productId : productId, productIdTo : productIdTo, productAssocTypeId : productAssocTypeId, fromDate : fromDate], false); +productAssoc = from("ProductAssoc").where("productId", productId, "productIdTo", productIdTo, "productAssocTypeId", productAssocTypeId, "fromDate", fromDate).queryOne(); if (productAssoc) { context.productAssoc = productAssoc; } @@ -78,7 +78,7 @@ if (!productAssoc) { context.useValues = useValues; context.isCreate = true; -assocTypes = delegator.findList("ProductAssocType", null, null, ['description'], null, false); +assocTypes = from("ProductAssocType").orderBy("description").queryList(); context.assocTypes = assocTypes; if (product) { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy Mon Jan 5 08:50:30 2015 @@ -43,7 +43,7 @@ if (!description) { description = null; } -productContent = delegator.findOne("ProductContent", [contentId : contentId, productId : productId, productContentTypeId : productContentTypeId, fromDate : fromDate], false); +productContent = from("ProductContent").where("contentId", contentId, "productId", productId, "productContentTypeId", productContentTypeId, "fromDate", fromDate).queryOne(); if (!productContent) { productContent = [:]; productContent.productId = productId; @@ -66,7 +66,7 @@ productContentData.putAll(productContent content = [:]; context.contentId = contentId; if (contentId) { - content = delegator.findOne("Content", [contentId : contentId], false); + content = from("Content").where("contentId", contentId).queryOne(); context.content = content; } else { if (description) { @@ -84,8 +84,7 @@ if ("FULFILLMENT_EMAIL".equals(productCo emailData.subject = subject.textData; emailData.subjectDataResourceId = subject.dataResourceId; } - serviceCtx = [userLogin : userLogin, contentId : contentId, mapKeys : ['plainBody', 'htmlBody']]; - result = dispatcher.runSync("findAssocContent", serviceCtx); + result = runService('findAssocContent', [userLogin : userLogin, contentId : contentId, mapKeys : ['plainBody', 'htmlBody']]); contentAssocs = result.get("contentAssocs"); if (contentAssocs) { contentAssocs.each { contentAssoc -> @@ -135,7 +134,7 @@ if ("FULFILLMENT_EMAIL".equals(productCo context.textData = textData; } if (productContentTypeId) { - productContentType = delegator.findOne("ProductContentType", [productContentTypeId : productContentTypeId], false); + productContentType = from("ProductContentType").where("productContentTypeId", productContentTypeId).queryOne(); if (productContentType && "DIGITAL_DOWNLOAD".equals(productContentType.parentTypeId)) { context.contentFormName = "EditProductContentDownload"; } |
Free forum by Nabble | Edit this page |