Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Mon Dec 1 10:16:27 2014 @@ -138,7 +138,7 @@ public class OagisShipmentServices { // before getting into this check to see if we've tried once and had an error, if so set isErrorRetry even if it wasn't passed in GenericValue previousOagisMessageInfo = null; try { - previousOagisMessageInfo = delegator.findOne("OagisMessageInfo", omiPkMap, false); + previousOagisMessageInfo = EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne(); } catch (GenericEntityException e) { String errMsg = "Error getting OagisMessageInfo from database for shipment ID [" + shipmentId + "] message ID [" + omiPkMap + "]: " + e.toString(); Debug.logInfo(e, errMsg, module); @@ -310,7 +310,7 @@ public class OagisShipmentServices { } if (UtilValidate.isEmpty(shipmentItemList)) { - shipmentItemList = delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", shipmentId, "productId",productId), null, false); + shipmentItemList = EntityQuery.use(delegator).from("ShipmentItem").where("shipmentId", shipmentId, "productId",productId).queryList(); if (UtilValidate.isEmpty(shipmentItemList)) { String errMsg = "Could not find Shipment Item for Shipment with ID [" + shipmentId + "] and Product with ID [" + productId + "]."; errorMapList.add(UtilMisc.<String, String>toMap("reasonCode", "ShipmentItemForProductNotFound", "description", errMsg)); @@ -324,8 +324,7 @@ public class OagisShipmentServices { if (messageQuantity.intValue() == shipmentItem.getDouble("quantity").intValue()) { // see if there is an ItemIssuance for this ShipmentItem, ie has already had inventory issued to it //if so then move on, this isn't the ShipmentItem you want - List<GenericValue> itemIssuanceList = delegator.findByAnd("ItemIssuance", - UtilMisc.toMap("shipmentId", shipmentId, "shipmentItemSeqId", shipmentItem.get("shipmentItemSeqId")), null, false); + List<GenericValue> itemIssuanceList = EntityQuery.use(delegator).from("ItemIssuance").where("shipmentId", shipmentId, "shipmentItemSeqId", shipmentItem.get("shipmentItemSeqId")).queryList(); if (itemIssuanceList.size() == 0) { // found a match, set the list to be a new list with just this item and then break shipmentItemList = UtilMisc.toList(shipmentItem); @@ -346,7 +345,7 @@ public class OagisShipmentServices { GenericValue shipmentItem = shipmentItemList.get(0); String shipmentItemSeqId = shipmentItem.getString("shipmentItemSeqId"); - GenericValue orderShipment = EntityUtil.getFirst(delegator.findByAnd("OrderShipment", UtilMisc.toMap("shipmentId", shipmentId, "shipmentItemSeqId", shipmentItemSeqId), null, false)); + GenericValue orderShipment = EntityQuery.use(delegator).from("OrderShipment").where("shipmentId", shipmentId, "shipmentItemSeqId", shipmentItemSeqId).queryFirst(); if (orderShipment == null) { String errMsg = "Could not find Order-Shipment record for ShipmentItem with ID [" + shipmentId + "] and Item Seq-ID [" + shipmentItemSeqId + "]."; errorMapList.add(UtilMisc.<String, String>toMap("reasonCode", "OrderShipmentNotFound", "description", errMsg)); @@ -356,15 +355,13 @@ public class OagisShipmentServices { String orderId = orderShipment.getString("orderId"); String orderItemSeqId = orderShipment.getString("orderItemSeqId"); - GenericValue product = delegator.findOne("Product",UtilMisc.toMap("productId", productId), false); - String requireInventory = product.getString("requireInventory"); + String requireInventory = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne().getString("requireInventory"); if (requireInventory == null) { requireInventory = "N"; } // NOTE: there could be more than one reservation record for a given shipment item? for example if there wasn't enough quantity in one inventory item and reservations on two were needed - List<GenericValue> orderItemShipGrpInvReservationList = delegator.findByAnd("OrderItemShipGrpInvRes", - UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId,"shipGroupSeqId",shipGroupSeqId), null, false); + List<GenericValue> orderItemShipGrpInvReservationList = EntityQuery.use(delegator).from("OrderItemShipGrpInvRes").where("orderId", orderId, "orderItemSeqId", orderItemSeqId,"shipGroupSeqId",shipGroupSeqId).queryList(); // find the total quantity for all reservations int totalReserved = 0; @@ -451,9 +448,8 @@ public class OagisShipmentServices { Set<String> productIdSet = ProductWorker.getRefurbishedProductIdSet(productId, delegator); productIdSet.add(productId); - EntityCondition bySerialNumberCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNumber), - EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet)); - List<GenericValue> inventoryItemsBySerialNumber = delegator.findList("InventoryItem", bySerialNumberCondition, null, null, null, false); + List<GenericValue> inventoryItemsBySerialNumber = EntityQuery.use(delegator).from("InventoryItem").where(EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNumber), + EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet))).queryList(); if (OagisServices.requireSerialNumberExist.booleanValue()) { if (inventoryItemsBySerialNumber.size() == 0) { String errMsg = "Referenced serial numbers must already exist, but serial number [" + serialNumber + "] was not found. Product ID(s) considered are: " + productIdSet; @@ -503,13 +499,12 @@ public class OagisShipmentServices { // NOTE ON THIS DEJ20070906: this is actually really bad because it implies the shipment //has been split and that isn't really allowed; maybe better to return an error! - List<GenericValue> shipmentItemList = delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", shipmentId), null, false); + List<GenericValue> shipmentItemList = EntityQuery.use(delegator).from("ShipmentItem").where("shipmentId", shipmentId).queryList(); for (GenericValue shipmentItem : shipmentItemList) { int shipmentItemQuantity = shipmentItem.getDouble("quantity").intValue(); int totalItemIssuanceQuantity = 0; - List<GenericValue> itemIssuanceList = delegator.findByAnd("ItemIssuance", UtilMisc.toMap("shipmentId", shipmentId, "shipmentItemSeqId", - shipmentItem.get("shipmentItemSeqId")), null, false); + List<GenericValue> itemIssuanceList = EntityQuery.use(delegator).from("ItemIssuance").where("shipmentId", shipmentId, "shipmentItemSeqId", shipmentItem.get("shipmentItemSeqId")).queryList(); for (GenericValue itemIssuance : itemIssuanceList) { totalItemIssuanceQuantity += itemIssuance.getDouble("quantity").intValue(); } @@ -704,8 +699,7 @@ public class OagisShipmentServices { try { // see if there are any OagisMessageInfo for this order that are in the OAGMP_OGEN_SUCCESS or OAGMP_SENT statuses, if so don't send again; these need to be manually reviewed before resending to avoid accidental duplicate messages - List<GenericValue> previousOagisMessageInfoList = delegator.findByAnd("OagisMessageInfo", - UtilMisc.toMap("orderId", orderId, "task", task, "component", component), null, false); + List<GenericValue> previousOagisMessageInfoList = EntityQuery.use(delegator).from("OagisMessageInfo").where("orderId", orderId, "task", task, "component", component).queryList(); if (EntityUtil.filterByAnd(previousOagisMessageInfoList, UtilMisc.toMap("processingStatusId", "OAGMP_OGEN_SUCCESS")).size() > 0) { // this isn't really an error, just a failed constraint so return success return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "OagisFoundExistingMessage", UtilMisc.toMap("orderId", orderId), locale) + EntityUtil.filterByAnd(previousOagisMessageInfoList, UtilMisc.toMap("processingStatusId", "OAGMP_OGEN_SUCCESS"))); @@ -792,8 +786,7 @@ public class OagisShipmentServices { EntityCondition.makeCondition("primaryOrderId", EntityOperator.EQUALS, orderId), EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_CANCELLED") ), EntityOperator.AND); - List<GenericValue> shipmentList = delegator.findList("Shipment", findShipmentCondition, null, null, null, false); - GenericValue shipment = EntityUtil.getFirst(shipmentList); + GenericValue shipment = EntityQuery.use(delegator).from("Shipment").where(findShipmentCondition).queryFirst(); if (shipment != null) { // if picked, packed, shipped, delivered then complain, no reason to process the shipment! @@ -809,7 +802,7 @@ public class OagisShipmentServices { } bodyParameters.put("shipment", shipment); - List<GenericValue> shipmentItems = delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", shipmentId), null, false); + List<GenericValue> shipmentItems = EntityQuery.use(delegator).from("ShipmentItem").where("shipmentId", shipmentId).queryList(); bodyParameters.put("shipmentItems", shipmentItems); GenericValue address = EntityUtil.getFirst(orderReadHelper.getShippingLocations()); @@ -824,7 +817,7 @@ public class OagisShipmentServices { } bodyParameters.put("telecomNumber", telecomNumber); - orderItemShipGroup = EntityUtil.getFirst(delegator.findByAnd("OrderItemShipGroup", UtilMisc.toMap("orderId", orderId), null, false)); + orderItemShipGroup = EntityQuery.use(delegator).from("OrderItemShipGroup").where("orderId", orderId).queryFirst(); bodyParameters.put("orderItemShipGroup", orderItemShipGroup); Set<String> correspondingPoIdSet = FastSet.newInstance(); @@ -842,13 +835,13 @@ public class OagisShipmentServices { bodyParameters.put("externalIdSet", externalIdSet); } // Check if order was a return replacement order (associated with return) - GenericValue returnItemResponse = EntityUtil.getFirst(delegator.findByAnd("ReturnItemResponse", UtilMisc.toMap("replacementOrderId", orderId), null, false)); + GenericValue returnItemResponse = EntityQuery.use(delegator).from("ReturnItemResponse").where("replacementOrderId", orderId).queryFirst(); if (returnItemResponse != null) { boolean includeReturnLabel = false; // Get the associated return Id (replaceReturnId) String returnItemResponseId = returnItemResponse.getString("returnItemResponseId"); - List<GenericValue> returnItemList = delegator.findByAnd("ReturnItem", UtilMisc.toMap("returnItemResponseId", returnItemResponseId), null, false); + List<GenericValue> returnItemList = EntityQuery.use(delegator).from("ReturnItem").where("returnItemResponseId", returnItemResponseId).queryList(); GenericValue firstReturnItem = EntityUtil.getFirst(returnItemList); if (firstReturnItem != null) { bodyParameters.put("replacementReturnId", firstReturnItem.getString("returnId")); @@ -873,8 +866,7 @@ public class OagisShipmentServices { // tracking shipper account, other Party info String partyId = shipment.getString("partyIdTo"); bodyParameters.put("partyNameView", EntityQuery.use(delegator).from("PartyNameView").where("partyId", partyId).queryOne()); - List<GenericValue> partyCarrierAccounts = delegator.findByAnd("PartyCarrierAccount", UtilMisc.toMap("partyId", partyId), null, false); - partyCarrierAccounts = EntityUtil.filterByDate(partyCarrierAccounts); + List<GenericValue> partyCarrierAccounts = EntityQuery.use(delegator).from("PartyCarrierAccount").where("partyId", partyId).filterByDate().queryList(); if (partyCarrierAccounts != null) { for (GenericValue partyCarrierAccount : partyCarrierAccounts) { String carrierPartyId = partyCarrierAccount.getString("carrierPartyId"); @@ -947,7 +939,7 @@ public class OagisShipmentServices { if (omiPkMap != null) { try { // only do this if there is a record already in place - if (delegator.findOne("OagisMessageInfo", omiPkMap, false) == null) { + if (EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne() == null) { return ServiceUtil.returnError(errMsg); } @@ -1021,8 +1013,7 @@ public class OagisShipmentServices { try { // see if there are any OagisMessageInfo for this order that are in the OAGMP_OGEN_SUCCESS or OAGMP_SENT statuses, if so don't send again; these need to be manually reviewed before resending to avoid accidental duplicate messages - List<GenericValue> previousOagisMessageInfoList = delegator.findByAnd("OagisMessageInfo", - UtilMisc.toMap("returnId", returnId, "task", task, "component", component), null, false); + List<GenericValue> previousOagisMessageInfoList = EntityQuery.use(delegator).from("OagisMessageInfo").where("returnId", returnId, "task", task, "component", component).queryList(); if (EntityUtil.filterByAnd(previousOagisMessageInfoList, UtilMisc.toMap("processingStatusId", "OAGMP_OGEN_SUCCESS")).size() > 0) { // this isn't really an error, just a failed constraint so return success return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "OagisFoundExistingMessageForReturn", UtilMisc.toMap("returnId", returnId), locale) + EntityUtil.filterByAnd(previousOagisMessageInfoList, UtilMisc.toMap("processingStatusId", "OAGMP_OGEN_SUCCESS"))); @@ -1041,7 +1032,7 @@ public class OagisShipmentServices { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "OagisReturnIdNotInAcceptedStatus", UtilMisc.toMap("returnId", returnId), locale)); } - List<GenericValue> returnItems = delegator.findByAnd("ReturnItem", UtilMisc.toMap("returnId", returnId), null, false); + List<GenericValue> returnItems = EntityQuery.use(delegator).from("ReturnItem").where("returnId", returnId).queryList(); bodyParameters.put("returnItems", returnItems); orderId = EntityUtil.getFirst(returnItems).getString("orderId"); @@ -1103,9 +1094,9 @@ public class OagisShipmentServices { GenericValue orderItem = returnItem.getRelatedOne("OrderItem", false); if (orderItem != null) { if (orderItem.getDouble("quantity").doubleValue() == itemQty) { - List<GenericValue> itemIssuanceAndInventoryItemList = delegator.findByAnd("ItemIssuanceAndInventoryItem", - UtilMisc.toMap("orderId", orderItem.get("orderId"), "orderItemSeqId", orderItem.get("orderItemSeqId"), - "inventoryItemTypeId", "SERIALIZED_INV_ITEM"), null, false); + List<GenericValue> itemIssuanceAndInventoryItemList = EntityQuery.use(delegator).from("ItemIssuanceAndInventoryItem") + .where("orderId", orderItem.get("orderId"), "orderItemSeqId", orderItem.get("orderItemSeqId"), "inventoryItemTypeId", "SERIALIZED_INV_ITEM") + .queryList(); if (itemIssuanceAndInventoryItemList.size() == itemQty) { List<String> serialNumberList = FastList.newInstance(); serialNumberListByReturnItemSeqIdMap.put(returnItem.getString("returnItemSeqId"), serialNumberList); @@ -1190,7 +1181,7 @@ public class OagisShipmentServices { if (omiPkMap != null) { try { // only do this if there is a record already in place - if (delegator.findOne("OagisMessageInfo", omiPkMap, false) == null) { + if (EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne() == null) { return ServiceUtil.returnError(errMsg); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/guiapp/xui/XuiSession.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/guiapp/xui/XuiSession.java?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/guiapp/xui/XuiSession.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/guiapp/xui/XuiSession.java Mon Dec 1 10:16:27 2014 @@ -32,6 +32,7 @@ import org.ofbiz.webapp.control.LoginWor import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; @@ -160,7 +161,7 @@ public class XuiSession { String partyId = userLogin.getString("partyId"); GenericValue partyRole = null; try { - partyRole = delegator.findOne("PartyRole", false, "partyId", partyId, "roleTypeId", roleTypeId); + partyRole = EntityQuery.use(delegator).from("PartyRole").where("partyId", partyId, "roleTypeId", roleTypeId).queryOne(); } catch (GenericEntityException e) { Debug.logError(e, module); return false; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Mon Dec 1 10:16:27 2014 @@ -1167,14 +1167,13 @@ public class PosTransaction implements S public GenericValue getTerminalState() { Delegator delegator = session.getDelegator(); - List<GenericValue> states = null; + GenericValue state = null; try { - states = delegator.findByAnd("PosTerminalState", UtilMisc.toMap("posTerminalId", this.getTerminalId()), null, false); + state = EntityQuery.use(delegator).from("PosTerminalState").where("posTerminalId", this.getTerminalId()).filterByDate(UtilDateTime.nowTimestamp(), "openedDate", "closedDate").queryFirst(); } catch (GenericEntityException e) { Debug.logError(e, module); } - states = EntityUtil.filterByDate(states, UtilDateTime.nowTimestamp(), "openedDate", "closedDate", true); - return EntityUtil.getFirst(states); + return state; } public void setPrintWriter(PrintWriter writer) { @@ -1306,7 +1305,7 @@ public class PosTransaction implements S List<GenericValue> shoppingLists = null; Delegator delegator = this.session.getDelegator(); try { - shoppingLists = delegator.findList("ShoppingList", null, null, null, null, false); + shoppingLists = EntityQuery.use(delegator).from("ShoppingList").queryList(); } catch (GenericEntityException e) { Debug.logError(e, module); return null; @@ -1656,9 +1655,14 @@ public class PosTransaction implements S try { // set distinct on so we only get one row per person - EntityFindOptions findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, -1, maxRows, true); // using list iterator - EntityListIterator pli = delegator.findListIteratorByCondition(dynamicView, mainCond, null, fieldsToSelect, orderBy, findOpts); + EntityListIterator pli = EntityQuery.use(delegator).select(UtilMisc.toSet(fieldsToSelect)) + .from(dynamicView).where(mainCond) + .cursorScrollInsensitive() + .fetchSize(-1) + .maxRows(maxRows) + .cache(true) + .queryIterator(); // get the partial list for this page partyList = pli.getPartialList(1, maxRows); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java Mon Dec 1 10:16:27 2014 @@ -45,6 +45,7 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.transaction.GenericTransactionException; import org.ofbiz.entity.transaction.TransactionUtil; import org.ofbiz.entity.util.EntityListIterator; +import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.guiapp.xui.XuiSession; import org.ofbiz.pos.PosTransaction; import org.ofbiz.pos.adaptor.SyncCallbackAdaptor; @@ -485,12 +486,10 @@ public class ManagerEvents { beganTransaction = TransactionUtil.begin(); Delegator delegator = pos.getSession().getDelegator(); - List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("originFacilityId", EntityOperator.EQUALS, trans.getFacilityId()), - EntityCondition.makeCondition("terminalId", EntityOperator.EQUALS, trans.getTerminalId())); EntityListIterator eli = null; try { - eli = delegator.find("OrderHeaderAndPaymentPref", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, null, null, null); + eli = EntityQuery.use(delegator).from("OrderHeaderAndPaymentPref").where("originFacilityId", trans.getFacilityId(), "terminalId", trans.getTerminalId()).queryIterator(); } catch (GenericEntityException e) { Debug.logError(e, module); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java Mon Dec 1 10:16:27 2014 @@ -28,6 +28,7 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityQuery; public class Various { @@ -92,7 +93,7 @@ public class Various { double actualHours = 0.00; if (timesheetId != null) { try { - List<GenericValue> actuals = delegator.findByAnd("TimeEntry", UtilMisc.toMap("timesheetId", timesheetId), null, false); + List<GenericValue> actuals = EntityQuery.use(delegator).from("TimeEntry").where("timesheetId", timesheetId).queryList(); if (actuals.size() > 0) { for (GenericValue actual : actuals) { Double hour = (Double) actual.get("hours"); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/widget/ResourceScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/widget/ResourceScreens.xml?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/widget/ResourceScreens.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/projectmgr/widget/ResourceScreens.xml Mon Dec 1 10:16:27 2014 @@ -78,7 +78,7 @@ under the License. <set field="titleProperty" value="PartyProfile"/> <set field="headerItem" value="find"/> <set field="labelTitleProperty" value="PartyTaxAuthInfos"/> - <set field="layoutSettings.javaScripts[]" value="/partymgr/js/PartyProfileContent.js" global="true"/> + <set field="layoutSettings.javaScripts[]" value="/partymgr/static/PartyProfileContent.js" global="true"/> <script location="component://party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/> <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetUserLoginPrimaryEmail.groovy"/> <entity-condition entity-name="RoleTypeAndParty" list="partyRoles"> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java Mon Dec 1 10:16:27 2014 @@ -44,6 +44,7 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.condition.EntityConditionList; import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; +import org.ofbiz.entity.util.EntityQuery; /** * ScrumEvents - Check The Warning Message. @@ -69,9 +70,9 @@ public class ScrumEvents { // should be scrum team or scrum master. EntityConditionList<EntityExpr> exprOrs = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "SCRUM_TEAM"), EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "SCRUM_MASTER")), EntityOperator.OR); EntityConditionList<EntityCondition> exprAnds = EntityCondition.makeCondition(UtilMisc.toList(exprOrs, EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)), EntityOperator.AND); - List<GenericValue> partyRoleList = delegator.findList("PartyRole", exprAnds, null, null, null, false); + List<GenericValue> partyRoleList = EntityQuery.use(delegator).from("PartyRole").where(exprAnds).queryList(); if (UtilValidate.isNotEmpty(partyRoleList)) { - List<GenericValue> timesheetList = delegator.findByAnd("Timesheet", UtilMisc.toMap("partyId", partyId, "statusId", "TIMESHEET_IN_PROCESS"), null, true); + List<GenericValue> timesheetList = EntityQuery.use(delegator).from("Timesheet").where("partyId", partyId, "statusId", "TIMESHEET_IN_PROCESS").cache(true).queryList(); if (UtilValidate.isNotEmpty(timesheetList)) { for (GenericValue timesheetMap : timesheetList) { String timesheetId = timesheetMap.getString("timesheetId"); @@ -85,7 +86,7 @@ public class ScrumEvents { //check time entry List<GenericValue> timeEntryList = timesheetMap.getRelated("TimeEntry", UtilMisc.toMap("partyId", partyId, "timesheetId",timesheetId, "fromDate",realTimeDate), null, false); //check EmplLeave - List<GenericValue> emplLeaveList = delegator.findByAnd("EmplLeave", UtilMisc.toMap("partyId", partyId, "fromDate", realTimeDate), null, true); + List<GenericValue> emplLeaveList = EntityQuery.use(delegator).from("EmplLeave").where("partyId", partyId, "fromDate", realTimeDate).cache(true).queryList(); if (UtilValidate.isEmpty(timeEntryList) && UtilValidate.isEmpty(emplLeaveList)) { Map<String, Object> noEntryMap = FastMap.newInstance(); noEntryMap.put("timesheetId", timesheetId); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java Mon Dec 1 10:16:27 2014 @@ -79,8 +79,7 @@ public class ScrumServices { communicationEventProduct.create(); } try { - List<GenericValue> productRoleList = delegator.findByAnd("ProductRole", UtilMisc.toMap("productId",productId, "partyId", communicationEvent.getString("partyIdFrom"), "roleTypeId","PRODUCT_OWNER"), null, false); - GenericValue productRoleMap = EntityUtil.getFirst(productRoleList); + GenericValue productRoleMap = EntityQuery.use(delegator).from("ProductRole").where("productId",productId, "partyId", communicationEvent.getString("partyIdFrom"), "roleTypeId","PRODUCT_OWNER").queryFirst(); GenericValue userLogin = (GenericValue) context.get("userLogin"); // also close the incoming communication event if (UtilValidate.isNotEmpty(productRoleMap)) { @@ -206,7 +205,7 @@ public class ScrumServices { Debug.logInfo("Revision Link ============== >>>>>>>>>>> "+ revisionLink, module); if (UtilValidate.isNotEmpty(taskId)) { String version = "R" + i; - List <GenericValue> workeffContentList = delegator.findByAnd("WorkEffortAndContentDataResource", UtilMisc.toMap("contentName",version.trim() ,"drObjectInfo", revisionLink.trim()), null, false); + List <GenericValue> workeffContentList = EntityQuery.use(delegator).from("WorkEffortAndContentDataResource").where("contentName",version.trim() ,"drObjectInfo", revisionLink.trim()).queryList(); List<EntityCondition> exprsAnd = FastList.newInstance(); exprsAnd.add(EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, taskId)); @@ -217,7 +216,7 @@ public class ScrumServices { exprsOr.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "SCRUM_TASK_INST")); exprsAnd.add(EntityCondition.makeCondition(exprsOr, EntityOperator.OR)); - List<GenericValue> workEffortList = delegator.findList("WorkEffort", EntityCondition.makeCondition(exprsAnd, EntityOperator.AND), null, null, null, false); + List<GenericValue> workEffortList = EntityQuery.use(delegator).from("WorkEffort").where(exprsAnd).queryList(); if (UtilValidate.isEmpty(workeffContentList) && UtilValidate.isNotEmpty(workEffortList)) { Map<String, Object> inputMap = FastMap.newInstance(); inputMap.put("taskId", taskId); @@ -267,7 +266,7 @@ public class ScrumServices { exprsAnd.add(EntityCondition.makeCondition("workEffortContentTypeId", EntityOperator.EQUALS, "TASK_SUB_INFO")); exprsAnd.add(EntityCondition.makeCondition("contentTypeId", EntityOperator.EQUALS, "DOCUMENT")); exprsAnd.add(EntityCondition.makeCondition("drObjectInfo", EntityOperator.LIKE, revisionLink + "%")); - List<GenericValue> workEffortDataResourceList = delegator.findList("WorkEffortAndContentDataResource", EntityCondition.makeCondition(exprsAnd, EntityOperator.AND), null, null, null, false); + List<GenericValue> workEffortDataResourceList = EntityQuery.use(delegator).from("WorkEffortAndContentDataResource").where(exprsAnd).queryList(); if (UtilValidate.isNotEmpty(workEffortDataResourceList)) { Debug.logInfo("Total Content Size ============== >>>>>>>>>>> "+ workEffortDataResourceList.size(), module); Set<String> keys = FastSet.newInstance(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/widget/ResourceScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/widget/ResourceScreens.xml?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/widget/ResourceScreens.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/scrum/widget/ResourceScreens.xml Mon Dec 1 10:16:27 2014 @@ -94,7 +94,7 @@ under the License. <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/> <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/control.progress_bar.js" global="true"/> <set field="layoutSettings.styleSheets[]" value="/images/prototypejs/progress_bar.css" global="true"/> - <set field="layoutSettings.javaScripts[]" value="/partymgr/js/PartyProfileContent.js" global="true"/> + <set field="layoutSettings.javaScripts[]" value="/partymgr/static/PartyProfileContent.js" global="true"/> <script location="component://party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/> </actions> <widgets> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/webpos/data/DemoPosData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/webpos/data/DemoPosData.xml?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/webpos/data/DemoPosData.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/webpos/data/DemoPosData.xml Mon Dec 1 10:16:27 2014 @@ -39,7 +39,7 @@ under the License. <ProductStoreShipmentMeth productStoreShipMethId="9111" productStoreId="9100" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_DAY" sequenceNumber="12"/> <ProductStoreShipmentMeth productStoreShipMethId="9112" productStoreId="9100" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_PM" sequenceNumber="13"/> <ProductStoreShipmentMeth productStoreShipMethId="9113" productStoreId="9100" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="SECOND_DAY" sequenceNumber="14"/> - <ProductStoreShipmentMeth productStoreShipMethId="9114" productStoreId="9100" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS" sequenceNumber="15"/> + <ProductStoreShipmentMeth productStoreShipMethId="9114" productStoreId="9100" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS_SAVER" sequenceNumber="15"/> <ProductStoreShipmentMeth productStoreShipMethId="9115" productStoreId="9100" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="16"/> <ProductStoreShipmentMeth productStoreShipMethId="9116" productStoreId="9100" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND_HOME" sequenceNumber="17"/> @@ -68,7 +68,7 @@ under the License. <ShipmentCostEstimate productStoreId="9100" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="19204" shipmentMethodTypeId="NEXT_DAY" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/> <ShipmentCostEstimate productStoreId="9100" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="19205" shipmentMethodTypeId="NEXT_PM" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/> <ShipmentCostEstimate productStoreId="9100" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="19206" shipmentMethodTypeId="SECOND_DAY" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/> - <ShipmentCostEstimate productStoreId="9100" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="19207" shipmentMethodTypeId="EXPRESS" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/> + <ShipmentCostEstimate productStoreId="9100" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="19207" shipmentMethodTypeId="EXPRESS_SAVER" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/> <ShipmentCostEstimate productStoreId="9100" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="19208" shipmentMethodTypeId="GROUND" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/> <ShipmentCostEstimate productStoreId="9100" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="19209" shipmentMethodTypeId="GROUND_HOME" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/> </entity-engine-xml> \ No newline at end of file Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/webpos/src/org/ofbiz/webpos/search/WebPosSearch.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/webpos/src/org/ofbiz/webpos/search/WebPosSearch.java?rev=1642661&r1=1642660&r2=1642661&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/webpos/src/org/ofbiz/webpos/search/WebPosSearch.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/webpos/src/org/ofbiz/webpos/search/WebPosSearch.java Mon Dec 1 10:16:27 2014 @@ -34,6 +34,7 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.model.DynamicViewEntity; import org.ofbiz.entity.model.ModelKeyMap; import org.ofbiz.entity.util.EntityListIterator; +import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.ServiceUtil; @@ -52,16 +53,8 @@ public class WebPosSearch { List<EntityCondition> andExprs = FastList.newInstance(); EntityCondition mainCond = null; - List<String> orderBy = FastList.newInstance(); - List<String> fieldsToSelect = FastList.newInstance(); String entityName = "Product"; - fieldsToSelect.add("productId"); - fieldsToSelect.add("productName"); - fieldsToSelect.add("description"); - orderBy.add("productName"); - orderBy.add("description"); - // search by product name if (UtilValidate.isNotEmpty(searchByProductName)) { searchByProductName = searchByProductName.toUpperCase().trim(); @@ -84,7 +77,7 @@ public class WebPosSearch { mainCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); List<GenericValue> products = null; try { - products = delegator.findList(entityName, mainCond, null, orderBy, null, false); + products = EntityQuery.use(delegator).from(entityName).where(mainCond).orderBy("productName", "description").queryList(); } catch (GenericEntityException e) { Debug.logError(e, module); } |
Free forum by Nabble | Edit this page |