Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy Fri Dec 26 06:54:50 2014 @@ -44,26 +44,26 @@ context.showWarningForm = showWarningFor orderId = parameters.orderId; shipGroupSeqId = parameters.shipGroupSeqId; -shipment = EntityUtil.getFirst(delegator.findByAnd("Shipment", [primaryOrderId : orderId, statusId : "SHIPMENT_PICKED"], null, false)); +shipment = from("Shipment").where("primaryOrderId", orderId, "statusId", "SHIPMENT_PICKED").queryFirst(); context.shipment = shipment; if (shipment) { - invoice = EntityUtil.getFirst(delegator.findByAnd("ShipmentItemBilling", [shipmentId : shipment.shipmentId], null, false)); + invoice = from("ShipmentItemBilling").where("shipmentId", shipment.shipmentId).queryFirst(); context.invoice = invoice; } else { context.invoice = null; } actualCost = null; if (shipment) { - shipmentRouteSegment = EntityUtil.getFirst(delegator.findByAnd("ShipmentRouteSegment", [shipmentId : shipment.shipmentId], null, false)); + shipmentRouteSegment = from("ShipmentRouteSegment").where("shipmentId", shipment.shipmentId).queryFirst(); actualCost = shipmentRouteSegment.actualCost; if (actualCost) { - context.shipmentPackages = delegator.findByAnd("ShipmentPackage", [shipmentId : shipment.shipmentId], null, false); + context.shipmentPackages = from("ShipmentPackage").where("shipmentId", shipment.shipmentId).queryList(); } } facilityId = parameters.facilityId; if (facilityId) { - facility = delegator.findOne("Facility", [facilityId : facilityId], false); + facility = from("Facility").where("facilityId", facilityId).queryOne(); context.facility = facility; } @@ -77,7 +77,7 @@ if (orderId && !shipGroupSeqId && orderI picklistBinId = parameters.picklistBinId; if (picklistBinId) { - picklistBin = delegator.findOne("PicklistBin", [picklistBinId : picklistBinId], false); + picklistBin = from("PicklistBin").where("picklistBinId", picklistBinId).queryOne(); if (picklistBin) { orderId = picklistBin.primaryOrderId; shipGroupSeqId = picklistBin.primaryShipGroupSeqId; @@ -96,9 +96,9 @@ if (!shipmentId && shipment) { context.shipmentId = shipmentId; if (shipmentId) { // Get the primaryOrderId from the shipment - shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); + shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); if (shipment && shipment.primaryOrderId) { - orderItemBillingList = delegator.findList("OrderItemBilling", EntityCondition.makeCondition([orderId : shipment.primaryOrderId]), null, ['invoiceId'], null, false); + orderItemBillingList = from("OrderItemBilling").where("orderId", shipment.primaryOrderId).orderBy("invoiceId").queryList(); invoiceIds = EntityUtil.getFieldListFromEntityList(orderItemBillingList, "invoiceId", true); if (invoiceIds) { context.invoiceIds = invoiceIds; @@ -108,7 +108,7 @@ if (shipmentId) { if (shipment.statusId && "SHIPMENT_PACKED" == shipment.statusId) { orderId = null; } - shipmentPackageRouteSegs = delegator.findByAnd("ShipmentPackageRouteSeg", [shipmentId : shipmentId], null, false); + shipmentPackageRouteSegs = from("ShipmentPackageRouteSeg").where("shipmentId", shipmentId).queryList(); shipmentPackageRouteSegList = []; shipmentPackageRouteSegs.each { shipmentPackageRouteSeg -> if (shipmentPackageRouteSeg.labelImage) { @@ -127,7 +127,7 @@ context.primaryOrderId = orderId; carrierPartyId = null; if (orderId) { - orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); if (orderHeader) { OrderReadHelper orderReadHelper = new OrderReadHelper(orderHeader); GenericValue orderItemShipGroup = orderReadHelper.getOrderItemShipGroup(shipGroupSeqId); @@ -137,7 +137,7 @@ if (orderId) { if (shipment) { productStoreId = orderReadHelper.getProductStoreId(); shippableItemInfo = orderReadHelper.getOrderItemAndShipGroupAssoc(shipGroupSeqId); - shippableItems = delegator.findList("OrderItemAndShipGrpInvResAndItemSum", EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId : shipGroupSeqId]), null, null, null, false); + shippableItems = from("OrderItemAndShipGrpInvResAndItemSum").where("orderId", orderId, "shipGroupSeqId", shipGroupSeqId).queryList(); shippableTotal = orderReadHelper.getShippableTotal(shipGroupSeqId); shippableWeight = orderReadHelper.getShippableWeight(shipGroupSeqId); shippableQuantity = orderReadHelper.getShippableQuantity(shipGroupSeqId); @@ -173,10 +173,10 @@ context.shipGroupSeqId = shipGroupSeqId; context.picklistBinId = picklistBinId; if (carrierPartyId) { - carrierShipmentBoxTypes = delegator.findByAnd("CarrierShipmentBoxType", [partyId : carrierPartyId], null, false); + carrierShipmentBoxTypes = from("CarrierShipmentBoxType").where("partyId", carrierPartyId).queryList(); shipmentBoxTypes = []; carrierShipmentBoxTypes.each { carrierShipmentBoxType -> - shipmentBoxTypes.add(delegator.findOne("ShipmentBoxType", [shipmentBoxTypeId : carrierShipmentBoxType.shipmentBoxTypeId], false)); + shipmentBoxTypes.add(from("ShipmentBoxType").where("shipmentBoxTypeId", carrierShipmentBoxType.shipmentBoxTypeId).queryOne()); context.shipmentBoxTypes = shipmentBoxTypes; } }
Modified: ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/assetmaint/EditMaint.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/assetmaint/EditMaint.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/assetmaint/EditMaint.groovy (original) +++ ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/assetmaint/EditMaint.groovy Fri Dec 26 06:54:50 2014 @@ -29,7 +29,7 @@ maintHistSeqId = parameters.maintHistSeq workEffortId = parameters.workEffortId; if (!maintHistSeqId && workEffortId) { - fixedAssetMaint = EntityUtil.getFirst(delegator.findList("FixedAssetMaint", EntityCondition.makeCondition([scheduleWorkEffortId : workEffortId]), null, null, null, false)); + fixedAssetMaint = from("FixedAssetMaint").where("scheduleWorkEffortId", workEffortId).queryFirst(); if (fixedAssetMaint) { parameters.fixedAssetId = fixedAssetMaint.fixedAssetId; parameters.maintHistSeqId = fixedAssetMaint.maintHistSeqId; Modified: ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/assetmaint/PrintFixedAssetMaint.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/assetmaint/PrintFixedAssetMaint.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/assetmaint/PrintFixedAssetMaint.groovy (original) +++ ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/assetmaint/PrintFixedAssetMaint.groovy Fri Dec 26 06:54:50 2014 @@ -23,7 +23,7 @@ import org.ofbiz.entity.condition.*; facility = fixedAsset.getRelatedOne("LocatedAtFacility", false); context.locatedAtFacility = facility; -fixedAssetIdents = delegator.findList("FixedAssetIdent", EntityCondition.makeCondition([fixedAssetId : fixedAssetId]), null, null, null, false); +fixedAssetIdents = from("FixedAssetIdent").where("fixedAssetId", fixedAssetId).queryList(); fixedAssetIdentValue = ""; if (fixedAssetIdents) { fixedAssetIdents.each { ident -> @@ -46,13 +46,13 @@ if (intervalUom) { instanceOfProductId = fixedAsset.instanceOfProductId; productMaintSeqId = fixedAssetMaint.productMaintSeqId; if (productMaintSeqId) { - productMaint = delegator.findOne("ProductMaint", [productId : instanceOfProductId, productMaintSeqId : productMaintSeqId], false); + productMaint = from("ProductMaint").where("productId", instanceOfProductId, "productMaintSeqId", productMaintSeqId).queryOne(); context.productMaintName = productMaint.maintName; } productMaintTypeId = fixedAssetMaint.productMaintTypeId; if (productMaintTypeId) { - productMaintType = delegator.findOne("ProductMaintType", [productMaintTypeId : productMaintTypeId], false); + productMaintType = from("ProductMaintType").where("productMaintTypeId", productMaintTypeId).queryOne(); if (productMaintType) { productMaintTypeDesc = productMaintType.description; context.productMaintTypeDesc = productMaintTypeDesc; @@ -62,7 +62,7 @@ if (productMaintTypeId) { intervalMeterTypeId = fixedAssetMaint.intervalMeterTypeId; productMeterTypeDesc = ""; if (intervalMeterTypeId) { - productMeterType = delegator.findOne("ProductMeterType", [productMeterTypeId : intervalMeterTypeId], false); + productMeterType = from("ProductMeterType").where("productMeterTypeId", intervalMeterTypeId).queryOne(); productMeterTypeDesc = productMeterType.description; } context.productMeterTypeDesc = productMeterTypeDesc; Modified: ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.groovy (original) +++ ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.groovy Fri Dec 26 06:54:50 2014 @@ -44,16 +44,16 @@ fixedAsset = null; rootWorkEffortId = null; if (workEffortId) { - workEffort = delegator.findOne("WorkEffort", [workEffortId : workEffortId], false); + workEffort = from("WorkEffort").where("workEffortId", workEffortId).queryOne(); if (workEffort) { if (!fixedAssetId) { fixedAssetId = workEffort.fixedAssetId; } // If this is a child workeffort, locate the "root" workeffort - parentWorkEffort = EntityUtil.getFirst(delegator.findList("WorkEffortAssoc", EntityCondition.makeCondition([workEffortIdTo : workEffortId]), null, null, null, false)); + parentWorkEffort = from("WorkEffortAssoc").where("workEffortIdTo", workEffortId).queryFirst(); while (parentWorkEffort) { rootWorkEffortId = parentWorkEffort.workEffortIdFrom; - parentWorkEffort = EntityUtil.getFirst(delegator.findList("WorkEffortAssoc", EntityCondition.makeCondition([workEffortIdTo : rootWorkEffortId]), null, null, null, false)); + parentWorkEffort = from("WorkEffortAssoc").where("workEffortIdTo", rootWorkEffortId).queryFirst(); } } } @@ -63,7 +63,7 @@ if (!rootWorkEffortId) { } if (rootWorkEffortId) { - fixedAssetMaint = EntityUtil.getFirst(delegator.findList("FixedAssetMaint", EntityCondition.makeCondition([scheduleWorkEffortId : rootWorkEffortId]), null, null, null, false)); + fixedAssetMaint = from("FixedAssetMaint").where("scheduleWorkEffortId", rootWorkEffortId).queryFirst(); if (fixedAssetMaint) { maintHistSeqId = fixedAssetMaint.maintHistSeqId; if (!fixedAssetId) { @@ -73,7 +73,7 @@ if (rootWorkEffortId) { } if (fixedAssetId) { - fixedAsset = delegator.findOne("FixedAsset", [fixedAssetId : fixedAssetId], false); + fixedAsset = from("FixedAsset").where("fixedAssetId", fixedAssetId).queryOne(); } context.fixedAssetMaint = fixedAssetMaint; Modified: ofbiz/trunk/specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/RunStarSchemaQuery.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/RunStarSchemaQuery.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/RunStarSchemaQuery.groovy (original) +++ ofbiz/trunk/specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/RunStarSchemaQuery.groovy Fri Dec 26 06:54:50 2014 @@ -41,21 +41,7 @@ selectedFieldList.each { selectedField - columnNames.add(selectedField.selectedFieldName); } context.columnNames = columnNames; -List conditionList = null; -EntityConditionList condition = null; -List orderByFields = null; -EntityFindOptions findOptions = null; - List records = FastList.newInstance(); - -//conditionList.add(...); -//condition = EntityCondition.makeCondition(conditionList, EntityOperator.AND); - -orderByFields = null; - -findOptions = new EntityFindOptions(); -findOptions.setDistinct(false); - -records = delegator.findList(starSchemaName, condition, context.columnNames, orderByFields, findOptions, false); +records = select(context.columnNames).from(starSchemaName).distinct(false).queryList(); context.records = records; Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/EbayAdvancedSearch.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/EbayAdvancedSearch.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/EbayAdvancedSearch.groovy (original) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/EbayAdvancedSearch.groovy Fri Dec 26 06:54:50 2014 @@ -31,12 +31,12 @@ if (parameters.productStoreId) { } else { productStoreId = ProductStoreWorker.getProductStoreId(request); } -ebayConfigList = delegator.findList("EbayConfig", null, null, null, null, false); +ebayConfigList = from("EbayConfig").queryList(); if (productStoreId) { productStoreCatalogs = CatalogWorker.getStoreCatalogs(delegator, productStoreId); if (productStoreCatalogs) { productStoreCatalogs.each { productStoreCatalog -> - prodCatalog = delegator.findOne("ProdCatalog", [prodCatalogId : productStoreCatalog.prodCatalogId], true); + prodCatalog = from("ProdCatalog").where("prodCatalogId", productStoreCatalog.prodCatalogId).cache(true).queryOne(); prodCatalogList.add(prodCatalog); } } Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy (original) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/ProductsExportToEbay.groovy Fri Dec 26 06:54:50 2014 @@ -24,9 +24,9 @@ webSiteList = []; webSite = null; if (parameters.productStoreId) { productStoreId = parameters.productStoreId; - webSiteList = delegator.findList("WebSite", EntityCondition.makeCondition("productStoreId", EntityOperator.EQUALS, productStoreId), null, null, null, false); + webSiteList = from("WebSite").where("productStoreId", productStoreId).queryList(); if (parameters.webSiteId) { - webSite = delegator.findOne("WebSite", ["webSiteId" : parameters.webSiteId], true); + webSite = from("WebSite").where("webSiteId", parameters.webSiteId).cache(true).queryOne(); context.selectedWebSiteId = parameters.webSiteId; } else if (webSiteList) { webSite = EntityUtil.getFirst(webSiteList); @@ -42,7 +42,7 @@ if (parameters.productStoreId) { } context.countryCode = countryCode; if (webSite) { - eBayConfig = delegator.findOne("EbayConfig", [productStoreId : productStoreId], false); + eBayConfig = from("EbayConfig").where("productStoreId", productStoreId).queryOne(); context.customXml = eBayConfig.customXml; context.webSiteUrl = webSite.getString("standardContentPrefix"); Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy Fri Dec 26 06:54:50 2014 @@ -19,7 +19,7 @@ import org.ofbiz.base.util.*; -jobSandboxs = delegator.findByAnd("JobSandbox", UtilMisc.toMap("authUserLoginId", userLoginId), null, false); +jobSandboxs = from("JobSandbox").where("authUserLoginId", userLoginId).queryList(); job = null jobId = null; if(jobSandboxs) { Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/email/GetProductStoreEmailTemplate.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/email/GetProductStoreEmailTemplate.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/email/GetProductStoreEmailTemplate.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/email/GetProductStoreEmailTemplate.groovy Fri Dec 26 06:54:50 2014 @@ -20,10 +20,10 @@ import org.ofbiz.base.util.*; contentId = null; -contentRoles = delegator.findByAnd("ContentRole", UtilMisc.toMap("partyId", partyId, "roleTypeId", "OWNER"), null, false); +contentRoles = from("ContentRole").where("partyId", partyId, "roleTypeId", "OWNER").queryList(); if (contentRoles.size() != 0) { contentRoles.each { contentRole-> - contents = delegator.findByAnd("Content", UtilMisc.toMap("contentId", contentRole.getString("contentId"), "ownerContentId", emailType), null, false); + contents = from("Content").where("contentId", contentRole.getString("contentId"), "ownerContentId", emailType).queryList(); if (contents.size() != 0) { if (emailType.equals(contents.get(0).getString("ownerContentId"))) { contentId = contents.get(0).getString("contentId"); Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy Fri Dec 26 06:54:50 2014 @@ -27,7 +27,7 @@ import javolution.util.FastMap; partyId = null resultUser = runService('getEbayStoreUser', ["productStoreId": parameters.productStoreId, "userLogin": context.get("userLogin")]); ownerUser = resultUser.get("userLoginId"); -userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", ownerUser), false); +userLogin = from("UserLogin").where("userLoginId", ownerUser).queryOne(); if (userLogin) { partyId = userLogin.get("partyId"); } @@ -52,23 +52,22 @@ if (fromDate && thruDate) { } else if (!fromDate && thruDate) { expr.add(EntityCondition.makeCondition("createdDate",EntityOperator.LESS_THAN, UtilDateTime.getDayEnd(Timestamp.valueOf(thruDate + " 23:59:59.999")))); } -contentRoles = delegator.findByAnd("ContentRole", UtilMisc.toMap("roleTypeId","OWNER", "partyId", partyId), null, false); +contentRoles = from("ContentRole").where("roleTypeId","OWNER", "partyId", partyId).queryList(); contentIds = []; contentRoles.each{ content -> contentIds.add(content.getString("contentId")); } expr.add(EntityCondition.makeCondition("contentId", EntityOperator.IN, contentIds)); -cond = EntityCondition.makeCondition(expr, EntityOperator.AND); -contents = delegator.findList("Content", cond, null, null, null, false); +contents = from("Content").where(expr).queryList(); recentFeedbackList = []; ownerUser = null; commentator = null; contents.each{ content -> - commentatorContents = delegator.findByAnd("ContentRole", UtilMisc.toMap("contentId",content.contentId, "roleTypeId","COMMENTATOR"), null, false); + commentatorContents = from("ContentRole").where("contentId",content.contentId, "roleTypeId","COMMENTATOR").queryList(); if(commentatorContents){ commentatorPartyId = commentatorContents.get(0).get("partyId"); - commentatorUsers = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", commentatorPartyId), null, false); + commentatorUsers = from("UserLogin").where("partyId", commentatorPartyId).queryList(); if(commentatorUsers){ commentator = commentatorUsers.get(0).get("userLoginId"); } Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/CheckOrderStatus.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/CheckOrderStatus.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/CheckOrderStatus.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/CheckOrderStatus.groovy Fri Dec 26 06:54:50 2014 @@ -19,7 +19,7 @@ import org.ofbiz.entity.util.EntityUtil; context.importStatus = "NOT_IMPORT"; -orderHeaders = delegator.findByAnd("OrderHeader", [externalId : externalId], null, false); +orderHeaders = from("OrderHeader").where("externalId", externalId).queryList(); if (orderHeaders.size() > 0) { orderHeader = EntityUtil.getFirst(orderHeaders); context.orderId = orderHeader.get("orderId"); Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/OrderListPrepare.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/OrderListPrepare.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/OrderListPrepare.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/OrderListPrepare.groovy Fri Dec 26 06:54:50 2014 @@ -28,7 +28,7 @@ if (orderList) { for (orderCount = 0; orderCount < orderList.size(); orderCount++) { orderItem = orderList[orderCount]; orderId = null; - orderHeaders = delegator.findByAnd("OrderHeader", [externalId : orderItem.("externalId")], null, false); + orderHeaders = from("OrderHeader").where("externalId", orderItem.("externalId")).queryList(); if (orderHeaders.size() > 0) { orderHeader = EntityUtil.getFirst(orderHeaders); orderId = orderHeader.get("orderId").toString(); @@ -44,7 +44,7 @@ if (orderList) { item = items[itemCount]; title = null; if (!(item.get("title"))) { - product = delegator.findOne("Product", [productId : item.get("productId")], true); + product = from("Product").where("productId", item.get("productId")).cache(true).queryOne(); title = product.get("internalName"); } orderMap = FastMap.newInstance(); Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy Fri Dec 26 06:54:50 2014 @@ -64,7 +64,7 @@ content = [:]; item = addItem.getItem(); productId = item.getSKU(); - product = delegator.findOne("Product", [productId : productId], true); + product = from("Product").where("productId", productId).cache(true).queryOne(); contentWrapper = new ProductContentWrapper(product, request); content.productContentWrapper = contentWrapper; content.product = product; @@ -94,7 +94,7 @@ } context.isProductId = productId; // get product default price form product price - productPrices = delegator.findByAnd("ProductPrice",["productId":productId,"productPricePurposeId":"EBAY"], null, false); + productPrices = from("ProductPrice").where("productId", productId, "productPricePurposeId", "EBAY").queryList(); if (productPrices) { context.productPrices = productPrices; } Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/StoreAccount.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/StoreAccount.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/StoreAccount.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/StoreAccount.groovy Fri Dec 26 06:54:50 2014 @@ -22,8 +22,8 @@ import javolution.util.FastList; import javolution.util.FastMap; results = FastList.newInstance(); -ebayAccountList = delegator.findByAnd("PartyRoleAndPartyDetail",["roleTypeId":"EBAY_ACCOUNT"], null, false); -productStoreRoles = delegator.findByAnd("ProductStoreRole",["roleTypeId":"EBAY_ACCOUNT"], null, false); +ebayAccountList = from("PartyRoleAndPartyDetail").where("roleTypeId", "EBAY_ACCOUNT").queryList(); +productStoreRoles = from("ProductStoreRole").where("roleTypeId", "EBAY_ACCOUNT").queryList(); if (productStoreRoles != null && ebayAccountList != null) { ebayAccountList.each{ebayAccount-> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/ShowCart.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/ShowCart.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/ShowCart.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/cart/ShowCart.groovy Fri Dec 26 06:54:50 2014 @@ -34,20 +34,18 @@ context.productStore = ProductStoreWorke if (parameters.add_product_id) { // check if a parameter is passed add_product_id = parameters.add_product_id; - product = delegator.findOne("Product", [productId : add_product_id], true); + product = from("Product").where("productId", add_product_id).cache(true).queryOne(); context.product = product; } // get all the possible gift wrap options -allgiftWraps = delegator.findByAnd("ProductFeature", [productFeatureTypeId : "GIFT_WRAP"], ["defaultSequenceNum"], false); +allgiftWraps = from("ProductFeature").where("productFeatureTypeId", "GIFT_WRAP").orderBy("defaultSequenceNum").queryList(); context.allgiftWraps = allgiftWraps; // get the shopping lists for the logged in user if (userLogin) { - exprList = [EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, userLogin.partyId), - EntityCondition.makeCondition("listName", EntityOperator.NOT_EQUAL, "auto-save")]; - condition = EntityCondition.makeCondition(exprList, EntityOperator.AND); - allShoppingLists = delegator.findList("ShoppingList", condition, null, ["listName"], null, false); + allShoppingLists = from("ShoppingList").where(EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, userLogin.partyId), + EntityCondition.makeCondition("listName", EntityOperator.NOT_EQUAL, "auto-save")).orderBy("listName").queryList(); context.shoppingLists = allShoppingLists; } @@ -70,7 +68,7 @@ if(shoppingCartItems) { } context.parentProductId = parentProductId; } - productCategoryMembers = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition("productId", EntityOperator.EQUALS, parentProductId), null, null, null, false); + productCategoryMembers = from("ProductCategoryMember").where("productId", parentProductId).queryList(); if (productCategoryMembers) { productCategoryMember = EntityUtil.getFirst(productCategoryMembers); productCategory = productCategoryMember.getRelatedOne("ProductCategory", false); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/LayeredNavigation.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/LayeredNavigation.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/LayeredNavigation.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/LayeredNavigation.groovy Fri Dec 26 06:54:50 2014 @@ -30,7 +30,7 @@ if (!searchCategoryId) { searchCategoryId = context.productCategoryId; } if (searchCategoryId) { - currentSearchCategory = delegator.findOne("ProductCategory", [productCategoryId: searchCategoryId], false); + currentSearchCategory = from("ProductCategory").where("productCategoryId", searchCategoryId).queryOne(); CategoryWorker.getRelatedCategories(request, "subCategoryList", searchCategoryId, false); subCategoryList = request.getAttribute("subCategoryList"); CategoryContentWrapper categoryContentWrapper = new CategoryContentWrapper(currentSearchCategory, request); @@ -39,7 +39,7 @@ if (searchCategoryId) { } productCategoryId = context.productCategoryId; if (productCategoryId) { - context.productCategory = delegator.findOne("ProductCategory", [productCategoryId: productCategoryId], false); + context.productCategory = from("ProductCategory").where("productCategoryId", productCategoryId).queryOne(); parameters.SEARCH_CATEGORY_ID = productCategoryId; } @@ -56,8 +56,7 @@ context.index = ProductSearchSession.get searchConstraintList = ProductSearchSession.getProductSearchOptions(session).getConstraintList(); if (searchCategoryId) { - productCategoryRollups = delegator.findByAnd("ProductCategoryRollup", [productCategoryId: searchCategoryId], null, false); - productCategoryRollups = EntityUtil.filterByDate(productCategoryRollups); + productCategoryRollups = from("ProductCategoryRollup").where("productCategoryId", searchCategoryId).filterByDate().queryList(); previousCategoryId = null; if (productCategoryRollups) { for (GenericValue categoryRollup : productCategoryRollups) { @@ -91,7 +90,7 @@ if (subCategoryList) { context.showColors = true; colors = ProductSearchSession.listCountByFeatureForType("COLOR", session, delegator); -colorFeatureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId: "COLOR"], false); +colorFeatureType = from("ProductFeatureType").where("productFeatureTypeId", "COLOR").queryOne(); if (colors) { colors.each { color -> featureConstraint = new ProductSearch.FeatureConstraint(color.productFeatureId, false); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/MiniProductSummary.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/MiniProductSummary.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/MiniProductSummary.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/MiniProductSummary.groovy Fri Dec 26 06:54:50 2014 @@ -39,7 +39,7 @@ cart = ShoppingCartEvents.getCartObject( context.remove("totalPrice"); if (optProductId) { - miniProduct = delegator.findOne("Product", [productId : optProductId], false); + miniProduct = from("Product").where("productId", optProductId).queryOne(); } if (miniProduct && productStoreId && prodCatalogId ) { Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/PopularTags.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/PopularTags.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/PopularTags.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/PopularTags.groovy Fri Dec 26 06:54:50 2014 @@ -36,16 +36,16 @@ int limitTagCloud = Integer.parseInt(Ent tagCloudList = [] as LinkedList; tagList = [] as LinkedList; -keywordConditions = EntityCondition.makeCondition([keywordTypeId : "KWT_TAG", statusId : "KW_APPROVED"], EntityOperator.AND); -keywordOrder = ["keyword"]; -keywordFields = ["keyword", "keywordTypeId", "statusId"] as Set; -keywordFindOptions = new EntityFindOptions(); -keywordFindOptions.setDistinct(true); -productKeywords = delegator.findList("ProductKeyword", keywordConditions, keywordFields, keywordOrder, keywordFindOptions, false); +productKeywords = select("keyword", "keywordTypeId", "statusId") + .from("ProductKeyword") + .where(keywordTypeId : "KWT_TAG", statusId : "KW_APPROVED") + .orderBy("keyword") + .distinct(true) + .queryList(); if (UtilValidate.isNotEmpty(productKeywords)) { productKeywords.each { productKeyword -> - productTags = delegator.findByAnd("ProductKeyword", ["keyword": productKeyword.keyword, "keywordTypeId" : "KWT_TAG", "statusId" : "KW_APPROVED"], null, false); + productTags = from("ProductKeyword").where("keyword", productKeyword.keyword, "keywordTypeId", "KWT_TAG", "statusId", "KW_APPROVED").queryList(); searchResult = [:]; searchResult.tag = productKeyword.keyword; searchResult.countTag = productTags.size(); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/ProductCategories.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/ProductCategories.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/ProductCategories.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/ProductCategories.groovy Fri Dec 26 06:54:50 2014 @@ -36,7 +36,7 @@ List fillTree(rootCat ,CatLvl, parentCat rootCat.sort{ it.productCategoryId } def listTree = FastList.newInstance(); for(root in rootCat) { - preCatChilds = delegator.findByAnd("ProductCategoryRollup", ["parentProductCategoryId": root.productCategoryId], null, false); + preCatChilds = from("ProductCategoryRollup").where("parentProductCategoryId", root.productCategoryId).queryList(); catChilds = EntityUtil.getRelated("CurrentProductCategory",null,preCatChilds,false); def childList = FastList.newInstance(); @@ -51,12 +51,12 @@ List fillTree(rootCat ,CatLvl, parentCat childList = fillTree(catChilds,CatLvl+1, parentCategoryId+'/'+root.productCategoryId); } - productsInCat = delegator.findByAnd("ProductCategoryAndMember", ["productCategoryId": root.productCategoryId], null, false); + productsInCat = from("ProductCategoryAndMember").where("productCategoryId", root.productCategoryId).queryList(); // Display the category if this category containing products or contain the category that's containing products if(productsInCat || childList) { def rootMap = FastMap.newInstance(); - category = delegator.findOne("ProductCategory", ["productCategoryId": root.productCategoryId], false); + category = from("ProductCategory").where("productCategoryId", root.productCategoryId).queryOne(); categoryContentWrapper = new CategoryContentWrapper(category, request); context.title = categoryContentWrapper.CATEGORY_NAME; categoryDescription = categoryContentWrapper.DESCRIPTION; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/ajaxbreadcrumbs.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/ajaxbreadcrumbs.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/ajaxbreadcrumbs.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/catalog/ajaxbreadcrumbs.groovy Fri Dec 26 06:54:50 2014 @@ -29,7 +29,7 @@ if(!UtilValidate.isEmpty(parentCategoryS pathTemp = ''; for(path in pathList) { cateMap = FastMap.newInstance(); - category = delegator.findOne("ProductCategory", ["productCategoryId": path], false); + category = from("ProductCategory").where("productCategoryId", path).queryOne(); categoryContentWrapper = new CategoryContentWrapper(category, request); pathTemp = pathTemp + path; @@ -44,7 +44,7 @@ if(!UtilValidate.isEmpty(parentCategoryS context.productCategoryTrail = cateList; } -currentCategory = delegator.findOne("ProductCategory", ["productCategoryId": productCategoryId], false); +currentCategory = from("ProductCategory").where("productCategoryId", productCategoryId).queryOne(); currentCategoryContentWrapper = new CategoryContentWrapper(currentCategory, request); context.currentCategoryName = currentCategoryContentWrapper.CATEGORY_NAME; context.currentCategoryDescription = currentCategoryContentWrapper.DESCRIPTION; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/content/Mrv.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/content/Mrv.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/content/Mrv.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/content/Mrv.groovy Fri Dec 26 06:54:50 2014 @@ -59,7 +59,7 @@ mrvList = []; lifoSet.each { pk0 -> pk = pk0.getPrimaryKey(); - gv = delegator.findOne(pk.getEntityName(), pk, true); + gv = from(pk.getEntityName()).where(pk).cache(true).queryOne(); if (gv) { arr = [gv.contentId, gv.contentName] as String[]; mrvList.add(arr); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/content/Search.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/content/Search.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/content/Search.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/content/Search.groovy Fri Dec 26 06:54:50 2014 @@ -105,7 +105,7 @@ if (searcher) { for (int start = 0; start < collector.getTotalHits(); start++) { Document doc = searcher.doc(hits[start].doc) contentId = doc.get("contentId"); - content = delegator.findOne("Content", [contentId : contentId], true); + content = from("Content").where("contentId", contentId).cache(true).queryOne(); if (!hitSet.contains(contentId)) { contentList.add(content); hitSet.add(contentId); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ContactList.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ContactList.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ContactList.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ContactList.groovy Fri Dec 26 06:54:50 2014 @@ -39,8 +39,7 @@ exprListThruDate.add(EntityCondition.mak exprListThruDate.add(EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN_EQUAL_TO, UtilDateTime.nowTimestamp())); orCond = EntityCondition.makeCondition(exprListThruDate, EntityOperator.OR); exprList.add(orCond); -topCond = EntityCondition.makeCondition(exprList, EntityOperator.AND); -webSiteContactList = delegator.findList("WebSiteContactList", topCond, null, null, null, false); +webSiteContactList = from("WebSiteContactList").where(exprList).queryList(); publicEmailContactLists = []; webSiteContactList.each { webSiteContactList -> @@ -54,8 +53,7 @@ webSiteContactList.each { webSiteContact context.publicEmailContactLists = publicEmailContactLists; if (userLogin) { - partyAndContactMechList = delegator.findByAnd("PartyAndContactMech", [partyId : partyId, contactMechTypeId : "EMAIL_ADDRESS"], ["-fromDate"], false); - partyAndContactMechList = EntityUtil.filterByDate(partyAndContactMechList); + partyAndContactMechList = from("PartyAndContactMech").where("partyId", partyId, "contactMechTypeId", "EMAIL_ADDRESS").orderBy("-fromDate").filterByDate().queryList(); context.partyAndContactMechList = partyAndContactMechList; } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/CustomerReviews.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/CustomerReviews.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/CustomerReviews.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/CustomerReviews.groovy Fri Dec 26 06:54:50 2014 @@ -22,8 +22,7 @@ import org.ofbiz.entity.condition.Entity // get the product review(s) for the given user if (userLogin) { - condition = EntityCondition.makeCondition("userLoginId", EntityOperator.EQUALS, userLogin.userLoginId); - reviews = delegator.findList("ProductReview", condition, null, null, null, true); + reviews = from("ProductReview").where("userLoginId", userLogin.userLoginId).cache(true).queryList(); context.reviews = reviews; } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/CustomerSurvey.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/CustomerSurvey.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/CustomerSurvey.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/CustomerSurvey.groovy Fri Dec 26 06:54:50 2014 @@ -27,7 +27,7 @@ paramMap = UtilHttp.getParameterMap(requ productStoreSurveyId = parameters.productStoreSurveyId; -surveyAppl = delegator.findOne("ProductStoreSurveyAppl", [productStoreSurveyId : productStoreSurveyId], false); +surveyAppl = from("ProductStoreSurveyAppl").where("productStoreSurveyId", productStoreSurveyId).queryOne(); if (surveyAppl) { survey = surveyAppl.getRelatedOne("Survey", false); context.survey = survey; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy Fri Dec 26 06:54:50 2014 @@ -36,17 +36,17 @@ if (userLogin) { context.billToPostalCode = postalAddress.postalCode; context.billToStateProvinceGeoId = postalAddress.stateProvinceGeoId; context.billToCountryGeoId = postalAddress.countryGeoId; - billToStateProvinceGeo = delegator.findOne("Geo", [geoId : postalAddress.stateProvinceGeoId], false); + billToStateProvinceGeo = from("Geo").where("geoId", postalAddress.stateProvinceGeoId).queryOne(); if (billToStateProvinceGeo) { context.billToStateProvinceGeo = billToStateProvinceGeo.geoName; } - billToCountryProvinceGeo = delegator.findOne("Geo", [geoId : postalAddress.countryGeoId], false); + billToCountryProvinceGeo = from("Geo").where("geoId", postalAddress.countryGeoId).queryOne(); if (billToCountryProvinceGeo) { context.billToCountryProvinceGeo = billToCountryProvinceGeo.geoName; } creditCards = []; - paymentMethod = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findList("PaymentMethod", EntityCondition.makeCondition([partyId : party.partyId, paymentMethodTypeId : "CREDIT_CARD"]), null, ["fromDate"], null, false))); + paymentMethod = from("PaymentMethod").where("partyId", party.partyId, "paymentMethodTypeId", "CREDIT_CARD").orderBy("fromDate").filterByDate().queryFirst(); if (paymentMethod) { creditCard = paymentMethod.getRelatedOne("CreditCard", false); context.paymentMethodTypeId = "CREDIT_CARD"; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditContactMech.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditContactMech.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditContactMech.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditContactMech.groovy Fri Dec 26 06:54:50 2014 @@ -46,7 +46,7 @@ if (paymentMethodId) context.paymentMeth cmNewPurposeTypeId = parameters.contactMechPurposeTypeId; if (cmNewPurposeTypeId) { - contactMechPurposeType = delegator.findOne("ContactMechPurposeType", [contactMechPurposeTypeId : cmNewPurposeTypeId], false); + contactMechPurposeType = from("ContactMechPurposeType").where("contactMechPurposeTypeId", cmNewPurposeTypeId).queryOne(); if (contactMechPurposeType) { context.contactMechPurposeType = contactMechPurposeType; } else { @@ -79,24 +79,24 @@ if (telecomNumberData) context.telecomNu // load the geo names for selected countries and states/regions if (parameters.countryGeoId) { - geoValue = delegator.findOne("Geo", [geoId : parameters.countryGeoId], true); + geoValue = from("Geo").where("geoId", parameters.countryGeoId).cache(true).queryOne(); if (geoValue) { context.selectedCountryName = geoValue.geoName; } } else if (postalAddressData?.countryGeoId) { - geoValue = delegator.findOne("Geo", [geoId : postalAddressData.countryGeoId], true); + geoValue = from("Geo").where("geoId", postalAddressData.countryGeoId).cache(true).queryOne(); if (geoValue) { context.selectedCountryName = geoValue.geoName; } } if (parameters.stateProvinceGeoId) { - geoValue = delegator.findOne("Geo", [geoId : parameters.stateProvinceGeoId], true); + geoValue = from("Geo").where("geoId", parameters.stateProvinceGeoId).cache(true).queryOne(); if (geoValue) { context.selectedStateName = geoValue.geoId; } } else if (postalAddressData?.stateProvinceGeoId) { - geoValue = delegator.findOne("Geo", [geoId : postalAddressData.stateProvinceGeoId], true); + geoValue = from("Geo").where("geoId", postalAddressData.stateProvinceGeoId).cache(true).queryOne(); if (geoValue) { context.selectedStateName = geoValue.geoId; } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditEmailAndTelecomNumber.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditEmailAndTelecomNumber.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditEmailAndTelecomNumber.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditEmailAndTelecomNumber.groovy Fri Dec 26 06:54:50 2014 @@ -31,7 +31,7 @@ if (userLogin) { contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_PHONE", "TELECOM_NUMBER", false)); if (contactMech) { - partyContactMech = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", [partyId : party.partyId, contactMechId : contactMech.contactMechId], null, false))); + partyContactMech = from("PartyContactMech").where("partyId", party.partyId, "contactMechId", contactMech.contactMechId).filterByDate().queryFirst(); if (partyContactMech) { telecomNumber = partyContactMech.getRelatedOne("TelecomNumber", false); context.phoneContactMechId = telecomNumber.contactMechId; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy Fri Dec 26 06:54:50 2014 @@ -24,11 +24,11 @@ if (userLogin) { party = userLogin.getRelatedOne("Party", false); context.partyId = party.partyId if ("PERSON".equals(party.partyTypeId)) { - person = delegator.findOne("Person", [partyId : party.partyId], false); + person = from("Person").where("partyId", party.partyId).queryOne(); context.firstName = person.firstName; context.lastName = person.lastName; } else { - group = delegator.findOne("PartyGroup", [partyId : party.partyId], false); + group = from("PartyGroup").where("partyId", party.partyId).queryOne(); context.firstName = group.groupName; context.lastName = ""; } @@ -46,11 +46,11 @@ if (userLogin) { context.shipToPostalCode = postalAddress.postalCode; context.shipToStateProvinceGeoId = postalAddress.stateProvinceGeoId; context.shipToCountryGeoId = postalAddress.countryGeoId; - shipToStateProvinceGeo = delegator.findOne("Geo", [geoId : postalAddress.stateProvinceGeoId], false); + shipToStateProvinceGeo = from("Geo").where("geoId", postalAddress.stateProvinceGeoId).queryOne(); if (shipToStateProvinceGeo) { context.shipToStateProvinceGeo = shipToStateProvinceGeo.geoName; } - shipToCountryProvinceGeo = delegator.findOne("Geo", [geoId : postalAddress.countryGeoId], false); + shipToCountryProvinceGeo = from("Geo").where("geoId", postalAddress.countryGeoId).queryOne(); if (shipToCountryProvinceGeo) { context.shipToCountryProvinceGeo = shipToCountryProvinceGeo.geoName; } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ViewProfile.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ViewProfile.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ViewProfile.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ViewProfile.groovy Fri Dec 26 06:54:50 2014 @@ -31,7 +31,7 @@ productStoreId = ProductStoreWorker.getP context.productStoreId = productStoreId; if (userLogin) { - profiledefs = delegator.findOne("PartyProfileDefault", [partyId : partyId, productStoreId : productStoreId], false); + profiledefs = from("PartyProfileDefault").where("partyId", partyId, "productStoreId", productStoreId).queryOne(); showOld = "true".equals(parameters.SHOW_OLD); @@ -45,7 +45,7 @@ if (userLogin) { // shipping methods - for default selection if (profiledefs?.defaultShipAddr) { - shipAddress = delegator.findOne("PostalAddress", [contactMechId : profiledefs.defaultShipAddr], false); + shipAddress = from("PostalAddress").where("contactMechId", profiledefs.defaultShipAddr).queryOne(); if (shipAddress) { carrierShipMeths = ProductStoreWorker.getAvailableStoreShippingMethods(delegator, productStoreId, shipAddress, [1], null, 0, 1); context.carrierShipMethods = carrierShipMeths; @@ -55,24 +55,19 @@ if (userLogin) { profileSurveys = ProductStoreWorker.getProductSurveys(delegator, productStoreId, null, "CUSTOMER_PROFILE"); context.surveys = profileSurveys; - orderBy = ["-entryDate"]; - findOpts = new EntityFindOptions(); - findOpts.setMaxRows(5); exprs = [EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)]; exprs.add(EntityCondition.makeCondition("roleStatusId", EntityOperator.NOT_EQUAL, "COM_ROLE_READ")); - condition = EntityCondition.makeCondition(exprs, EntityOperator.AND); - messages = delegator.findList("CommunicationEventAndRole", condition, null, orderBy, findOpts, false); + messages = from("CommunicationEventAndRole").where(exprs).orderBy("-entryDate").maxRows(5).queryList(); context.messages = messages; context.profileMessages = true; - partyContent = delegator.findByAnd("ContentRole", [partyId : partyId, roleTypeId : "OWNER"], null, false); - partyContent = EntityUtil.filterByDate(partyContent); + partyContent = from("ContentRole").where("partyId", partyId, "roleTypeId", "OWNER").filterByDate().queryList(); context.partyContent = partyContent; - mimeTypes = delegator.findList("MimeType", null, null, ["description", "mimeTypeId"], null, false); + mimeTypes = from("MimeType").orderBy("description", "mimeTypeId").queryList(); context.mimeTypes = mimeTypes; - partyContentTypes = delegator.findList("PartyContentType", null, null, ["description"], null, false); + partyContentTypes = from("PartyContentType").orderBy("description").queryList(); context.partyContentTypes = partyContentTypes; // call the getOrderedSummaryInformation service to get the sub-total of valid orders in last X months @@ -82,14 +77,13 @@ if (userLogin) { context.totalSubRemainingAmount = result.totalSubRemainingAmount; context.totalOrders = result.totalOrders; - contactListPartyList = delegator.findByAnd("ContactListParty", [partyId : partyId], ["-fromDate"], false); + contactListPartyList = from("ContactListParty").where("partyId", partyId).orderBy("-fromDate").queryList(); // show all, including history, ie don't filter: contactListPartyList = EntityUtil.filterByDate(contactListPartyList, true); context.contactListPartyList = contactListPartyList; - publicContactLists = delegator.findByAnd("ContactList", [isPublic : "Y"], ["contactListName"], false); + publicContactLists = from("ContactList").where("isPublic", "Y").orderBy("contactListName").queryList(); context.publicContactLists = publicContactLists; - partyAndContactMechList = delegator.findByAnd("PartyAndContactMech", [partyId : partyId], ["-fromDate"], false); - partyAndContactMechList = EntityUtil.filterByDate(partyAndContactMechList); + partyAndContactMechList = from("PartyAndContactMech").where("partyId", partyId).orderBy("-fromDate").filterByDate().queryList(); context.partyAndContactMechList = partyAndContactMechList; } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ContentAddPrep.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ContentAddPrep.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ContentAddPrep.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ContentAddPrep.groovy Fri Dec 26 06:54:50 2014 @@ -54,7 +54,7 @@ contentIdTo = ContentManagementWorker.ge context.contentIdTo = contentIdTo; //Debug.logInfo("in contentaddprep, contentIdTo:" + contentIdTo,""); //Debug.logInfo("in contentaddprep, paramMap:" + paramMap,""); -attrList = delegator.findByAnd("ContentAttribute", [contentId : contentIdTo, attrName : "publishOperation"], null, true); +attrList = from("ContentAttribute").where("contentId", contentIdTo, "attrName", "publishOperation").cache(true).queryList(); publishOperation = null; if (attrList) { contentAttribute = attrList.get(0); @@ -76,7 +76,7 @@ contentPurpose = page.contentPurpose ?: singleWrapper.putInContext("contentPurpose", contentPurpose); singleWrapper.putInContext("forumId", contentIdTo); -forumContent = delegator.findOne("Content", [contentId : contentIdTo], true); +forumContent = from("Content").where("contentId", contentIdTo).cache(true).queryOne(); statusId = "CTNT_PUBLISHED"; if (forumContent) { statusId = forumContent.statusId; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ContentPrep.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ContentPrep.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ContentPrep.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ContentPrep.groovy Fri Dec 26 06:54:50 2014 @@ -61,7 +61,7 @@ if (!contentId && currentValue) { contentId = currentValue.contentId; } if (contentId && !currentValue) { - currentValue = delegator.findOne("Content", [contentId : contentId], true); + currentValue = from("Content").where("contentId", contentId).cache(true).queryOne(); } //Debug.logInfo("in contentprep, currentValue(1):" + currentValue, ""); //Debug.logInfo("in contentprep, contentId(4):" + contentId, ""); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/CurrentValPrep.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/CurrentValPrep.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/CurrentValPrep.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/CurrentValPrep.groovy Fri Dec 26 06:54:50 2014 @@ -120,7 +120,7 @@ if (!pksEqual) { currentEntityMap[currentEntityName] = currentPK; request.setAttribute("currentPK", currentPK); context.currentPK = currentPK; -currentValue = delegator.findOne(currentPK.getPrimaryKey().getEntityName(), currentPK.getPrimaryKey(), false); +currentValue = from(currentPK.getPrimaryKey().getEntityName()).where(currentPK.getPrimaryKey()).queryOne(); context.currentValue = currentValue; request.setAttribute("currentValue", currentValue); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/EditAddPrep.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/EditAddPrep.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/EditAddPrep.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/EditAddPrep.groovy Fri Dec 26 06:54:50 2014 @@ -68,7 +68,7 @@ currentValue = ContentWorker.getSubConte //Debug.logInfo("in editaddprep, currentValue:" + currentValue,""); if (!currentValue) { - parentValue = delegator.findOne("Content", [contentId : contentIdTo], true); + parentValue = from("Content").where("contentId", contentIdTo).cache(true).queryOne(); currentValue = delegator.makeValue("Content"); subject = parentValue.contentName; if ("SUMMARY".equals(mapKey)) { Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/PermPrep.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/PermPrep.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/PermPrep.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/PermPrep.groovy Fri Dec 26 06:54:50 2014 @@ -102,7 +102,7 @@ if (permissionType.equals("complex")) { if (!currentValue || !"Content".equals(entityName)) { if (thisContentId) { - currentValue = delegator.findOne("Content", [contentId : thisContentId], false); + currentValue = from("Content").where("contentId", thisContentId).queryOne(); } } if ("add".equals(mode)) { Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/RespondPermAndPrep.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/RespondPermAndPrep.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/RespondPermAndPrep.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/RespondPermAndPrep.groovy Fri Dec 26 06:54:50 2014 @@ -55,7 +55,7 @@ if (!pubPt) { } */ -contentToValue = delegator.findOne("Content", [contentId : contentIdTo], false); +contentToValue = from("Content").where("contentId", contentIdTo).queryOne(); contentToPurposeList = contentToValue.getRelated("ContentPurpose", null, null, true); currentValue = delegator.makeValue("Content", [contentTypeId : "DOCUMENT", statusId : "CTNT_PUBLISHED", privilegeEnumId : "_00_"]); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ResponsePrep.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ResponsePrep.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ResponsePrep.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/forum/ResponsePrep.groovy Fri Dec 26 06:54:50 2014 @@ -63,7 +63,7 @@ if (trail) { // start at 1 to skip webSiteId idList.each { id -> - webSitePublishPoint = delegator.findOne("WebSitePublishPoint", [contentId : id], true); + webSitePublishPoint = from("WebSitePublishPoint").where("contentId", id).cache(true).queryOne(); siteAncestorList.add(webSitePublishPoint); } context.siteAncestorList = siteAncestorList; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/BillSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/BillSettings.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/BillSettings.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/BillSettings.groovy Fri Dec 26 06:54:50 2014 @@ -40,7 +40,7 @@ context.partyId = partyId; request.removeAttribute("_EVENT_MESSAGE_"); if (partyId && !partyId.equals("_NA_")) { - party = delegator.findOne("Party", [partyId : partyId], false); + party = from("Party").where("partyId", partyId).queryOne(); person = party.getRelatedOne("Person", false); context.party = party; context.person = person; @@ -57,14 +57,12 @@ if (partyId && !partyId.equals("_NA_")) if (parameters.useShipAddr && cart.getShippingContactMechId()) { shippingContactMech = cart.getShippingContactMechId(); - postalAddress = delegator.findOne("PostalAddress", [contactMechId : shippingContactMech], false); + postalAddress = from("PostalAddress").where("contactMechId", shippingContactMech).queryOne(); context.useEntityFields = "Y"; context.postalFields = postalAddress; if (postalAddress && partyId) { - partyContactMechs = delegator.findByAnd("PartyContactMech", [partyId : partyId, contactMechId : postalAddress.contactMechId], ["-fromDate"], false); - partyContactMechs = EntityUtil.filterByDate(partyContactMechs); - partyContactMech = EntityUtil.getFirst(partyContactMechs); + partyContactMech = from("PartyContactMech").where("partyId", partyId, "contactMechId", postalAddress.contactMechId).orderBy("-fromDate").filterByDate().queryFirst(); context.partyContactMech = partyContactMech; } } else { @@ -75,7 +73,7 @@ if (cart && !parameters.singleUsePayment if (cart.getPaymentMethodIds() ) { checkOutPaymentId = cart.getPaymentMethodIds()[0]; context.checkOutPaymentId = checkOutPaymentId; - paymentMethod = delegator.findOne("PaymentMethod", [paymentMethodId : checkOutPaymentId], false); + paymentMethod = from("PaymentMethod").where("paymentMethodId", checkOutPaymentId).queryOne(); account = null; if ("CREDIT_CARD".equals(paymentMethod.paymentMethodTypeId)) { Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/CheckoutReview.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/CheckoutReview.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/CheckoutReview.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/CheckoutReview.groovy Fri Dec 26 06:54:50 2014 @@ -64,7 +64,7 @@ paymentMethodType = null; paymentMethodTypeId = null; if (paymentMethodTypeIds) { paymentMethodTypeId = paymentMethodTypeIds[0]; - paymentMethodType = delegator.findOne("PaymentMethodType", [paymentMethodTypeId : paymentMethodTypeId], false); + paymentMethodType = from("PaymentMethodType").where("paymentMethodTypeId", paymentMethodTypeId).queryOne(); context.paymentMethodType = paymentMethodType; } @@ -97,7 +97,7 @@ context.giftMessage = cart.getGiftMessag context.isGift = cart.getIsGift(); context.currencyUomId = cart.getCurrency(); -shipmentMethodType = delegator.findOne("ShipmentMethodType", [shipmentMethodTypeId : cart.getShipmentMethodTypeId()], false); +shipmentMethodType = from("ShipmentMethodType").where("shipmentMethodTypeId", cart.getShipmentMethodTypeId()).queryOne(); if (shipmentMethodType) context.shipMethDescription = shipmentMethodType.description; orh = new OrderReadHelper(orderAdjustments, orderItems); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/CustSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/CustSettings.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/CustSettings.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/CustSettings.groovy Fri Dec 26 06:54:50 2014 @@ -35,7 +35,7 @@ if (partyId) { // NOTE: if there was an error, then don't look up and fill in all of this data, just use the values from the previous request (which will be in the parameters Map automagically) if (!request.getAttribute("_ERROR_MESSAGE_") && !request.getAttribute("_ERROR_MESSAGE_LIST_")) { - person = delegator.findOne("Person", [partyId : partyId], false); + person = from("Person").where("partyId", partyId).queryOne(); if (person) { context.callSubmitForm = true; // should never be null for the anonymous checkout, but just in case @@ -68,8 +68,7 @@ if (partyId) { } // get the Email Address - emailPartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - [partyId : partyId, contactMechPurposeTypeId : "PRIMARY_EMAIL"], null, false))); + emailPartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechPurposeTypeId", "PRIMARY_EMAIL").filterByDate().queryFirst(); if (emailPartyContactDetail) { parameters.emailContactMechId = emailPartyContactDetail.contactMechId; parameters.emailAddress = emailPartyContactDetail.infoString; @@ -77,8 +76,7 @@ if (partyId) { } // get the Phone Numbers - homePhonePartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - [partyId : partyId, contactMechPurposeTypeId : "PHONE_HOME"], null, false))); + homePhonePartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechPurposeTypeId", "PHONE_HOME").filterByDate().queryFirst(); if (homePhonePartyContactDetail) { parameters.homePhoneContactMechId = homePhonePartyContactDetail.contactMechId; parameters.homeCountryCode = homePhonePartyContactDetail.countryCode; @@ -88,8 +86,7 @@ if (partyId) { parameters.homeSol = homePhonePartyContactDetail.allowSolicitation; } - workPhonePartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - [partyId : partyId, contactMechPurposeTypeId : "PHONE_WORK"], null, false))); + workPhonePartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechPurposeTypeId", "PHONE_WORK").filterByDate().queryFirst(); if (workPhonePartyContactDetail) { parameters.workPhoneContactMechId = workPhonePartyContactDetail.contactMechId; parameters.workCountryCode = workPhonePartyContactDetail.countryCode; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OptionSettings.groovy Fri Dec 26 06:54:50 2014 @@ -40,7 +40,7 @@ request.removeAttribute("_EVENT_MESSAGE_ party = null; partyId = session.getAttribute("orderPartyId"); if (partyId) { - party = delegator.findOne("Party", [partyId : partyId], false); + party = from("Party").where("partyId", partyId).queryOne(); context.party = party; } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderHistory.groovy Fri Dec 26 06:54:50 2014 @@ -22,11 +22,11 @@ import org.ofbiz.entity.*; import org.ofbiz.entity.util.*; import org.ofbiz.entity.condition.*; -partyRole = delegator.findOne("PartyRole", [partyId : userLogin.partyId, roleTypeId : "SUPPLIER"], false); +partyRole = from("PartyRole").where("partyId", userLogin.partyId, "roleTypeId", "SUPPLIER").queryOne(); if (partyRole) { if ("SUPPLIER".equals(partyRole.roleTypeId)) { /** drop shipper or supplier **/ - porderRoleCollection = delegator.findByAnd("OrderRole", [partyId : userLogin.partyId, roleTypeId : "SUPPLIER_AGENT"], null, false); + porderRoleCollection = from("OrderRole").where("partyId", userLogin.partyId, "roleTypeId", "SUPPLIER_AGENT").queryList(); porderHeaderList = EntityUtil.orderBy(EntityUtil.filterByAnd(EntityUtil.getRelated("OrderHeader", null, porderRoleCollection, false), [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "PURCHASE_ORDER")]), @@ -34,11 +34,10 @@ if (partyRole) { context.porderHeaderList = porderHeaderList; } } -orderRoleCollection = delegator.findByAnd("OrderRole", [partyId : userLogin.partyId, roleTypeId : "PLACING_CUSTOMER"], null, false); +orderRoleCollection = from("OrderRole").where("partyId", userLogin.partyId, "roleTypeId", "PLACING_CUSTOMER").queryList(); orderHeaderList = EntityUtil.orderBy(EntityUtil.filterByAnd(EntityUtil.getRelated("OrderHeader", null, orderRoleCollection, false), [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED")]), ["orderDate DESC"]); context.orderHeaderList = orderHeaderList; -downloadOrderRoleAndProductContentInfoList = delegator.findByAnd("OrderRoleAndProductContentInfo", - [partyId : userLogin.partyId, roleTypeId : "PLACING_CUSTOMER", productContentTypeId : "DIGITAL_DOWNLOAD", statusId : "ITEM_COMPLETED"], null, false); +downloadOrderRoleAndProductContentInfoList = from("OrderRoleAndProductContentInfo").where("partyId", userLogin.partyId, "roleTypeId", "PLACING_CUSTOMER", "productContentTypeId", "DIGITAL_DOWNLOAD", "statusId", "ITEM_COMPLETED").queryList(); context.downloadOrderRoleAndProductContentInfoList = downloadOrderRoleAndProductContentInfoList; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy Fri Dec 26 06:54:50 2014 @@ -38,7 +38,7 @@ if (!userLogin) { // then userLogin is not found when Order Complete Mail is send to user. if (!userLogin) { if (orderId) { - orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); orderStatuses = orderHeader.getRelated("OrderStatus", null, null, false); filteredOrderStatusList = []; extOfflineModeExists = false; @@ -57,12 +57,12 @@ if (!userLogin) { if (UtilValidate.isNotEmpty(filteredOrderStatusList)) { if (filteredOrderStatusList.size() < 2) { statusUserLogin = EntityUtil.getFirst(filteredOrderStatusList).statusUserLogin; - userLogin = delegator.findOne("UserLogin", [userLoginId : statusUserLogin], false); + userLogin = from("UserLogin").where("userLoginId", statusUserLogin).queryOne(); } else { filteredOrderStatusList.each { orderStatus -> if ("ORDER_COMPLETED".equals(orderStatus.statusId)) { statusUserLogin = orderStatus.statusUserLogin; - userLogin = delegator.findOne("UserLogin", [userLoginId :statusUserLogin], false); + userLogin = from("UserLogin").where("userLoginId", statusUserLogin).queryOne(); } } } @@ -88,7 +88,7 @@ allowAnonymousView = context.allowAnonym isDemoStore = true; if (orderId) { - orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); if ("PURCHASE_ORDER".equals(orderHeader?.orderTypeId)) { //drop shipper or supplier roleTypeId = "SUPPLIER_AGENT"; @@ -100,7 +100,7 @@ if (orderId) { // check OrderRole to make sure the user can view this order. This check must be done for any order which is not anonymously placed and // any anonymous order when the allowAnonymousView security flag (see above) is not set to Y, to prevent peeking if (orderHeader && (!"anonymous".equals(orderHeader.createdBy) || ("anonymous".equals(orderHeader.createdBy) && !"Y".equals(allowAnonymousView)))) { - orderRole = EntityUtil.getFirst(delegator.findByAnd("OrderRole", [orderId : orderId, partyId : partyId, roleTypeId : roleTypeId], null, false)); + orderRole = from("OrderRole").where("orderId", orderId, "partyId", partyId, "roleTypeId", roleTypeId).queryFirst(); if (!userLogin || !orderRole) { context.remove("orderHeader"); @@ -128,9 +128,8 @@ if (orderHeader) { orderTaxTotal = OrderReadHelper.getAllOrderItemsAdjustmentsTotal(orderItems, orderAdjustments, false, true, false); orderTaxTotal = orderTaxTotal.add(OrderReadHelper.calcOrderAdjustments(orderHeaderAdjustments, orderSubTotal, false, true, false)); - placingCustomerOrderRoles = delegator.findByAnd("OrderRole", [orderId : orderId, roleTypeId : roleTypeId], null, false); - placingCustomerOrderRole = EntityUtil.getFirst(placingCustomerOrderRoles); - placingCustomerPerson = placingCustomerOrderRole == null ? null : delegator.findOne("Person", [partyId : placingCustomerOrderRole.partyId], false); + placingCustomerOrderRole = from("OrderRole").where("orderId", orderId, "roleTypeId", roleTypeId).queryFirst(); + placingCustomerPerson = placingCustomerOrderRole == null ? null : from("Person").where("partyId", placingCustomerOrderRole.partyId).queryOne(); billingAccount = orderHeader.getRelatedOne("BillingAccount", false); @@ -154,15 +153,12 @@ if (orderHeader) { if (paymentAddress) context.paymentAddress = paymentAddress; // get Shipment tracking info - osisCond = EntityCondition.makeCondition([orderId : orderId], EntityOperator.AND); - osisOrder = ["shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId"]; - osisFields = ["shipmentId", "shipmentRouteSegmentId", "carrierPartyId", "shipmentMethodTypeId"] as Set; - osisFields.add("shipmentPackageSeqId"); - osisFields.add("trackingCode"); - osisFields.add("boxNumber"); - osisFindOptions = new EntityFindOptions(); - osisFindOptions.setDistinct(true); - orderShipmentInfoSummaryList = delegator.findList("OrderShipmentInfoSummary", osisCond, osisFields, osisOrder, osisFindOptions, false); + orderShipmentInfoSummaryList = select("shipmentId", "shipmentRouteSegmentId", "carrierPartyId", "shipmentMethodTypeId","shipmentPackageSeqId","trackingCode","boxNumber") + .from("OrderShipmentInfoSummary") + .where("orderId", orderId) + .orderBy("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId") + .distinct(true) + .queryList(); customerPoNumberSet = new TreeSet(); orderItems.each { orderItemPo -> @@ -215,6 +211,6 @@ if (orderHeader) { context.orderShipmentInfoSummaryList = orderShipmentInfoSummaryList; context.customerPoNumberSet = customerPoNumberSet; - orderItemChangeReasons = delegator.findByAnd("Enumeration", [enumTypeId : "ODR_ITM_CH_REASON"], ["sequenceId"], false); + orderItemChangeReasons = from("Enumeration").where("enumTypeId", "ODR_ITM_CH_REASON").queryList(); context.orderItemChangeReasons = orderItemChangeReasons; } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/PaymentInformation.groovy Fri Dec 26 06:54:50 2014 @@ -36,7 +36,7 @@ if (!partyId) { context.partyId = partyId; if (partyId && !partyId.equals("_NA_")) { - party = delegator.findOne("Party", [partyId : partyId], false); + party = from("Party").where("partyId", partyId).queryOne(); person = party.getRelatedOne("Person", false); context.party = party; context.person = person; @@ -47,14 +47,12 @@ request.removeAttribute("_EVENT_MESSAGE_ if (parameters.useShipAddr && cart.getShippingContactMechId()) { shippingContactMech = cart.getShippingContactMechId(); - postalAddress = delegator.findOne("PostalAddress", [contactMechId : shippingContactMech], false); + postalAddress = from("PostalAddress").where("contactMechId", shippingContactMech).queryOne(); context.useEntityFields = "Y"; context.postalAddress = postalAddress; if (postalAddress && partyId) { - partyContactMechs = delegator.findByAnd("PartyContactMech", [partyId : partyId, contactMechId : postalAddress.contactMechId], ["-fromDate"], false); - partyContactMechs = EntityUtil.filterByDate(partyContactMechs); - partyContactMech = EntityUtil.getFirst(partyContactMechs); + partyContactMech = from("PartyContactMech").where("partyId", partyId, "contactMechId", postalAddress.contactMechId).orderBy("-fromDate").filterByDate().queryFirst(); context.partyContactMech = partyContactMech; } } else {