Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonCustSettings.groovy Fri Dec 26 06:54:50 2014 @@ -42,7 +42,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 @@ -52,8 +52,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; @@ -61,8 +60,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; @@ -72,8 +70,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; @@ -93,7 +90,7 @@ context.cart = cart; request.removeAttribute("_EVENT_MESSAGE_"); if (cartPartyId && !cartPartyId.equals("_NA_")) { - cartParty = delegator.findOne("Party", [partyId : cartPartyId], false); + cartParty = from("Party").where("partyId", cartPartyId).queryOne(); if (cartParty) { cartPerson = cartParty.getRelatedOne("Person", false); context.party = cartParty; @@ -103,8 +100,7 @@ if (cartPartyId && !cartPartyId.equals(" if (cart && cart.getShippingContactMechId()) { shippingContactMechId = cart.getShippingContactMechId(); - shippingPartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - [partyId : cartPartyId, contactMechId : shippingContactMechId], null, false))); + shippingPartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", cartPartyId, "contactMechId", shippingContactMechId).filterByDate().queryFirst(); parameters.shippingContactMechId = shippingPartyContactDetail.contactMechId; context.callSubmitForm = true; parameters.shipToName = shippingPartyContactDetail.toName; @@ -121,7 +117,7 @@ if (cart && cart.getShippingContactMechI billingContactMechId = session.getAttribute("billingContactMechId"); if (billingContactMechId) { - billPostalAddress = delegator.findOne("PostalAddress", [contactMechId : billingContactMechId], false); + billPostalAddress = from("PostalAddress").where("contactMechId", billingContactMechId).queryOne(); parameters.billingContactMechId = billPostalAddress.contactMechId; parameters.billToName = billPostalAddress.toName; parameters.billToAttnName = billPostalAddress.attnName;
Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/QuickAnonOptionSettings.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/RequestReturn.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/RequestReturn.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/RequestReturn.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/RequestReturn.groovy Fri Dec 26 06:54:50 2014 @@ -27,27 +27,27 @@ context.orderId = orderId; party = userLogin.getRelatedOne("Party", false); context.party = party; -returnTypes = delegator.findList("ReturnType", null, null, ["sequenceId"], null, false); +returnTypes = from("ReturnType").orderBy("sequenceId").queryList(); context.returnTypes = returnTypes; -returnReasons = delegator.findList("ReturnReason", null, null, ["sequenceId"], null, false); +returnReasons = from("ReturnReason").orderBy("sequenceId").queryList(); context.returnReasons = returnReasons; if (orderId) { returnRes = runService('getReturnableItems', [orderId : orderId]); context.returnableItems = returnRes.returnableItems; - orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); context.orderHeader = orderHeader; } -returnItemTypeMap = delegator.findByAnd("ReturnItemTypeMap", [returnHeaderTypeId : "CUSTOMER_RETURN"], null, false); +returnItemTypeMap = from("ReturnItemTypeMap").where("returnHeaderTypeId", "CUSTOMER_RETURN").queryList(); typeMap = new HashMap(); returnItemTypeMap.each { value -> typeMap[value.returnItemMapKey] = value.returnItemTypeId } context.returnItemTypeMap = typeMap; //put in the return to party information from the order header if (orderId) { - order = delegator.findOne("OrderHeader", [orderId : orderId], false); + order = from("OrderHeader").where("orderId", orderId).queryOne(); productStore = order.getRelatedOne("ProductStore", false); context.toPartyId = productStore.payToPartyId; } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy Fri Dec 26 06:54:50 2014 @@ -32,7 +32,7 @@ context.cart = cart; 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; @@ -40,8 +40,7 @@ if (partyId && !partyId.equals("_NA_")) if (cart?.getShippingContactMechId()) { shippingContactMechId = cart.getShippingContactMechId(); - shippingPartyContactDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyContactDetailByPurpose", - [partyId : partyId, contactMechId : shippingContactMechId], null, false))); + shippingPartyContactDetail = from("PartyContactDetailByPurpose").where("partyId", partyId, "contactMechId", shippingContactMechId).filterByDate().queryFirst(); parameters.shippingContactMechId = shippingPartyContactDetail.contactMechId; context.callSubmitForm = true; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy Fri Dec 26 06:54:50 2014 @@ -25,16 +25,16 @@ import org.ofbiz.entity.util.*; shipmentId = parameters.shipmentId; if (shipmentId) { - shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); - shipmentItems = delegator.findByAnd("ShipmentItem", [shipmentId : shipmentId], null, false); + shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); + shipmentItems = from("ShipmentItem").where("shipmentId", shipmentId).queryList(); // get Shipment tracking info - osisCond = EntityCondition.makeCondition([shipmentId : shipmentId], EntityOperator.AND); - osisOrder = ["shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId"]; - osisFields = ["shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId", "carrierPartyId", "trackingCode"] as Set; - osisFindOptions = new EntityFindOptions(); - osisFindOptions.setDistinct(true); - orderShipmentInfoSummaryList = delegator.findList("OrderShipmentInfoSummary", osisCond, osisFields, osisOrder, osisFindOptions, false); + orderShipmentInfoSummaryList = select("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId", "carrierPartyId", "trackingCode") + .from("OrderShipmentInfoSummary") + .where("shipmentId", shipmentId) + .orderBy("shipmentId", "shipmentRouteSegmentId", "shipmentPackageSeqId") + .distinct() + .queryList(); context.shipment = shipment; context.shipmentItems = shipmentItems; Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/shoppinglist/EditShoppingList.groovy Fri Dec 26 06:54:50 2014 @@ -53,13 +53,13 @@ context.currencyUomId = currencyUomId; 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(exprList).orderBy("listName").queryList(); shoppingLists = EntityUtil.filterByAnd(allShoppingLists, [parentShoppingListId : null]); context.allShoppingLists = allShoppingLists; context.shoppingLists = shoppingLists; // get all shoppingListTypes -shoppingListTypes = delegator.findList("ShoppingListType", null, null, ["description"], null, true); +shoppingListTypes = from("ShoppingListType").orderBy("description").cache(true).queryList(); context.shoppingListTypes = shoppingListTypes; // get the shoppingListId for this reqest @@ -78,7 +78,7 @@ session.setAttribute("currentShoppingLis // if we passed a shoppingListId get the shopping list info if (shoppingListId) { - shoppingList = delegator.findOne("ShoppingList", [shoppingListId : shoppingListId], false); + shoppingList = from("ShoppingList").where("shoppingListId", shoppingListId).queryOne(); context.shoppingList = shoppingList; if (shoppingList) { @@ -161,7 +161,7 @@ if (shoppingListId) { context.shoppingListType = shoppingListType; // get the child shopping lists of the current list for the logged in user - childShoppingLists = delegator.findByAnd("ShoppingList", [partyId : userLogin.partyId, parentShoppingListId : shoppingListId], ["listName"], true); + childShoppingLists = from("ShoppingList").where("partyId", userLogin.partyId, "parentShoppingListId", shoppingListId).orderBy("listName").cache(true).queryList(); // now get prices for each child shopping list... if (childShoppingLists) { childShoppingListDatas = new ArrayList(childShoppingLists.size()); @@ -201,7 +201,7 @@ if (shoppingListId) { context.shippingContactMechList = ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); context.paymentMethodList = EntityUtil.filterByDate(party.getRelated("PaymentMethod", null, ["paymentMethodTypeId"], false)); - shipAddress = delegator.findOne("PostalAddress", ["contactMechId" : shoppingList.contactMechId], false); + shipAddress = from("PostalAddress").where("contactMechId", shoppingList.contactMechId).queryOne(); Debug.log("SL - address : " + shipAddress); if (shipAddress) { listCart = ShoppingListServices.makeShoppingListCart(dispatcher, shoppingListId, locale); Modified: ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/actions/includes/FindExampleFeatures.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/actions/includes/FindExampleFeatures.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/actions/includes/FindExampleFeatures.groovy (original) +++ ofbiz/trunk/specialpurpose/example/webapp/example/WEB-INF/actions/includes/FindExampleFeatures.groovy Fri Dec 26 06:54:50 2014 @@ -36,8 +36,7 @@ if (fieldValue) { autocompleteOptions = []; if (andExprs) { - entityConditionList = EntityCondition.makeCondition(andExprs, EntityOperator.AND); - autocompleteOptions = delegator.findList("ExampleFeature", entityConditionList, ['exampleFeatureId', 'description'] as Set, ['-exampleFeatureId'], null, false); + autocompleteOptions = select("exampleFeatureId", "description").from("ExampleFeature").where(andExprs).orderBy("-exampleFeatureId").queryList(); //context.autocompleteOptions = autocompleteOptions; request.setAttribute("autocompleteOptions", autocompleteOptions); } Modified: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy Fri Dec 26 06:54:50 2014 @@ -27,7 +27,7 @@ import javax.servlet.http.HttpSession; defaultLocaleString = ""; if (parameters.productStoreId) { - productStore = delegator.findByAnd("ProductStore", ["productStoreId":parameters.productStoreId], null, false); + productStore = from("ProductStore").where("productStoreId", parameters.productStoreId).queryList(); defaultLocaleString = productStore[0].defaultLocaleString.toString() } active = parameters.ACTIVE_PRODUCT; @@ -37,12 +37,11 @@ productList = FastList.newInstance(); if (UtilValidate.isNotEmpty(productIds) && ("Y".equals(active) || "Y".equals(notSynced))) { for (int i = 0; i < productIds.size(); i++) { productId = productIds[i]; - productCategoryMembers = delegator.findByAnd("ProductCategoryMember", [productId : productId], null, false); - productCategoryMember = EntityUtil.getFirst(productCategoryMembers); + productCategoryMember = from("ProductCategoryMember").where("productId", productId).queryFirst(); if (UtilValidate.isNotEmpty(productCategoryMember)) { if ("Y".equals(active) && "Y".equals(notSynced)) { thruDate = productCategoryMember.get("thruDate"); - goodIdentification = delegator.findOne("GoodIdentification", [productId : productId, goodIdentificationTypeId : "GOOGLE_ID_" + defaultLocaleString], false); + goodIdentification = from("GoodIdentification").where("productId", productId, "goodIdentificationTypeId", "GOOGLE_ID_" + defaultLocaleString).queryOne(); if (UtilValidate.isEmpty(thruDate) && UtilValidate.isEmpty(goodIdentification)) { productList.add(productId); } @@ -53,7 +52,7 @@ if (UtilValidate.isNotEmpty(productIds) } parameters.GOOGLE_SYNCED = "N" } else if ("Y".equals(notSynced)) { - goodIdentification = delegator.findOne("GoodIdentification", [productId : productId, goodIdentificationTypeId : "GOOGLE_ID_" + defaultLocaleString], false); + goodIdentification = from("GoodIdentification").where("productId", productId, "goodIdentificationTypeId", "GOOGLE_ID_" + defaultLocaleString).queryOne(); if (UtilValidate.isEmpty(goodIdentification)) { productList.add(productId); } @@ -72,7 +71,7 @@ def notDiscontProdList = [] if(parameters.DISCONTINUED_PRODUCT == 'Y'){ productIds.each { value -> def stockIsZero = runService('isStoreInventoryAvailable', ["productId": value, "productStoreId": parameters.productStoreId, "quantity": BigDecimal.valueOf(1.00)]); - def thisProduct = delegator.findOne("Product", [productId : value], false); + def thisProduct = from("Product").where("productId", value).queryOne(); if (stockIsZero.get("available") == 'Y'){ notDiscontProdList.add(value); }else { Modified: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/GoogleBaseAdvancedSearch.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/GoogleBaseAdvancedSearch.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/GoogleBaseAdvancedSearch.groovy (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/GoogleBaseAdvancedSearch.groovy Fri Dec 26 06:54:50 2014 @@ -31,7 +31,7 @@ if (parameters.productStoreId) { } else { productStoreId = ProductStoreWorker.getProductStoreId(request); } -googleBaseConfigList = delegator.findList("GoogleBaseConfig", null, null, null, null, false); +googleBaseConfigList = from("GoogleBaseConfig").queryList(); if (!productStoreId) { googleBaseProductStore = EntityUtil.getFirst(googleBaseConfigList); productStoreId = googleBaseProductStore.productStoreId; @@ -40,7 +40,7 @@ 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/googlebase/webapp/googlebase/WEB-INF/actions/googlebaseDivideList.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/googlebaseDivideList.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/googlebaseDivideList.groovy (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/googlebaseDivideList.groovy Fri Dec 26 06:54:50 2014 @@ -20,7 +20,7 @@ // productList.unique() like distinct sql command, return string type. def productUniqueStr = productList.unique(); def productUniqueStrList = productUniqueStr.toList(); -def googleBaseList = delegator.findByAnd("GoodIdentification",["goodIdentificationTypeId":"GOOGLE_ID_" + productStore.defaultLocaleString], null, false); +def googleBaseList = from("GoodIdentification").where("goodIdentificationTypeId", "GOOGLE_ID_" + productStore.defaultLocaleString).queryList(); // find product is existed in google base. def notNeededList = productUniqueStrList - googleBaseList.productId; def resultList = productUniqueStrList - notNeededList; Modified: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsExportToGoogle.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsExportToGoogle.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsExportToGoogle.groovy (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsExportToGoogle.groovy Fri Dec 26 06:54:50 2014 @@ -28,9 +28,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.webSiteId = parameters.webSiteId; } else if (webSiteList) { webSite = EntityUtil.getFirst(webSiteList); @@ -43,7 +43,7 @@ if (parameters.productStoreId) { } if (parameters.productStoreId) { - productStore = delegator.findByAnd("ProductStore", ["productStoreId":parameters.productStoreId], null, false); + productStore = from("ProductStore").where("productStoreId", parameters.productStoreId).queryList(); str = productStore[0].defaultLocaleString.toString().toUpperCase(); localeString = str.substring(str.length()-2, str.length()); if(localeString.equals("US")){ Modified: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsToGooglebase.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsToGooglebase.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsToGooglebase.groovy (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsToGooglebase.groovy Fri Dec 26 06:54:50 2014 @@ -33,12 +33,12 @@ categoryIdsTemp = [] if (parameters.productStoreId) { productStoreId = parameters.productStoreId; } -googleBaseConfigList = delegator.findByAnd("GoogleBaseConfig",["productStoreId":productStoreId], null, false); +googleBaseConfigList = from("GoogleBaseConfig").where("productStoreId", productStoreId).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); } } @@ -46,7 +46,7 @@ if (productStoreId) { currentCatalogId = null; prodCatalogList.each { prodCatalogList -> currentCatalogId = prodCatalogList.prodCatalogId - prodCatalogCategoryList = delegator.findByAnd("ProdCatalogCategory",["prodCatalogId":currentCatalogId, "prodCatalogCategoryTypeId":"PCCT_BROWSE_ROOT"], null, false); + prodCatalogCategoryList = from("ProdCatalogCategory").where("prodCatalogId", currentCatalogId, "prodCatalogCategoryTypeId", "PCCT_BROWSE_ROOT").queryList(); topCategory = prodCatalogCategoryList.productCategoryId[0]; if (topCategory){ relatedCategories = runService('getRelatedCategories', [parentProductCategoryId: topCategory]); Modified: ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy (original) +++ ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy Fri Dec 26 06:54:50 2014 @@ -17,4 +17,4 @@ * under the License. */ -context.facilities = delegator.findList("Facility", null, null, null, null, false); +context.facilities = from("Facility").queryList(); Modified: ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy (original) +++ ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy Fri Dec 26 06:54:50 2014 @@ -27,7 +27,7 @@ if (!productId) { } if (productId) { - product = delegator.findOne("Product", [productId : productId], true); + product = from("Product").where("productId", productId).cache(true).queryOne(); context.product = product; facilityId = request.getParameter("facilityId"); @@ -40,8 +40,7 @@ if (productId) { // For now this just generates a visual list of locations set against the product for this facility. // todo: Will need to be able to edit and change these values at some point in the future. - productFacilityLocList = delegator.findList("ProductFacilityLocation", - EntityCondition.makeCondition([productId : productId, facilityId : facilityId]), null, null, null, false); + productFacilityLocList = from("ProductFacilityLocation").where("productId", productId, "facilityId", facilityId).queryList(); facStr = null; productFacilityLocList.each { facilityLoc -> if (!facStr) { @@ -55,8 +54,7 @@ if (productId) { // Now we build a list of locations for inventory items against the facility. // todo: change this to a select from inv_items where productId and facilityId matches distinct (locationSeqId). - invItemList = delegator.findList("InventoryItem", - EntityCondition.makeCondition([productId : productId, facilityId : facilityId]), null, null, null, false); + invItemList = from("InventoryItem").where("productId", productId, "facilityId", facilityId).queryList(); locations = FastMap.newInstance(); Modified: ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/IndexProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/IndexProducts.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/IndexProducts.groovy (original) +++ ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/IndexProducts.groovy Fri Dec 26 06:54:50 2014 @@ -29,7 +29,7 @@ if (pi) { beganTransaction = TransactionUtil.begin() EntityListIterator products try { - products = delegator.find('Product', null, null, new TreeSet(['productId']), null, null) + products = select("productId").from("Product").queryIterator(); while (product = products.next()) { pi.queue(new ProductDocument(product.productId)) productsCounter++ Modified: ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/Search.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/Search.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/Search.groovy (original) +++ ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/Search.groovy Fri Dec 26 06:54:50 2014 @@ -102,7 +102,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/lucene/webapp/content/WEB-INF/actions/SearchProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/SearchProducts.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/SearchProducts.groovy (original) +++ ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/actions/SearchProducts.groovy Fri Dec 26 06:54:50 2014 @@ -64,7 +64,7 @@ if (parameters.luceneQuery) { hits.each { hit -> Document doc = searcher.doc(hit.doc) productId = doc.productId - product = delegator.findOne("Product", [productId : productId], true) + product = from("Product").where("productId", productId).cache(true).queryOne(); if (product) { productList.add(product) } Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.groovy Fri Dec 26 06:54:50 2014 @@ -39,7 +39,7 @@ if (!partyId) { timesheet = null; timesheetId = parameters.timesheetId; if (timesheetId) { - timesheet = delegator.findOne("Timesheet", ["timesheetId" : timesheetId], false); + timesheet = from("Timesheet").where("timesheetId", timesheetId).queryOne(); partyId = timesheet.partyId; // use the party from this timesheet } else { // make sure because of timezone changes, not a duplicate timesheet is created @@ -49,13 +49,13 @@ if (timesheetId) { EntityCondition.makeCondition("thruDate", EntityComparisonOperator.GREATER_THAN, midweek), EntityCondition.makeCondition("partyId", EntityComparisonOperator.EQUALS, partyId) ], EntityOperator.AND); - entryIterator = delegator.find("Timesheet", entryExprs, null, null, null, null); + entryIterator = from("Timesheet").where(entryExprs).queryIterator(); timesheet = entryIterator.next(); entryIterator.close(); if (timesheet == null) { result = runService('createProjectTimesheet', ["userLogin" : parameters.userLogin, "partyId" : partyId]); if (result && result.timesheetId) { - timesheet = delegator.findOne("Timesheet", ["timesheetId" : result.timesheetId], false); + timesheet = from("Timesheet").where("timesheetId", result.timesheetId).queryOne(); } } } @@ -64,9 +64,9 @@ context.timesheet = timesheet; context.weekNumber = UtilDateTime.weekNumber(timesheet.fromDate); // get the user names -context.partyNameView = delegator.findOne("PartyNameView",["partyId" : partyId], false); +context.partyNameView = from("PartyNameView").where("partyId", partyId).queryOne(); // get the default rate for this person -rateTypes = EntityUtil.filterByDate(delegator.findByAnd("PartyRate", ["partyId" : partyId, "defaultRate" : "Y"], null, false)); +rateTypes = from("PartyRate").where("partyId", partyId, "defaultRate", "Y").filterByDate().queryList(); if (rateTypes) { context.defaultRateTypeId = rateTypes[0].rateTypeId; } @@ -189,7 +189,7 @@ if (timeEntry) { } context.timeEntries = entries; // get all timesheets of this user, including the planned hours -timesheetsDb = delegator.findByAnd("Timesheet", ["partyId" : partyId], ["fromDate DESC"], false); +timesheetsDb = from("Timesheet").where("partyId", partyId).orderBy("fromDate DESC").queryList(); timesheets = new LinkedList(); timesheetsDb.each { timesheetDb -> timesheet = [:]; Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy Fri Dec 26 06:54:50 2014 @@ -71,7 +71,7 @@ if (phases) { EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "PTS_CANCELLED"), EntityCondition.makeCondition("workEffortParentId", EntityOperator.EQUALS, phase.phaseId) ], EntityOperator.AND); - tasks = delegator.findList("WorkEffort", cond, null, ["sequenceNum","workEffortName"], null, false); + tasks = from("WorkEffort").where(cond).orderBy("sequenceNum","workEffortName").queryList(); if (tasks) { tasks.each { task -> resultTaskInfo = runService('getProjectTask', [userLogin : userLogin , taskId : task.workEffortId]); @@ -117,7 +117,7 @@ if (phases) { } // dependency can only show one in the ganttchart, so onl show the latest one.. - preTasks = delegator.findByAnd("WorkEffortAssoc", ["workEffortIdTo" : task.workEffortId], ["workEffortIdFrom"], false); + preTasks = from("WorkEffortAssoc").where("workEffortIdTo", task.workEffortId).orderBy("workEffortIdFrom").queryList(); latestTaskIds = new LinkedList(); preTasks.each { preTask -> wf = preTask.getRelatedOne("FromWorkEffort", false); Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy Fri Dec 26 06:54:50 2014 @@ -23,13 +23,13 @@ cond = EntityCondition.makeCondition([ EntityCondition.makeCondition ("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"), EntityCondition.makeCondition ("currentStatusId", EntityOperator.NOT_EQUAL, "PRJ_CLOSED") ], EntityJoinOperator.AND); -allProjects = delegator.findList("WorkEffort", cond, (HashSet) ["workEffortId"], ["workEffortName"], null, false); +allProjects = select("workEffortId").from("WorkEffort").where(cond).orderBy("workEffortName").queryList(); projects = []; allProjects.each { project -> result = runService('getProject', ["userLogin" : parameters.userLogin, "projectId" : project.workEffortId]); if (result.projectInfo) { - resultAssign = delegator.findByAnd("WorkEffortPartyAssignment", ["partyId" : parameters.userLogin.partyId, "workEffortId" : project.workEffortId], null, false) + resultAssign = from("WorkEffortPartyAssignment").where("partyId", parameters.userLogin.partyId, "workEffortId", project.workEffortId).queryList(); if (security.hasEntityPermission("PROJECTMGR", "_ADMIN", session) || ((security.hasEntityPermission("PROJECTMGR", "_ROLE_ADMIN", session) || security.hasEntityPermission("PROJECTMGR", "_ROLE_VIEW", session)) && resultAssign)) { projects.add(result.projectInfo); Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListResourceBillingHours.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListResourceBillingHours.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListResourceBillingHours.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListResourceBillingHours.groovy Fri Dec 26 06:54:50 2014 @@ -27,12 +27,7 @@ import javolution.util.FastMap; import javolution.util.FastList; -cond = - EntityCondition.makeCondition( - [EntityCondition.makeCondition ("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"), - EntityCondition.makeCondition ("partyId", EntityOperator.EQUALS, parameters.partyId) - ],EntityOperator.AND); -allProjects = delegator.findList("WorkEffortAndPartyAssign", cond, (HashSet) ["workEffortId"], ["workEffortName"], null, true); +allProjects = select("workEffortId").from("WorkEffortAndPartyAssign").where("workEffortTypeId", "PROJECT", "partyId", parameters.partyId).orderBy("workEffortName").cache(true).queryList(); projects = []; allProjects.each { project -> Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectBilling.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectBilling.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectBilling.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectBilling.groovy Fri Dec 26 06:54:50 2014 @@ -32,7 +32,13 @@ entryExprs = ], EntityOperator.AND); orderBy = ["-fromDate"]; // check if latest invoice generated is still in process so allow re-generation to correct errors -entryIterator = delegator.find("ProjectPhaseTaskAndTimeEntryTimeSheet", entryExprs, null, null, orderBy, null); +entryIterator = from("ProjectPhaseTaskAndTimeEntryTimeSheet") + .where(EntityCondition.makeCondition([ + EntityCondition.makeCondition("projectId", EntityOperator.EQUALS, projectId), + EntityCondition.makeCondition("invoiceId", EntityOperator.NOT_EQUAL, null), + ], EntityOperator.AND)) + .orderBy("-fromDate") + .queryIterator(); while (entryItem = entryIterator.next()) { invoice = entryItem.getRelatedOne("Invoice", false); if (invoice.getString("statusId").equals("INVOICE_IN_PROCESS")) { Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy Fri Dec 26 06:54:50 2014 @@ -19,8 +19,7 @@ import org.ofbiz.entity.util.EntityUtil; -projectMembers = delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : context.projectId], null, false); -projectMembers = EntityUtil.filterByDate(projectMembers); +projectMembers = from("WorkEffortPartyAssignment").where("workEffortId", context.projectId).filterByDate().queryList(); toPartyId = null; fromPartyId = null; Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy Fri Dec 26 06:54:50 2014 @@ -22,7 +22,7 @@ import org.ofbiz.base.util.*; // get last request from this user and use that project/task assignment as default on the screen -custRequestList = delegator.findByAnd("CustRequest", ["fromPartyId" : fromPartyId], ["-createdDate"], false); +custRequestList = from("CustRequest").where("fromPartyId", fromPartyId).orderBy("-createdDate").queryList(); if (custRequestList) { custReqTaskList = custRequestList.get(0).getRelated("CustRequestWorkEffort", null, null, false); if (custReqTaskList) { Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getProjectId.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getProjectId.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getProjectId.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getProjectId.groovy Fri Dec 26 06:54:50 2014 @@ -25,7 +25,7 @@ import javolution.util.FastMap; if (parameters.workEffortId) { workEffortId = parameters.workEffortId; - projects = delegator.findByAnd("ProjectAndPhaseAndTask", UtilMisc.toMap("workEffortId", workEffortId), null, false); + projects = from("ProjectAndPhaseAndTask").where("workEffortId", workEffortId).queryList(); if (UtilValidate.isNotEmpty(projects)) { context.put("projectId", projects.get(0).getString("projectId")); context.put("projectName", projects.get(0).getString("projectName")); Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/AddProductBacklogItem.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/AddProductBacklogItem.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/AddProductBacklogItem.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/AddProductBacklogItem.groovy Fri Dec 26 06:54:50 2014 @@ -50,7 +50,7 @@ custRequestAndItems.each() { custRequest tempCustRequestAndItem.custSequenceNum = countSequence; tempCustRequestAndItem.realSequenceNum = custRequestAndItem.custSequenceNum; // if custRequest has task then get Actual Hours - custWorkEffortList = delegator.findByAnd("CustRequestWorkEffort",["custRequestId" : custRequestAndItem.custRequestId], null, false); + custWorkEffortList = from("CustRequestWorkEffort").where("custRequestId", custRequestAndItem.custRequestId).queryList(); if (custWorkEffortList) { actualHours = 0.00; custWorkEffortList.each() { custWorkEffortMap -> @@ -97,9 +97,8 @@ conditions = EntityCondition.makeConditi mainConditionList.add(orConditions); mainConditionList.add(conditions); -mainConditions = EntityCondition.makeCondition(mainConditionList, EntityOperator.AND); -unplannedList = delegator.findList("CustRequestAndCustRequestItem", mainConditions, ["custRequestId", "custSequenceNum", "statusId", "description", "custEstimatedMilliSeconds", "custRequestName", "parentCustRequestId"] as Set, ["custSequenceNum"], null, false); +unplannedList = select("custRequestId", "custSequenceNum", "statusId", "description", "custEstimatedMilliSeconds", "custRequestName", "parentCustRequestId").from("CustRequestAndCustRequestItem").where(mainConditionList).orderBy("custSequenceNum").queryList(); def countSequenceUnplanned = 1; def unplanBacklogItems = []; @@ -109,7 +108,7 @@ unplannedList.each() { unplannedItem -> tempUnplanned.custSequenceNum = countSequenceUnplanned; tempUnplanned.realSequenceNum = unplannedItem.custSequenceNum; // if custRequest has task then get Actual Hours - unplanCustWorkEffortList = delegator.findByAnd("CustRequestWorkEffort",["custRequestId" : unplannedItem.custRequestId], null, false); + unplanCustWorkEffortList = from("CustRequestWorkEffort").where("custRequestId", unplannedItem.custRequestId).queryList(); if (unplanCustWorkEffortList) { actualHours = 0.00; unplanCustWorkEffortList.each() { custWorkEffortMap -> Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/AddResourceTaskParty.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/AddResourceTaskParty.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/AddResourceTaskParty.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/AddResourceTaskParty.groovy Fri Dec 26 06:54:50 2014 @@ -23,21 +23,21 @@ import org.ofbiz.base.util.Debug; partyId = parameters.partyId // get existing task that no assign projectSprintBacklogAndTaskList = []; -projectAndTaskList = delegator.findByAnd("ProjectSprintBacklogAndTask", ["sprintTypeId" : "SCRUM_SPRINT","taskCurrentStatusId" : "STS_CREATED"], ["taskId DESC"], false); +projectAndTaskList = from("ProjectSprintBacklogAndTask").where("sprintTypeId", "SCRUM_SPRINT","taskCurrentStatusId", "STS_CREATED").orderBy("taskId DESC").queryList(); projectAndTaskList.each { projectAndTaskMap -> userLoginId = userLogin.partyId; projectId = projectAndTaskMap.projectId; - partyAssignmentProjectList = delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : projectId, "partyId" : partyId], null, false); + partyAssignmentProjectList = from("WorkEffortPartyAssignment").where("workEffortId", projectId, "partyId", partyId).queryList(); partyAssignmentProjectMap = partyAssignmentProjectList[0]; // if this userLoginId is a member of project if (partyAssignmentProjectMap) { sprintId = projectAndTaskMap.sprintId; - partyAssignmentSprintList = delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : sprintId, "partyId" : partyId], null, false); + partyAssignmentSprintList = from("WorkEffortPartyAssignment").where("workEffortId", sprintId, "partyId", partyId).queryList(); partyAssignmentSprintMap = partyAssignmentSprintList[0]; // if this userLoginId is a member of sprint if (partyAssignmentSprintMap) { workEffortId = projectAndTaskMap.taskId; - partyAssignmentTaskList = delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : workEffortId], null, false); + partyAssignmentTaskList = from("WorkEffortPartyAssignment").where("workEffortId", workEffortId).queryList(); partyAssignmentTaskMap = partyAssignmentTaskList[0]; // if the task do not assigned if (!partyAssignmentTaskMap) { Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/BacklogNotifications.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/BacklogNotifications.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/BacklogNotifications.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/BacklogNotifications.groovy Fri Dec 26 06:54:50 2014 @@ -22,8 +22,8 @@ import org.ofbiz.entity.condition.*; def module = "BacklogNotifications.groovy"; -custRequest = delegator.findOne("CustRequest", ["custRequestId" : custRequestId], false); -person = delegator.findOne("PartyNameView", ["partyId" : partyIdTo], false); +custRequest = from("CustRequest").where("custRequestId", custRequestId).queryOne(); +person = from("PartyNameView").where("partyId", partyIdTo).queryOne(); informationMap = [:]; informationMap.internalName = null; informationMap.productId = null; @@ -31,24 +31,19 @@ informationMap.workEffortName = null; informationMap.workEffortId = null; //check in sprint -andExprs = [EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "SCRUM_SPRINT"), - EntityCondition.makeCondition("custRequestId", EntityOperator.EQUALS, custRequestId)]; -backlogCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); -backlogList = delegator.findList("ProductBacklog", backlogCond, ["productId", "workEffortId", "custRequestId"] as Set ,null ,null, false); +backlogList = select("productId", "workEffortId", "custRequestId").from("ProductBacklog").where("workEffortTypeId", "SCRUM_SPRINT", "custRequestId", custRequestId).queryList(); if (backlogList) { - product = delegator.findOne("Product", ["productId" : backlogList[0].productId], false); - sprint = delegator.findOne("WorkEffort", ["workEffortId" : backlogList[0].workEffortId], false); + product = from("Product").where("productId", backlogList[0].productId).queryOne(); + sprint = from("WorkEffort").where("workEffortId", backlogList[0].workEffortId).queryOne(); informationMap.internalName = product.internalName; informationMap.productId = product.productId; informationMap.workEffortName = sprint.workEffortName; informationMap.workEffortId = sprint.workEffortId; } else { - andExprs = [EntityCondition.makeCondition("custRequestId", EntityOperator.EQUALS, custRequestId)]; - backlogCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); - backlogList = delegator.findList("ProductBacklog", backlogCond, ["productId", "workEffortId", "custRequestId"] as Set ,null ,null, false); + backlogList = select("productId", "workEffortId", "custRequestId").from("ProductBacklog").where("custRequestId", custRequestId).queryList(); if (backlogList) { if (backlogList[0].productId) { - product = delegator.findOne("Product", ["productId" : backlogList[0].productId], false); + product = from("Product").where("productId", backlogList[0].productId).queryOne(); informationMap.internalName = product.internalName; informationMap.productId = product.productId; } Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/EditDailyHourReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/EditDailyHourReport.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/EditDailyHourReport.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/EditDailyHourReport.groovy Fri Dec 26 06:54:50 2014 @@ -40,7 +40,7 @@ if (!partyId) { timesheet = null; timesheetId = parameters.timesheetId; if (timesheetId) { - timesheet = delegator.findOne("Timesheet", ["timesheetId" : timesheetId], false); + timesheet = from("Timesheet").where("timesheetId", timesheetId).queryOne(); partyId = timesheet.partyId; // use the party from this timesheet } else { // make sure because of timezone changes, not a duplicate timesheet is created @@ -50,13 +50,13 @@ if (timesheetId) { EntityCondition.makeCondition("thruDate", EntityComparisonOperator.GREATER_THAN, midweek), EntityCondition.makeCondition("partyId", EntityComparisonOperator.EQUALS, partyId) ], EntityOperator.AND); - entryIterator = delegator.find("Timesheet", entryExprs, null, null, null, null); + entryIterator = from("Timesheet").where(entryExprs).queryIterator(); timesheet = entryIterator.next(); entryIterator.close(); if (timesheet == null) { result = runService('createProjectTimesheet', ["userLogin" : parameters.userLogin, "partyId" : partyId]); if (result && result.timesheetId) { - timesheet = delegator.findOne("Timesheet", ["timesheetId" : result.timesheetId], false); + timesheet = from("Timesheet").where("timesheetId", result.timesheetId).queryOne(); } } } @@ -65,9 +65,9 @@ context.timesheet = timesheet; context.weekNumber = UtilDateTime.weekNumber(timesheet.fromDate); // get the user names -context.partyNameView = delegator.findOne("PartyNameView",["partyId" : partyId], false); +context.partyNameView = from("PartyNameView").where("partyId", partyId).queryOne(); // get the default rate for this person -rateTypes = EntityUtil.filterByDate(delegator.findByAnd("PartyRate", ["partyId" : partyId, "defaultRate" : "Y"], null, false)); +rateTypes = from("PartyRate").where("partyId", partyId, "defaultRate", "Y").filterByDate().queryList(); if (rateTypes) { context.defaultRateTypeId = rateTypes[0].rateTypeId; } @@ -108,7 +108,7 @@ void retrieveWorkEffortData() { //entry.plannedHours = pHours; planHours = 0.0; planHours = lastTimeEntry.planHours; - lastTimeEntryOfTasks = delegator.findByAnd("TimeEntry", ["workEffortId" : lastTimeEntry.workEffortId, "partyId" : partyId], ["-fromDate"], false); + lastTimeEntryOfTasks = from("TimeEntry").where("workEffortId", lastTimeEntry.workEffortId, "partyId", partyId).orderBy("-fromDate").queryList(); if (lastTimeEntryOfTasks.size() != 0) lastTimeEntry = lastTimeEntryOfTasks[0]; if (planHours < 1) { planHours = estimatedHour; @@ -238,12 +238,11 @@ void retrieveEmplLeaveData() { } // define condition -findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); leaveExprs = []; leaveExprs.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, timesheet.fromDate)); leaveExprs.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, timesheet.thruDate)); leaveExprs.add(EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)); -emplLeave = delegator.find("EmplLeave", EntityCondition.makeCondition(leaveExprs, EntityOperator.AND), null, null, null, findOpts); +emplLeave = from("EmplLeave").where(leaveExprs).cursorScrollInsensitive().distinct().queryIterator(); while ((emplLeaveMap = emplLeave.next())) { if (emplLeaveEntry!=void) { @@ -334,7 +333,7 @@ if (timeEntry || emplLeaveEntry) { } context.timeEntries = entries; // get all timesheets of this user, including the planned hours -timesheetsDb = delegator.findByAnd("Timesheet", ["partyId" : partyId], ["fromDate DESC"], false); +timesheetsDb = from("Timesheet").where("partyId", partyId).orderBy("fromDate DESC").queryList(); timesheets = new LinkedList(); timesheetsDb.each { timesheetDb -> //get hours from EmplLeave; @@ -343,7 +342,7 @@ timesheetsDb.each { timesheetDb -> leaveExprsList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, timesheetDb.fromDate)); leaveExprsList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, timesheetDb.thruDate)); leaveExprsList.add(EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)); - emplLeaveList = delegator.find("EmplLeave", EntityCondition.makeCondition(leaveExprsList, EntityOperator.AND), null, null, null, findOpts); + emplLeaveList = from("EmplLeave").where(leaveExprsList).cursorScrollInsensitive().distinct().queryIterator(); leaveHours = 0.00; while ((emplLeaveMap = emplLeaveList.next())) { @@ -376,19 +375,19 @@ context.timesheets = timesheets; taskList=[]; projectSprintBacklogAndTaskList = []; backlogIndexList = []; -projectAndTaskList = delegator.findByAnd("ProjectSprintBacklogAndTask", ["sprintTypeId" : "SCRUM_SPRINT","taskCurrentStatusId" : "STS_CREATED"], ["projectName ASC","taskActualStartDate DESC"], false); +projectAndTaskList = from("ProjectSprintBacklogAndTask").where("sprintTypeId" : "SCRUM_SPRINT","taskCurrentStatusId" : "STS_CREATED").orderBy("projectName ASC","taskActualStartDate DESC").queryList(); projectAndTaskList.each { projectAndTaskMap -> userLoginId = userLogin.partyId; sprintId = projectAndTaskMap.sprintId; - workEffortList = delegator.findByAnd("WorkEffortAndProduct", ["workEffortId" : projectAndTaskMap.projectId], null, false); + workEffortList = from("WorkEffortAndProduct").where("workEffortId", projectAndTaskMap.projectId).queryList(); backlogIndexList.add(workEffortList[0].productId); - partyAssignmentSprintList = delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : sprintId, "partyId" : userLoginId], null, false); + partyAssignmentSprintList = from("WorkEffortPartyAssignment").where("workEffortId", sprintId, "partyId", userLoginId).queryList(); partyAssignmentSprintMap = partyAssignmentSprintList[0]; // if this userLoginId is a member of sprint if (partyAssignmentSprintMap) { workEffortId = projectAndTaskMap.taskId; - partyAssignmentTaskList = delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : workEffortId], null, false); + partyAssignmentTaskList = from("WorkEffortPartyAssignment").where("workEffortId", workEffortId).queryList(); partyAssignmentTaskMap = partyAssignmentTaskList[0]; // if the task do not assigned if (partyAssignmentTaskMap) { @@ -407,24 +406,24 @@ userLoginId = userLogin.partyId; unplanList=[]; if (backlogIndexList) { backlogIndex = new HashSet(backlogIndexList); - custRequestList = delegator.findByAnd("CustRequest", ["custRequestTypeId" : "RF_UNPLAN_BACKLOG","statusId" : "CRQ_REVIEWED"],["custRequestDate DESC"], false); + custRequestList = from("CustRequest").where("custRequestTypeId", "RF_UNPLAN_BACKLOG","statusId", "CRQ_REVIEWED").orderBy("custRequestDate DESC").queryList(); if (custRequestList) { custRequestList.each { custRequestMap -> custRequestItemList = custRequestMap.getRelated("CustRequestItem", null, null, false); custRequestItem = productOut = custRequestItemList[0].productId; - product = delegator.findOne("Product", ["productId" : productOut], false); + product = from("Product").where("productId", productOut).queryOne(); backlogIndex.each { backlogProduct -> productId = backlogProduct if (productId.equals(productOut)) { - custRequestWorkEffortList = delegator.findByAnd("CustRequestWorkEffort", ["custRequestId" : custRequestItemList[0].custRequestId], null, false); + custRequestWorkEffortList = from("CustRequestWorkEffort").where("custRequestId", custRequestItemList[0].custRequestId).queryList(); custRequestWorkEffortList.each { custRequestWorkEffortMap -> - partyAssignmentTaskList = delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : custRequestWorkEffortMap.workEffortId], null, false); + partyAssignmentTaskList = from("WorkEffortPartyAssignment").where("workEffortId", custRequestWorkEffortMap.workEffortId).queryList(); partyAssignmentTaskMap = partyAssignmentTaskList[0]; // if the task do not assigned if (!partyAssignmentTaskMap) { result = [:]; - workEffortMap = delegator.findOne("WorkEffort", ["workEffortId" : custRequestWorkEffortMap.workEffortId], false); + workEffortMap = from("WorkEffort").where("workEffortId", custRequestWorkEffortMap.workEffortId).queryOne(); result.description = custRequestMap.description; result.productName = product.internalName; result.taskId = workEffortMap.workEffortId; Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/EditWeekTimesheet.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/EditWeekTimesheet.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/EditWeekTimesheet.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/EditWeekTimesheet.groovy Fri Dec 26 06:54:50 2014 @@ -39,7 +39,7 @@ if (!partyId) { timesheet = null; timesheetId = parameters.timesheetId; if (timesheetId) { - timesheet = delegator.findOne("Timesheet", ["timesheetId" : timesheetId], false); + timesheet = from("Timesheet").where("timesheetId", timesheetId).queryOne(); partyId = timesheet.partyId; // use the party from this timesheet } else { // make sure because of timezone changes, not a duplicate timesheet is created @@ -49,13 +49,13 @@ if (timesheetId) { EntityCondition.makeCondition("thruDate", EntityComparisonOperator.GREATER_THAN, midweek), EntityCondition.makeCondition("partyId", EntityComparisonOperator.EQUALS, partyId) ], EntityOperator.AND); - entryIterator = delegator.find("Timesheet", entryExprs, null, null, null, null); + entryIterator = from("Timesheet").where(entryExprs).queryIterator(); timesheet = entryIterator.next(); entryIterator.close(); if (timesheet == null) { result = runService('createProjectTimesheet', ["userLogin" : parameters.userLogin, "partyId" : partyId]); if (result && result.timesheetId) { - timesheet = delegator.findOne("Timesheet", ["timesheetId" : result.timesheetId], false); + timesheet = from("Timesheet").where("timesheetId", result.timesheetId).queryOne(); } } } @@ -64,9 +64,9 @@ context.timesheet = timesheet; context.weekNumber = UtilDateTime.weekNumber(timesheet.fromDate); // get the user names -context.partyNameView = delegator.findOne("PartyNameView",["partyId" : partyId], false); +context.partyNameView = from("PartyNameView").where("partyId", partyId).queryOne(); // get the default rate for this person -rateTypes = EntityUtil.filterByDate(delegator.findByAnd("PartyRate", ["partyId" : partyId, "defaultRate" : "Y"], null, false)); +rateTypes = from("PartyRate").where("partyId", partyId, "defaultRate", "Y").filterByDate().queryList(); if (rateTypes) { context.defaultRateTypeId = rateTypes[0].rateTypeId; } @@ -189,7 +189,7 @@ if (timeEntry) { } context.timeEntries = entries; // get all timesheets of this user, including the planned hours -timesheetsDb = delegator.findByAnd("Timesheet", ["partyId" : partyId], ["fromDate DESC"], false); +timesheetsDb = from("Timesheet").where("partyId", partyId).orderBy("fromDate DESC").queryList(); timesheets = new LinkedList(); timesheetsDb.each { timesheetDb -> timesheet = [:]; Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindBacklogItem.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindBacklogItem.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindBacklogItem.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindBacklogItem.groovy Fri Dec 26 06:54:50 2014 @@ -32,7 +32,7 @@ import java.sql.Timestamp; productId =parameters.productId; custRequestList=[]; backlogList=[]; -custRequestList = delegator.findByAnd("CustRequestItem", ["productId" : productId], null, false); +custRequestList = from("CustRequestItem").where("productId", productId).queryList(); custRequestList.each { custRequestListMap -> custRequestId=custRequestListMap.custRequestId; exprBldr = FastList.newInstance(); @@ -43,15 +43,15 @@ custRequestList.each { custRequestListMa andExprs.add(EntityCondition.makeCondition(exprBldr, EntityOperator.OR)); custRequestTypeCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); orderBy = ["custRequestTypeId"]; - productBacklogList = delegator.findList("CustRequest", custRequestTypeCond, null,orderBy ,null, false); + productBacklogList = from("CustRequest").where(andExprs).orderBy("custRequestTypeId").queryList(); productBacklogList.each { productBacklogMap -> productBackId = productBacklogMap.custRequestId; - taskBacklogList = delegator.findByAnd("CustRequestWorkEffort", ["custRequestId" : productBackId], null, false); + taskBacklogList = from("CustRequestWorkEffort").where("custRequestId", productBackId).queryList(); int countImplTask=0, countImplTaskComplete=0, countInstallTask=0, countInstallTaskComplete=0, countErrTask=0, countErrTaskComplete=0, countTestTask=0; taskBacklogList.each { taskBacklogMap -> taskId = taskBacklogMap.workEffortId; - task = delegator.findOne("WorkEffort", ["workEffortId" : taskId], false); + task = from("WorkEffort").where("workEffortId", taskId).queryOne(); if (task.workEffortTypeId == "SCRUM_TASK_IMPL") { countImplTask+=1; if ( task.currentStatusId == "STS_COMPLETED" || task.currentStatusId == "STS_CANCELLED") { Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindProductBacklogItem.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindProductBacklogItem.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindProductBacklogItem.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindProductBacklogItem.groovy Fri Dec 26 06:54:50 2014 @@ -94,9 +94,12 @@ if ((parameters.billed != null)||(parame } mainConditionBacklogList.add(conditionsBacklog); - mainConditionsBacklog = EntityCondition.makeCondition(mainConditionBacklogList, EntityOperator.AND); - backlogList = delegator.findList("CustRequestAndCustRequestItem", mainConditionsBacklog, ["custRequestId","custRequestTypeId", "custSequenceNum", "statusId", "description", "custEstimatedMilliSeconds", "custRequestName", "parentCustRequestId","productId","billed","custRequestDate","fromPartyId"] as Set, ["-custRequestTypeId",orderBy], null, false); + backlogList = select("custRequestId","custRequestTypeId", "custSequenceNum", "statusId", "description", "custEstimatedMilliSeconds", "custRequestName", "parentCustRequestId","productId","billed","custRequestDate","fromPartyId") + .from("CustRequestAndCustRequestItem") + .where(mainConditionBacklogList) + .orderBy("-custRequestTypeId", orderBy) + .queryList(); def countSequenceBacklog = 1; def backlogItems = []; backlogList.each() { backlogItem -> @@ -105,7 +108,7 @@ if ((parameters.billed != null)||(parame tempBacklog.custSequenceNum = countSequenceBacklog; tempBacklog.realSequenceNum = backlogItem.custSequenceNum; // if custRequest has task then get Actual Hours - backlogCustWorkEffortList = delegator.findByAnd("CustRequestWorkEffort",["custRequestId" : backlogItem.custRequestId], null, false); + backlogCustWorkEffortList = from("CustRequestWorkEffort").where("custRequestId", backlogItem.custRequestId).queryList(); if (backlogCustWorkEffortList) { actualHours = 0.00; backlogCustWorkEffortList.each() { custWorkEffortMap -> Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindTaskList.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindTaskList.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindTaskList.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/FindTaskList.groovy Fri Dec 26 06:54:50 2014 @@ -69,11 +69,10 @@ if ((taskId != null)||(taskName != null) if (statusId){ exprBldr.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, statusId)); } - unplannedCond = EntityCondition.makeCondition(exprBldr, EntityOperator.AND); - unplannedTaskList = delegator.findList("UnPlannedBacklogsAndTasks", unplannedCond, null,["-createdDate"] ,null, false); + unplannedTaskList = from("UnPlannedBacklogsAndTasks").where(exprBldr).orderBy("-createdDate").queryList(); } else{ - unplannedTaskList = delegator.findList("UnPlannedBacklogsAndTasks", null, null,["-createdDate"] ,null, false); + unplannedTaskList = from("UnPlannedBacklogsAndTasks").orderBy("-createdDate").queryList(); } exprBldr2 = FastList.newInstance(); @@ -102,8 +101,7 @@ if ((taskId != null)||(taskName != null) exprBldr2.add(EntityCondition.makeCondition("projectName", EntityOperator.LIKE, "%"+projectName+"%")); } exprBldr2.add(EntityCondition.makeCondition("sprintTypeId", EntityOperator.EQUALS, "SCRUM_SPRINT")); - plannedCond = EntityCondition.makeCondition(exprBldr2, EntityOperator.AND); - plannedTaskList = delegator.findList("ProjectSprintBacklogAndTask", plannedCond, null,["-taskCreatedDate"] ,null, false); + plannedTaskList = from("ProjectSprintBacklogAndTask").where(exprBldr2).orderBy("-taskCreatedDate").queryList(); unplannedTaskList.each{ unplannedTaskMap -> unplannedMap = [:]; @@ -170,7 +168,7 @@ if ((taskId != null)||(taskName != null) resultList = []; assignedList.each { assignedMap -> workEffortId = assignedMap.taskId; - assignToList = delegator.findByAnd("WorkEffortPartyAssignment",["workEffortId" : workEffortId, "partyId" : partyId], null, false); + assignToList = from("WorkEffortPartyAssignment").where("workEffortId", workEffortId, "partyId", partyId).queryList(); if (assignToList) { assignedMap.partyId = assignToList[0].partyId; resultList.add(assignedMap); @@ -181,7 +179,7 @@ if ((taskId != null)||(taskName != null) resultList = []; assignedList.each { assignedMap -> workEffortId = assignedMap.taskId; - assignToList = delegator.findByAnd("WorkEffortPartyAssignment",["workEffortId" : workEffortId], null, false); + assignToList = from("WorkEffortPartyAssignment").where("workEffortId", workEffortId).queryList(); if (assignToList) { assignedMap.partyId = assignToList[0].partyId; resultList.add(assignedMap); Modified: ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/ListCurrentProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/ListCurrentProducts.groovy?rev=1647937&r1=1647936&r2=1647937&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/ListCurrentProducts.groovy (original) +++ ofbiz/trunk/specialpurpose/scrum/webapp/scrum/WEB-INF/actions/ListCurrentProducts.groovy Fri Dec 26 06:54:50 2014 @@ -59,22 +59,22 @@ if (userLogin) { paramCond.add(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "PRODUCT_OWNER_COMP")); paramCond.add(EntityCondition.makeCondition("thruDate", EntityOperator.EQUALS, null)); - cond = EntityCondition.makeCondition(paramCond, EntityOperator.AND); + allProducts = from("ProductAndRole").where(paramCond).orderBy("groupName", "internalName").queryList(); - allProducts = delegator.findList("ProductAndRole", cond, null, ["groupName", "internalName"], null, false); + partyAndSecurityGroupList = select("partyId", "groupId") + .from("ScrumMemberUserLoginAndSecurityGroup").where(EntityCondition.makeCondition([ + EntityCondition.makeCondition ("partyId", EntityOperator.EQUALS, userLogin.partyId), + EntityCondition.makeCondition ("partyStatusId", EntityOperator.NOT_EQUAL, "PARTY_DISABLED"), + EntityCondition.makeCondition ("thruDate", EntityOperator.EQUALS, null) + ], EntityJoinOperator.AND)) + .orderBy("partyId") + .queryList(); - securityGroupCond = EntityCondition.makeCondition([ - EntityCondition.makeCondition ("partyId", EntityOperator.EQUALS, userLogin.partyId), - EntityCondition.makeCondition ("partyStatusId", EntityOperator.NOT_EQUAL, "PARTY_DISABLED"), - EntityCondition.makeCondition ("thruDate", EntityOperator.EQUALS, null) - ], EntityJoinOperator.AND); - fields = new HashSet(["partyId", "groupId"]); - partyAndSecurityGroupList = delegator.findList("ScrumMemberUserLoginAndSecurityGroup", securityGroupCond, fields, ["partyId"], null, false); context.partyAndSecurityGroupList = partyAndSecurityGroupList; boolean addAllProducts = false; allProducts.each { product -> product = product.getAllFields(); - productMap = delegator.findOne("Product", ["productId" : product.productId], false); + productMap = from("Product").where("productId", product.productId).queryOne(); product.put("longDescription",productMap.longDescription) if(security.hasEntityPermission("SCRUM", "_ADMIN", session)){ addAllProducts = true; @@ -83,7 +83,7 @@ if (userLogin) { if (partyAndSecurityGroupList) { groupId = partyAndSecurityGroupList[0].groupId; if ("SCRUM_PRODUCT_OWNER".equals(groupId)) { - productAndRoleList = delegator.findByAnd("ProductRole", ["productId" : product.productId, "partyId" : userLogin.partyId, "thruDate" : null], null, false); + productAndRoleList = from("ProductRole").where("productId", product.productId, "partyId", userLogin.partyId, "thruDate", null).queryList(); if (productAndRoleList) { productAndRoleList.each { productAndRoleMap -> productIdInner = productAndRoleMap.productId; @@ -100,8 +100,8 @@ if (userLogin) { EntityCondition.makeCondition ("partyStatusId", EntityOperator.NOT_EQUAL, "PARTY_DISABLED"), EntityCondition.makeCondition ("thruDate", EntityOperator.EQUALS, null) ], EntityJoinOperator.AND); - scrumRolesPersonAndCompanyList = delegator.findList("ScrumRolesPersonAndCompany", scrumRolesCond, null, null, null, false); - productRoleList = delegator.findByAnd("ProductRole", ["partyId" : scrumRolesPersonAndCompanyList[0].partyIdFrom, "roleTypeId" : "PRODUCT_OWNER_COMP", "thruDate" : null], null, false); + scrumRolesPersonAndCompanyList = from("ScrumRolesPersonAndCompany").where(scrumRolesCond).queryList(); + productRoleList = from("ProductRole").where("partyId", scrumRolesPersonAndCompanyList[0].partyIdFrom, "roleTypeId", "PRODUCT_OWNER_COMP", "thruDate", null).queryList(); if (productRoleList) { productRoleList.each { productRoleMap -> stakeholderProduct = productRoleMap.productId; @@ -112,8 +112,7 @@ if (userLogin) { } //check in product. if (ismember == false) { - productAndRoleList = delegator.findByAnd("ProductAndRole", ["productId" : product.productId, "partyId" : userLogin.partyId - , "roleTypeId" : "STAKEHOLDER", "supportDiscontinuationDate" : null, "thruDate" : null], null, false); + productAndRoleList = from("ProductAndRole").where("productId" : product.productId, "partyId" : userLogin.partyId, "roleTypeId" : "STAKEHOLDER", "supportDiscontinuationDate" : null, "thruDate" : null).queryList() if (productAndRoleList) { ismember = true; } @@ -121,18 +120,17 @@ if (userLogin) { } else if ("SCRUM_MASTER".equals(groupId)) { //check in product. productRoleList = []; - productRoleList = delegator.findByAnd("ProductAndRole", ["productId" : product.productId, "partyId" : userLogin.partyId - , "roleTypeId" : "SCRUM_MASTER", "supportDiscontinuationDate" : null, "thruDate" : null], null, false); + productRoleList = from("ProductAndRole").where("productId" : product.productId, "partyId" : userLogin.partyId, "roleTypeId" : "SCRUM_MASTER", "supportDiscontinuationDate" : null, "thruDate" : null).queryList(); if (productRoleList) { ismember = true; } //check in project. if (ismember == false) { projects = []; - projects = delegator.findByAnd("WorkEffortAndProduct", ["productId" : product.productId, "workEffortTypeId" : "SCRUM_PROJECT", "currentStatusId" : "SPJ_ACTIVE"], null, false); + projects = from("WorkEffortAndProduct").where("productId", product.productId, "workEffortTypeId", "SCRUM_PROJECT", "currentStatusId", "SPJ_ACTIVE").queryList(); if (projects) { projects.each { project -> - projectPartyAssignment = delegator.findByAnd("WorkEffortPartyAssignment", ["partyId" : userLogin.partyId, "workEffortId" : project.workEffortId], null, false); + projectPartyAssignment = from("WorkEffortPartyAssignment").where("partyId", userLogin.partyId, "workEffortId", project.workEffortId).queryList(); if (projectPartyAssignment) { ismember = true; } @@ -143,10 +141,10 @@ if (userLogin) { if (ismember == false) { projects.each { project -> allSprintList = []; - allSprintList = delegator.findByAnd("WorkEffort", ["workEffortParentId" : project.workEffortId, "currentStatusId" : "SPRINT_ACTIVE"], null, false); + allSprintList = from("WorkEffort").where("workEffortParentId", project.workEffortId, "currentStatusId", "SPRINT_ACTIVE").queryList(); allSprintList.each { SprintListMap -> sprintId = SprintListMap.workEffortId; - workEffortPartyAssignment = delegator.findByAnd("WorkEffortPartyAssignment", ["partyId" : userLogin.partyId, "workEffortId" : sprintId], null, false) + workEffortPartyAssignment = from("WorkEffortPartyAssignment").where("partyId", userLogin.partyId, "workEffortId", sprintId).queryList(); if (workEffortPartyAssignment) { ismember = true; } @@ -155,14 +153,14 @@ if (userLogin) { } } else { projects = []; - projects = delegator.findByAnd("WorkEffortAndProduct", ["productId" : product.productId, "workEffortTypeId" : "SCRUM_PROJECT", "currentStatusId" : "SPJ_ACTIVE"], null, false); + projects = from("WorkEffortAndProduct").where("productId", product.productId, "workEffortTypeId", "SCRUM_PROJECT", "currentStatusId", "SPJ_ACTIVE").queryList(); if (projects) { projects.each { project -> allSprintList = []; - allSprintList = delegator.findByAnd("WorkEffort", ["workEffortParentId" : project.workEffortId, "currentStatusId" : "SPRINT_ACTIVE"], null, false); + allSprintList = from("WorkEffort").where("workEffortParentId", project.workEffortId, "currentStatusId", "SPRINT_ACTIVE").queryList(); allSprintList.each { SprintListMap -> sprintId = SprintListMap.workEffortId; - workEffortPartyAssignment = delegator.findByAnd("WorkEffortPartyAssignment", ["partyId" : userLogin.partyId, "workEffortId" : sprintId], null, false) + workEffortPartyAssignment = from("WorkEffortPartyAssignment").where("partyId", userLogin.partyId, "workEffortId", sprintId).queryList(); if (workEffortPartyAssignment) { ismember = true; } @@ -176,11 +174,11 @@ if (userLogin) { EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, "STS_CREATED"), EntityCondition.makeCondition(exprBldr, EntityOperator.OR)]; unplannedBacklogCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); - unplannedBacklogList = delegator.findList("UnPlannedBacklogsAndTasks", unplannedBacklogCond, null,null ,null, false); + unplannedBacklogList = from("UnPlannedBacklogsAndTasks").where(unplannedBacklogCond).queryList(); if (unplannedBacklogList) { unplannedBacklogList.each { unplannedMap -> workEffortId = unplannedMap.workEffortId; - workEffortPartyAssignment = delegator.findByAnd("WorkEffortPartyAssignment", ["partyId" : userLogin.partyId, "workEffortId" : workEffortId], null, false) + workEffortPartyAssignment = from("WorkEffortPartyAssignment").where("partyId", userLogin.partyId, "workEffortId", workEffortId).queryList(); if (workEffortPartyAssignment) { ismember = true; }