Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java Tue Dec 9 10:09:22 2014 @@ -56,6 +56,7 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -71,9 +72,9 @@ public class FrameImage { Map<String, Object> result = FastMap.newInstance(); LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String imageServerUrl = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.url"), context); - String nameOfThumb = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.nameofthumbnail"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); + String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator), context); + String nameOfThumb = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.nameofthumbnail", delegator), context); GenericValue userLogin = (GenericValue) context.get("userLogin"); String productId = (String) context.get("productId"); @@ -248,12 +249,13 @@ public class FrameImage { public static String uploadFrame(HttpServletRequest request, HttpServletResponse response) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); + Delegator delegator = dispatcher.getDelegator(); HttpSession session = request.getSession(); GenericValue userLogin = (GenericValue)session.getAttribute("userLogin"); Map<String, ? extends Object> context = UtilGenerics.checkMap(request.getParameterMap()); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String imageServerUrl = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.url"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); + String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator), context); Map<String, Object> tempFile = LayoutWorker.uploadImageAndParameters(request, "uploadedFile"); String imageName = tempFile.get("imageFileName").toString(); String mimType = tempFile.get("uploadMimeType").toString(); @@ -326,7 +328,7 @@ public class FrameImage { Delegator delegator = (Delegator) request.getAttribute("delegator"); Map<String, ? extends Object> context = UtilGenerics.checkMap(request.getParameterMap()); HttpSession session = request.getSession(); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); String productId = request.getParameter("productId"); String imageName = request.getParameter("imageName"); @@ -425,7 +427,7 @@ public class FrameImage { public static String deleteFrameImage(HttpServletRequest request, HttpServletResponse response) { Map<String, ? extends Object> context = UtilGenerics.checkMap(request.getParameterMap()); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", (Delegator) context.get("delegator")), context); File file = new File(imageServerPath + "/preview/" + "/previewImage.jpg"); if (file.exists()) { file.delete(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java Tue Dec 9 10:09:22 2014 @@ -50,6 +50,7 @@ import org.ofbiz.entity.GenericEntityExc import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -81,9 +82,9 @@ public class ImageManagementServices { Locale locale = (Locale) context.get("locale"); if (UtilValidate.isNotEmpty(uploadFileName)) { - String imageFilenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.format"); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String imageServerUrl = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.url"), context); + String imageFilenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.format", delegator); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); + String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator), context); String rootTargetDirectory = imageServerPath; File rootTargetDir = new File(rootTargetDirectory); if (!rootTargetDir.exists()) { @@ -261,7 +262,7 @@ public class ImageManagementServices { return ServiceUtil.returnError(e.getMessage()); } - String autoApproveImage = UtilProperties.getPropertyValue("catalog", "image.management.autoApproveImage"); + String autoApproveImage = EntityUtilProperties.getPropertyValue("catalog", "image.management.autoApproveImage", delegator); if (autoApproveImage.equals("Y")) { Map<String, Object> autoApproveCtx = FastMap.newInstance(); autoApproveCtx.put("contentId", contentId); @@ -282,10 +283,11 @@ public class ImageManagementServices { String productId = (String) context.get("productId"); String contentId = (String) context.get("contentId"); String dataResourceName = (String) context.get("dataResourceName"); + Delegator delegator = dctx.getDelegator(); try { if (UtilValidate.isNotEmpty(contentId)) { - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); File file = new File(imageServerPath + "/" + productId + "/" + dataResourceName); file.delete(); } @@ -334,8 +336,8 @@ public class ImageManagementServices { index = filenameToUse.lastIndexOf("."); String imgExtension = filenameToUse.substring(index + 1); // paths - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String imageServerUrl = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.url"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", (Delegator) context.get("delegator")), context); + String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", (Delegator) context.get("delegator")), context); /* get original BUFFERED IMAGE */ @@ -488,8 +490,8 @@ public class ImageManagementServices { Locale locale = (Locale) context.get("locale"); //FIXME can be removed ? // String imageFilenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.format"); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String nameOfThumb = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.nameofthumbnail"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); + String nameOfThumb = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.nameofthumbnail", delegator), context); // Create content for thumbnail Map<String, Object> contentThumb = FastMap.newInstance(); @@ -696,9 +698,10 @@ public class ImageManagementServices { public static Map<String, Object> createNewImageThumbnail(DispatchContext dctx, Map<String, ? extends Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); + Delegator delegator = dispatcher.getDelegator(); GenericValue userLogin = (GenericValue) context.get("userLogin"); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String imageServerUrl = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.url"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); + String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator), context); String productId = (String) context.get("productId"); String contentId = (String) context.get("contentId"); String dataResourceName = (String) context.get("dataResourceName"); @@ -759,7 +762,8 @@ public class ImageManagementServices { } public static Map<String, Object> resizeImageOfProduct(DispatchContext dctx, Map<String, ? extends Object> context) { - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); + Delegator delegator = dctx.getDelegator(); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); String productId = (String) context.get("productId"); String dataResourceName = (String) context.get("dataResourceName"); String width = (String) context.get("resizeWidth"); @@ -786,8 +790,8 @@ public class ImageManagementServices { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); GenericValue userLogin = (GenericValue) context.get("userLogin"); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String imageServerUrl = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.url"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); + String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator), context); String productId = (String) context.get("productId"); String contentId = (String) context.get("contentId"); String filenameToUse = (String) context.get("drDataResourceName"); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/ReplaceImage.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/ReplaceImage.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/ReplaceImage.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/ReplaceImage.java Tue Dec 9 10:09:22 2014 @@ -36,6 +36,7 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; @@ -49,7 +50,7 @@ public class ReplaceImage{ LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); GenericValue userLogin = (GenericValue) context.get("userLogin"); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); String productId = (String) context.get("productId"); String contentIdExist = (String) context.get("contentIdExist"); String contentIdReplace = (String) context.get("contentIdReplace"); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/RotateImage.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/RotateImage.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/RotateImage.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/RotateImage.java Tue Dec 9 10:09:22 2014 @@ -35,7 +35,9 @@ import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.string.FlexibleStringExpander; +import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -50,8 +52,9 @@ public class RotateImage { public static Map<String, Object> imageRotate(DispatchContext dctx, Map<String, ? extends Object> context) throws IOException, JDOMException { LocalDispatcher dispatcher = dctx.getDispatcher(); + Delegator delegator = dctx.getDelegator(); GenericValue userLogin = (GenericValue) context.get("userLogin"); - String nameOfThumb = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.nameofthumbnail"), context); + String nameOfThumb = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.nameofthumbnail", delegator), context); String productId = (String) context.get("productId"); String imageName = (String) context.get("imageName"); @@ -85,8 +88,8 @@ public class RotateImage { String filenameToUse = (String) contentResult.get("contentId") + ".jpg"; String filenameTouseThumb = (String) contentResult.get("contentId") + nameOfThumb + ".jpg"; - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String imageServerUrl = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.url"), context); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); + String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator), context); BufferedImage bufImg = ImageIO.read(new File(imageServerPath + "/" + productId + "/" + imageName)); int bufImgType; Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/WatermarkImage.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/WatermarkImage.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/WatermarkImage.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/WatermarkImage.java Tue Dec 9 10:09:22 2014 @@ -49,6 +49,7 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; @@ -65,9 +66,10 @@ public class WatermarkImage{ public static String createWatermarkImage(HttpServletRequest request, HttpServletResponse response) throws WatermarkerException, IOException { Map<String, ? extends Object> context = UtilGenerics.checkMap(request.getParameterMap()); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); - String imageServerUrl = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.url"), context); - String nameOfThumb = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.nameofthumbnail"), context); + Delegator delegator = (Delegator) request.getAttribute("delegator"); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); + String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator), context); + String nameOfThumb = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.nameofthumbnail", delegator), context); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); String watermarkText = null; @@ -311,7 +313,8 @@ public class WatermarkImage{ public static String setPreviewWaterMark(HttpServletRequest request, HttpServletResponse response) { Map<String, ? extends Object> context = UtilGenerics.checkMap(request.getParameterMap()); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); + Delegator delegator = (Delegator) request.getAttribute("delegator"); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); String productId = request.getParameter("productId"); String imageName = request.getParameter("imageName"); String text = request.getParameter("text"); @@ -372,7 +375,8 @@ public class WatermarkImage{ public static String deletePreviewWatermarkImage(HttpServletRequest request, HttpServletResponse response) { Map<String, ? extends Object> context = UtilGenerics.checkMap(request.getParameterMap()); - String imageServerPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); + Delegator delegator = (Delegator) request.getAttribute("delegator"); + String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); String count = request.getParameter("count"); File file = new File(imageServerPath + "/preview/" + "/previewImage" + count + ".jpg"); file.delete(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java Tue Dec 9 10:09:22 2014 @@ -522,7 +522,7 @@ public class PriceServices { } // Convert the value to the price currency, if required - if ("true".equals(UtilProperties.getPropertyValue("catalog.properties", "convertProductPriceCurrency"))) { + if ("true".equals(EntityUtilProperties.getPropertyValue("catalog.properties", "convertProductPriceCurrency", delegator))) { if (UtilValidate.isNotEmpty(currencyDefaultUomId) && UtilValidate.isNotEmpty(currencyUomIdTo) && !currencyDefaultUomId.equals(currencyUomIdTo)) { if (UtilValidate.isNotEmpty(result)) { Map<String, Object> convertPriceMap = FastMap.newInstance(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java Tue Dec 9 10:09:22 2014 @@ -40,6 +40,7 @@ import org.ofbiz.entity.GenericEntityExc import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; /** * Does indexing in preparation for a keyword search. @@ -59,22 +60,21 @@ public class KeywordIndex { public static void indexKeywords(GenericValue product, boolean doAll) throws GenericEntityException { if (product == null) return; Timestamp nowTimestamp = UtilDateTime.nowTimestamp(); - + Delegator delegator = product.getDelegator(); if (!doAll) { if ("N".equals(product.getString("autoCreateKeywords"))) { return; } - if ("Y".equals(product.getString("isVariant")) && "true".equals(UtilProperties.getPropertyValue("prodsearch", "index.ignore.variants"))) { + if ("Y".equals(product.getString("isVariant")) && "true".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.ignore.variants", delegator))) { return; } Timestamp salesDiscontinuationDate = product.getTimestamp("salesDiscontinuationDate"); if (salesDiscontinuationDate != null && salesDiscontinuationDate.before(nowTimestamp) && - "true".equals(UtilProperties.getPropertyValue("prodsearch", "index.ignore.discontinued.sales"))) { + "true".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.ignore.discontinued.sales", delegator))) { return; } } - - Delegator delegator = product.getDelegator(); + if (delegator == null) return; String productId = product.getString("productId"); @@ -90,33 +90,33 @@ public class KeywordIndex { int pidWeight = 1; try { - pidWeight = Integer.parseInt(UtilProperties.getPropertyValue("prodsearch", "index.weight.Product.productId", "0")); + pidWeight = Integer.parseInt(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Product.productId", "0", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } keywords.put(product.getString("productId").toLowerCase(), Long.valueOf(pidWeight)); // Product fields - default is 0 if not found in the properties file - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.Product.productName", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Product.productName", "0", delegator))) { addWeightedKeywordSourceString(product, "productName", strings); } - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.Product.internalName", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Product.internalName", "0", delegator))) { addWeightedKeywordSourceString(product, "internalName", strings); } - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.Product.brandName", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Product.brandName", "0", delegator))) { addWeightedKeywordSourceString(product, "brandName", strings); } - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.Product.description", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Product.description", "0", delegator))) { addWeightedKeywordSourceString(product, "description", strings); } - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.Product.longDescription", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Product.longDescription", "0", delegator))) { addWeightedKeywordSourceString(product, "longDescription", strings); } // ProductFeatureAppl - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductFeatureAndAppl.description", "0")) || - !"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductFeatureAndAppl.abbrev", "0")) || - !"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductFeatureAndAppl.idCode", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.ProductFeatureAndAppl.description", "0", delegator)) || + !"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.ProductFeatureAndAppl.abbrev", "0", delegator)) || + !"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.ProductFeatureAndAppl.idCode", "0", delegator))) { // get strings from attributes and features List<GenericValue> productFeatureAndAppls = EntityQuery.use(delegator).from("ProductFeatureAndAppl").where("productId", productId).queryList(); for (GenericValue productFeatureAndAppl: productFeatureAndAppls) { @@ -127,8 +127,8 @@ public class KeywordIndex { } // ProductAttribute - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductAttribute.attrName", "0")) || - !"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductAttribute.attrValue", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.ProductAttribute.attrName", "0", delegator)) || + !"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.ProductAttribute.attrValue", "0", delegator))) { List<GenericValue> productAttributes = EntityQuery.use(delegator).from("ProductAttribute").where("productId", productId).queryList(); for (GenericValue productAttribute: productAttributes) { addWeightedKeywordSourceString(productAttribute, "attrName", strings); @@ -137,7 +137,7 @@ public class KeywordIndex { } // GoodIdentification - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.GoodIdentification.idValue", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.GoodIdentification.idValue", "0", delegator))) { List<GenericValue> goodIdentifications = EntityQuery.use(delegator).from("GoodIdentification").where("productId", productId).queryList(); for (GenericValue goodIdentification: goodIdentifications) { addWeightedKeywordSourceString(goodIdentification, "idValue", strings); @@ -146,12 +146,12 @@ public class KeywordIndex { // Variant Product IDs if ("Y".equals(product.getString("isVirtual"))) { - if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.Variant.Product.productId", "0"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Variant.Product.productId", "0", delegator))) { List<GenericValue> variantProductAssocs = EntityQuery.use(delegator).from("ProductAssoc").where("productId", productId, "productAssocTypeId", "PRODUCT_VARIANT").filterByDate().queryList(); for (GenericValue variantProductAssoc: variantProductAssocs) { int weight = 1; try { - weight = Integer.parseInt(UtilProperties.getPropertyValue("prodsearch", "index.weight.Variant.Product.productId", "0")); + weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.Variant.Product.productId", "0", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } @@ -162,12 +162,12 @@ public class KeywordIndex { } } - String productContentTypes = UtilProperties.getPropertyValue("prodsearch", "index.include.ProductContentTypes"); + String productContentTypes = EntityUtilProperties.getPropertyValue("prodsearch", "index.include.ProductContentTypes", delegator); for (String productContentTypeId: productContentTypes.split(",")) { int weight = 1; try { // this is defaulting to a weight of 1 because you specified you wanted to index this type - weight = Integer.parseInt(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductContent." + productContentTypeId, "1")); + weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight.ProductContent." + productContentTypeId, "1", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } @@ -191,7 +191,7 @@ public class KeywordIndex { } List<GenericValue> toBeStored = FastList.newInstance(); - int keywordMaxLength = Integer.parseInt(UtilProperties.getPropertyValue("prodsearch", "product.keyword.max.length")); + int keywordMaxLength = Integer.parseInt(EntityUtilProperties.getPropertyValue("prodsearch", "product.keyword.max.length", delegator)); 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(), "keywordTypeId", "KWT_KEYWORD", "relevancyWeight", entry.getValue())); @@ -201,7 +201,7 @@ public class KeywordIndex { if (toBeStored.size() > 0) { if (Debug.verboseOn()) Debug.logVerbose("[KeywordIndex.indexKeywords] Storing " + toBeStored.size() + " keywords for productId " + product.getString("productId"), module); - if ("true".equals(UtilProperties.getPropertyValue("prodsearch", "index.delete.on_index", "false"))) { + if ("true".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.delete.on_index", "false", delegator))) { // delete all keywords if the properties file says to delegator.removeByAnd("ProductKeyword", UtilMisc.toMap("productId", product.getString("productId"))); } @@ -229,7 +229,8 @@ public class KeywordIndex { int weight = 1; try { - weight = Integer.parseInt(UtilProperties.getPropertyValue("prodsearch", "index.weight." + value.getEntityName() + "." + fieldName, "1")); + Delegator delegator = value.getDelegator(); + weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("prodsearch", "index.weight." + value.getEntityName() + "." + fieldName, "1", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java Tue Dec 9 10:09:22 2014 @@ -54,6 +54,7 @@ import org.ofbiz.entity.transaction.Tran import org.ofbiz.entity.util.EntityListIterator; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.product.store.ProductStoreWorker; import org.ofbiz.security.Security; import org.ofbiz.service.GenericServiceException; @@ -98,10 +99,10 @@ public class ProductEvents { if (!"Y".equals(doAll)) { List<EntityCondition> condList = FastList.newInstance(); condList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("autoCreateKeywords", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("autoCreateKeywords", EntityOperator.NOT_EQUAL, "N"))); - if ("true".equals(UtilProperties.getPropertyValue("prodsearch", "index.ignore.variants"))) { + if ("true".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.ignore.variants", delegator))) { condList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("isVariant", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("isVariant", EntityOperator.NOT_EQUAL, "Y"))); } - if ("true".equals(UtilProperties.getPropertyValue("prodsearch", "index.ignore.discontinued.sales"))) { + if ("true".equals(EntityUtilProperties.getPropertyValue("prodsearch", "index.ignore.discontinued.sales", delegator))) { condList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.GREATER_THAN_EQUAL_TO, nowTimestamp))); } condition = EntityCondition.makeCondition(condList, EntityOperator.AND); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Tue Dec 9 10:09:22 2014 @@ -55,6 +55,7 @@ import org.ofbiz.entity.util.EntityFindO import org.ofbiz.entity.util.EntityListIterator; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.product.catalog.CatalogWorker; import org.ofbiz.product.category.CategoryWorker; import org.ofbiz.product.feature.ParametricSearch; @@ -913,7 +914,7 @@ public class ProductSearchSession { List<ProductSearchConstraint> productSearchConstraintList = ProductSearchOptions.getConstraintList(session); String noConditionFind = (String) requestParams.get("noConditionFind"); if (UtilValidate.isEmpty(noConditionFind)) { - noConditionFind = UtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind"); + noConditionFind = EntityUtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind", delegator); } // if noConditionFind to Y then find without conditions otherwise search according to constraints. if ("Y".equals(noConditionFind) || UtilValidate.isNotEmpty(productSearchConstraintList)) { Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java Tue Dec 9 10:09:22 2014 @@ -901,9 +901,9 @@ public class ProductServices { } public static Map<String, Object> updateProductIfAvailableFromShipment(DispatchContext dctx, Map<String, ? extends Object> context) { - if ("Y".equals(UtilProperties.getPropertyValue("catalog.properties", "reactivate.product.from.receipt", "N"))) { + Delegator delegator = dctx.getDelegator(); + if ("Y".equals(EntityUtilProperties.getPropertyValue("catalog.properties", "reactivate.product.from.receipt", "N", delegator))) { LocalDispatcher dispatcher = dctx.getDispatcher(); - Delegator delegator = dctx.getDelegator(); GenericValue userLogin = (GenericValue) context.get("userLogin"); String inventoryItemId = (String) context.get("inventoryItemId"); @@ -975,7 +975,7 @@ public class ProductServices { Locale locale = (Locale) context.get("locale"); if (UtilValidate.isNotEmpty(context.get("_uploadedFile_fileName"))) { - String imageFilenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.additionalviewsize.format"); + String imageFilenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.additionalviewsize.format", delegator); String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.server.path", delegator), context); String imageUrlPrefix = EntityUtilProperties.getPropertyValue("catalog", "image.url.prefix", delegator); @@ -1269,7 +1269,7 @@ public class ProductServices { Locale locale = (Locale) context.get("locale"); if (UtilValidate.isNotEmpty(context.get("_uploadedFile_fileName"))) { - String imageFilenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.format"); + String imageFilenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.format", delegator); String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.server.path",delegator), context); String imageUrlPrefix = EntityUtilProperties.getPropertyValue("catalog", "image.url.prefix", delegator); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java Tue Dec 9 10:09:22 2014 @@ -501,7 +501,7 @@ public class ProductUtilServices { String errMsg = null; if (UtilValidate.isEmpty(pattern)) { - String imageFilenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.format"); + String imageFilenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.format", delegator); String imageUrlPrefix = EntityUtilProperties.getPropertyValue("catalog", "image.url.prefix",delegator); pattern = imageUrlPrefix + "/" + imageFilenameFormat; } @@ -624,14 +624,14 @@ while (allCatIter.hasNext()) { Timestamp nowTimestamp = UtilDateTime.nowTimestamp(); Set<String> productFeatureTypeIdsToExclude = FastSet.newInstance(); - String excludeProp = UtilProperties.getPropertyValue("prodsearch", "attach.feature.type.exclude"); + String excludeProp = EntityUtilProperties.getPropertyValue("prodsearch", "attach.feature.type.exclude", delegator); if (UtilValidate.isNotEmpty(excludeProp)) { List<String> typeList = StringUtil.split(excludeProp, ","); productFeatureTypeIdsToExclude.addAll(typeList); } Set<String> productFeatureTypeIdsToInclude = null; - String includeProp = UtilProperties.getPropertyValue("prodsearch", "attach.feature.type.include"); + String includeProp = EntityUtilProperties.getPropertyValue("prodsearch", "attach.feature.type.include", delegator); if (UtilValidate.isNotEmpty(includeProp)) { List<String> typeList = StringUtil.split(includeProp, ","); if (typeList.size() > 0) { Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java Tue Dec 9 10:09:22 2014 @@ -28,10 +28,11 @@ import javolution.util.FastMap; import org.ofbiz.base.util.Debug; 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.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -161,8 +162,9 @@ public class ShipmentWorker { public static BigDecimal calcPackageWeight(DispatchContext dctx, Map<String, BigDecimal> packageMap, List<Map<String, Object>> shippableItemInfo, BigDecimal additionalWeight) { LocalDispatcher dispatcher = dctx.getDispatcher(); + Delegator delegator = dctx.getDelegator(); BigDecimal totalWeight = BigDecimal.ZERO; - String defaultWeightUomId = UtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom"); + String defaultWeightUomId = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom", delegator); for (Map.Entry<String, BigDecimal> entry: packageMap.entrySet()) { String productId = entry.getKey(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/dhl/DhlServices.java Tue Dec 9 10:09:22 2014 @@ -46,6 +46,7 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -212,7 +213,7 @@ public class DhlServices { } if ((shippableWeight == null) || (shippableWeight.compareTo(BigDecimal.ZERO) <= 0)) { - String tmpValue = UtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.weight.value"); + String tmpValue = EntityUtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.weight.value", delegator); if (tmpValue != null) { try { shippableWeight = new BigDecimal(tmpValue); @@ -678,7 +679,7 @@ public class DhlServices { } else { // use default weight if available try { - packageWeight = new BigDecimal(UtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.weight.value")); + packageWeight = new BigDecimal(EntityUtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.weight.value", delegator)); } catch (NumberFormatException ne) { Debug.logWarning("Default shippable weight not configured (shipment.default.weight.value)", module); packageWeight = BigDecimal.ONE; @@ -970,7 +971,7 @@ public class DhlServices { Debug.logError(e, module); } } else { - String value = UtilProperties.getPropertyValue(resource, parameterName); + String value = EntityUtilProperties.getPropertyValue(resource, parameterName, delegator); if (value != null) { returnValue = value.trim(); } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/fedex/FedexServices.java Tue Dec 9 10:09:22 2014 @@ -432,7 +432,7 @@ public class FedexServices { } // Get the weight units to be used in the request - String weightUomId = UtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.weight.uom"); + String weightUomId = EntityUtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.weight.uom", delegator); if (UtilValidate.isEmpty(weightUomId)) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "FacilityShipmentDefaultWeightUomIdNotFound", locale)); @@ -442,7 +442,7 @@ public class FedexServices { } // Get the dimension units to be used in the request - String dimensionsUomId = UtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.dimension.uom"); + String dimensionsUomId = EntityUtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.dimension.uom", delegator); if (UtilValidate.isEmpty(dimensionsUomId)) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "FacilityShipmentDefaultDimensionUomIdNotFound", locale)); @@ -875,7 +875,7 @@ public class FedexServices { // Use default weight if available try { - packageWeight = new BigDecimal(UtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.weight.value")); + packageWeight = new BigDecimal(EntityUtilProperties.getPropertyValue(shipmentPropertiesFile, "shipment.default.weight.value", delegator)); } catch (NumberFormatException ne) { Debug.logWarning("Default shippable weight not configured (shipment.default.weight.value), assuming 1.0" + weightUomId , module); packageWeight = BigDecimal.ONE; @@ -1076,7 +1076,7 @@ public class FedexServices { Debug.logError(e, module); } } else { - String value = UtilProperties.getPropertyValue(resource, parameterName); + String value = EntityUtilProperties.getPropertyValue(resource, parameterName, delegator); if (value != null) { returnValue = value.trim(); } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Tue Dec 9 10:09:22 2014 @@ -2618,7 +2618,7 @@ public class UpsServices { Element packageWeightElement = UtilXml.addChildElement(packageElement, "PackageWeight", shipmentConfirmRequestDoc); Element packageWeightUnitOfMeasurementElement = UtilXml.addChildElement(packageElement, "UnitOfMeasurement", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(packageWeightUnitOfMeasurementElement, "Code", "LBS", shipmentConfirmRequestDoc); - UtilXml.addChildElementValue(packageWeightElement, "Weight", UtilProperties.getPropertyValue("shipment", "shipment.default.weight.value"), shipmentConfirmRequestDoc); + UtilXml.addChildElementValue(packageWeightElement, "Weight", EntityUtilProperties.getPropertyValue("shipment", "shipment.default.weight.value", delegator), shipmentConfirmRequestDoc); String shipmentConfirmRequestString = null; try { @@ -2912,7 +2912,7 @@ public class UpsServices { UtilXml.addChildElementValue(shipperElement, "Name", UtilValidate.isNotEmpty(originPostalAddress.getString("toName")) ? originPostalAddress.getString("toName") : "", rateRequestDoc); UtilXml.addChildElementValue(shipperElement, "AttentionName", UtilValidate.isNotEmpty(originPostalAddress.getString("attnName")) ? originPostalAddress.getString("attnName") : "", rateRequestDoc); UtilXml.addChildElementValue(shipperElement, "PhoneNumber", originPhoneNumber, rateRequestDoc); - UtilXml.addChildElementValue(shipperElement, "ShipperNumber", UtilProperties.getPropertyValue("shipment", "shipment.ups.shipper.number"), rateRequestDoc); + UtilXml.addChildElementValue(shipperElement, "ShipperNumber", EntityUtilProperties.getPropertyValue("shipment", "shipment.ups.shipper.number", delegator), rateRequestDoc); Element shipperAddressElement = UtilXml.addChildElement(shipperElement, "Address", rateRequestDoc); UtilXml.addChildElementValue(shipperAddressElement, "AddressLine1", originPostalAddress.getString("address1"), rateRequestDoc); @@ -3198,7 +3198,7 @@ public class UpsServices { Debug.logError(e, module); } } else { - String value = UtilProperties.getPropertyValue(resource, parameterName); + String value = EntityUtilProperties.getPropertyValue(resource, parameterName, delegator); if (value != null) { returnValue = value.trim(); } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Tue Dec 9 10:09:22 2014 @@ -55,6 +55,7 @@ import org.ofbiz.entity.GenericEntityExc import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.party.contact.ContactMechWorker; import org.ofbiz.product.product.ProductWorker; import org.ofbiz.product.store.ProductStoreWorker; @@ -1787,7 +1788,7 @@ public class UspsServices { Debug.logError(e, module); } } else { - String value = UtilProperties.getPropertyValue(resource, parameterName); + String value = EntityUtilProperties.getPropertyValue(resource, parameterName, delegator); if (value != null) { returnValue = value.trim(); } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java Tue Dec 9 10:09:22 2014 @@ -32,6 +32,7 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.ServiceUtil; @@ -130,6 +131,7 @@ public class WeightPackageServices { WeightPackageSession weightPackageSession = (WeightPackageSession) context.get("weightPackageSession"); Locale locale = (Locale) context.get("locale"); + Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); String shipmentId = (String) context.get("shipmentId"); String invoiceId = (String) context.get("invoiceId"); @@ -151,7 +153,7 @@ public class WeightPackageServices { Map<String, Object> response = FastMap.newInstance(); try { - String getActualShippingQuoteFromUps = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N"); + String getActualShippingQuoteFromUps = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N", delegator); String result = weightPackageSession.complete(orderId, locale, getActualShippingQuoteFromUps); if ("showWarningForm".equals(result)) { response.put("showWarningForm", true); @@ -168,6 +170,7 @@ public class WeightPackageServices { public static Map<String, Object> completeShipment(DispatchContext dctx, Map<String, ? extends Object> context) { Locale locale = (Locale) context.get("locale"); + Delegator delegator = dctx.getDelegator(); WeightPackageSession weightPackageSession = (WeightPackageSession) context.get("weightPackageSession"); String shipmentId = (String) context.get("shipmentId"); @@ -175,7 +178,7 @@ public class WeightPackageServices { Map<String, Object> response = FastMap.newInstance(); try { - String getActualShippingQuoteFromUps = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N"); + String getActualShippingQuoteFromUps = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N", delegator); if (weightPackageSession.completeShipment(orderId, getActualShippingQuoteFromUps)) { response.put("shipmentId", shipmentId); } else { @@ -189,11 +192,12 @@ public class WeightPackageServices { public static Map<String, Object> savePackagesInfo(DispatchContext dctx, Map<String, ? extends Object> context) { Locale locale = (Locale) context.get("locale"); + Delegator delegator = dctx.getDelegator(); WeightPackageSession weightPackageSession = (WeightPackageSession) context.get("weightPackageSession"); String orderId = (String) context.get("orderId"); - String getActualShippingQuoteFromUps = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N"); + String getActualShippingQuoteFromUps = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N", delegator); try { weightPackageSession.savePackagesInfo(orderId, getActualShippingQuoteFromUps); } catch (GeneralException e) { Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategory.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategory.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategory.groovy (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/category/EditCategory.groovy Tue Dec 9 10:09:22 2014 @@ -36,7 +36,7 @@ context.primaryParentCategory = primaryP // make the image file formats -imageFilenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.format"); +imageFilenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.format", delegator); imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.server.path", delegator), context); imageUrlPrefix = EntityUtilProperties.getPropertyValue("catalog", "image.url.prefix",delegator); context.imageFilenameFormat = imageFilenameFormat; Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/find/sidedeepcategory.groovy Tue Dec 9 10:09:22 2014 @@ -20,6 +20,7 @@ import org.ofbiz.base.util.* import org.ofbiz.entity.* import org.ofbiz.product.category.* +import org.ofbiz.entity.util.EntityUtilProperties; state = request.getParameter("BrowseCategoriesState"); isOpen = true; @@ -35,7 +36,7 @@ if (state) { context.isOpen = isOpen; requestParameters = UtilHttp.getParameterMap(request); -defaultTopCategoryId = requestParameters.TOP_CATEGORY ? requestParameters.TOP_CATEGORY : UtilProperties.getPropertyValue("catalog", "top.category.default"); +defaultTopCategoryId = requestParameters.TOP_CATEGORY ? requestParameters.TOP_CATEGORY : EntityUtilProperties.getPropertyValue("catalog", "top.category.default", delegator); currentTopCategoryId = CategoryWorker.getCatalogTopCategory(request, defaultTopCategoryId); currentTopCategory = null; if (isOpen) { Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageUpload.groovy Tue Dec 9 10:09:22 2014 @@ -27,7 +27,7 @@ import org.ofbiz.entity.condition.* context.nowTimestampString = UtilDateTime.nowTimestamp().toString(); // make the image file formats -imageFilenameFormat = UtilProperties.getPropertyValue('catalog', 'image.filename.format'); +imageFilenameFormat = EntityUtilProperties.getPropertyValue('catalog', 'image.filename.format', delegator); imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.server.path", delegator), context); imageUrlPrefix = EntityUtilProperties.getPropertyValue('catalog', 'image.url.prefix',delegator); context.imageFilenameFormat = imageFilenameFormat; Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy Tue Dec 9 10:09:22 2014 @@ -33,7 +33,7 @@ import org.ofbiz.product.image.ScaleImag context.nowTimestampString = UtilDateTime.nowTimestamp().toString(); -imageManagementPath = FlexibleStringExpander.expandString(UtilProperties.getPropertyValue("catalog", "image.management.path"), context); +imageManagementPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", delegator), context); String fileType = "original"; String productId = request.getParameter("productId"); @@ -44,7 +44,7 @@ if (productContentList) { } // make the image file formats -imageFilenameFormat = UtilProperties.getPropertyValue('catalog', 'image.filename.format'); +imageFilenameFormat = EntityUtilProperties.getPropertyValue('catalog', 'image.filename.format', delegator); imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.server.path", delegator), context); imageUrlPrefix = EntityUtilProperties.getPropertyValue('catalog', 'image.url.prefix',delegator); context.imageFilenameFormat = imageFilenameFormat; Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.groovy (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContent.groovy Tue Dec 9 10:09:22 2014 @@ -26,7 +26,7 @@ import org.ofbiz.product.image.ScaleImag context.nowTimestampString = UtilDateTime.nowTimestamp().toString(); // make the image file formats -imageFilenameFormat = UtilProperties.getPropertyValue('catalog', 'image.filename.format'); +imageFilenameFormat = EntityUtilProperties.getPropertyValue('catalog', 'image.filename.format', delegator); imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.server.path", delegator), context); imageUrlPrefix = EntityUtilProperties.getPropertyValue('catalog', 'image.url.prefix',delegator); context.imageFilenameFormat = imageFilenameFormat; Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy Tue Dec 9 10:09:22 2014 @@ -22,6 +22,7 @@ import org.ofbiz.entity.* import org.ofbiz.entity.condition.* import org.ofbiz.entity.util.* import org.ofbiz.product.product.* +import org.ofbiz.entity.util.EntityUtilProperties; context.nowTimestampString = UtilDateTime.nowTimestamp().toString(); @@ -303,7 +304,7 @@ context.featureThruDate = featureThruDat context.selFeatureDesc = selFeatureDesc; // get "all" category id -String allCategoryId = UtilProperties.getPropertyValue("catalog", "all.product.category"); +String allCategoryId = EntityUtilProperties.getPropertyValue("catalog", "all.product.category", delegator); context.allCategoryId = allCategoryId; // show the publish or unpublish section Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy Tue Dec 9 10:09:22 2014 @@ -40,7 +40,7 @@ maxDate = parameters.maxDate; // set the page parameters viewIndex = Integer.valueOf(parameters.VIEW_INDEX ?: 0); -viewSize = Integer.valueOf(parameters.VIEW_SIZE ?: UtilProperties.getPropertyValue("widget", "widget.form.defaultViewSize", "20")); +viewSize = Integer.valueOf(parameters.VIEW_SIZE ?: EntityUtilProperties.getPropertyValue("widget", "widget.form.defaultViewSize", "20", delegator)); context.viewIndex = viewIndex; context.viewSize = viewSize; Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy Tue Dec 9 10:09:22 2014 @@ -20,6 +20,7 @@ import org.ofbiz.base.util.*; import org.ofbiz.order.order.*; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.entity.condition.EntityCondition; @@ -179,6 +180,6 @@ if (facility) { defaultWeightUomId = facility.defaultWeightUomId; } if (!defaultWeightUomId) { - defaultWeightUomId = UtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom", "WT_kg"); + defaultWeightUomId = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom", "WT_kg", delegator); } context.defaultWeightUomId = defaultWeightUomId; Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/QuickShipOrder.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/QuickShipOrder.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/QuickShipOrder.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/QuickShipOrder.groovy Tue Dec 9 10:09:22 2014 @@ -19,6 +19,7 @@ import org.ofbiz.base.util.* import org.ofbiz.order.order.* +import org.ofbiz.entity.util.EntityUtilProperties; facilityId = parameters.facilityId; if (facilityId) { @@ -65,7 +66,7 @@ if (shipmentId) { context.shipmentId = shipmentId; weightUoms = delegator.findList("Uom", EntityCondition.makeCondition(['uomTypeId' : 'WEIGHT_MEASURE']), null, ['description'], null, false); - defaultWeightUom = UtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom"); + defaultWeightUom = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom", delegator); if (defaultWeightUom) { defaultWeight = delegator.findOne("Uom", [uomId : defaultWeightUom], false); if (defaultWeight) { Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy Tue Dec 9 10:09:22 2014 @@ -21,6 +21,7 @@ import org.ofbiz.base.util.UtilPropertie import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.order.order.OrderReadHelper; import org.ofbiz.shipment.weightPackage.WeightPackageSession; @@ -189,7 +190,7 @@ if (facility) { defaultDimensionUomId = facility.defaultDimensionUomId; } if (!defaultDimensionUomId) { - defaultDimensionUomId = UtilProperties.getPropertyValue("shipment.properties", "shipment.default.dimension.uom", "LEN_in"); + defaultDimensionUomId = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.default.dimension.uom", "LEN_in", delegator); } context.defaultDimensionUomId = defaultDimensionUomId; @@ -198,6 +199,6 @@ if (facility) { defaultWeightUomId = facility.defaultWeightUomId; } if (!defaultWeightUomId) { - defaultWeightUomId = UtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom", "WT_kg"); + defaultWeightUomId = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.default.weight.uom", "WT_kg", delegator); } context.defaultWeightUomId = defaultWeightUomId; Modified: ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java (original) +++ ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java Tue Dec 9 10:09:22 2014 @@ -72,6 +72,7 @@ public class LoginEvents { public static String saveEntryParams(HttpServletRequest request, HttpServletResponse response) { GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); HttpSession session = request.getSession(); + Delegator delegator = (Delegator) request.getAttribute("delegator"); // save entry login parameters if we don't have a valid login object if (userLogin == null) { @@ -79,10 +80,10 @@ public class LoginEvents { String username = request.getParameter("USERNAME"); String password = request.getParameter("PASSWORD"); - if ((username != null) && ("true".equalsIgnoreCase(UtilProperties.getPropertyValue("security.properties", "username.lowercase")))) { + if ((username != null) && ("true".equalsIgnoreCase(EntityUtilProperties.getPropertyValue("security.properties", "username.lowercase", delegator)))) { username = username.toLowerCase(); } - if ((password != null) && ("true".equalsIgnoreCase(UtilProperties.getPropertyValue("security.properties", "password.lowercase")))) { + if ((password != null) && ("true".equalsIgnoreCase(EntityUtilProperties.getPropertyValue("security.properties", "password.lowercase", delegator)))) { password = password.toLowerCase(); } @@ -128,7 +129,7 @@ public class LoginEvents { String userLoginId = request.getParameter("USERNAME"); String errMsg = null; - if ((userLoginId != null) && ("true".equals(UtilProperties.getPropertyValue("security.properties", "username.lowercase")))) { + if ((userLoginId != null) && ("true".equals(EntityUtilProperties.getPropertyValue("security.properties", "username.lowercase", delegator)))) { userLoginId = userLoginId.toLowerCase(); } @@ -184,11 +185,11 @@ public class LoginEvents { String errMsg = null; - boolean useEncryption = "true".equals(UtilProperties.getPropertyValue("security.properties", "password.encrypt")); + boolean useEncryption = "true".equals(EntityUtilProperties.getPropertyValue("security.properties", "password.encrypt", delegator)); String userLoginId = request.getParameter("USERNAME"); - if ((userLoginId != null) && ("true".equals(UtilProperties.getPropertyValue("security.properties", "username.lowercase")))) { + if ((userLoginId != null) && ("true".equals(EntityUtilProperties.getPropertyValue("security.properties", "username.lowercase", delegator)))) { userLoginId = userLoginId.toLowerCase(); } @@ -212,13 +213,13 @@ public class LoginEvents { } if (useEncryption) { // password encrypted, can't send, generate new password and email to user - passwordToSend = RandomStringUtils.randomAlphanumeric(Integer.parseInt(UtilProperties.getPropertyValue("security", "password.length.min", "5"))); - if ("true".equals(UtilProperties.getPropertyValue("security.properties", "password.lowercase"))){ + passwordToSend = RandomStringUtils.randomAlphanumeric(Integer.parseInt(EntityUtilProperties.getPropertyValue("security", "password.length.min", "5", delegator))); + if ("true".equals(EntityUtilProperties.getPropertyValue("security.properties", "password.lowercase", delegator))){ passwordToSend=passwordToSend.toLowerCase(); } supposedUserLogin.set("currentPassword", HashCrypt.cryptUTF8(LoginServices.getHashType(), null, passwordToSend)); supposedUserLogin.set("passwordHint", "Auto-Generated Password"); - if ("true".equals(UtilProperties.getPropertyValue("security.properties", "password.email_password.require_password_change"))){ + if ("true".equals(EntityUtilProperties.getPropertyValue("security.properties", "password.email_password.require_password_change", delegator))){ supposedUserLogin.set("requirePasswordChange", "Y"); } } else { @@ -386,7 +387,8 @@ public class LoginEvents { public static void setUsername(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); - String domain = UtilProperties.getPropertyValue("url.properties", "cookie.domain"); + Delegator delegator = (Delegator) request.getAttribute("delegator"); + String domain = EntityUtilProperties.getPropertyValue("url.properties", "cookie.domain", delegator); // first try to get the username from the cookie synchronized (session) { if (UtilValidate.isEmpty(getUsername(request))) { Modified: ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/thirdparty/truition/TruitionCoReg.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/thirdparty/truition/TruitionCoReg.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/thirdparty/truition/TruitionCoReg.java (original) +++ ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/thirdparty/truition/TruitionCoReg.java Tue Dec 9 10:09:22 2014 @@ -33,8 +33,10 @@ import org.ofbiz.base.util.Debug; 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.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityUtilProperties; import org.ofbiz.party.contact.ContactHelper; public class TruitionCoReg { @@ -43,6 +45,7 @@ public class TruitionCoReg { public static final String logPrefix = "Truition Cookie Info: "; public static String truitionReg(HttpServletRequest req, HttpServletResponse resp) { + Delegator delegator = (Delegator) req.getAttribute("delegator"); HttpSession session = req.getSession(); GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); StringBuffer cookieNameB = new StringBuffer(); @@ -57,9 +60,9 @@ public class TruitionCoReg { } // locate the domain/cookie name setting - String domainName = UtilProperties.getPropertyValue("truition.properties", "truition.domain.name"); - String cookiePath = UtilProperties.getPropertyValue("truition.properties", "truition.cookie.path"); - String cookieName = UtilProperties.getPropertyValue("truition.properties", "truition.cookie.name"); + String domainName = EntityUtilProperties.getPropertyValue("truition.properties", "truition.domain.name", delegator); + String cookiePath = EntityUtilProperties.getPropertyValue("truition.properties", "truition.cookie.path", delegator); + String cookieName = EntityUtilProperties.getPropertyValue("truition.properties", "truition.cookie.name", delegator); int time = (int) UtilProperties.getPropertyNumber("truition.properties", "truition.cookie.time"); if (UtilValidate.isEmpty(domainName)) { Debug.logError("Truition is not properly configured; domainName missing; see truition.properties", module); @@ -101,9 +104,10 @@ public class TruitionCoReg { } public static String truitionLogoff(HttpServletRequest req, HttpServletResponse resp) { + Delegator delegator = (Delegator) req.getAttribute("delegator"); // locate the domain/cookie name setting - String domainName = UtilProperties.getPropertyValue("truition.properties", "truition.domain.name"); - String cookieName = UtilProperties.getPropertyValue("truition.properties", "truition.cookie.name"); + String domainName = EntityUtilProperties.getPropertyValue("truition.properties", "truition.domain.name", delegator); + String cookieName = EntityUtilProperties.getPropertyValue("truition.properties", "truition.cookie.name", delegator); if (UtilValidate.isEmpty(domainName)) { Debug.logError("Truition is not properly configured; domainName missing; see truition.properties", module); return "error"; @@ -128,8 +132,9 @@ public class TruitionCoReg { } public static String truitionRedirect(HttpServletRequest req, HttpServletResponse resp) { + Delegator delegator = (Delegator) req.getAttribute("delegator"); // redirect URL form field - String redirectUrlName = UtilProperties.getPropertyValue("truition.properties", "truition.redirect.urlName"); + String redirectUrlName = EntityUtilProperties.getPropertyValue("truition.properties", "truition.redirect.urlName", delegator); String redirectUrl = req.getParameter(redirectUrlName); Debug.logInfo("Redirect to : " + redirectUrl, module); if (truitionEnabled() && redirectUrl != null) { @@ -148,8 +153,9 @@ public class TruitionCoReg { } public static boolean makeTruitionCookie(GenericValue userLogin, StringBuffer cookieName, StringBuffer cookieValue) { - String domainName = UtilProperties.getPropertyValue("truition.properties", "truition.domain.name"); - String siteId = UtilProperties.getPropertyValue("truition.properties", "truition.siteId"); + Delegator delegator = userLogin.getDelegator(); + String domainName = EntityUtilProperties.getPropertyValue("truition.properties", "truition.domain.name", delegator); + String siteId = EntityUtilProperties.getPropertyValue("truition.properties", "truition.siteId", delegator); if (UtilValidate.isEmpty(domainName)) { Debug.logError("Truition is not properly configured; domainName missing; see truition.properties!", module); Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java?rev=1644015&r1=1644014&r2=1644015&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java Tue Dec 9 10:09:22 2014 @@ -39,6 +39,7 @@ import org.ofbiz.entity.GenericEntityExc import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.util.EntityUtilProperties; public class WorkEffortKeywordIndex { public static final String module = WorkEffortKeywordIndex.class.getName(); @@ -58,7 +59,7 @@ public class WorkEffortKeywordIndex { List<String> strings = FastList.newInstance(); int widWeight = 1; try { - widWeight = Integer.parseInt(UtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffort.workEffortId", "1")); + widWeight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffort.workEffortId", "1", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } @@ -68,15 +69,15 @@ public class WorkEffortKeywordIndex { addWeightedKeywordSourceString(workEffort, "workEffortTypeId", strings); addWeightedKeywordSourceString(workEffort, "currentStatusId", strings); - if (!"0".equals(UtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortNoteAndData.noteInfo", "1"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortNoteAndData.noteInfo", "1", delegator))) { List<GenericValue> workEffortNotes = EntityQuery.use(delegator).from("WorkEffortNoteAndData").where("workEffortId", workEffortId).queryList(); for (GenericValue workEffortNote : workEffortNotes) { addWeightedKeywordSourceString(workEffortNote, "noteInfo", strings); } } //WorkEffortAttribute - if (!"0".equals(UtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortAttribute.attrName", "1")) || - !"0".equals(UtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortAttribute.attrValue", "1"))) { + if (!"0".equals(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortAttribute.attrName", "1", delegator)) || + !"0".equals(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortAttribute.attrValue", "1", delegator))) { List<GenericValue> workEffortAttributes = EntityQuery.use(delegator).from("WorkEffortAttribute").where("workEffortId", workEffortId).queryList(); for (GenericValue workEffortAttribute : workEffortAttributes) { addWeightedKeywordSourceString(workEffortAttribute, "attrName", strings); @@ -84,11 +85,11 @@ public class WorkEffortKeywordIndex { } } - String workEffortContentTypes = UtilProperties.getPropertyValue("workeffortsearch", "index.include.WorkEffortContentTypes"); + String workEffortContentTypes = EntityUtilProperties.getPropertyValue("workeffortsearch", "index.include.WorkEffortContentTypes", delegator); for (String workEffortContentTypeId: workEffortContentTypes.split(",")) { int weight = 1; try { - weight = Integer.parseInt(UtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortContent." + workEffortContentTypeId, "1")); + weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight.WorkEffortContent." + workEffortContentTypeId, "1", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } @@ -136,11 +137,12 @@ public class WorkEffortKeywordIndex { } } public static void addWeightedKeywordSourceString(GenericValue value, String fieldName, List<String> strings) { + Delegator delegator = value.getDelegator(); if (value.getString(fieldName) != null) { int weight = 1; try { - weight = Integer.parseInt(UtilProperties.getPropertyValue("workeffortsearch", "index.weight." + value.getEntityName() + "." + fieldName, "1")); + weight = Integer.parseInt(EntityUtilProperties.getPropertyValue("workeffortsearch", "index.weight." + value.getEntityName() + "." + fieldName, "1", delegator)); } catch (Exception e) { Debug.logWarning("Could not parse weight number: " + e.toString(), module); } |
Free forum by Nabble | Edit this page |