You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by er...@apache.org on 2012/03/26 22:56:30 UTC

svn commit: r1305581 [19/36] - in /ofbiz/branches/20111205EmailHandling: ./ applications/accounting/config/ applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/finaccount/ applications/ac...

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Mon Mar 26 20:56:02 2012
@@ -19,7 +19,9 @@
 package org.ofbiz.product.category;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.servlet.ServletRequest;
@@ -34,14 +36,18 @@ import org.ofbiz.base.util.UtilFormatOut
 import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilHttp;
 import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.product.product.ProductWorker;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.ServiceUtil;
 
 /**
  * CategoryWorker - Worker class to reduce code in JSPs.
@@ -50,6 +56,8 @@ public class CategoryWorker {
 
     public static final String module = CategoryWorker.class.getName();
 
+    private CategoryWorker () {}
+
     public static String getCatalogTopCategory(ServletRequest request, String defaultTopCategory) {
         HttpServletRequest httpRequest = (HttpServletRequest) request;
         Map<String, Object> requestParameters = UtilHttp.getParameterMap(httpRequest);
@@ -127,11 +135,16 @@ public class CategoryWorker {
     }
 
     public static List<GenericValue> getRelatedCategoriesRet(ServletRequest request, String attributeName, String parentId, boolean limitView, boolean excludeEmpty, boolean recursive) {
+      Delegator delegator = (Delegator) request.getAttribute("delegator");
+
+      return getRelatedCategoriesRet(delegator, attributeName, parentId, limitView, excludeEmpty, false);
+    }
+
+    public static List<GenericValue> getRelatedCategoriesRet(Delegator delegator, String attributeName, String parentId, boolean limitView, boolean excludeEmpty, boolean recursive) {
         List<GenericValue> categories = FastList.newInstance();
 
         if (Debug.verboseOn()) Debug.logVerbose("[CategoryWorker.getRelatedCategories] ParentID: " + parentId, module);
 
-        Delegator delegator = (Delegator) request.getAttribute("delegator");
         List<GenericValue> rollups = null;
 
         try {
@@ -145,9 +158,9 @@ public class CategoryWorker {
             Debug.logWarning(e.getMessage(), module);
         }
         if (rollups != null) {
-            // Debug.log("Rollup size: " + rollups.size(), module);
+            // Debug.logInfo("Rollup size: " + rollups.size(), module);
             for (GenericValue parent: rollups) {
-                // Debug.log("Adding child of: " + parent.getString("parentProductCategoryId"), module);
+                // Debug.logInfo("Adding child of: " + parent.getString("parentProductCategoryId"), module);
                 GenericValue cv = null;
 
                 try {
@@ -158,16 +171,16 @@ public class CategoryWorker {
                 if (cv != null) {
                     if (excludeEmpty) {
                         if (!isCategoryEmpty(cv)) {
-                            //Debug.log("Child : " + cv.getString("productCategoryId") + " is not empty.", module);
+                            //Debug.logInfo("Child : " + cv.getString("productCategoryId") + " is not empty.", module);
                             categories.add(cv);
                             if (recursive) {
-                                categories.addAll(getRelatedCategoriesRet(request, attributeName, cv.getString("productCategoryId"), limitView, excludeEmpty, recursive));
+                                categories.addAll(getRelatedCategoriesRet(delegator, attributeName, cv.getString("productCategoryId"), limitView, excludeEmpty, recursive));
                             }
                         }
                     } else {
                         categories.add(cv);
                         if (recursive) {
-                            categories.addAll(getRelatedCategoriesRet(request, attributeName, cv.getString("productCategoryId"), limitView, excludeEmpty, recursive));
+                            categories.addAll(getRelatedCategoriesRet(delegator, attributeName, cv.getString("productCategoryId"), limitView, excludeEmpty, recursive));
                         }
                     }
                 }
@@ -179,14 +192,14 @@ public class CategoryWorker {
     public static boolean isCategoryEmpty(GenericValue category) {
         boolean empty = true;
         long members = categoryMemberCount(category);
-        //Debug.log("Category : " + category.get("productCategoryId") + " has " + members  + " members", module);
+        //Debug.logInfo("Category : " + category.get("productCategoryId") + " has " + members  + " members", module);
         if (members > 0) {
             empty = false;
         }
 
         if (empty) {
             long rollups = categoryRollupCount(category);
-            //Debug.log("Category : " + category.get("productCategoryId") + " has " + rollups  + " rollups", module);
+            //Debug.logInfo("Category : " + category.get("productCategoryId") + " has " + rollups  + " rollups", module);
             if (rollups > 0) {
                 empty = false;
             }
@@ -410,4 +423,58 @@ public class CategoryWorker {
             }
         }
     }
+    
+    /**
+     * Returns a complete category trail - can be used for exporting proper category trees. 
+     * This is mostly useful when used in combination with bread-crumbs,  for building a 
+     * faceted index tree, or to export a category tree for migration to another system.
+     * Will create the tree from root point to categoryId.
+     * 
+     * This method is not meant to be run on every request.
+     * Its best use is to generate the trail every so often and store somewhere 
+     * (a lucene/solr tree, entities, cache or so). 
+     * 
+     * @param  productCategoryId  id of category the trail should be generated for
+     * @returns List organized trail from root point to categoryId.
+     * */
+    public static Map getCategoryTrail(DispatchContext dctx, Map context) {
+        String productCategoryId = (String) context.get("productCategoryId");
+        Map<String, Object> results = ServiceUtil.returnSuccess();
+        GenericDelegator delegator = (GenericDelegator) dctx.getDelegator();
+        List<String> trailElements = FastList.newInstance();
+        trailElements.add(productCategoryId);
+        String parentProductCategoryId = productCategoryId;
+        while (UtilValidate.isNotEmpty(parentProductCategoryId)) {
+            // find product category rollup
+            try {
+                List<EntityCondition> rolllupConds = FastList.newInstance();
+                rolllupConds.add(EntityCondition.makeCondition("productCategoryId", parentProductCategoryId));
+                rolllupConds.add(EntityUtil.getFilterByDateExpr());
+                List<GenericValue> productCategoryRollups = delegator.findList("ProductCategoryRollup", 
+                        EntityCondition.makeCondition(rolllupConds), null, UtilMisc.toList("sequenceNum"), null, true);
+                if (UtilValidate.isNotEmpty(productCategoryRollups)) {
+                    // add only categories that belong to the top category to trail
+                    for (GenericValue productCategoryRollup : productCategoryRollups) {
+                        String trailCategoryId = productCategoryRollup.getString("parentProductCategoryId");
+                        parentProductCategoryId = trailCategoryId;
+                        if (trailElements.contains(trailCategoryId)) {
+                            break;
+                        } else {
+                            trailElements.add(trailCategoryId);
+                        }
+                    }
+                } else {
+                    parentProductCategoryId = null;
+                }
+            } catch (GenericEntityException e) {
+                Map<String, String> messageMap = UtilMisc.toMap("errMessage", ". Cannot generate trail from product category. ");
+                String errMsg = UtilProperties.getMessage("CommonUiLabels", "CommonDatabaseProblem", messageMap, (Locale) context.get("locale"));
+                Debug.logError(e, errMsg, module);
+                return ServiceUtil.returnError(errMsg);
+            }
+        }
+        Collections.reverse(trailElements);
+        results.put("trail", trailElements);
+        return results;
+    }
 }

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java Mon Mar 26 20:56:02 2012
@@ -97,7 +97,7 @@ public class ProductConfigWrapper implem
 
     private void init(Delegator delegator, LocalDispatcher dispatcher, String productId, String productStoreId, String catalogId, String webSiteId, String currencyUomId, Locale locale, GenericValue autoUserLogin) throws Exception {
         product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
-        if (product == null || !product.getString("productTypeId").equals("AGGREGATED")) {
+        if (product == null || !product.getString("productTypeId").equals("AGGREGATED") && !product.getString("productTypeId").equals("AGGREGATED_SERVICE")) {
             throw new ProductConfigWrapperException("Product " + productId + " is not an AGGREGATED product.");
         }
         this.dispatcher = dispatcher;
@@ -123,7 +123,7 @@ public class ProductConfigWrapper implem
             basePrice = price;
         }
         questions = FastList.newInstance();
-        if ("AGGREGATED".equals(product.getString("productTypeId"))) {
+        if ("AGGREGATED".equals(product.getString("productTypeId")) || "AGGREGATED_SERVICE".equals(product.getString("productTypeId"))) {
             List<GenericValue> questionsValues = delegator.findByAnd("ProductConfig", UtilMisc.toMap("productId", productId), UtilMisc.toList("sequenceNum"));
             questionsValues = EntityUtil.filterByDate(questionsValues);
             Set<String> itemIds = FastSet.newInstance();
@@ -664,6 +664,15 @@ public class ProductConfigWrapper implem
             }
         }
 
+        public String getOptionName() {
+            return (configOption.getString("configOptionName") != null? configOption.getString("configOptionName"): "no option name");
+        }
+
+        public String getOptionName(Locale locale) {
+        	
+            return (configOption.getString("configOptionName") != null? (String) configOption.get("configOptionName", locale): "no option name");
+        }
+
         public String getDescription() {
             return (configOption.getString("description") != null? configOption.getString("description"): "no description");
         }

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/feature/ProductFeatureServices.java Mon Mar 26 20:56:02 2012
@@ -151,15 +151,15 @@ public class ProductFeatureServices {
                             "productFeatureId", productFeatureAndAppl,
                             "productFeatureApplTypeId", "STANDARD_FEATURE");
 
-                    //Debug.log("Using findByMap: " + findByMap);
+                    //Debug.logInfo("Using findByMap: " + findByMap);
 
                     List<GenericValue> standardProductFeatureAndAppls = EntityUtil.filterByDate(delegator.findByAnd("ProductFeatureAppl", findByMap));
                     if (UtilValidate.isEmpty(standardProductFeatureAndAppls)) {
-                        // Debug.log("Does NOT have this standard feature");
+                        // Debug.logInfo("Does NOT have this standard feature");
                         hasAllFeatures = false;
                         break;
                     } else {
-                        // Debug.log("DOES have this standard feature");
+                        // Debug.logInfo("DOES have this standard feature");
                     }
                 }
 

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/image/ScaleImage.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/image/ScaleImage.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/image/ScaleImage.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/image/ScaleImage.java Mon Mar 26 20:56:02 2012
@@ -25,7 +25,6 @@ import java.io.File;
 import java.io.IOException;
 import java.lang.NullPointerException;
 import java.lang.SecurityException;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -335,9 +334,7 @@ public class ScaleImage {
             }
 
             /* scale Image for each Size Type */
-            Iterator<String> sizeIter = sizeTypeList.iterator();
-            while (sizeIter.hasNext()) {
-                String sizeType = sizeIter.next();
+            for(String sizeType : sizeTypeList) {
                 resultScaleImgMap.putAll(ImageTransform.scaleImage(bufImg, imgHeight, imgWidth, imgPropertyMap, sizeType, locale));
 
                 if (resultScaleImgMap.containsKey("responseMessage") && resultScaleImgMap.get("responseMessage").equals("success")) {

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java Mon Mar 26 20:56:02 2012
@@ -30,7 +30,6 @@ import java.io.UnsupportedEncodingExcept
 import java.io.Writer;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -112,29 +111,7 @@ public class ImageManagementServices {
             
             String sizeType = null;
             if (UtilValidate.isNotEmpty(imageResize)) {
-                if (imageResize.equals("IMAGE_AVATAR")) {
-                    sizeType = "100x75";
-                } else if (imageResize.equals("IMAGE_THUMBNAIL")) {
-                    sizeType = "150x112";
-                }    
-                else if (imageResize.equals("IMAGE_WEBSITE")) {
-                    sizeType = "320x240";
-                }
-                else if (imageResize.equals("IMAGE_BOARD")) {
-                    sizeType = "640x480";
-                }
-                else if (imageResize.equals("IMAGE_MONITOR15")) {
-                    sizeType = "800x600";
-                }
-                else if (imageResize.equals("IMAGE_MONITOR17")) {
-                    sizeType = "1024x768";
-                }
-                else if (imageResize.equals("IMAGE_MONITOR19")) {
-                    sizeType = "1280x1024";
-                }
-                else if (imageResize.equals("IMAGE_MONITOR21")) {
-                    sizeType = "1600x1200";
-                }
+                sizeType = imageResize;
             }
             
             Map<String, Object> contentCtx = FastMap.newInstance();
@@ -150,8 +127,7 @@ public class ImageManagementServices {
             
             String contentId = (String) contentResult.get("contentId");
             result.put("contentFrameId", contentId);
-            result.put("contentId", (String) context.get("contentId"));
-            result.put("dataResourceId", (String) context.get("dataResourceId"));
+            result.put("contentId", contentId);
             
             // File to use for original image
             FlexibleStringExpander filenameExpander = FlexibleStringExpander.getInstance(imageFilenameFormat);
@@ -298,6 +274,20 @@ public class ImageManagementServices {
                 Debug.logError(e, module);
                 return ServiceUtil.returnError(e.getMessage());
             }
+            
+            String autoApproveImage = UtilProperties.getPropertyValue("catalog", "image.management.autoApproveImage");
+            if (autoApproveImage.equals("Y")) {
+                Map<String, Object> autoApproveCtx = FastMap.newInstance();
+                autoApproveCtx.put("contentId", contentId);
+                autoApproveCtx.put("userLogin", userLogin);
+                autoApproveCtx.put("checkStatusId", "IM_APPROVED");
+                try {
+                    dispatcher.runSync("updateStatusImageManagement", autoApproveCtx);
+                } catch (GenericServiceException e) {
+                    Debug.logError(e, module);
+                    return ServiceUtil.returnError(e.getMessage());
+                }
+            }
         }
         return result;
     }
@@ -379,10 +369,7 @@ public class ImageManagementServices {
             }
             
             /* scale Image for each Size Type */
-            Iterator<String> sizeIter = sizeTypeList.iterator();
-            while (sizeIter.hasNext()) {
-                String sizeType = sizeIter.next();
-                
+            for(String sizeType : sizeTypeList) {
                 resultScaleImgMap.putAll(ImageTransform.scaleImage(bufImg, imgHeight, imgWidth, imgPropertyMap, sizeType, locale));
                 
                 if (resultScaleImgMap.containsKey("responseMessage") && resultScaleImgMap.get("responseMessage").equals("success")) {
@@ -462,7 +449,9 @@ public class ImageManagementServices {
             return ServiceUtil.returnError(e.getMessage());
         }
         
-        result.put("dataResourceFrameId", dataResourceResult.get("dataResourceId"));
+        String dataResourceId = (String) dataResourceResult.get("dataResourceId");
+        result.put("dataResourceFrameId", dataResourceId);
+        result.put("dataResourceId", dataResourceId);
         
         Map<String, Object> contentUp = FastMap.newInstance();
         contentUp.put("contentId", contentId);
@@ -843,7 +832,7 @@ public class ImageManagementServices {
         return result;
     }
     
-    public static Map<String, Object> resizeImageOfProduct(DispatchContext dctx, Map<String, ? extends Object> context) {
+    public static Map<String, Object> createNewImageThumbnail(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context);
@@ -851,7 +840,7 @@ public class ImageManagementServices {
         String productId = (String) context.get("productId");
         String contentId = (String) context.get("contentId");
         String dataResourceName = (String) context.get("dataResourceName");
-        String width = (String) context.get("resizeWidth");
+        String width = (String) context.get("sizeWidth");
         String imageType = ".jpg";
         int resizeWidth = Integer.parseInt(width);
         int resizeHeight = resizeWidth;
@@ -903,6 +892,30 @@ public class ImageManagementServices {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.getMessage());
         }
+        String successMsg = "Create new thumbnail size successful";
+        return ServiceUtil.returnSuccess(successMsg);
+    }
+    
+    public static Map<String, Object> resizeImageOfProduct(DispatchContext dctx, Map<String, ? extends Object> context) {
+        String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context);
+        String productId = (String) context.get("productId");
+        String dataResourceName = (String) context.get("dataResourceName");
+        String width = (String) context.get("resizeWidth");
+        int resizeWidth = Integer.parseInt(width);
+        int resizeHeight = resizeWidth;
+        
+        try {
+            BufferedImage bufImg = ImageIO.read(new File(imageServerPath + "/" + productId + "/" + dataResourceName));
+            double imgHeight = bufImg.getHeight();
+            double imgWidth = bufImg.getWidth();
+            String filenameToUse = dataResourceName;
+            String mimeType = dataResourceName.substring(dataResourceName.length() - 3, dataResourceName.length());
+            Map<String, Object> resultResize = ImageManagementServices.resizeImage(bufImg, imgHeight, imgWidth, resizeHeight, resizeWidth);
+            ImageIO.write((RenderedImage) resultResize.get("bufferedImage"), mimeType, new File(imageServerPath + "/" + productId + "/" + filenameToUse));
+        } catch (Exception e) {
+            Debug.logError(e, module);
+            return ServiceUtil.returnError(e.getMessage());
+        }
         String successMsg = "Resize images successful";
         return ServiceUtil.returnSuccess(successMsg);
     }

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java Mon Mar 26 20:56:02 2012
@@ -439,7 +439,7 @@ public class InventoryServices {
             return ServiceUtil.returnSuccess();
         }
 
-        Debug.log("OOS Inventory Items: " + inventoryItems.size(), module);
+        Debug.logInfo("OOS Inventory Items: " + inventoryItems.size(), module);
 
         for (GenericValue inventoryItem: inventoryItems) {
             // get the incomming shipment information for the item
@@ -474,7 +474,7 @@ public class InventoryServices {
                 continue;
             }
 
-            Debug.log("Reservations for item: " + reservations.size(), module);
+            Debug.logInfo("Reservations for item: " + reservations.size(), module);
 
             // available at the time of order
             BigDecimal availableBeforeReserved = inventoryItem.getBigDecimal("availableToPromiseTotal");
@@ -495,7 +495,7 @@ public class InventoryServices {
                     }
                 }
 
-                Debug.log("Promised Date: " + actualPromiseDate, module);
+                Debug.logInfo("Promised Date: " + actualPromiseDate, module);
 
                 // find the next possible ship date
                 Timestamp nextShipDate = null;
@@ -508,7 +508,7 @@ public class InventoryServices {
                     }
                 }
 
-                Debug.log("Next Ship Date: " + nextShipDate, module);
+                Debug.logInfo("Next Ship Date: " + nextShipDate, module);
 
                 // create a modified promise date (promise date - 1 day)
                 Calendar pCal = Calendar.getInstance();
@@ -517,17 +517,17 @@ public class InventoryServices {
                 Timestamp modifiedPromisedDate = new Timestamp(pCal.getTimeInMillis());
                 Timestamp now = UtilDateTime.nowTimestamp();
 
-                Debug.log("Promised Date + 1: " + modifiedPromisedDate, module);
-                Debug.log("Now: " + now, module);
+                Debug.logInfo("Promised Date + 1: " + modifiedPromisedDate, module);
+                Debug.logInfo("Now: " + now, module);
 
                 // check the promised date vs the next ship date
                 if (nextShipDate == null || nextShipDate.after(actualPromiseDate)) {
                     if (nextShipDate == null && modifiedPromisedDate.after(now)) {
                         // do nothing; we are okay to assume it will be shipped on time
-                        Debug.log("No ship date known yet, but promised date hasn't approached, assuming it will be here on time", module);
+                        Debug.logInfo("No ship date known yet, but promised date hasn't approached, assuming it will be here on time", module);
                     } else {
                         // we cannot ship by the promised date; need to notify the customer
-                        Debug.log("We won't ship on time, getting notification info", module);
+                        Debug.logInfo("We won't ship on time, getting notification info", module);
                         Map<String, Timestamp> notifyItems = ordersToUpdate.get(orderId);
                         if (notifyItems == null) {
                             notifyItems = FastMap.newInstance();
@@ -545,7 +545,7 @@ public class InventoryServices {
                         boolean needToCancel = false;
                         if (nextShipDate == null || nextShipDate.after(farPastPromised)) {
                             // we cannot ship until >30 days after promised; using cancel rule
-                            Debug.log("Ship date is >30 past the promised date", module);
+                            Debug.logInfo("Ship date is >30 past the promised date", module);
                             needToCancel = true;
                         } else if (currentPromiseDate != null && actualPromiseDate.equals(currentPromiseDate)) {
                             // this is the second notification; using cancel rule
@@ -555,7 +555,7 @@ public class InventoryServices {
                         // add the info to the cancel map if we need to schedule a cancel
                         if (needToCancel) {
                             // queue the item to be cancelled
-                            Debug.log("Flagging the item to auto-cancel", module);
+                            Debug.logInfo("Flagging the item to auto-cancel", module);
                             Map<String, Timestamp> cancelItems = ordersToCancel.get(orderId);
                             if (cancelItems == null) {
                                 cancelItems = FastMap.newInstance();

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/price/PriceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/price/PriceServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/price/PriceServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/price/PriceServices.java Mon Mar 26 20:56:02 2012
@@ -21,12 +21,10 @@ package org.ofbiz.product.price;
 import java.math.BigDecimal;
 import java.sql.Timestamp;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.TreeSet;
-import java.util.Map.Entry;
 
 import javolution.util.FastList;
 import javolution.util.FastMap;
@@ -44,6 +42,7 @@ import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
 import org.ofbiz.product.product.ProductWorker;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
@@ -147,7 +146,7 @@ public class PriceServices {
         String currencyDefaultUomId = (String) context.get("currencyUomId");
         String currencyUomIdTo = (String) context.get("currencyUomIdTo"); 
         if (UtilValidate.isEmpty(currencyDefaultUomId)) {
-            currencyDefaultUomId = UtilProperties.getPropertyValue("general", "currency.uom.id.default", "USD");
+            currencyDefaultUomId = EntityUtilProperties.getPropertyValue("general", "currency.uom.id.default", "USD", delegator);
         }
 
         // productPricePurposeId is null assume "PURCHASE", which is equivalent to what prices were before the purpose concept
@@ -529,9 +528,7 @@ public class PriceServices {
             if (UtilValidate.isNotEmpty(currencyDefaultUomId) && UtilValidate.isNotEmpty(currencyUomIdTo) && !currencyDefaultUomId.equals(currencyUomIdTo)) {
                 if(UtilValidate.isNotEmpty(result)){
                     Map<String, Object> convertPriceMap = FastMap.newInstance();
-                    Iterator<Entry<String, Object>> it= result.entrySet().iterator();
-                    while (it.hasNext()) {
-                        Map.Entry<String, Object> entry = it.next();
+                    for(Map.Entry<String, Object> entry : result.entrySet()) {
                         BigDecimal tempPrice = BigDecimal.ZERO;
                         if(entry.getKey() == "basePrice")
                             tempPrice = (BigDecimal) entry.getValue();

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/KeywordIndex.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/KeywordIndex.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/KeywordIndex.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/KeywordIndex.java Mon Mar 26 20:56:02 2012
@@ -194,7 +194,7 @@ public class KeywordIndex {
         int keywordMaxLength = Integer.parseInt(UtilProperties.getPropertyValue("prodsearch", "product.keyword.max.length"));
         for (Map.Entry<String, Long> entry: keywords.entrySet()) {
             if (entry.getKey().length() <= keywordMaxLength) {
-                GenericValue productKeyword = delegator.makeValue("ProductKeyword", UtilMisc.toMap("productId", product.getString("productId"), "keyword", entry.getKey(), "relevancyWeight", entry.getValue()));
+                GenericValue productKeyword = delegator.makeValue("ProductKeyword", UtilMisc.toMap("productId", product.getString("productId"), "keyword", entry.getKey(), "keywordTypeId", "KWT_KEYWORD", "relevancyWeight", entry.getValue()));
                 toBeStored.add(productKeyword);
             }
         }

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductEvents.java Mon Mar 26 20:56:02 2012
@@ -24,6 +24,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -1170,5 +1172,40 @@ public class ProductEvents {
         }
         return new BigDecimal(bigDecimalString);
     }
-
-}
+    
+    /** Event add product tags */
+    public static String addProductTags (HttpServletRequest request, HttpServletResponse response) {
+        Delegator delegator = (Delegator) request.getAttribute("delegator");
+        LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
+        String productId = request.getParameter("productId");
+        String productTags = request.getParameter("productTags");
+        if (UtilValidate.isNotEmpty(productId) && UtilValidate.isNotEmpty(productTags)) {
+            List<String> matchList = FastList.newInstance();
+            Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
+            Matcher regexMatcher = regex.matcher(productTags);
+            while (regexMatcher.find()) {
+                matchList.add(regexMatcher.group().replace("'", ""));
+            }
+            
+            GenericValue userLogin = null;
+            try {
+                userLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+            } catch (GenericEntityException e) {
+                request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
+                return "error";
+            }
+            
+            if(UtilValidate.isNotEmpty(matchList)) {
+                for (String keywordStr : matchList) {
+                    try {
+                        dispatcher.runSync("createProductKeyword", UtilMisc.toMap("productId", productId, "keyword", keywordStr.trim(), "keywordTypeId", "KWT_TAG","statusId","KW_PENDING" , "userLogin", userLogin));
+                    } catch (GenericServiceException e) {
+                        request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
+                        return "error";
+                    }
+                }
+            }
+        }
+        return "success";
+    }
+}
\ No newline at end of file

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductSearch.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductSearch.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductSearch.java Mon Mar 26 20:56:02 2012
@@ -181,6 +181,9 @@ public class ProductSearch {
         public Set<String> excludeFeatureGroupIds = FastSet.newInstance();
         public Set<String> alwaysIncludeFeatureGroupIds = FastSet.newInstance();
 
+        public List<String> keywordTypeIds = FastList.newInstance();
+        public String statusId = null;
+
         public ProductSearchContext(Delegator delegator, String visitId) {
             this.delegator = delegator;
             this.visitId = visitId;
@@ -282,9 +285,34 @@ public class ProductSearch {
 
                     dynamicViewEntity.addMemberEntity(entityAlias, "ProductKeyword");
                     dynamicViewEntity.addAlias(entityAlias, prefix + "Keyword", "keyword", null, null, null, null);
+                    
+                    // keyword type filter
+                    if (UtilValidate.isNotEmpty(keywordTypeIds)) {
+                        dynamicViewEntity.addAlias(entityAlias, "keywordTypeId");
+                    }
+                    
+                    // keyword status filter
+                    if (UtilValidate.isNotEmpty(statusId)) {
+                        dynamicViewEntity.addAlias(entityAlias, "statusId");
+                    }
+                    
                     dynamicViewEntity.addViewLink("PROD", entityAlias, Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
                     entityConditionList.add(EntityCondition.makeCondition(prefix + "Keyword", EntityOperator.LIKE, keyword));
-
+                    
+                    // keyword type filter
+                    if (UtilValidate.isNotEmpty(keywordTypeIds)) {
+                        List<EntityCondition> keywordTypeCons = FastList.newInstance();
+                        for (String keywordTypeId : keywordTypeIds) {
+                            keywordTypeCons.add(EntityCondition.makeCondition("keywordTypeId", EntityOperator.EQUALS, keywordTypeId));
+                        }
+                        entityConditionList.add(EntityCondition.makeCondition(keywordTypeCons, EntityOperator.OR));
+                    }
+                    
+                    // keyword status filter
+                    if (UtilValidate.isNotEmpty(statusId)) {
+                        entityConditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId));
+                    }
+                    
                     //don't add an alias for this, will be part of a complex alias: dynamicViewEntity.addAlias(entityAlias, prefix + "RelevancyWeight", "relevancyWeight", null, null, null, null);
                     //needed when doingBothAndOr or will get an SQL error
                     if (doingBothAndOr) {
@@ -1946,8 +1974,10 @@ public class ProductSearch {
         public void setSortOrder(ProductSearchContext productSearchContext) {
             if (productSearchContext.includedKeywordSearch) {
                 // we have to check this in order to be sure that there is a totalRelevancy to sort by...
-                productSearchContext.orderByList.add("-totalRelevancy");
-                productSearchContext.fieldsToSelect.add("totalRelevancy");
+                if(productSearchContext.keywordFixedOrSetAndList.size() > 0 || productSearchContext.andKeywordFixedSet.size() > 0) {
+                    productSearchContext.orderByList.add("-totalRelevancy");
+                    productSearchContext.fieldsToSelect.add("totalRelevancy");
+                }
                 if (productSearchContext.keywordFixedOrSetAndList.size() > 0)
                     productSearchContext.productIdGroupBy = true;
             }

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Mon Mar 26 20:56:02 2012
@@ -859,6 +859,7 @@ public class ProductSearchSession {
         productSearchOptions.setPaging((String) parameters.get("PAGING"));
     }
 
+    @SuppressWarnings("unchecked")
     public static Map<String, Object> getProductSearchResult(HttpServletRequest request, Delegator delegator, String prodCatalogId) {
 
         // ========== Create View Indexes
@@ -869,6 +870,14 @@ public class ProductSearchSession {
         int listSize = 0;
         String paging = "Y";
         int previousViewSize = 20;
+        Map<String, Object> requestParams = UtilHttp.getCombinedMap(request);
+        List<String> keywordTypeIds = FastList.newInstance();
+        if (requestParams.get("keywordTypeId") instanceof String) {
+            keywordTypeIds.add((String) requestParams.get("keywordTypeId"));
+        } else if (requestParams.get("keywordTypeId") instanceof List){
+            keywordTypeIds = (List<String>) requestParams.get("keywordTypeId");
+        }
+        String statusId = (String) requestParams.get("statusId");
 
         HttpSession session = request.getSession();
         ProductSearchOptions productSearchOptions = getProductSearchOptions(session);
@@ -902,7 +911,6 @@ public class ProductSearchSession {
         List<String> productIds = FastList.newInstance();
         String visitId = VisitHandler.getVisitId(session);
         List<ProductSearchConstraint> productSearchConstraintList = ProductSearchOptions.getConstraintList(session);
-        Map<String, Object> requestParams = UtilHttp.getParameterMap(request);
         String noConditionFind = (String) requestParams.get("noConditionFind");
         if (UtilValidate.isEmpty(noConditionFind)) {
             noConditionFind = UtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind");
@@ -965,7 +973,17 @@ public class ProductSearchSession {
             productSearchContext.setResultSortOrder(resultSortOrder);
             productSearchContext.setResultOffset(resultOffset);
             productSearchContext.setMaxResults(maxResults);
-
+            
+            if (UtilValidate.isNotEmpty(keywordTypeIds)) {
+                productSearchContext.keywordTypeIds = keywordTypeIds;
+            } else {
+                 productSearchContext.keywordTypeIds = UtilMisc.toList("KWT_KEYWORD");
+            }
+            
+            if (UtilValidate.isNotEmpty(statusId)) {
+                productSearchContext.statusId = statusId;
+            }
+            
             List<String> foundProductIds = productSearchContext.doSearch();
             if (maxResultsInt > 0) {
                 productIds.addAll(foundProductIds);

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductWorker.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/product/ProductWorker.java Mon Mar 26 20:56:02 2012
@@ -41,6 +41,7 @@ import org.ofbiz.entity.GenericEntityExc
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.util.EntityTypeUtil;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.product.config.ProductConfigWrapper;
 import org.ofbiz.product.config.ProductConfigWrapper.ConfigOption;
@@ -58,6 +59,8 @@ public class ProductWorker {
 
     public static final MathContext generalRounding = new MathContext(10);
 
+    private ProductWorker () {}
+
     public static boolean shippingApplies(GenericValue product) {
         String errMsg = "";
         if (product != null) {
@@ -146,7 +149,7 @@ public class ProductWorker {
     public static String getInstanceAggregatedId(Delegator delegator, String instanceProductId) throws GenericEntityException {
         GenericValue instanceProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", instanceProductId));
 
-        if (UtilValidate.isNotEmpty(instanceProduct) && "AGGREGATED_CONF".equals(instanceProduct.getString("productTypeId"))) {
+        if (UtilValidate.isNotEmpty(instanceProduct) && EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", instanceProduct.getString("productTypeId"), "parentTypeId", "AGGREGATED")) {
             GenericValue productAssoc = EntityUtil.getFirst(EntityUtil.filterByDate(instanceProduct.getRelatedByAnd("AssocProductAssoc",
                     UtilMisc.toMap("productAssocTypeId", "PRODUCT_CONF"))));
             if (UtilValidate.isNotEmpty(productAssoc)) {
@@ -172,7 +175,7 @@ public class ProductWorker {
     public static List<GenericValue> getAggregatedAssocs(Delegator delegator, String  aggregatedProductId) throws GenericEntityException {
         GenericValue aggregatedProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", aggregatedProductId));
 
-        if (UtilValidate.isNotEmpty(aggregatedProduct) && "AGGREGATED".equals(aggregatedProduct.getString("productTypeId"))) {
+        if (UtilValidate.isNotEmpty(aggregatedProduct) && ("AGGREGATED".equals(aggregatedProduct.getString("productTypeId")) || "AGGREGATED_SERVICE".equals(aggregatedProduct.getString("productTypeId")))) {
             List<GenericValue> productAssocs = EntityUtil.filterByDate(aggregatedProduct.getRelatedByAnd("MainProductAssoc",
                     UtilMisc.toMap("productAssocTypeId", "PRODUCT_CONF")));
             return productAssocs;
@@ -1029,7 +1032,7 @@ public class ProductWorker {
                 }
             }
             // find variant
-            // Debug.log("=====try to find variant for product: " + productId + " and features: " + selectedFeatures);
+            // Debug.logInfo("=====try to find variant for product: " + productId + " and features: " + selectedFeatures);
             List<GenericValue> productAssocs = EntityUtil.filterByDate(delegator.findByAnd("ProductAssoc", UtilMisc.toMap("productId", productId, "productAssocTypeId","PRODUCT_VARIANT")));
             boolean productFound = false;
 nextProd:
@@ -1045,7 +1048,7 @@ nextProd:
                 break;
             }
 //          if (productFound)
-//              Debug.log("=====product found:" + productId + " and features: " + selectedFeatures);
+//              Debug.logInfo("=====product found:" + productId + " and features: " + selectedFeatures);
 
             /**
              * 1. variant not found so create new variant product and use the virtual product as basis, new one  is a variant type and not a virtual type.
@@ -1099,7 +1102,7 @@ nextProd:
                 GenericValue productAssoc = delegator.makeValue("ProductAssoc", UtilMisc.toMap("productId", productId, "productIdTo", product.getString("productId"), "productAssocTypeId", "PRODUCT_VARIANT"));
                 productAssoc.put("fromDate", UtilDateTime.nowTimestamp());
                 productAssoc.create();
-                Debug.log("set the productId to: " + product.getString("productId"));
+                Debug.logInfo("set the productId to: " + product.getString("productId"), module);
 
                 // copy the supplier
                 List<GenericValue> supplierProducts = delegator.findByAndCache("SupplierProduct", UtilMisc.toMap("productId", productId));
@@ -1193,4 +1196,16 @@ nextProd:
         return Boolean.TRUE;
     }
 
+    public static boolean isAggregateService(Delegator delegator, String aggregatedProductId) {
+        try {
+            GenericValue aggregatedProduct = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", aggregatedProductId));
+            if (UtilValidate.isNotEmpty(aggregatedProduct) && "AGGREGATED_SERVICE".equals(aggregatedProduct.getString("productTypeId"))) {
+                return true;
+            }
+        } catch (GenericEntityException e) {
+            Debug.logWarning(e.getMessage(), module);
+        }
+
+        return false;
+    }
 }

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java Mon Mar 26 20:56:02 2012
@@ -478,7 +478,7 @@ public class ProductStoreWorker {
             storeSurveys = EntityUtil.filterByAnd(storeSurveys, UtilMisc.toMap("groupName", groupName));
         }
 
-         Debug.log("getSurvey for product " + productId,module);
+         Debug.logInfo("getSurvey for product " + productId,module);
         // limit by product
         if (!UtilValidate.isEmpty(productId) && !UtilValidate.isEmpty(storeSurveys)) {
             for (GenericValue surveyAppl: storeSurveys) {
@@ -495,7 +495,7 @@ public class ProductStoreWorker {
                         else {
                             virtualProductId = ProductWorker.getVariantVirtualId(product);
                         }
-                        Debug.log("getSurvey for virtual product " + virtualProductId,module);
+                        Debug.logInfo("getSurvey for virtual product " + virtualProductId,module);
                     }
                 } catch (GenericEntityException e) {
                     Debug.logError(e, "Problem finding product from productId " + productId, module);

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java Mon Mar 26 20:56:02 2012
@@ -57,7 +57,7 @@ public class PackingServices {
             quantity = BigDecimal.ONE;
         }
 
-        Debug.log("OrderId [" + orderId + "] ship group [" + shipGroupSeqId + "] Pack input [" + productId + "] @ [" + quantity + "] packageSeq [" + packageSeq + "] weight [" + weight +"]", module);
+        Debug.logInfo("OrderId [" + orderId + "] ship group [" + shipGroupSeqId + "] Pack input [" + productId + "] @ [" + quantity + "] packageSeq [" + packageSeq + "] weight [" + weight +"]", module);
 
         if (weight == null) {
             Debug.logWarning("OrderId [" + orderId + "] ship group [" + shipGroupSeqId + "] product [" + productId + "] being packed without a weight, assuming 0", module);
@@ -134,7 +134,7 @@ public class PackingServices {
                 String boxType = boxTypeInfo.get(rowKey);
                 session.setShipmentBoxTypeId(boxType);
 
-                Debug.log("Item: " + orderItemSeqId + " / Product: " + prdStr + " / Quantity: " + qtyStr + " /  Package: " + pkgStr + " / Weight: " + wgtStr, module);
+                Debug.logInfo("Item: " + orderItemSeqId + " / Product: " + prdStr + " / Quantity: " + qtyStr + " /  Package: " + pkgStr + " / Weight: " + wgtStr, module);
 
                 // array place holders
                 String[] quantities;

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java Mon Mar 26 20:56:02 2012
@@ -170,16 +170,16 @@ public class PackingSession implements j
                 int thisCheck = this.checkLineForAdd(res, orderId, orderItemSeqId, shipGroupSeqId, productId, thisQty, packageSeqId, update);
                 switch (thisCheck) {
                     case 2:
-                        Debug.log("Packing check returned '2' - new pack line will be created!", module);
+                        Debug.logInfo("Packing check returned '2' - new pack line will be created!", module);
                         toCreateMap.put(res, thisQty);
                         qtyRemain = qtyRemain.subtract(thisQty);
                         break;
                     case 1:
-                        Debug.log("Packing check returned '1' - existing pack line has been updated!", module);
+                        Debug.logInfo("Packing check returned '1' - existing pack line has been updated!", module);
                         qtyRemain = qtyRemain.subtract(thisQty);
                         break;
                     case 0:
-                        Debug.log("Packing check returned '0' - doing nothing.", module);
+                        Debug.logInfo("Packing check returned '0' - doing nothing.", module);
                         break;
                 }
             }
@@ -290,10 +290,10 @@ public class PackingSession implements j
         PackingSessionLine line = this.findLine(orderId, orderItemSeqId, shipGroupSeqId, productId, invItemId, packageSeqId);
         BigDecimal packedQty = this.getPackedQuantity(orderId, orderItemSeqId, shipGroupSeqId, productId);
 
-        Debug.log("Packed quantity [" + packedQty + "] + [" + quantity + "]", module);
+        Debug.logInfo("Packed quantity [" + packedQty + "] + [" + quantity + "]", module);
 
         if (line == null) {
-            Debug.log("No current line found testing [" + invItemId + "] R: " + resQty + " / Q: " + quantity, module);
+            Debug.logInfo("No current line found testing [" + invItemId + "] R: " + resQty + " / Q: " + quantity, module);
             if (resQty.compareTo(quantity) < 0) {
                 return 0;
             } else {
@@ -301,7 +301,7 @@ public class PackingSession implements j
             }
         } else {
             BigDecimal newQty = update ? quantity : (line.getQuantity().add(quantity));
-            Debug.log("Existing line found testing [" + invItemId + "] R: " + resQty + " / Q: " + newQty, module);
+            Debug.logInfo("Existing line found testing [" + invItemId + "] R: " + resQty + " / Q: " + newQty, module);
             if (resQty.compareTo(newQty) < 0) {
                 return 0;
             } else {
@@ -755,7 +755,7 @@ public class PackingSession implements j
         }
 
         newShipment.put("partyIdFrom", partyIdFrom);
-        Debug.log("Creating new shipment with context: " + newShipment, module);
+        Debug.logInfo("Creating new shipment with context: " + newShipment, module);
         Map<String, Object> newShipResp = this.getDispatcher().runSync("createShipment", newShipment);
 
         if (ServiceUtil.isError(newShipResp)) {
@@ -1010,7 +1010,7 @@ public class PackingSession implements j
                 productId = v.getString("inventoryProductId");
                 quantity = v.getBigDecimal("totQuantityReserved").setScale(2, BigDecimal.ROUND_HALF_UP);
             }
-            Debug.log("created item display object quantity: " + quantity + " (" + productId + ")", module);
+            Debug.logInfo("created item display object quantity: " + quantity + " (" + productId + ")", module);
         }
 
         public GenericValue getOrderItem() {

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java Mon Mar 26 20:56:02 2012
@@ -204,7 +204,7 @@ public class PackingSessionLine implemen
 
         if (picklistBinId != null) {
             // find the pick list item
-            Debug.log("Looking up picklist item for bin ID #" + picklistBinId, module);
+            Debug.logInfo("Looking up picklist item for bin ID #" + picklistBinId, module);
             Delegator delegator = dispatcher.getDelegator();
             Map<String, Object> itemLookup = FastMap.newInstance();
             itemLookup.put("picklistBinId", picklistBinId);
@@ -214,7 +214,7 @@ public class PackingSessionLine implemen
             itemLookup.put("inventoryItemId", this.getInventoryItemId());
             GenericValue plItem = delegator.findByPrimaryKey("PicklistItem", itemLookup);
             if (plItem != null) {
-                Debug.log("Found picklist bin: " + plItem, module);
+                Debug.logInfo("Found picklist bin: " + plItem, module);
                 BigDecimal itemQty = plItem.getBigDecimal("quantity");
                 if (itemQty.compareTo(quantity) == 0) {
                     // set to complete
@@ -229,7 +229,7 @@ public class PackingSessionLine implemen
                     throw new GeneralException(ServiceUtil.getErrorMessage(issueResp));
                 }
             } else {
-                Debug.log("No item was found for lookup: " + itemLookup, module);
+                Debug.logInfo("No item was found for lookup: " + itemLookup, module);
             }
         } else {
             Debug.logWarning("*** NO Picklist Bin ID set; cannot update picklist status!", module);

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java Mon Mar 26 20:56:02 2012
@@ -75,8 +75,8 @@ public class PickListServices {
                     Debug.logError(e, module);
                     return ServiceUtil.returnError(e.getMessage());
                 }
-                Debug.log("Recieved orderIdList  - " + orderIdList, module);
-                Debug.log("Found orderHeaderList - " + orderHeaderList, module);
+                Debug.logInfo("Recieved orderIdList  - " + orderIdList, module);
+                Debug.logInfo("Found orderHeaderList - " + orderHeaderList, module);
             }
         }
 

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java Mon Mar 26 20:56:02 2012
@@ -496,7 +496,7 @@ public class ShipmentServices {
         // Grab the estimate and work with it.
         GenericValue estimate = estimateList.get(estimateIndex);
 
-        //Debug.log("[ShippingEvents.getShipEstimate] Working with estimate [" + estimateIndex + "]: " + estimate, module);
+        //Debug.logInfo("[ShippingEvents.getShipEstimate] Working with estimate [" + estimateIndex + "]: " + estimate, module);
 
         // flat fees
         BigDecimal orderFlat = BigDecimal.ZERO;

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java Mon Mar 26 20:56:02 2012
@@ -420,7 +420,7 @@ public class DhlServices {
 
         try {
             requestString = UtilXml.writeXmlDocument(requestDocument);
-            Debug.log("AccessRequest XML Document:" + requestString);
+            Debug.logInfo("AccessRequest XML Document:" + requestString, module);
         } catch (IOException e) {
             String ioeErrMsg = "Error writing the AccessRequest XML Document to a String: " + e.toString();
             Debug.logError(e, ioeErrMsg, module);
@@ -432,7 +432,7 @@ public class DhlServices {
         String registerResponseString = null;
         try {
             registerResponseString = sendDhlRequest(requestString, delegator, shipmentGatewayConfigId, resource, locale);
-            Debug.log("DHL request for DHL Register Account:" + registerResponseString);
+            Debug.logInfo("DHL request for DHL Register Account:" + registerResponseString, module);
         } catch (DhlConnectException e) {
             String uceErrMsg = "Error sending DHL request for DHL Register Account: " + e.toString();
             Debug.logError(e, uceErrMsg, module);
@@ -445,7 +445,7 @@ public class DhlServices {
         try {
             registerResponseDocument = UtilXml.readXmlDocument(registerResponseString, false);
             result = handleDhlRegisterResponse(registerResponseDocument, locale);
-            Debug.log("DHL response for DHL Register Account:" + registerResponseString);
+            Debug.logInfo("DHL response for DHL Register Account:" + registerResponseString, module);
         } catch (SAXException e2) {
             String excErrMsg = "Error parsing the RegisterAccountServiceSelectionResponse: " + e2.toString();
             Debug.logError(e2, excErrMsg, module);
@@ -883,7 +883,7 @@ public class DhlServices {
             // store in db blob
             shipmentPackageRouteSeg.setBytes("labelImage", labelBytes);
         } else {
-            Debug.log("Failed to either decode returned DHL label or no data found in eCommerce/Shipment/Label/Image.");
+            Debug.logInfo("Failed to either decode returned DHL label or no data found in eCommerce/Shipment/Label/Image.", module);
             // TODO: VOID
         }
 

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java Mon Mar 26 20:56:02 2012
@@ -49,6 +49,7 @@ import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
 import org.ofbiz.party.party.PartyHelper;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
@@ -350,7 +351,7 @@ public class FedexServices {
             String fDXSubscriptionReplyString = null;
             try {
                 fDXSubscriptionReplyString = sendFedexRequest(fDXSubscriptionRequestString, delegator, shipmentGatewayConfigId, resource, locale);
-                Debug.log("Fedex response for FDXSubscriptionRequest:" + fDXSubscriptionReplyString);
+                Debug.logInfo("Fedex response for FDXSubscriptionRequest:" + fDXSubscriptionReplyString, module);
             } catch (FedexConnectException e) {
                 String errorMessage = "Error sending Fedex request for FDXSubscriptionRequest: " + e.toString();
                 Debug.logError(e, errorMessage, module);
@@ -362,7 +363,7 @@ public class FedexServices {
             Document fDXSubscriptionReplyDocument = null;
             try {
                 fDXSubscriptionReplyDocument = UtilXml.readXmlDocument(fDXSubscriptionReplyString, false);
-                Debug.log("Fedex response for FDXSubscriptionRequest:" + fDXSubscriptionReplyString);
+                Debug.logInfo("Fedex response for FDXSubscriptionRequest:" + fDXSubscriptionReplyString, module);
             } catch (SAXException se) {
                 String errorMessage = "Error parsing the FDXSubscriptionRequest response: " + se.toString();
                 Debug.logError(se, errorMessage, module);
@@ -538,7 +539,7 @@ public class FedexServices {
             } else if (UtilValidate.isNotEmpty(shipmentRouteSegment.getString("currencyUomId"))) {
                 currencyCode = shipment.getString("currencyUomId");
             } else {
-                currencyCode = UtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD");
+                currencyCode = EntityUtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD", delegator);
             }
 
             // Get and validate origin postal address
@@ -1044,7 +1045,7 @@ public class FedexServices {
             // Store in db blob
             shipmentPackageRouteSeg.setBytes("labelImage", labelBytes);
         } else {
-            Debug.log("Failed to either decode returned FedEx label or no data found in Labels/OutboundLabel.");
+            Debug.logInfo("Failed to either decode returned FedEx label or no data found in Labels/OutboundLabel.", module);
             // TODO: Cancel the package
         }
 

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Mon Mar 26 20:56:02 2012
@@ -56,6 +56,7 @@ import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
 import org.ofbiz.party.contact.ContactMechWorker;
 import org.ofbiz.product.store.ProductStoreWorker;
 import org.ofbiz.service.DispatchContext;
@@ -304,7 +305,7 @@ public class UpsServices {
             } else if (UtilValidate.isNotEmpty(shipment.getString("currencyUomId"))) {
                 currencyCode = shipment.getString("currencyUomId");
             } else {
-                currencyCode = UtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD");
+                currencyCode = EntityUtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD", delegator);
             }
 
             // Okay, start putting the XML together...
@@ -639,7 +640,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
 
@@ -660,7 +661,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
 
@@ -924,7 +925,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
 
@@ -945,7 +946,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
 
@@ -1149,7 +1150,7 @@ public class UpsServices {
                             fileOut.flush();
                             fileOut.close();
                         } catch (IOException e) {
-                            Debug.log(e, "Could not save UPS LabelImage GIF file: [[[" + packageLabelGraphicImageString + "]]] to file: " + outFileName, module);
+                            Debug.logInfo(e, "Could not save UPS LabelImage GIF file: [[[" + packageLabelGraphicImageString + "]]] to file: " + outFileName, module);
                         }
                     }
                     if (labelInternationalSignatureGraphicImageBytes != null) {
@@ -1160,7 +1161,7 @@ public class UpsServices {
                             fileOut.flush();
                             fileOut.close();
                         } catch (IOException e) {
-                            Debug.log(e, "Could not save UPS IntlSign LabelImage GIF file: [[[" + packageLabelInternationalSignatureGraphicImageString + "]]] to file: " + outFileName, module);
+                            Debug.logInfo(e, "Could not save UPS IntlSign LabelImage GIF file: [[[" + packageLabelInternationalSignatureGraphicImageString + "]]] to file: " + outFileName, module);
                         }
                     }
                     if (packageLabelHTMLImageStringDecoded != null) {
@@ -1171,7 +1172,7 @@ public class UpsServices {
                             fileOut.flush();
                             fileOut.close();
                         } catch (IOException e) {
-                            Debug.log(e, "Could not save UPS LabelImage HTML file: [[[" + packageLabelHTMLImageStringDecoded + "]]] to file: " + outFileName, module);
+                            Debug.logInfo(e, "Could not save UPS LabelImage HTML file: [[[" + packageLabelHTMLImageStringDecoded + "]]] to file: " + outFileName, module);
                         }
                     }
                 }
@@ -1197,7 +1198,7 @@ public class UpsServices {
                         file.flush();
                         file.close();
                     } catch (IOException e) {
-                        Debug.log(e, "Could not save UPS International Invoice: [[[" + imgStringDecoded + "]]] to file: " + outFile, module);
+                        Debug.logInfo(e, "Could not save UPS International Invoice: [[[" + imgStringDecoded + "]]] to file: " + outFile, module);
                     }
                 }
                 String formGroupId = UtilXml.childElementValue(formElement, "FormGroupId");
@@ -1230,7 +1231,7 @@ public class UpsServices {
                         fileOut.flush();
                         fileOut.close();
                     } catch (IOException e) {
-                        Debug.log(e, "Could not save UPS High Value Report data: [[[" + fileStringDecoded + "]]] to file: " + outFileName, module);
+                        Debug.logInfo(e, "Could not save UPS High Value Report data: [[[" + fileStringDecoded + "]]] to file: " + outFileName, module);
                     }
                 }
             }
@@ -1354,7 +1355,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
 
@@ -1375,7 +1376,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
 
@@ -1560,7 +1561,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
 
@@ -1581,7 +1582,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
 
@@ -1870,7 +1871,7 @@ public class UpsServices {
                 }
             }
 
-            Debug.log("UPS Rate Map : " + rateMap, module);
+            Debug.logInfo("UPS Rate Map : " + rateMap, module);
 
             Map<String, Object> resp = ServiceUtil.returnSuccess();
             resp.put("upsRateCodeMap", rateMap);
@@ -1979,8 +1980,8 @@ public class UpsServices {
             Debug.logError(e, "Unable to set timeout to " + timeOutStr + " using default " + timeout);
         }
 
-        //Debug.log("UPS Connect URL : " + conStr, module);
-        //Debug.log("UPS XML String : " + xmlString, module);
+        //Debug.logInfo("UPS Connect URL : " + conStr, module);
+        //Debug.logInfo("UPS XML String : " + xmlString, module);
 
         HttpClient http = new HttpClient(conStr);
         http.setTimeout(timeout * 1000);
@@ -2752,7 +2753,7 @@ public class UpsServices {
                     fileOut.flush();
                     fileOut.close();
                 } catch (IOException e) {
-                    Debug.log(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
+                    Debug.logInfo(e, "Could not save UPS XML file: [[[" + xmlString.toString() + "]]] to file: " + outFileName, module);
                 }
             }
             try {
@@ -3167,7 +3168,7 @@ public class UpsServices {
                     rateMap.put(serviceCode, new BigDecimal(totalRates));
                 }
             }
-            Debug.log("UPS Rate Map : " + rateMap, module);
+            Debug.logInfo("UPS Rate Map : " + rateMap, module);
             Map<String, Object> resp = ServiceUtil.returnSuccess();
             resp.put("upsRateCodeMap", rateMap);
             return resp;

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsMockApiServlet.java Mon Mar 26 20:56:02 2012
@@ -129,7 +129,7 @@ public class UspsMockApiServlet extends 
             try {
                 UtilXml.writeXmlDocument(responseDocument, os, "UTF-8", true, false, 0);
             } catch (TransformerException e) {
-                Debug.log(e, module);
+                Debug.logInfo(e, module);
                 return;
             }
 

Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Mon Mar 26 20:56:02 2012
@@ -225,7 +225,7 @@ public class UspsServices {
         try {
             responseDocument = sendUspsRequest("RateV2", requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
         } catch (UspsRequestException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsRateDomesticSendingError", UtilMisc.toMap("errorString", e.getMessage()), locale));
         }
@@ -248,7 +248,7 @@ public class UspsServices {
                 BigDecimal packageAmount = new BigDecimal(UtilXml.childElementValue(postageElement, "Rate"));
                 estimateAmount = estimateAmount.add(packageAmount);
             } catch (NumberFormatException e) {
-                Debug.log(e, module);
+                Debug.logInfo(e, module);
             }
         }
 
@@ -380,7 +380,7 @@ public class UspsServices {
         try {
             responseDocument = sendUspsRequest("IntlRate", requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
         } catch (UspsRequestException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsRateInternationalSendingError", UtilMisc.toMap("errorString", e.getMessage()), locale));
         }
@@ -401,7 +401,7 @@ public class UspsServices {
             Element errorElement = UtilXml.firstChildElement(packageElement, "Error");
             if (errorElement != null) {
                 String errorDescription = UtilXml.childElementValue(errorElement, "Description");
-                Debug.log("USPS International Rate Calculation returned a package error: " + errorDescription);
+                Debug.logInfo("USPS International Rate Calculation returned a package error: " + errorDescription, module);
                 return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                         "FacilityShipmentRateNotAvailable", locale));
             }
@@ -415,7 +415,7 @@ public class UspsServices {
                     BigDecimal packageAmount = new BigDecimal(UtilXml.childElementValue(serviceElement, "Postage"));
                     estimateAmount = estimateAmount.add(packageAmount);
                 } catch (NumberFormatException e) {
-                    Debug.log("USPS International Rate Calculation returned an unparsable postage amount: " + UtilXml.childElementValue(serviceElement, "Postage"));
+                    Debug.logInfo("USPS International Rate Calculation returned an unparsable postage amount: " + UtilXml.childElementValue(serviceElement, "Postage"), module);
                     return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                             "FacilityShipmentRateNotAvailable", locale));
                 }
@@ -464,7 +464,7 @@ public class UspsServices {
         try {
             responseDocument = sendUspsRequest("TrackV2", requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
         } catch (UspsRequestException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsTrackingSendingError", UtilMisc.toMap("errorString", e.getMessage()), locale));
         }
@@ -562,7 +562,7 @@ public class UspsServices {
         try {
             responseDocument = sendUspsRequest("Verify", requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
         } catch (UspsRequestException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsAddressValidationSendingError", UtilMisc.toMap("errorString", e.getMessage()), locale));
         }
@@ -648,7 +648,7 @@ public class UspsServices {
         try {
             responseDocument = sendUspsRequest("CityStateLookup", requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
         } catch (UspsRequestException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsCityStateLookupSendingError", 
                     UtilMisc.toMap("errorString", e.getMessage()), locale));
@@ -762,7 +762,7 @@ public class UspsServices {
         try {
             responseDocument = sendUspsRequest(type, requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
         } catch (UspsRequestException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsServiceStandardSendingError", 
                     UtilMisc.toMap("serviceType", type, "errorString", e.getMessage()), locale));
@@ -867,7 +867,7 @@ public class UspsServices {
         try {
             responseDocument = sendUspsRequest("Rate", requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
         } catch (UspsRequestException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsRateDomesticSendingError", 
                     UtilMisc.toMap("errorString", e.getMessage()), locale));
@@ -1126,7 +1126,7 @@ public class UspsServices {
                 try {
                     responseDocument = sendUspsRequest("Rate", requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
                 } catch (UspsRequestException e) {
-                    Debug.log(e, module);
+                    Debug.logInfo(e, module);
                     return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                             "FacilityShipmentUspsRateDomesticSendingError", 
                             UtilMisc.toMap("errorString", e.getMessage()), locale));
@@ -1179,7 +1179,7 @@ public class UspsServices {
             shipmentRouteSegment.store();
 
         } catch (GenericEntityException gee) {
-            Debug.log(gee, module);
+            Debug.logInfo(gee, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsRateDomesticReadingError",
                     UtilMisc.toMap("errorString", gee.getMessage()), locale));
@@ -1396,7 +1396,7 @@ public class UspsServices {
                 try {
                     responseDocument = sendUspsRequest("DeliveryConfirmationV2", requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
                 } catch (UspsRequestException e) {
-                    Debug.log(e, module);
+                    Debug.logInfo(e, module);
                     return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                             "FacilityShipmentUspsDeliveryConfirmationSendingError", 
                             UtilMisc.toMap("errorString", e.getMessage()), locale));
@@ -1428,7 +1428,7 @@ public class UspsServices {
             }
 
         } catch (GenericEntityException gee) {
-            Debug.log(gee, module);
+            Debug.logInfo(gee, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                     "FacilityShipmentUspsDeliveryConfirmationReadingError", 
                     UtilMisc.toMap("errorString", gee.getMessage()), locale));
@@ -1467,10 +1467,10 @@ public class UspsServices {
             }
 
         } catch (GenericEntityException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(e.getMessage());
         } catch (IOException e) {
-            Debug.log(e, module);
+            Debug.logInfo(e, module);
             return ServiceUtil.returnError(e.getMessage());
         }
         return ServiceUtil.returnSuccess();
@@ -1632,7 +1632,7 @@ public class UspsServices {
                     product = shipmentItem.getRelatedOne("Product");
                     originGeo = product.getRelatedOne("OriginGeo");
                 } catch (GenericEntityException e) {
-                    Debug.log(e, module);
+                    Debug.logInfo(e, module);
                 }
 
                 UtilXml.addChildElementValue(itemDetail, "Description", product.getString("productName"), packageDocument);
@@ -1653,7 +1653,7 @@ public class UspsServices {
             try {
                 responseDocument = sendUspsRequest(api, requestDocument, delegator, shipmentGatewayConfigId, resource, locale);
             } catch (UspsRequestException e) {
-                Debug.log(e, module);
+                Debug.logInfo(e, module);
                 return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
                         "FacilityShipmentUspsPriorityMailLabelSendingError", 
                         UtilMisc.toMap("errorString", e.getMessage()), locale));