svn commit: r1649482 [10/26] - in /ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23: ./ applications/accounting/src/org/ofbiz/accounting/invoice/ applications/accounting/src/org/ofbiz/accounting/payment/ applications/accounting/src/org/ofbiz/ac...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1649482 [10/26] - in /ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23: ./ applications/accounting/src/org/ofbiz/accounting/invoice/ applications/accounting/src/org/ofbiz/accounting/payment/ applications/accounting/src/org/ofbiz/ac...

jleroux@apache.org
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.groovy Mon Jan  5 08:50:30 2015
@@ -27,7 +27,7 @@ if (!shipmentId) {
 
 shipment = null;
 if (shipmentId) {
-    shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false);
+    shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
 }
 
 if (shipment) {
@@ -51,21 +51,21 @@ if (shipment) {
             shipmentRouteSegmentData.currencyUom = shipmentRouteSegment.getRelatedOne("CurrencyUom", false);
             shipmentRouteSegmentData.billingWeightUom = shipmentRouteSegment.getRelatedOne("BillingWeightUom", false);
             if (shipmentRouteSegment.carrierServiceStatusId) {
-                shipmentRouteSegmentData.carrierServiceStatusValidChangeToDetails = delegator.findList("StatusValidChangeToDetail", EntityCondition.makeCondition([statusId : shipmentRouteSegment.carrierServiceStatusId]), null, ['sequenceId'], null, false);
+                shipmentRouteSegmentData.carrierServiceStatusValidChangeToDetails = from("StatusValidChangeToDetail").where("statusId", shipmentRouteSegment.carrierServiceStatusId).orderBy("sequenceId").queryList();
             } else {
-                shipmentRouteSegmentData.carrierServiceStatusValidChangeToDetails = delegator.findList("StatusValidChangeToDetail", EntityCondition.makeCondition([statusId : 'SHRSCS_NOT_STARTED']), null, ['sequenceId'], null, false);
+                shipmentRouteSegmentData.carrierServiceStatusValidChangeToDetails = from("StatusValidChangeToDetail").where("statusId", "SHRSCS_NOT_STARTED").orderBy("sequenceId").queryList();
             }
             shipmentRouteSegmentDatas.add(shipmentRouteSegmentData);
         }
     }
 
     shipmentPackages = shipment.getRelated("ShipmentPackage", null, ['shipmentPackageSeqId'], false);
-    facilities = delegator.findList("Facility", null, null, ['facilityName'], null, false);
-    shipmentMethodTypes = delegator.findList("ShipmentMethodType", null, null, ['description'], null, false);
-    weightUoms = delegator.findList("Uom", EntityCondition.makeCondition([uomTypeId : 'WEIGHT_MEASURE']), null, null, null, false);
-    currencyUoms = delegator.findList("Uom", EntityCondition.makeCondition([uomTypeId : 'CURRENCY_MEASURE']), null, null, null, false);
+    facilities = from("Facility").orderBy("facilityName").queryList();
+    shipmentMethodTypes = from("ShipmentMethodType").orderBy("description").queryList();
+    weightUoms = from("Uom").where("uomTypeId", "WEIGHT_MEASURE").queryList();
+    currencyUoms = from("Uom").where("uomTypeId", "CURRENCY_MEASURE").queryList();
 
-    carrierPartyRoles = delegator.findList("PartyRole", EntityCondition.makeCondition([roleTypeId : 'CARRIER']), null, null, null, false);
+    carrierPartyRoles = from("PartyRole").where("roleTypeId", "CARRIER").queryList();
     carrierPartyDatas = [] as LinkedList;
     carrierPartyRoles.each { carrierPartyRole ->
         party = carrierPartyRole.getRelatedOne("Party", false);

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy Mon Jan  5 08:50:30 2015
@@ -59,21 +59,21 @@ if (shipmentTypeId) {
     paramListBuffer.append("&shipmentTypeId=");
     paramListBuffer.append(shipmentTypeId);
     findShipmentExprs.add(EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, shipmentTypeId));
-    currentShipmentType = delegator.findOne("ShipmentType", [shipmentTypeId : shipmentTypeId], true);
+    currentShipmentType = from("ShipmentType").where("shipmentTypeId", shipmentTypeId).cache(true).queryOne();
     context.currentShipmentType = currentShipmentType;
 }
 if (originFacilityId) {
     paramListBuffer.append("&originFacilityId=");
     paramListBuffer.append(originFacilityId);
     findShipmentExprs.add(EntityCondition.makeCondition("originFacilityId", EntityOperator.EQUALS, originFacilityId));
-    currentOriginFacility = delegator.findOne("Facility", [facilityId : originFacilityId], true);
+    currentOriginFacility = from("Facility").where("facilityId", originFacilityId).cache(true).queryOne();
     context.currentOriginFacility = currentOriginFacility;
 }
 if (destinationFacilityId) {
     paramListBuffer.append("&destinationFacilityId=");
     paramListBuffer.append(destinationFacilityId);
     findShipmentExprs.add(EntityCondition.makeCondition("destinationFacilityId", EntityOperator.EQUALS, destinationFacilityId));
-    currentDestinationFacility = delegator.findOne("Facility", [facilityId : destinationFacilityId], true);
+    currentDestinationFacility = from("Facility").where("facilityId", destinationFacilityId).cache(true).queryOne();
     context.currentDestinationFacility = currentDestinationFacility;
 }
 if (statusId) {
@@ -82,7 +82,7 @@ if (statusId) {
     if (!orderReturnValue) {
         findShipmentExprs.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId));
     }
-    currentStatus = delegator.findOne("StatusItem", [statusId : statusId], true);
+    currentStatus = from("StatusItem").where("statusId", statusId).cache(true).queryOne();
     context.currentStatus = currentStatus;
 }
 if (minDate && minDate.length() > 8) {
@@ -117,12 +117,10 @@ if (maxDate && maxDate.length() > 8) {
 if ("Y".equals(lookupFlag)) {
     context.paramList = paramListBuffer.toString();
 
-    findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true);
     mainCond = null;
     if (findShipmentExprs.size() > 0) {
         mainCond = EntityCondition.makeCondition(findShipmentExprs, EntityOperator.AND);
     }
-    orderBy = ['-estimatedShipDate'];
 
     beganTransaction = false;
     try {
@@ -131,11 +129,10 @@ if ("Y".equals(lookupFlag)) {
         // get the indexes for the partial list
         lowIndex = viewIndex * viewSize + 1;
         highIndex = (viewIndex + 1) * viewSize;
-        findOpts.setMaxRows(highIndex);
         
         if (!orderReturnValue) {
             // using list iterator
-            orli = delegator.find("Shipment", mainCond, null, null, orderBy, findOpts);
+            orli = from("Shipment").where(mainCond).orderBy("-estimatedShipDate").cursorScrollInsensitive().distinct().maxRows(highIndex).queryIterator();
     
             shipmentListSize = orli.getResultsSizeAfterPartialList();
             if (highIndex > shipmentListSize) {
@@ -172,7 +169,7 @@ if ("Y".equals(lookupFlag)) {
             OrderReturnViewEntity.addAlias("RH", "entryDate");
             OrderReturnViewEntity.addAlias("RH", "returnStatusId", "statusId", null, null, null, null);
             
-            orderReturnIt = delegator.findListIteratorByCondition(OrderReturnViewEntity, returnCond, null, null, null, null);
+            orderReturnIt = from(OrderReturnViewEntity).where(returnCond).queryList();
             shipmentListSize = orderReturnIt.getResultsSizeAfterPartialList();
             
             if (highIndex > shipmentListSize) {
@@ -211,16 +208,16 @@ if ("Y".equals(lookupFlag)) {
 
 // =============== Prepare the Option Data for the Find Form =================
 
-context.shipmentTypes = delegator.findList("ShipmentType", null, null, ['description'], null, false);
+context.shipmentTypes = from("ShipmentType").orderBy("description").queryList();
 
-context.facilities = delegator.findList("Facility", null, null, ['facilityName'], null, false);
+context.facilities = from("Facility").orderBy("facilityName").queryList();
 
 // since purchase and sales shipments have different status codes, we'll need to make two separate lists
-context.shipmentStatuses = delegator.findList("StatusItem", EntityCondition.makeCondition([statusTypeId : 'SHIPMENT_STATUS']), null, ['sequenceId'], null, false);
-context.purchaseShipmentStatuses = delegator.findList("StatusItem", EntityCondition.makeCondition([statusTypeId : 'PURCH_SHIP_STATUS']), null, ['sequenceId'], null, false);
+context.shipmentStatuses = from("StatusItem").where("statusTypeId", "SHIPMENT_STATUS").orderBy("sequenceId").queryList();
+context.purchaseShipmentStatuses = from("StatusItem").where("statusTypeId", "PURCH_SHIP_STATUS").orderBy("sequenceId").queryList();
 
 /// Get return status lists
-context.returnStatuses = delegator.findList("StatusItem", EntityCondition.makeCondition([statusTypeId : 'ORDER_RETURN_STTS']), null, ['sequenceId'], null, false);
+context.returnStatuses = from("StatusItem").where("statusTypeId", "ORDER_RETURN_STTS").orderBy("sequenceId").queryList();
 
 // create the fromDate for calendar
 fromCal = Calendar.getInstance();

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy Mon Jan  5 08:50:30 2015
@@ -26,7 +26,7 @@ import org.ofbiz.entity.condition.Entity
 
 facilityId = parameters.facilityId;
 if (facilityId) {
-    facility = delegator.findOne("Facility", [facilityId : facilityId], false);
+    facility = from("Facility").where("facilityId", facilityId).queryOne();
     context.facilityId = facilityId;
     context.facility = facility;
 }
@@ -44,9 +44,9 @@ context.shipmentId = shipmentId;
 invoiceIds = null;
 if (shipmentId) {
     // Get the primaryOrderId from the shipment
-    shipment = delegator.findOne("Shipment",  [shipmentId : shipmentId], false);
+    shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
     if (shipment && shipment.primaryOrderId) {
-        orderItemBillingList = delegator.findList("OrderItemBilling", EntityCondition.makeCondition([orderId : shipment.primaryOrderId]), null, ['invoiceId'], null, false);
+        orderItemBillingList = from("OrderItemBilling").where("orderId", shipment.primaryOrderId).orderBy("invoiceId").queryList();
         invoiceIds = EntityUtil.getFieldListFromEntityList(orderItemBillingList, "invoiceId", true);
         if (invoiceIds) {
             context.invoiceIds = invoiceIds;
@@ -95,7 +95,7 @@ if (!picklistBinId) {
     picklistBinId = packSession.getPicklistBinId();
 }
 if (picklistBinId) {
-    bin = delegator.findOne("PicklistBin", [picklistBinId : picklistBinId], false);
+    bin = from("PicklistBin").where("picklistBinId", picklistBinId).queryOne();
     if (bin) {
         orderId = bin.primaryOrderId;
         shipGroupSeqId = bin.primaryShipGroupSeqId;
@@ -115,7 +115,7 @@ packSession.setFacilityId(facilityId);
 if (invoiceIds) {
     orderId = null;
 }
-shipment = EntityUtil.getFirst(delegator.findByAnd("Shipment", [primaryOrderId : orderId, statusId : "SHIPMENT_PICKED"], null, false));
+shipment = from("Shipment").where("primaryOrderId", orderId, "statusId", "SHIPMENT_PICKED").queryFirst();
 context.shipment = shipment;
 
 context.packingSession = packSession;
@@ -125,7 +125,7 @@ context.picklistBinId = picklistBinId;
 
 // grab the order information
 if (orderId) {
-    orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
+    orderHeader = from("OrderHeader").where("orderId", orderId).queryOne();
     if (orderHeader) {
         OrderReadHelper orh = new OrderReadHelper(orderHeader);
         context.orderId = orderId;
@@ -134,7 +134,7 @@ if (orderId) {
         orderItemShipGroup = orh.getOrderItemShipGroup(shipGroupSeqId);
         context.orderItemShipGroup = orderItemShipGroup;
         carrierPartyId = orderItemShipGroup.carrierPartyId;
-            carrierShipmentBoxTypes = delegator.findList("CarrierShipmentBoxType", EntityCondition.makeCondition([partyId : carrierPartyId]), null, null, null, false);
+            carrierShipmentBoxTypes = from("CarrierShipmentBoxType").where("partyId", carrierPartyId).queryList();
             if (carrierShipmentBoxTypes) {
             context.carrierShipmentBoxTypes = carrierShipmentBoxTypes;
             }
@@ -146,7 +146,7 @@ if (orderId) {
                     // Generate the shipment cost estimate for the ship group
                     productStoreId = orh.getProductStoreId();
                     shippableItemInfo = orh.getOrderItemAndShipGroupAssoc(shipGroupSeqId);
-                    shippableItems = delegator.findList("OrderItemAndShipGrpInvResAndItemSum", EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId : shipGroupSeqId]), null, null, null, false);
+                    shippableItems = from("OrderItemAndShipGrpInvResAndItemSum").where("orderId", orderId, "shipGroupSeqId", shipGroupSeqId).queryList();
                     shippableTotal = new Double(orh.getShippableTotal(shipGroupSeqId).doubleValue());
                     shippableWeight = new Double(orh.getShippableWeight(shipGroupSeqId).doubleValue());
                     shippableQuantity = new Double(orh.getShippableQuantity(shipGroupSeqId).doubleValue());

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy Mon Jan  5 08:50:30 2015
@@ -48,15 +48,16 @@ shipmentItems.each { shipmentItem ->
 }
 
 // Add in the total of all previously shipped items
-previousShipmentIter = delegator.find("Shipment",
-        EntityCondition.makeCondition(
-            UtilMisc.toList(
-                EntityCondition.makeCondition("primaryOrderId", EntityOperator.EQUALS, shipment.getString("primaryOrderId")),
-                EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, "SALES_SHIPMENT"),
-                EntityCondition.makeCondition("createdDate", EntityOperator.LESS_THAN_EQUAL_TO,
-                        ObjectType.simpleTypeConvert(shipment.getString("createdDate"), "Timestamp", null, null))
-            ),
-        EntityOperator.AND), null, null, null, null);
+previousShipmentIter = from("Shipment")
+                            .where(EntityCondition.makeCondition(
+                                            UtilMisc.toList(
+                                                EntityCondition.makeCondition("primaryOrderId", EntityOperator.EQUALS, shipment.getString("primaryOrderId")),
+                                                EntityCondition.makeCondition("shipmentTypeId", EntityOperator.EQUALS, "SALES_SHIPMENT"),
+                                                EntityCondition.makeCondition("createdDate", EntityOperator.LESS_THAN_EQUAL_TO,
+                                                    ObjectType.simpleTypeConvert(shipment.getString("createdDate"), "Timestamp", null, null))
+                                            ),
+                                        EntityOperator.AND))
+                            .queryIterator();
 
 while (previousShipmentItem = previousShipmentIter.next()) {
     if (!previousShipmentItem.shipmentId.equals(shipment.shipmentId)) {

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PrintPickSheets.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PrintPickSheets.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PrintPickSheets.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/PrintPickSheets.groovy Mon Jan  5 08:50:30 2015
@@ -59,13 +59,13 @@ if (toPrintOrders) {
                     orderMap.orderId = orderId;
                     orderMap.orderDate = orderHeader.orderDate;
                     billingOrderContactMechs = [];
-                    billingOrderContactMechs = delegator.findByAnd("OrderContactMech", [orderId : orderId, contactMechPurposeTypeId : "BILLING_LOCATION"], null, false);
+                    billingOrderContactMechs = from("OrderContactMech").where("orderId", orderId, "contactMechPurposeTypeId", "BILLING_LOCATION").queryList();
                     if (billingOrderContactMechs.size() > 0) {
                         billingContactMechId = EntityUtil.getFirst(billingOrderContactMechs).contactMechId;
-                        billingAddress = delegator.findOne("PostalAddress", [contactMechId : billingContactMechId], false);
+                        billingAddress = from("PostalAddress").where("contactMechId", billingContactMechId).queryOne();
                     }
-                    shippingContactMechId = EntityUtil.getFirst(delegator.findByAnd("OrderContactMech", [orderId : orderId, contactMechPurposeTypeId : "SHIPPING_LOCATION"], null, false)).contactMechId;
-                    shippingAddress = delegator.findOne("PostalAddress", [contactMechId : shippingContactMechId], false);
+                    shippingContactMechId = from("OrderContactMech").where("orderId", orderId, "contactMechPurposeTypeId", "SHIPPING_LOCATION").queryFirst().contactMechId;
+                    shippingAddress = from("PostalAddress").where("contactMechId", shippingContactMechId).queryOne();
                     orderItemShipGroups.each { orderItemShipGroup ->
                         if (orderItemShipGroup.orderId == orderId) {
                             orderMap.shipmentMethodType = EntityUtil.getFirst(orderItemShipGroup.getRelated("ShipmentMethodType", null, null, false)).description;

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/QuickShipOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/QuickShipOrder.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/QuickShipOrder.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/QuickShipOrder.groovy Mon Jan  5 08:50:30 2015
@@ -23,14 +23,14 @@ import org.ofbiz.entity.util.EntityUtilP
 
 facilityId = parameters.facilityId;
 if (facilityId) {
-    facility = delegator.findOne("Facility", [facilityId : facilityId], false);
+    facility = from("Facility").where("facilityId", facilityId).queryOne();
     context.facilityId = facilityId;
     context.facility = facility;
 }
 
 orderId = parameters.orderId
 if (orderId) {
-    orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
+    orderHeader = from("OrderHeader").where("orderId", orderId).queryOne();
     if (orderHeader) {
         OrderReadHelper orh = new OrderReadHelper(orderHeader);
         context.orderId = orderId;
@@ -43,7 +43,7 @@ if (orderId) {
 
 shipmentId = parameters.shipmentId;
 if (shipmentId) {
-    shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false);
+    shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
     if (shipment) {
         // nuke event message - throws off the flow
         request.setAttribute("_EVENT_MESSAGE_", null);
@@ -65,10 +65,10 @@ if (shipmentId) {
         context.shipment = shipment;
         context.shipmentId = shipmentId;
 
-        weightUoms = delegator.findList("Uom", EntityCondition.makeCondition(['uomTypeId' : 'WEIGHT_MEASURE']), null, ['description'], null, false);
+        weightUoms = from("Uom").where("uomTypeId", "WEIGHT_MEASURE").orderBy("description").queryList();
         defaultWeightUom = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom", delegator);
         if (defaultWeightUom) {
-            defaultWeight = delegator.findOne("Uom", [uomId : defaultWeightUom], false);
+            defaultWeight = from("Uom").where("uomId", defaultWeightUom).queryOne();
             if (defaultWeight) {
                 weightUoms.add(0, defaultWeight);
             }

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy Mon Jan  5 08:50:30 2015
@@ -43,7 +43,7 @@ if (itemQuantitiesToReceive) {
     }
 }
 
-shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false);
+shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
 context.shipment = shipment;
 if (!shipment) {
     return;
@@ -72,7 +72,7 @@ if (!orderId) {
     return;
 }
 
-orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
+orderHeader = from("OrderHeader").where("orderId", orderId).queryOne();
 context.orderHeader = orderHeader;
 if (!orderHeader) {
     return;
@@ -89,7 +89,7 @@ baseCurrencyUomId = null;
 if (facility) {
     owner = facility.getRelatedOne("OwnerParty", false);
     if (owner) {
-        result = dispatcher.runSync("getPartyAccountingPreferences", [organizationPartyId : owner.partyId, userLogin : request.getAttribute("userLogin")]);
+        result = runService('getPartyAccountingPreferences', [organizationPartyId : owner.partyId, userLogin : request.getAttribute("userLogin")]);
         if (!ServiceUtil.isError(result) && result.partyAccountingPreference) {
             ownerAcctgPref = result.partyAccountingPreference;
         }
@@ -99,7 +99,7 @@ if (facility) {
     }
 }
 
-inventoryItemTypes = delegator.findList("InventoryItemType", null, null, null, null, false);
+inventoryItemTypes = from("InventoryItemType").queryList();
 context.inventoryItemTypes = inventoryItemTypes;
 
 // Populate the tracking map with shipment and order IDs
@@ -121,7 +121,7 @@ orderItems.each { orderItemAndShipGroupA
     product = orderItemAndShipGroupAssoc.getRelatedOne("Product", false);
 
     // Get the order item, since the orderItemAndShipGroupAssoc's quantity field is manipulated in some cases
-    orderItem = delegator.findOne("OrderItem", [orderId : orderId, orderItemSeqId : orderItemAndShipGroupAssoc.orderItemSeqId], false);
+    orderItem = from("OrderItem").where("orderId", orderId, "orderItemSeqId", orderItemAndShipGroupAssoc.orderItemSeqId).queryOne();
     orderItemData = [:];
 
     // Get the item's ordered quantity
@@ -137,7 +137,7 @@ orderItems.each { orderItemAndShipGroupA
 
     // Get the item quantity received from all shipments via the ShipmentReceipt entity
     totalReceived = 0.0;
-    receipts = delegator.findList("ShipmentReceipt", EntityCondition.makeCondition([orderId : orderId, orderItemSeqId : orderItem.orderItemSeqId]), null, null, null, false);
+    receipts = from("ShipmentReceipt").where("orderId", orderId, "orderItemSeqId", orderItem.orderItemSeqId).queryList();
     fulfilledReservations = [] as ArrayList;
     if (receipts) {
         receipts.each { rec ->
@@ -150,7 +150,7 @@ orderItems.each { orderItemAndShipGroupA
                 totalReceived += rejected.doubleValue();
             }
             // Get the reservations related to this receipt
-            oisgirs = delegator.findList("OrderItemShipGrpInvRes", EntityCondition.makeCondition([inventoryItemId : rec.inventoryItemId]), null, null, null, false);
+            oisgirs = from("OrderItemShipGrpInvRes").where("inventoryItemId", rec.inventoryItemId).queryList();
             if (oisgirs) {
                 fulfilledReservations.addAll(oisgirs);
             }
@@ -161,7 +161,7 @@ orderItems.each { orderItemAndShipGroupA
     // Update the unit cost with the converted value, if any
     if (baseCurrencyUomId && orderHeader.currencyUom) {
         if (product) {
-            result = dispatcher.runSync("convertUom", [uomId : orderHeader.currencyUom, uomIdTo : baseCurrencyUomId, originalValue : orderItem.unitPrice]);
+            result = runService('convertUom', [uomId : orderHeader.currencyUom, uomIdTo : baseCurrencyUomId, originalValue : orderItem.unitPrice]);
             if (!ServiceUtil.isError(result)) {
                 orderItem.unitPrice = result.convertedValue;
             }
@@ -172,7 +172,7 @@ orderItems.each { orderItemAndShipGroupA
     // TODO: limit to a facility? The shipment destination facility is not necessarily the same facility as the inventory
     conditions = [EntityCondition.makeCondition("productId", EntityOperator.EQUALS, product.productId),
                   EntityCondition.makeCondition("availableToPromiseTotal", EntityOperator.LESS_THAN, BigDecimal.ZERO)];
-    negativeInventoryItems = delegator.findList("InventoryItem",  EntityCondition.makeCondition(conditions, EntityOperator.AND), null, null, null, false);
+    negativeInventoryItems = from("InventoryItem").where(conditions).queryList();
     backOrderedQuantity = 0;
     negativeInventoryItems.each { negativeInventoryItem ->
         backOrderedQuantity += negativeInventoryItem.getDouble("availableToPromiseTotal").doubleValue();
@@ -201,7 +201,7 @@ if (productIdToReceive) {
 
     // If the productId as given isn't found in the order, try any goodIdentifications and use the first match
     if (!candidateOrderItems) {
-        goodIdentifications = delegator.findList("GoodIdentification", EntityCondition.makeCondition([idValue : productIdToReceive]), null, null, null, false);
+        goodIdentifications = from("GoodIdentification").where("idValue", productIdToReceive).queryList();
         if (goodIdentifications) {
             giit = goodIdentifications.iterator();
             while (giit.hasNext()) {

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy Mon Jan  5 08:50:30 2015
@@ -27,12 +27,11 @@ condList = [];
 condList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "ORDER_APPROVED"));
 condList.add(EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER"));
 condList.add(EntityCondition.makeCondition("pickSheetPrintedDate", EntityOperator.NOT_EQUAL, null));
-cond = EntityCondition.makeCondition(condList, EntityOperator.AND);
-orderHeaders = delegator.findList("OrderHeader", cond, null, null, null, false);
+orderHeaders = from("OrderHeader").where(condList).queryList();
 orders = [];
 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'/'K:mm a");
-orderHeaders.each { orderHeader ->
-    itemIssuanceList = delegator.findByAnd("ItemIssuance", [orderId : orderHeader.orderId], null, false);
+orderHeaders.each { orderHeader ->k
+    itemIssuanceList = from("ItemIssuance").where("orderId", orderHeader.orderId).queryList();
     if (itemIssuanceList) {
         orders.add([orderId : orderHeader.orderId, pickSheetPrintedDate : dateFormat.format(orderHeader.pickSheetPrintedDate), isVerified : "Y"]);
     } else {

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ShipmentManifest.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ShipmentManifest.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ShipmentManifest.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ShipmentManifest.groovy Mon Jan  5 08:50:30 2015
@@ -22,7 +22,7 @@ import org.ofbiz.base.util.*
 import org.ofbiz.content.report.*
 
 shipmentId = request.getParameter("shipmentId");
-shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false);
+shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
 
 if (shipment) {
     shipmentPackageRouteSegs = shipment.getRelated("ShipmentPackageRouteSeg", null, ['shipmentRouteSegmentId', 'shipmentPackageSeqId'], false);

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy Mon Jan  5 08:50:30 2015
@@ -39,7 +39,7 @@ context.shipmentId = shipmentId;
 
 if (shipmentId) {
     context.orderId = null;
-    shipment = delegator.findOne("Shipment",  [shipmentId : shipmentId], false);
+    shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
     if (shipment) {
         shipmentItemBillingList = shipment.getRelated("ShipmentItemBilling", null, null, false);
         invoiceIds = EntityUtil.getFieldListFromEntityList(shipmentItemBillingList, "invoiceId", true);
@@ -52,7 +52,7 @@ if (shipmentId) {
 
 facilityId = parameters.facilityId;
 if (facilityId) {
-    facility = delegator.findOne("Facility", [facilityId : facilityId], false);
+    facility = from("Facility").where("facilityId", facilityId).queryOne();
     context.facility = facility;
 }
 verifyPickSession.setFacilityId(facilityId);
@@ -69,7 +69,7 @@ if (orderId && !shipGroupSeqId && orderI
 
 picklistBinId = parameters.picklistBinId;
 if (picklistBinId) {
-    picklistBin = delegator.findOne("PicklistBin", [picklistBinId : picklistBinId], false);
+    picklistBin = from("PicklistBin").where("picklistBinId", picklistBinId).queryOne();
     if (picklistBin) {
         orderId = picklistBin.primaryOrderId;
         shipGroupSeqId = picklistBin.primaryShipGroupSeqId;
@@ -78,7 +78,7 @@ if (picklistBinId) {
 }
 
 if (orderId && !picklistBinId) {
-    picklistBin = EntityUtil.getFirst(delegator.findByAnd("PicklistBin", [primaryOrderId : orderId], null, false));
+    picklistBin = from("PicklistBin").where("primaryOrderId", orderId).queryFirst();
     if (picklistBin) {
         picklistBinId = picklistBin.picklistBinId;
         verifyPickSession.setPicklistBinId(picklistBinId);
@@ -91,7 +91,7 @@ context.picklistBinId = picklistBinId;
 context.isOrderStatusApproved = false;
 
 if (orderId) {
-    orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
+    orderHeader = from("OrderHeader").where("orderId", orderId).queryOne();
     if (orderHeader) {
         OrderReadHelper orh = new OrderReadHelper(orderHeader);
         context.orderId = orderId;
@@ -108,7 +108,7 @@ if (orderId) {
             if (shipGroupSeqId) {
                 productStoreId = orh.getProductStoreId();
                 context.productStoreId = productStoreId;
-                shipments = delegator.findByAnd("Shipment", [primaryOrderId : orderId, statusId : "SHIPMENT_PICKED"], null, false);
+                shipments = from("Shipment").where("primaryOrderId", orderId, "statusId", "SHIPMENT_PICKED").queryList();
                 if (shipments) {
                     request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorAllItemsOfOrderAreAlreadyVerified", [orderId : orderId], locale));
                 }

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ViewShipment.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ViewShipment.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ViewShipment.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/ViewShipment.groovy Mon Jan  5 08:50:30 2015
@@ -23,7 +23,7 @@ shipmentId = parameters.shipmentId;
 if (!shipmentId) {
     shipmentId = request.getAttribute("shipmentId");
 }
-shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false);
+shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
 
 context.shipmentId = shipmentId;
 context.shipment = shipment;
@@ -50,8 +50,7 @@ if (security.hasEntityPermission("FACILI
     if (shipment) {
         if (shipment.primaryOrderId) {
             // allow if userLogin is associated with the primaryOrderId with the SUPPLIER_AGENT roleTypeId
-            orderRoleCheckMap = [orderId : shipment.primaryOrderId, partyId : userLogin.partyId, roleTypeId : 'SUPPLIER_AGENT'];
-            orderRole = delegator.findOne("OrderRole", orderRoleCheckMap, false);
+            orderRole = from("OrderRole").where("orderId", shipment.primaryOrderId, "partyId", userLogin.partyId, "roleTypeId", "SUPPLIER_AGENT").queryOne();
             if (orderRole) {
                 hasPermission = true;
             }

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy Mon Jan  5 08:50:30 2015
@@ -44,26 +44,26 @@ context.showWarningForm = showWarningFor
 orderId = parameters.orderId;
 shipGroupSeqId = parameters.shipGroupSeqId;
 
-shipment = EntityUtil.getFirst(delegator.findByAnd("Shipment", [primaryOrderId : orderId, statusId : "SHIPMENT_PICKED"], null, false));
+shipment = from("Shipment").where("primaryOrderId", orderId, "statusId", "SHIPMENT_PICKED").queryFirst();
 context.shipment = shipment;
 if (shipment) {
-    invoice = EntityUtil.getFirst(delegator.findByAnd("ShipmentItemBilling", [shipmentId : shipment.shipmentId], null, false));
+    invoice = from("ShipmentItemBilling").where("shipmentId", shipment.shipmentId).queryFirst();
     context.invoice = invoice;
 } else {
     context.invoice = null;
 }
 actualCost = null;
 if (shipment) {
-    shipmentRouteSegment = EntityUtil.getFirst(delegator.findByAnd("ShipmentRouteSegment", [shipmentId : shipment.shipmentId], null, false));
+    shipmentRouteSegment = from("ShipmentRouteSegment").where("shipmentId", shipment.shipmentId).queryFirst();
     actualCost = shipmentRouteSegment.actualCost;
     if (actualCost) {
-        context.shipmentPackages = delegator.findByAnd("ShipmentPackage", [shipmentId : shipment.shipmentId], null, false);
+        context.shipmentPackages = from("ShipmentPackage").where("shipmentId", shipment.shipmentId).queryList();
     }
 }
 
 facilityId = parameters.facilityId;
 if (facilityId) {
-    facility = delegator.findOne("Facility", [facilityId : facilityId], false);
+    facility = from("Facility").where("facilityId", facilityId).queryOne();
     context.facility = facility;
 }
 
@@ -77,7 +77,7 @@ if (orderId && !shipGroupSeqId && orderI
 
 picklistBinId = parameters.picklistBinId;
 if (picklistBinId) {
-    picklistBin = delegator.findOne("PicklistBin", [picklistBinId : picklistBinId], false);
+    picklistBin = from("PicklistBin").where("picklistBinId", picklistBinId).queryOne();
     if (picklistBin) {
         orderId = picklistBin.primaryOrderId;
         shipGroupSeqId = picklistBin.primaryShipGroupSeqId;
@@ -96,9 +96,9 @@ if (!shipmentId && shipment) {
 context.shipmentId = shipmentId;
 if (shipmentId) {
     // Get the primaryOrderId from the shipment
-    shipment = delegator.findOne("Shipment",  [shipmentId : shipmentId], false);
+    shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
     if (shipment && shipment.primaryOrderId) {
-        orderItemBillingList = delegator.findList("OrderItemBilling", EntityCondition.makeCondition([orderId : shipment.primaryOrderId]), null, ['invoiceId'], null, false);
+        orderItemBillingList = from("OrderItemBilling").where("orderId", shipment.primaryOrderId).orderBy("invoiceId").queryList();
         invoiceIds = EntityUtil.getFieldListFromEntityList(orderItemBillingList, "invoiceId", true);
         if (invoiceIds) {
             context.invoiceIds = invoiceIds;
@@ -108,7 +108,7 @@ if (shipmentId) {
     if (shipment.statusId && "SHIPMENT_PACKED" == shipment.statusId) {
         orderId = null;
     }
-    shipmentPackageRouteSegs = delegator.findByAnd("ShipmentPackageRouteSeg",  [shipmentId : shipmentId], null, false);
+    shipmentPackageRouteSegs = from("ShipmentPackageRouteSeg").where("shipmentId", shipmentId).queryList();
     shipmentPackageRouteSegList = [];
     shipmentPackageRouteSegs.each { shipmentPackageRouteSeg ->
         if (shipmentPackageRouteSeg.labelImage) {
@@ -127,7 +127,7 @@ context.primaryOrderId = orderId;
 
 carrierPartyId = null;
 if (orderId) {
-    orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
+    orderHeader = from("OrderHeader").where("orderId", orderId).queryOne();
     if (orderHeader) {
         OrderReadHelper orderReadHelper = new OrderReadHelper(orderHeader);
         GenericValue orderItemShipGroup = orderReadHelper.getOrderItemShipGroup(shipGroupSeqId);
@@ -137,7 +137,7 @@ if (orderId) {
             if (shipment) {
                 productStoreId = orderReadHelper.getProductStoreId();
                 shippableItemInfo = orderReadHelper.getOrderItemAndShipGroupAssoc(shipGroupSeqId);
-                shippableItems = delegator.findList("OrderItemAndShipGrpInvResAndItemSum", EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId : shipGroupSeqId]), null, null, null, false);
+                shippableItems = from("OrderItemAndShipGrpInvResAndItemSum").where("orderId", orderId, "shipGroupSeqId", shipGroupSeqId).queryList();
                 shippableTotal = orderReadHelper.getShippableTotal(shipGroupSeqId);
                 shippableWeight = orderReadHelper.getShippableWeight(shipGroupSeqId);
                 shippableQuantity = orderReadHelper.getShippableQuantity(shipGroupSeqId);
@@ -173,10 +173,10 @@ context.shipGroupSeqId = shipGroupSeqId;
 context.picklistBinId = picklistBinId;
 
 if (carrierPartyId) {
-    carrierShipmentBoxTypes =  delegator.findByAnd("CarrierShipmentBoxType", [partyId : carrierPartyId], null, false);
+    carrierShipmentBoxTypes = from("CarrierShipmentBoxType").where("partyId", carrierPartyId).queryList();
     shipmentBoxTypes = [];
     carrierShipmentBoxTypes.each { carrierShipmentBoxType ->
-        shipmentBoxTypes.add(delegator.findOne("ShipmentBoxType", [shipmentBoxTypeId : carrierShipmentBoxType.shipmentBoxTypeId], false));
+        shipmentBoxTypes.add(from("ShipmentBoxType").where("shipmentBoxTypeId", carrierShipmentBoxType.shipmentBoxTypeId).queryOne());
         context.shipmentBoxTypes = shipmentBoxTypes;
     }
 }

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/controller.xml?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/controller.xml Mon Jan  5 08:50:30 2015
@@ -1378,7 +1378,7 @@ under the License.
     <view-map name="PicklistOptions" type="screen" page="component://product/widget/facility/FacilityScreens.xml#PicklistOptions"/>
     <view-map name="PicklistManage" type="screen" page="component://product/widget/facility/FacilityScreens.xml#PicklistManage"/>
     <view-map name="PickMoveStock" type="screen" page="component://product/widget/facility/FacilityScreens.xml#PickMoveStock"/>
-    <view-map name="PickMoveStockSimple" type="screen" page="component://product/widget/facility/FacilityScreens.xml#PickMoveStockSimple"/>
+    <view-map name="PickMoveStockSimple" type="screenfop" page="component://product/widget/facility/FacilityScreens.xml#PickMoveStockSimple.fo" content-type="application/pdf" encoding="none"/>
     <view-map name="PicklistReport.pdf" type="screenfop" page="component://product/widget/facility/FacilityScreens.xml#PicklistReport.fo" content-type="application/pdf" encoding="none"/>
     <view-map name="PrintPickSheets.pdf" type="screenfop" page="component://product/widget/facility/FacilityScreens.xml#PrintPickSheets.fo" content-type="application/pdf" encoding="none"/>
     <view-map name="ReviewOrdersNotPickedOrPacked" type="screen" page="component://product/widget/facility/FacilityScreens.xml#ReviewOrdersNotPickedOrPacked"/>

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/shipment/PackOrder.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/shipment/PackOrder.ftl?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/shipment/PackOrder.ftl (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/shipment/PackOrder.ftl Mon Jan  5 08:50:30 2015
@@ -150,7 +150,7 @@ under the License.
         </div>
         <div class="screenlet-body">
               <#if orderItemShipGroup?has_content>
-                <#if (orderItemShipGroup.contacMechId)?has_content>
+                <#if (orderItemShipGroup.contactMechId)?has_content>
                   <#assign postalAddress = orderItemShipGroup.getRelatedOne("PostalAddress", false)>
                 </#if>
                 <#assign carrier = orderItemShipGroup.carrierPartyId?default("N/A")>

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ImageManagementForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ImageManagementForms.xml?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ImageManagementForms.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ImageManagementForms.xml Mon Jan  5 08:50:30 2015
@@ -53,7 +53,7 @@ under the License.
             </hyperlink>
         </field>
         <field name="contentId"><display/></field>
-        <field name="dataResourceId"><display/></field>
+        <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}"><display/></field>
         <field name="fromDate"><display/></field>
         <field name="statusId" title="${uiLabelMap.CommonStatus}">
             <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
@@ -116,7 +116,7 @@ under the License.
         </field>
         <field name="drDataResourceName" position="2" title="${uiLabelMap.ImageManagementImageName}"><display/></field>
         <field name="contentId" position="2"><display/></field>
-        <field name="dataResourceId" position="2"><display/></field>
+        <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}" position="2"><display/></field>
         <field name="fromDate" position="2"><display/></field>
         <field name="viewButton" position="2" title="${uiLabelMap.CommonView}" widget-style="buttontext">
             <hyperlink target="${origContentDataResourceViews[0].drObjectInfo}" target-window="_blank" description="${uiLabelMap.CommonView}" also-hidden="false" target-type="content"/>
@@ -156,7 +156,7 @@ under the License.
         <field name="drObjectInfo" position="2" title="${uiLabelMap.CommonImage}"><image style="cssImgLarge"/></field>
         <field name="drDataResourceName" position="2" title="${uiLabelMap.ImageManagementImageName}"><display/></field>
         <field name="contentId" position="2"><display/></field>
-        <field name="dataResourceId" position="2"><display/></field>
+        <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}" position="2"><display/></field>
         <field name="fromDate" position="2"><display/></field>
         <field name="viewButton" position="2" title="${uiLabelMap.CommonView}" widget-style="buttontext">
             <hyperlink target="${origContentDataResourceViews[0].drObjectInfo}" target-window="_blank" description="${uiLabelMap.CommonView}" also-hidden="false" target-type="content"/>
@@ -196,7 +196,7 @@ under the License.
         <field name="drObjectInfo" position="2" title="${uiLabelMap.CommonImage}"><image style="cssImgLarge"/></field>
         <field name="drDataResourceName" position="2" title="${uiLabelMap.ImageManagementImageName}"><display/></field>
         <field name="contentId" position="2"><display/></field>
-        <field name="dataResourceId" position="2"><display/></field>
+        <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}" position="2"><display/></field>
         <field name="fromDate" position="2"><display/></field>
         <field name="statusId" position="2" title="${uiLabelMap.CommonStatus}">
             <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
@@ -250,7 +250,7 @@ under the License.
         <field name="drObjectInfo" position="2" title="${uiLabelMap.CommonImage}"><image style="cssImgLarge"/></field>
         <field name="drDataResourceName" position="2" title="${uiLabelMap.ImageManagementImageName}"><display/></field>
         <field name="contentId" position="2"><display/></field>
-        <field name="dataResourceId" position="2"><display/></field>
+        <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}" position="2"><display/></field>
         <field name="fromDate" position="2"><display/></field>
         <field name="thruDate" position="2"><display/></field>
         <field name="statusId" position="2" title="${uiLabelMap.CommonStatus}">
@@ -665,7 +665,7 @@ under the License.
             <hyperlink also-hidden="false" target-type="plain" description="${drDataResourceName}" target="javascript:set_value('${contentId}')"/>
         </field>
         <field name="contentId"><display/></field>
-        <field name="dataResourceId"><display/></field>
+        <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}"><display/></field>
         <field name="fromDate"><display/></field>
         <field name="statusId" title="${uiLabelMap.CommonStatus}">
             <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
@@ -714,7 +714,7 @@ under the License.
         <field name="drObjectInfo" title="${uiLabelMap.CommonImage}"><image style="cssImgLarge"/></field>
         <field name="drDataResourceName" title="${uiLabelMap.ImageManagementImageName}"><display/></field>
         <field name="contentId"><display/></field>
-        <field name="dataResourceId"><display/></field>
+        <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}"><display/></field>
         <field name="statusId" title="${uiLabelMap.CommonStatus}">
             <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
         </field>
@@ -819,7 +819,7 @@ under the License.
             <hyperlink also-hidden="false" target-type="plain" description="${drDataResourceName}" target="javascript:set_value('${contentId}')"/>
         </field>
         <field name="contentId"><display/></field>
-        <field name="dataResourceId"><display/></field>
+        <field name="dataResourceId" title="${uiLabelMap.ContentDataResourceId}"><display/></field>
         <field name="createdDate"><display/></field>
         <!--<field name="deleteButton" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
             <hyperlink target="deleteImageFrame" target-window="_blank" description="${uiLabelMap.CommonDelete}" also-hidden="false">

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml Mon Jan  5 08:50:30 2015
@@ -1306,7 +1306,7 @@ under the License.
             </widgets>
         </section>
     </screen>
-    <screen name="PickMoveStockSimple">
+    <screen name="PickMoveStockSimple.fo">
         <section>
             <actions>
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
@@ -1333,7 +1333,7 @@ under the License.
                 <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="body">
                         <platform-specific>
-                            <html><html-template location="component://product/webapp/facility/facility/PickMoveStock.ftl"/></html>
+                            <xsl-fo><html-template location="component://product/webapp/facility/facility/PickMoveStockSimple.fo.ftl"/></xsl-fo>
                         </platform-specific>
                     </decorator-section>
                 </decorator-screen>

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/entitydef/entitymodel.xml?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/entitydef/entitymodel.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/entitydef/entitymodel.xml Mon Jan  5 08:50:30 2015
@@ -787,9 +787,6 @@ under the License.
         <field name="secondsTotal" type="floating-point"></field>
         <field name="searchDate" type="date-time"></field>
         <prim-key field="workEffortSearchResultId"/>
-        <relation type="one" fk-name="WEFF_SCHRES_VST" rel-entity-name="Visit">
-            <key-map field-name="visitId"/>
-        </relation>
     </entity>
     <entity entity-name="WorkEffortSkillStandard"
             package-name="org.ofbiz.workeffort.workeffort"

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy Mon Jan  5 08:50:30 2015
@@ -40,7 +40,7 @@ serviceCtx.putAll(UtilMisc.toMap("userLo
 if (context.entityExprList) {
     serviceCtx.entityExprList = entityExprList;
 }
-Map result = dispatcher.runSync("getWorkEffortEventsByPeriod", serviceCtx);
+Map result = runService('getWorkEffortEventsByPeriod', serviceCtx);
 context.put("periods", result.get("periods"));
 context.put("maxConcurrentEntries", result.get("maxConcurrentEntries"));
 context.put("start", start);

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy Mon Jan  5 08:50:30 2015
@@ -62,7 +62,7 @@ serviceCtx.putAll(UtilMisc.toMap("userLo
 if (context.entityExprList) {
     serviceCtx.entityExprList = entityExprList;
 }
-result = dispatcher.runSync("getWorkEffortEventsByPeriod", serviceCtx);
+result = runService('getWorkEffortEventsByPeriod', serviceCtx);
 context.put("periods",result.get("periods"));
 context.put("maxConcurrentEntries", result.get("maxConcurrentEntries"));
 context.put("start", start);

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Upcoming.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Upcoming.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Upcoming.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Upcoming.groovy Mon Jan  5 08:50:30 2015
@@ -43,7 +43,7 @@ if (workEffortTypeId != null) {
 Map serviceCtx = UtilMisc.toMap("userLogin", userLogin, "start", start, "numPeriods", 7, "periodType", Calendar.DATE);
 serviceCtx.putAll(UtilMisc.toMap("partyId", partyId, "facilityId", facilityId, "fixedAssetId", fixedAssetId, "workEffortTypeId", workEffortTypeId, "calendarType", calendarType, "locale", locale, "timeZone", timeZone));
 
-Map result = dispatcher.runSync("getWorkEffortEventsByPeriod",serviceCtx);
+Map result = runService('getWorkEffortEventsByPeriod',serviceCtx);
 context.put("days", result.get("periods"));
 context.put("start", start);
 context.put("eventsParam", eventsParam);

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Week.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Week.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Week.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Week.groovy Mon Jan  5 08:50:30 2015
@@ -41,7 +41,7 @@ serviceCtx.putAll(UtilMisc.toMap("userLo
 if (context.entityExprList) {
     serviceCtx.entityExprList = entityExprList;
 }
-Map result = dispatcher.runSync("getWorkEffortEventsByPeriod",serviceCtx);
+Map result = runService('getWorkEffortEventsByPeriod',serviceCtx);
 context.put("periods",result.get("periods"));
 context.put("maxConcurrentEntries",result.get("maxConcurrentEntries"));
 context.put("start",start);

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/content/WorkEffortContentWrapper.groovy Mon Jan  5 08:50:30 2015
@@ -24,7 +24,7 @@
 
  workEffort = context.get("workEffort");
  if (workEffort == null && workEffortId != null) {
-    workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), true);
+    workEffort = from("WorkEffort").where("workEffortId", workEffortId).cache(true).queryOne();
  }
 
  if (workEffort != null) {

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/find/WorkEffortSearchOptions.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/find/WorkEffortSearchOptions.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/find/WorkEffortSearchOptions.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/find/WorkEffortSearchOptions.groovy Mon Jan  5 08:50:30 2015
@@ -53,8 +53,8 @@ context.put("thruDateStr", toStr);
 
 searchConstraintStrings = WorkEffortSearchSession.searchGetConstraintStrings(false, session, delegator);
 searchSortOrderString = WorkEffortSearchSession.searchGetSortOrderString(false, request);
-workEffortAssocTypes=delegator.findList("WorkEffortAssocType", null, null, null, null, false);
-roleTypes=delegator.findList("RoleType", null, null, null, null, false);
+workEffortAssocTypes = from("WorkEffortAssocType").queryList();
+roleTypes = from("RoleType").queryList();
 
 context.put("searchOperator", searchOperator);
 context.put("searchConstraintStrings", searchConstraintStrings);

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/request/RequestList.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/request/RequestList.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/request/RequestList.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/webapp/workeffort/WEB-INF/actions/request/RequestList.groovy Mon Jan  5 08:50:30 2015
@@ -19,7 +19,6 @@
 
 import org.ofbiz.base.util.UtilMisc;
 
-Map serviceCtx = UtilMisc.toMap("userLogin", userLogin);
-Map requests = dispatcher.runSync("getCustRequestsByRole", serviceCtx);
+Map requests = runService('getCustRequestsByRole', ["userLogin": userLogin]);
 
 context.put("custRequestAndRoles", requests.get("custRequestAndRoles"));

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/widget/CalendarScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/widget/CalendarScreens.xml?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/widget/CalendarScreens.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/workeffort/widget/CalendarScreens.xml Mon Jan  5 08:50:30 2015
@@ -167,7 +167,7 @@ under the License.
                                 <if-compare field="isCalOwner" operator="equals" value="true" type="Boolean" />
                             </and>
                             <if-empty field="workEffort" />
-                            <if-has-permission permission="WORKEFFORTMGR" action="ADMIN" />
+                            <if-has-permission permission="WORKEFFORTMGR" action="_ADMIN" />
                         </or>
                     </condition>
                     <actions>

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/lang/ComparableRange.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/lang/ComparableRange.java?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/lang/ComparableRange.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/lang/ComparableRange.java Mon Jan  5 08:50:30 2015
@@ -18,9 +18,8 @@
  *******************************************************************************/
 package org.ofbiz.base.lang;
 
-/** An immutable range of values. */
+/** A range of values. */
 @SourceMonitored
-@ThreadSafe
 public class ComparableRange<T extends Comparable<T>> implements Range<T>, Comparable<ComparableRange<T>> {
 
     protected final T start;

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/DateRange.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/DateRange.java?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/DateRange.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/DateRange.java Mon Jan  5 08:50:30 2015
@@ -30,9 +30,9 @@ import org.ofbiz.base.lang.ComparableRan
 @SuppressWarnings("serial")
 public class DateRange extends ComparableRange<Date> implements Serializable {
     /** A <code>Date</code> instance initialized to the earliest possible date.*/
-    public static final Date MIN_DATE = UtilDateTime.getEarliestDate();
+    public static final Date MIN_DATE = UtilDateTime.unmodifiableDate(UtilDateTime.getEarliestDate());
     /** A <code>Date</code> instance initialized to the latest possible date.*/
-    public static final Date MAX_DATE = UtilDateTime.getLatestDate();
+    public static final Date MAX_DATE = UtilDateTime.unmodifiableDate(UtilDateTime.getLatestDate());
     /** A <code>DateRange</code> instance initialized to the widest possible range of dates.*/
     public static final DateRange FullRange = new DateRange(MIN_DATE, MAX_DATE);
 
@@ -50,7 +50,8 @@ public class DateRange extends Comparabl
      * @param end If null, defaults to <a href="#MAX_DATE">MAX_DATE</a>
      */
     public DateRange(Date start, Date end) {
-        super(start == null ? MIN_DATE : timestampToDate(start), end == null ? MAX_DATE : timestampToDate(end));
+        super(start == null ? MIN_DATE : UtilDateTime.unmodifiableDate(timestampToDate(start)), end == null ? MAX_DATE
+                : UtilDateTime.unmodifiableDate(timestampToDate(end)));
     }
 
     @Override

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java Mon Jan  5 08:50:30 2015
@@ -21,7 +21,6 @@ package org.ofbiz.base.util;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -36,14 +35,6 @@ import java.util.regex.Pattern;
 import org.apache.commons.codec.DecoderException;
 import org.apache.commons.codec.binary.Hex;
 import org.ofbiz.base.lang.Appender;
-import org.owasp.esapi.ValidationErrorList;
-import org.owasp.esapi.Validator;
-import org.owasp.esapi.codecs.Codec;
-import org.owasp.esapi.codecs.HTMLEntityCodec;
-import org.owasp.esapi.codecs.PercentCodec;
-import org.owasp.esapi.errors.IntrusionException;
-import org.owasp.esapi.reference.DefaultEncoder;
-import org.owasp.esapi.reference.DefaultValidator;
 
 /**
  * Misc String Utility Functions
@@ -56,15 +47,7 @@ public class StringUtil {
     // FIXME: Not thread safe
     protected static final Map<String, Pattern> substitutionPatternMap;
 
-    /** OWASP ESAPI canonicalize strict flag; setting false so we only get warnings about double encoding, etc; can be set to true for exceptions and more security */
-    public static final boolean esapiCanonicalizeStrict = false;
-    public static final DefaultEncoder defaultWebEncoder;
-    public static final Validator defaultWebValidator;
     static {
-        // possible codecs: CSSCodec, HTMLEntityCodec, JavaScriptCodec, MySQLCodec, OracleCodec, PercentCodec, UnixCodec, VBScriptCodec, WindowsCodec
-        List<Codec> codecList = Arrays.asList(new HTMLEntityCodec(), new PercentCodec());
-        defaultWebEncoder = new DefaultEncoder(codecList);
-        defaultWebValidator = new DefaultValidator();
         substitutionPatternMap = new HashMap<String, Pattern>();
         substitutionPatternMap.put("&&", Pattern.compile("@and", Pattern.LITERAL));
         substitutionPatternMap.put("||", Pattern.compile("@or", Pattern.LITERAL));
@@ -74,52 +57,9 @@ public class StringUtil {
         substitutionPatternMap.put(">", Pattern.compile("@gt", Pattern.LITERAL));
     }
 
-    public static final SimpleEncoder htmlEncoder = new HtmlEncoder();
-    public static final SimpleEncoder xmlEncoder = new XmlEncoder();
-    public static final SimpleEncoder stringEncoder = new StringEncoder();
-
     private StringUtil() {
     }
 
-    public static interface SimpleEncoder {
-        public String encode(String original);
-    }
-
-    public static class HtmlEncoder implements SimpleEncoder {
-        public String encode(String original) {
-            return StringUtil.defaultWebEncoder.encodeForHTML(original);
-        }
-    }
-
-    public static class XmlEncoder implements SimpleEncoder {
-        public String encode(String original) {
-            return StringUtil.defaultWebEncoder.encodeForXML(original);
-        }
-    }
-
-    public static class StringEncoder implements SimpleEncoder {
-        public String encode(String original) {
-            if (original != null) {
-                original = original.replace("\"", "\\\"");
-            }
-            return original;
-        }
-    }
-
-    // ================== Begin General Functions ==================
-
-    public static SimpleEncoder getEncoder(String type) {
-        if ("xml".equals(type)) {
-            return StringUtil.xmlEncoder;
-        } else if ("html".equals(type)) {
-            return StringUtil.htmlEncoder;
-        } else if ("string".equals(type)) {
-            return StringUtil.stringEncoder;
-        } else {
-            return null;
-        }
-    }
-
     public static String internString(String value) {
         return value != null ? value.intern() : null;
     }
@@ -595,78 +535,6 @@ public class StringUtil {
     }
 
     /**
-     * Uses a black-list approach for necessary characters for HTML.
-     * Does not allow various characters (after canonicalization), including "<", ">", "&" (if not followed by a space), and "%" (if not followed by a space).
-     *
-     * @param value
-     * @param errorMessageList
-     */
-    public static String checkStringForHtmlStrictNone(String valueName, String value, List<String> errorMessageList) {
-        if (UtilValidate.isEmpty(value)) return value;
-
-        // canonicalize, strict (error on double-encoding)
-        try {
-            value = defaultWebEncoder.canonicalize(value, true);
-        } catch (IntrusionException e) {
-            // NOTE: using different log and user targeted error messages to allow the end-user message to be less technical
-            Debug.logError("Canonicalization (format consistency, character escaping that is mixed or double, etc) error for attribute named [" + valueName + "], String [" + value + "]: " + e.toString(), module);
-            errorMessageList.add("In field [" + valueName + "] found character escaping (mixed or double) that is not allowed or other format consistency error: " + e.toString());
-        }
-
-        // check for "<", ">"
-        if (value.indexOf("<") >= 0 || value.indexOf(">") >= 0) {
-            errorMessageList.add("In field [" + valueName + "] less-than (<) and greater-than (>) symbols are not allowed.");
-        }
-
-        /* NOTE DEJ 20090311: After playing with this more this doesn't seem to be necessary; the canonicalize will convert all such characters into actual text before this check is done, including other illegal chars like &lt; which will canonicalize to < and then get caught
-        // check for & followed a semicolon within 7 characters, no spaces in-between (and perhaps other things sometime?)
-        int curAmpIndex = value.indexOf("&");
-        while (curAmpIndex > -1) {
-            int semicolonIndex = value.indexOf(";", curAmpIndex + 1);
-            int spaceIndex = value.indexOf(" ", curAmpIndex + 1);
-            if (semicolonIndex > -1 && (semicolonIndex - curAmpIndex <= 7) && (spaceIndex < 0 || (spaceIndex > curAmpIndex && spaceIndex < semicolonIndex))) {
-                errorMessageList.add("In field [" + valueName + "] the ampersand (&) symbol is only allowed if not used as an encoded character: no semicolon (;) within 7 spaces or there is a space between.");
-                // once we find one like this we have the message so no need to check for more
-                break;
-            }
-            curAmpIndex = value.indexOf("&", curAmpIndex + 1);
-        }
-         */
-
-        /* NOTE DEJ 20090311: After playing with this more this doesn't seem to be necessary; the canonicalize will convert all such characters into actual text before this check is done, including other illegal chars like %3C which will canonicalize to < and then get caught
-        // check for % followed by 2 hex characters
-        int curPercIndex = value.indexOf("%");
-        while (curPercIndex >= 0) {
-            if (value.length() > (curPercIndex + 3) && UtilValidate.isHexDigit(value.charAt(curPercIndex + 1)) && UtilValidate.isHexDigit(value.charAt(curPercIndex + 2))) {
-                errorMessageList.add("In field [" + valueName + "] the percent (%) symbol is only allowed if followed by a space.");
-                // once we find one like this we have the message so no need to check for more
-                break;
-            }
-            curPercIndex = value.indexOf("%", curPercIndex + 1);
-        }
-         */
-
-        // TODO: anything else to check for that can be used to get HTML or JavaScript going without these characters?
-
-        return value;
-    }
-
-    /**
-     * Uses a white-list approach to check for safe HTML.
-     * Based on the ESAPI validator configured in the antisamy-esapi.xml file.
-     *
-     * @param value
-     * @param errorMessageList
-     * @return String with updated value if needed for safer HTML.
-     */
-    public static String checkStringForHtmlSafeOnly(String valueName, String value, List<String> errorMessageList) {
-        ValidationErrorList vel = new ValidationErrorList();
-        value = defaultWebValidator.getValidSafeHTML(valueName, value, Integer.MAX_VALUE, true, vel);
-        errorMessageList.addAll(UtilGenerics.checkList(vel.errors(), String.class));
-        return value;
-    }
-
-    /**
      * Remove/collapse multiple newline characters
      *
      * @param str string to collapse newlines in
@@ -786,57 +654,4 @@ public class StringUtil {
             return this.theString;
         }
     }
-
-    /**
-     * A simple Map wrapper class that will do HTML encoding. To be used for passing a Map to something that will expand Strings with it as a context, etc.
-     */
-    public static class HtmlEncodingMapWrapper<K> implements Map<K, Object> {
-        public static <K> HtmlEncodingMapWrapper<K> getHtmlEncodingMapWrapper(Map<K, Object> mapToWrap, SimpleEncoder encoder) {
-            if (mapToWrap == null) return null;
-
-            HtmlEncodingMapWrapper<K> mapWrapper = new HtmlEncodingMapWrapper<K>();
-            mapWrapper.setup(mapToWrap, encoder);
-            return mapWrapper;
-        }
-
-        protected Map<K, Object> internalMap = null;
-        protected SimpleEncoder encoder = null;
-        protected HtmlEncodingMapWrapper() { }
-
-        public void setup(Map<K, Object> mapToWrap, SimpleEncoder encoder) {
-            this.internalMap = mapToWrap;
-            this.encoder = encoder;
-        }
-        public void reset() {
-            this.internalMap = null;
-            this.encoder = null;
-        }
-
-        public int size() { return this.internalMap.size(); }
-        public boolean isEmpty() { return this.internalMap.isEmpty(); }
-        public boolean containsKey(Object key) { return this.internalMap.containsKey(key); }
-        public boolean containsValue(Object value) { return this.internalMap.containsValue(value); }
-        public Object get(Object key) {
-            Object theObject = this.internalMap.get(key);
-            if (theObject instanceof String) {
-                if (this.encoder != null) {
-                    return encoder.encode((String) theObject);
-                } else {
-                    return StringUtil.defaultWebEncoder.encodeForHTML((String) theObject);
-                }
-            } else if (theObject instanceof Map<?, ?>) {
-                return HtmlEncodingMapWrapper.getHtmlEncodingMapWrapper(UtilGenerics.<K, Object>checkMap(theObject), this.encoder);
-            }
-            return theObject;
-        }
-        public Object put(K key, Object value) { return this.internalMap.put(key, value); }
-        public Object remove(Object key) { return this.internalMap.remove(key); }
-        public void putAll(Map<? extends K, ? extends Object> arg0) { this.internalMap.putAll(arg0); }
-        public void clear() { this.internalMap.clear(); }
-        public Set<K> keySet() { return this.internalMap.keySet(); }
-        public Collection<Object> values() { return this.internalMap.values(); }
-        public Set<Map.Entry<K, Object>> entrySet() { return this.internalMap.entrySet(); }
-        @Override
-        public String toString() { return this.internalMap.toString(); }
-    }
 }

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilDateTime.java?rev=1649482&r1=1649481&r2=1649482&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilDateTime.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilDateTime.java Mon Jan  5 08:50:30 2015
@@ -25,8 +25,8 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Date;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -972,7 +972,7 @@ public class UtilDateTime {
         if (UtilValidate.isEmpty(dateFormat)) {
             df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
         } else {
-            df = new SimpleDateFormat(dateFormat);
+            df = new SimpleDateFormat(dateFormat, locale == null ? Locale.getDefault() : locale);
         }
         df.setTimeZone(tz);
         return df;
@@ -990,7 +990,7 @@ public class UtilDateTime {
         if (UtilValidate.isEmpty(dateTimeFormat)) {
             df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, locale);
         } else {
-            df = new SimpleDateFormat(dateTimeFormat);
+            df = new SimpleDateFormat(dateTimeFormat, locale == null ? Locale.getDefault() : locale);
         }
         df.setTimeZone(tz);
         return df;
@@ -1008,7 +1008,7 @@ public class UtilDateTime {
         if (UtilValidate.isEmpty(timeFormat)) {
             df = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
         } else {
-            df = new SimpleDateFormat(timeFormat);
+            df = new SimpleDateFormat(timeFormat, locale == null ? Locale.getDefault() : locale);
         }
         df.setTimeZone(tz);
         return df;
@@ -1042,34 +1042,37 @@ public class UtilDateTime {
      */
     public static String timeStampToString(Timestamp stamp, String dateTimeFormat, TimeZone tz, Locale locale) {
         DateFormat dateFormat = toDateTimeFormat(dateTimeFormat, tz, locale);
-        dateFormat.setTimeZone(tz);
         return dateFormat.format(stamp);
     }
 
-    protected static List<TimeZone> availableTimeZoneList = null;
+    // Private lazy-initializer class
+    private static class TimeZoneHolder {
+        private static final List<TimeZone> availableTimeZoneList = getTimeZones();
+
+        private static List<TimeZone> getTimeZones() {
+            ArrayList<TimeZone> availableTimeZoneList = new ArrayList<TimeZone>();
+            List<String> idList = null;
+            String tzString = UtilProperties.getPropertyValue("general", "timeZones.available");
+            if (UtilValidate.isNotEmpty(tzString)) {
+                idList = StringUtil.split(tzString, ",");
+            } else {
+                idList = Arrays.asList(TimeZone.getAvailableIDs());
+            }
+            for (String id : idList) {
+                TimeZone curTz = TimeZone.getTimeZone(id);
+                availableTimeZoneList.add(curTz);
+            }
+            availableTimeZoneList.trimToSize();
+            return Collections.unmodifiableList(availableTimeZoneList);
+        }
+
+    }
+
     /** Returns a List of available TimeZone objects.
      * @see java.util.TimeZone
      */
     public static List<TimeZone> availableTimeZones() {
-        if (availableTimeZoneList == null) {
-            synchronized(UtilDateTime.class) {
-                if (availableTimeZoneList == null) {
-                    availableTimeZoneList = new LinkedList<TimeZone>();
-                    List<String> idList = null;
-                    String tzString = UtilProperties.getPropertyValue("general", "timeZones.available");
-                    if (UtilValidate.isNotEmpty(tzString)) {
-                        idList = StringUtil.split(tzString, ",");
-                    } else {
-                        idList = Arrays.asList(TimeZone.getAvailableIDs());
-                    }
-                    for (String id: idList) {
-                        TimeZone curTz = TimeZone.getTimeZone(id);
-                        availableTimeZoneList.add(curTz);
-                    }
-                }
-            }
-        }
-        return availableTimeZoneList;
+        return TimeZoneHolder.availableTimeZoneList;
     }
 
     /** Returns a TimeZone object based upon a time zone ID. Method defaults to
@@ -1096,47 +1099,47 @@ public class UtilDateTime {
     }
 
     public static int getSecond(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.SECOND);
     }
 
     public static int getMinute(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.MINUTE);
     }
 
     public static int getHour(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.HOUR_OF_DAY);
     }
 
     public static int getDayOfWeek(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.DAY_OF_WEEK);
     }
 
     public static int getDayOfMonth(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.DAY_OF_MONTH);
     }
 
     public static int getDayOfYear(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.DAY_OF_YEAR);
     }
 
     public static int getWeek(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.WEEK_OF_YEAR);
     }
 
     public static int getMonth(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.MONTH);
     }
 
     public static int getYear(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        Calendar cal = UtilDateTime.toCalendar(stamp, timeZone, locale);
+        Calendar cal = toCalendar(stamp, timeZone, locale);
         return cal.get(Calendar.YEAR);
     }
 
@@ -1163,4 +1166,67 @@ public class UtilDateTime {
         cal.set(Calendar.MILLISECOND, 999);
         return cal.getTime();
     }
+
+    /**
+     * Returns a copy of <code>date</code> that cannot be modified.
+     * Attempts to modify the returned date will result in an
+     * <tt>UnsupportedOperationException</tt>.
+     *
+     * @param date
+     */
+    public static Date unmodifiableDate(Date date) {
+        if (date instanceof ImmutableDate) {
+            return date;
+        }
+        return new ImmutableDate(date.getTime());
+    }
+
+    @SuppressWarnings("serial")
+    private static class ImmutableDate extends Date {
+        private ImmutableDate(long date) {
+            super(date);
+        }
+
+        @Override
+        public Object clone() {
+            // No need to clone an immutable object.
+            return this;
+        }
+
+        @Override
+        public void setYear(int year) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void setMonth(int month) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void setDate(int date) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void setHours(int hours) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void setMinutes(int minutes) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void setSeconds(int seconds) {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void setTime(long time) {
+            throw new UnsupportedOperationException();
+        }
+
+    }
 }