You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/12/15 10:10:05 UTC
svn commit: r1645602 [2/4] - in
/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23: ./
applications/accounting/src/org/ofbiz/accounting/invoice/
applications/accounting/src/org/ofbiz/accounting/payment/
applications/accounting/src/org/ofbiz/acco...
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/output/OutputServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/output/OutputServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/output/OutputServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/content/src/org/ofbiz/content/output/OutputServices.java Mon Dec 15 09:10:03 2014
@@ -58,6 +58,8 @@ import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.collections.MapStack;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.ServiceUtil;
import org.ofbiz.webapp.view.ApacheFopWorker;
@@ -190,6 +192,7 @@ public class OutputServices {
public static Map<String, Object> createFileFromScreen(DispatchContext dctx, Map<String, ? extends Object> serviceContext) {
Locale locale = (Locale) serviceContext.get("locale");
+ Delegator delegator = dctx.getDelegator();
String screenLocation = (String) serviceContext.remove("screenLocation");
Map<String, Object> screenContext = UtilGenerics.checkMap(serviceContext.remove("screenContext"));
String contentType = (String) serviceContext.remove("contentType");
@@ -237,7 +240,7 @@ public class OutputServices {
fileName += ".txt";
}
if (UtilValidate.isEmpty(filePath)) {
- filePath = UtilProperties.getPropertyValue("content.properties", "content.output.path", "/output");
+ filePath = EntityUtilProperties.getPropertyValue("content.properties", "content.output.path", "/output", delegator);
}
File file = new File(filePath, fileName);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/mrp/FindInventoryEventPlan.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/mrp/FindInventoryEventPlan.groovy?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/mrp/FindInventoryEventPlan.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/mrp/FindInventoryEventPlan.groovy Mon Dec 15 09:10:03 2014
@@ -20,7 +20,7 @@
import org.ofbiz.base.util.ObjectType;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.condition.EntityCondition;
-import org.ofbiz.base.util.UtilProperties ;
+import org.ofbiz.entity.util.EntityUtilProperties;
productId = parameters.productId;
@@ -69,7 +69,7 @@ context.paramList = paramList;
// 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));
listSize = 0;
if (inventoryList)
listSize = inventoryList.size();
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java Mon Dec 15 09:10:03 2014
@@ -220,7 +220,7 @@ public class TrackingCodeEvents {
}
if (cookieDomain == null) {
- cookieDomain = UtilProperties.getPropertyValue("url", "cookie.domain", "");
+ cookieDomain = EntityUtilProperties.getPropertyValue("url", "cookie.domain", "", delegator);
}
// if trackingCode.trackableLifetime not null and is > 0 write a trackable cookie with name in the form: TKCDT_{trackingCode.trackingCodeTypeId} and timeout will be trackingCode.trackableLifetime
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java Mon Dec 15 09:10:03 2014
@@ -60,6 +60,7 @@ import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.util.EntityQuery;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.party.party.PartyHelper;
import org.ofbiz.party.party.PartyWorker;
import org.ofbiz.service.DispatchContext;
@@ -263,7 +264,7 @@ public class VCard {
}
ContactIOFactory ciof = Pim.getContactIOFactory();
ContactMarshaller marshaller = ciof.createContactMarshaller();
- String saveToDirectory = UtilProperties.getPropertyValue("sfa.properties", "save.outgoing.directory", "");
+ String saveToDirectory = EntityUtilProperties.getPropertyValue("sfa.properties", "save.outgoing.directory", "", delegator);
if (UtilValidate.isEmpty(saveToDirectory)) {
saveToDirectory = System.getProperty("ofbiz.home");
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Mon Dec 15 09:10:03 2014
@@ -50,6 +50,7 @@ import org.ofbiz.entity.condition.Entity
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.order.thirdparty.paypal.ExpressCheckoutEvents;
import org.ofbiz.product.product.ProductContentWrapper;
import org.ofbiz.product.product.ProductWorker;
@@ -334,7 +335,7 @@ public class OrderReturnServices {
for (GenericValue returnHeader : returnHeaders) {
String returnId = returnHeader.getString("returnId");
Timestamp entryDate = returnHeader.getTimestamp("entryDate");
- String daysTillCancelStr = UtilProperties.getPropertyValue("order.properties", "daysTillCancelReplacementOrder", "30");
+ String daysTillCancelStr = EntityUtilProperties.getPropertyValue("order.properties", "daysTillCancelReplacementOrder", "30", delegator);
int daysTillCancel = 0;
try {
daysTillCancel = Integer.parseInt(daysTillCancelStr);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/order/OrderServices.java Mon Dec 15 09:10:03 2014
@@ -64,6 +64,7 @@ import org.ofbiz.entity.util.EntityListI
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityTypeUtil;
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.order.shoppingcart.CartItemModifyException;
import org.ofbiz.order.shoppingcart.CheckOutHelper;
import org.ofbiz.order.shoppingcart.ItemNotFoundException;
@@ -546,7 +547,7 @@ public class OrderServices {
orderHeader.set("createdBy", userLogin.getString("userLoginId"));
}
- String invoicePerShipment = UtilProperties.getPropertyValue("AccountingConfig","create.invoice.per.shipment");
+ String invoicePerShipment = EntityUtilProperties.getPropertyValue("AccountingConfig","create.invoice.per.shipment", delegator);
if (UtilValidate.isNotEmpty(invoicePerShipment)) {
orderHeader.set("invoicePerShipment", invoicePerShipment);
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Mon Dec 15 09:10:03 2014
@@ -49,6 +49,7 @@ import org.ofbiz.entity.condition.Entity
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityTypeUtil;
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.order.finaccount.FinAccountHelper;
import org.ofbiz.order.order.OrderChangeHelper;
import org.ofbiz.order.order.OrderReadHelper;
@@ -1608,7 +1609,7 @@ public class CheckOutHelper {
// get the payment config
String paymentConfig = ProductStoreWorker.getProductStorePaymentProperties(delegator, cart.getProductStoreId(), "GIFT_CARD", null, true);
- String giftCardType = UtilProperties.getPropertyValue(paymentConfig, "", "ofbiz");
+ String giftCardType = EntityUtilProperties.getPropertyValue(paymentConfig, "", "ofbiz", delegator);
String balanceField = null;
// get the gift card objects to check
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Mon Dec 15 09:10:03 2014
@@ -47,6 +47,7 @@ import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityTypeUtil;
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
import org.ofbiz.product.config.ProductConfigWorker;
@@ -231,7 +232,7 @@ public class ShoppingCartHelper {
// get order item attributes
Map<String, String> orderItemAttributes = FastMap.newInstance();
- String orderItemAttributePrefix = UtilProperties.getPropertyValue("order.properties", "order.item.attr.prefix");
+ String orderItemAttributePrefix = EntityUtilProperties.getPropertyValue("order.properties", "order.item.attr.prefix", delegator);
for (Entry<String, ? extends Object> entry : context.entrySet()) {
if (entry.getKey().toString().contains(orderItemAttributePrefix) && UtilValidate.isNotEmpty(entry.getValue())) {
orderItemAttributes.put(entry.getKey().replaceAll(orderItemAttributePrefix, ""), entry.getValue().toString());
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Mon Dec 15 09:10:03 2014
@@ -54,6 +54,7 @@ import org.ofbiz.entity.condition.Entity
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
import org.ofbiz.order.shoppinglist.ShoppingListEvents;
@@ -1188,7 +1189,7 @@ public class ShoppingCartItem implements
}
}
}
- if ("true".equals(UtilProperties.getPropertyValue("catalog.properties", "convertProductPriceCurrency"))){
+ if ("true".equals(EntityUtilProperties.getPropertyValue("catalog.properties", "convertProductPriceCurrency", delegator))){
priceContext.put("currencyUomIdTo", cart.getCurrency());
} else {
priceContext.put("currencyUomId", cart.getCurrency());
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Mon Dec 15 09:10:03 2014
@@ -46,6 +46,7 @@ import org.ofbiz.entity.condition.Entity
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityTypeUtil;
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.order.shoppingcart.ShoppingCart.CartShipInfo;
import org.ofbiz.order.shoppingcart.ShoppingCart.CartShipInfo.CartShipItemInfo;
@@ -988,7 +989,7 @@ public class ShoppingCartServices {
}
// If we still have no currency, use the default from general.properties. Failing that, use USD
if (currency == null) {
- currency = UtilProperties.getPropertyValue("general", "currency.uom.id.default", "USD");
+ currency = EntityUtilProperties.getPropertyValue("general", "currency.uom.id.default", "USD", delegator);
}
// create the cart
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Mon Dec 15 09:10:03 2014
@@ -411,6 +411,7 @@ public class ProductPromoWorker {
// set a max limit on how many times each promo can be run, for cases where there is no use limit this will be the use limit
//default to 2 times the number of items in the cart
long maxUseLimit = cart.getTotalQuantity().multiply(BigDecimal.valueOf(2)).setScale(0, BigDecimal.ROUND_CEILING).longValue();
+ maxUseLimit = Math.max(1, maxUseLimit);
try {
// repeat until no more rules to run: either all rules are run, or no changes to the cart in a loop
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEvents.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEvents.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEvents.java Mon Dec 15 09:10:03 2014
@@ -41,6 +41,7 @@ import org.ofbiz.entity.condition.Entity
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.order.shoppingcart.ShoppingCart;
import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
@@ -292,6 +293,7 @@ public class ShippingEvents {
public static BigDecimal getExternalShipEstimate(LocalDispatcher dispatcher, GenericValue storeShipMeth, Map<String, Object> context) throws GeneralException {
String shipmentCustomMethodId = storeShipMeth.getString("shipmentCustomMethodId");
+ Delegator delegator = dispatcher.getDelegator();
String serviceName = "";
if (UtilValidate.isNotEmpty(shipmentCustomMethodId)) {
serviceName = getShipmentCustomMethod(dispatcher.getDelegator(), shipmentCustomMethodId);
@@ -302,10 +304,10 @@ public class ShippingEvents {
// invoke the external shipping estimate service
BigDecimal externalShipAmt = null;
if (serviceName != null) {
- String doEstimates = UtilProperties.getPropertyValue("shipment.properties", "shipment.doratecheck", "true");
+ String doEstimates = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.doratecheck", "true", delegator);
//If all estimates are not turned off, check for the individual one
if ("true".equals(doEstimates)) {
- String dothisEstimate = UtilProperties.getPropertyValue("shipment.properties", "shipment.doratecheck." + serviceName, "true");
+ String dothisEstimate = EntityUtilProperties.getPropertyValue("shipment.properties", "shipment.doratecheck." + serviceName, "true", delegator);
if ("false".equals(dothisEstimate))
serviceName = null;
} else {
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java Mon Dec 15 09:10:03 2014
@@ -41,6 +41,7 @@ import org.ofbiz.entity.util.EntityListI
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityTypeUtil;
import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.order.shoppingcart.CartItemModifyException;
import org.ofbiz.order.shoppingcart.CheckOutHelper;
@@ -588,7 +589,7 @@ public class ShoppingListServices {
} catch (GenericEntityException e) {
Debug.logError(e.getMessage(), module);
}
- String maxDaysStr = UtilProperties.getPropertyValue("order.properties", "autosave.max.age", "30");
+ String maxDaysStr = EntityUtilProperties.getPropertyValue("order.properties", "autosave.max.age", "30", delegator);
int maxDays = 0;
try {
maxDays = Integer.parseInt(maxDaysStr);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java Mon Dec 15 09:10:03 2014
@@ -46,6 +46,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.security.Security;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.ServiceUtil;
@@ -229,7 +230,7 @@ public class ZipSalesServices {
List<List<GenericValue>> itemAdjustments = FastList.newInstance();
// check for a valid state/province geo
- String validStates = UtilProperties.getPropertyValue("zipsales.properties", "zipsales.valid.states");
+ String validStates = EntityUtilProperties.getPropertyValue("zipsales.properties", "zipsales.valid.states", delegator);
if (UtilValidate.isNotEmpty(validStates)) {
List<String> stateSplit = StringUtil.split(validStates, "|");
if (!stateSplit.contains(stateProvince)) {
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy Mon Dec 15 09:10:03 2014
@@ -150,7 +150,7 @@ viewIndex = request.getParameter("viewIn
context.viewIndex = viewIndex;
viewSize = request.getParameter("viewSize") ? Integer.valueOf(request.getParameter("viewSize")) :
- UtilProperties.getPropertyValue("widget", "widget.form.defaultViewSize", "20");
+ EntityUtilProperties.getPropertyValue("widget", "widget.form.defaultViewSize", "20", delegator);
context.viewSize = viewSize;
// get the lookup flag
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/user/UserEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/user/UserEvents.xml?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/user/UserEvents.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/user/UserEvents.xml Mon Dec 15 09:10:03 2014
@@ -311,8 +311,9 @@ under the License.
<if-not-empty field="newUserLogin">
<!-- If password encryption is enabled, encrpyt it now -->
+ <set field="delegator" from-field="parameters.delegator" type="Object"/>
<call-bsh><![CDATA[
- boolean useEncryption = "true".equals(org.ofbiz.base.util.UtilProperties.getPropertyValue("security", "password.encrypt"));
+ boolean useEncryption = "true".equals(org.ofbiz.entity.util.EntityUtilProperties.getPropertyValue("security", "password.encrypt", delegator));
if (useEncryption) { newUserLogin.set("currentPassword", org.ofbiz.base.crypto.HashCrypt.getDigestHash((String) newUserLogin.get("currentPassword"))); }
]]></call-bsh>
@@ -322,7 +323,6 @@ under the License.
<set-current-user-login value-field="newUserLogin"/>
<!-- On successful user creation, create password history record if configured -->
- <set field="delegator" from-field="parameters.delegator" type="Object"/>
<call-class-method method-name="getPropertyValue" class-name="org.ofbiz.base.util.UtilProperties" ret-field="autoPasswordChangeEnabled">
<string value="security"/>
<string value="user.auto.change.password.enable"/>
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Mon Dec 15 09:10:03 2014
@@ -62,6 +62,7 @@ import org.ofbiz.entity.condition.Entity
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.service.DispatchContext;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
@@ -715,8 +716,8 @@ public class CommunicationEventServices
if (Debug.verboseOn()) Debug.logVerbose("Processing Incoming Email " + aboutThisEmail, module);
// ignore the message when the spam status = yes
- String spamHeaderName = UtilProperties.getPropertyValue("general.properties", "mail.spam.name", "N");
- String configHeaderValue = UtilProperties.getPropertyValue("general.properties", "mail.spam.value");
+ String spamHeaderName = EntityUtilProperties.getPropertyValue("general.properties", "mail.spam.name", "N", delegator);
+ String configHeaderValue = EntityUtilProperties.getPropertyValue("general.properties", "mail.spam.value", delegator);
// only execute when config file has been set && header variable found
if (!spamHeaderName.equals("N") && wrapper.getHeader(spamHeaderName) != null && wrapper.getHeader(spamHeaderName).length > 0) {
String msgHeaderValue = wrapper.getHeader(spamHeaderName)[0];
@@ -1120,8 +1121,9 @@ public class CommunicationEventServices
private static List<Map<String, Object>> buildListOfWorkEffortInfoFromEmailAddresses(Address [] addresses, GenericValue userLogin, LocalDispatcher dispatcher) throws GenericServiceException {
InternetAddress emailAddress = null;
Map<String, Object> result = null;
+ Delegator delegator = dispatcher.getDelegator();
List<Map<String, Object>> tempResults = new LinkedList<Map<String,Object>>();
- String caseInsensitiveEmail = org.ofbiz.base.util.UtilProperties.getPropertyValue("general.properties", "mail.address.caseInsensitive", "N");
+ String caseInsensitiveEmail = EntityUtilProperties.getPropertyValue("general.properties", "mail.address.caseInsensitive", "N", delegator);
if (addresses != null) {
for (Address addr: addresses) {
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java Mon Dec 15 09:10:03 2014
@@ -43,6 +43,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.security.Security;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.ModelService;
@@ -1050,7 +1051,7 @@ public class ContactMechServices {
String emailAddress = (String) context.get("emailAddress");
String verifyHash = null;
- String expireTime = UtilProperties.getPropertyValue("security", "email_verification.expire.hours");
+ String expireTime = EntityUtilProperties.getPropertyValue("security", "email_verification.expire.hours", delegator);
Integer expTime = Integer.valueOf(expireTime);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR, expTime.intValue());
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/EditShoppingList.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/EditShoppingList.groovy?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/EditShoppingList.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/party/EditShoppingList.groovy Mon Dec 15 09:10:03 2014
@@ -21,7 +21,7 @@ import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.base.util.UtilHttp;
import org.ofbiz.product.catalog.CatalogWorker;
import org.ofbiz.webapp.website.WebSiteWorker;
-import org.ofbiz.base.util.UtilProperties ;
+import org.ofbiz.entity.util.EntityUtilProperties;
prodCatalogId = CatalogWorker.getCurrentCatalogId(request);
@@ -105,7 +105,7 @@ if (shoppingListId) {
context.shoppingListItemDatas = shoppingListItemDatas;
// pagination for the shopping list
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));
listSize = shoppingListItemDatas ? shoppingListItemDatas.size() : 0;
lowIndex = (viewIndex * viewSize) + 1;
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/ShowVisits.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/ShowVisits.groovy?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/ShowVisits.groovy (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/webapp/partymgr/WEB-INF/actions/visit/ShowVisits.groovy Mon Dec 15 09:10:03 2014
@@ -21,6 +21,7 @@ import org.ofbiz.entity.util.EntityFindO
import org.ofbiz.entity.condition.*;
import org.ofbiz.entity.transaction.TransactionUtil;
import org.ofbiz.base.util.*
+import org.ofbiz.entity.util.EntityUtilProperties;
module = "showvisits.groovy";
@@ -42,7 +43,7 @@ try {
beganTransaction = TransactionUtil.begin();
viewIndex = Integer.valueOf(parameters.VIEW_INDEX ?: 1);
- 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/image/ScaleImage.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/image/ScaleImage.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/image/ScaleImage.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/image/ScaleImage.java Mon Dec 15 09:10:03 2014
@@ -114,12 +114,12 @@ public class ScaleImage {
String type = null;
String id = null;
if (viewType.toLowerCase().contains("main")) {
- String filenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.format");
+ String filenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.format", (Delegator) context.get("delegator"));
filenameExpander = FlexibleStringExpander.getInstance(filenameFormat);
id = (String) context.get("productId");
fileLocation = filenameExpander.expandString(UtilMisc.toMap("location", "products", "id", id, "type", "original"));
} else if (viewType.toLowerCase().contains("additional") && viewNumber != null && !viewNumber.equals("0")) {
- String filenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.additionalviewsize.format");
+ String filenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.additionalviewsize.format", (Delegator) context.get("delegator"));
filenameExpander = FlexibleStringExpander.getInstance(filenameFormat);
id = (String) context.get("productId");
if (filenameFormat.endsWith("${id}")) {
@@ -282,7 +282,7 @@ public class ScaleImage {
String imgName = filenameToUse.substring(0, index - 1);
String imgExtension = filenameToUse.substring(index + 1);
// paths
- String mainFilenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.format");
+ String mainFilenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.format", (Delegator) context.get("delegator"));
String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.server.path", (Delegator)context.get("delegator")), context);
String imageUrlPrefix = EntityUtilProperties.getPropertyValue("catalog", "image.url.prefix",(Delegator)context.get("delegator"));
@@ -328,7 +328,7 @@ public class ScaleImage {
// new Filename Format
FlexibleStringExpander addFilenameExpander = mainFilenameExpander;
if (viewType.toLowerCase().contains("additional")) {
- String addFilenameFormat = UtilProperties.getPropertyValue("catalog", "image.filename.additionalviewsize.format");
+ String addFilenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.additionalviewsize.format", (Delegator) context.get("delegator"));
addFilenameExpander = FlexibleStringExpander.getInstance(addFilenameFormat);
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/CropImage.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/CropImage.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/CropImage.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/CropImage.java Mon Dec 15 09:10:03 2014
@@ -34,7 +34,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;
@@ -49,8 +51,9 @@ public class CropImage {
public static Map<String, Object> imageCrop(DispatchContext dctx, Map<String, ? extends Object> context)
throws IOException, JDOMException {
LocalDispatcher dispatcher = dctx.getDispatcher();
+ Delegator delegator = dispatcher.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");
@@ -87,8 +90,8 @@ public class CropImage {
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 x = Integer.parseInt(imageX);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ReplaceImage.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ReplaceImage.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ReplaceImage.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ReplaceImage.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/RotateImage.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/RotateImage.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/RotateImage.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/RotateImage.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/WatermarkImage.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/WatermarkImage.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/WatermarkImage.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/WatermarkImage.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/price/PriceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/price/PriceServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/price/PriceServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/price/PriceServices.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/KeywordIndex.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/KeywordIndex.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/KeywordIndex.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/KeywordIndex.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductEvents.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductServices.java Mon Dec 15 09:10:03 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/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java?rev=1645602&r1=1645601&r2=1645602&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java Mon Dec 15 09:10:03 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) {