Author: jleroux
Date: Mon Dec 2 20:59:22 2013 New Revision: 1547192 URL: http://svn.apache.org/r1547192 Log: Merges trunk HEAD Removed: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/CompilerMatcher.java Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/ (props changed) ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/entry/shipsettings.ftl ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/servicedef/services_facility.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/dtd/ofbiz-component.xsd ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/component/ComponentConfig.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/PatternFactory.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilHttp.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/webcommon/changePassword.ftl ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/MessageElement.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallScript.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CombinedCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareFieldCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/EmptyCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/RegexpCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/ValidateMethodCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/ClearCacheLine.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/ClearEntityCaches.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/CloneValue.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/CreateValue.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityAnd.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityOne.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FilterListByAnd.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FilterListByDate.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelatedOne.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeNextSeqId.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeValue.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/OrderValueList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RefreshValue.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveByAnd.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveRelated.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveValue.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/SequencedIdToEnv.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/SetCurrentUserLogin.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/SetNonpkFields.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/SetPkFields.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreValue.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionBegin.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionCommit.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionRollback.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/AddError.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/Assert.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/Break.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckErrors.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckId.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/ClearField.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/Continue.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/CreateObject.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/FirstFromList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/IterateMap.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/ListToList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/Loop.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/MapToMap.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/Now.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/OrderMapList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/StringToList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/ToString.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/envops/While.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToRequest.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToSession.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestParametersToList.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestToField.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/eventops/SessionToField.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfInstanceOf.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfNotEmpty.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/otherops/PropertyToField.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/otherops/Trace.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/serviceops/FieldToResult.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/operation/Regexp.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ecommerce/webapp/ecommerce/order/orderitems.ftl ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/ProductDocument.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/themes/flatgrey/includes/appbar.ftl Propchange: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1542707-1547188 Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Mon Dec 2 20:59:22 2013 @@ -795,11 +795,17 @@ public class CheckOutEvents { // set the shipping method if (mode.equals("ship")) { shippingContactMechId = request.getParameter(shipGroupIndex + "_shipping_contact_mech_id"); + String facilityId = request.getParameter(shipGroupIndex + "_shipGroupFacilityId"); if (shippingContactMechId == null) { - shippingContactMechId = (String) request.getAttribute("contactMechId"); // FIXME + shippingContactMechId = (String) request.getAttribute("contactMechId"); + } else if(cart.getOrderType().equals("PURCHASE_ORDER")){ + String[] shipInfo = shippingContactMechId.split("_@_"); + if(shipInfo.length > 1){ + shippingContactMechId = shipInfo[0]; + facilityId = shipInfo[1]; + } } String supplierPartyId = request.getParameter(shipGroupIndex + "_supplierPartyId"); - String facilityId = request.getParameter(shipGroupIndex + "_shipGroupFacilityId"); if (UtilValidate.isNotEmpty(facilityId)) { cart.setShipGroupFacilityId(shipGroupIndex, facilityId); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/entry/shipsettings.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/entry/shipsettings.ftl?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/entry/shipsettings.ftl (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/entry/shipsettings.ftl Mon Dec 2 20:59:22 2013 @@ -43,6 +43,7 @@ under the License. </td> </tr> <#assign i = 0> + <#assign shipGroup = cart.getShipInfo(shipGroupIndex)> <#list facilityMaps as facilityMap> <#assign facility = facilityMap.facility> <#assign facilityContactMechList = facilityMap.facilityContactMechList> @@ -61,7 +62,13 @@ under the License. <#assign shippingAddress = shippingContactMech.postalAddress> <tr> <td valign="top" nowrap="nowrap"> - <input type="radio" name="${shipGroupIndex?default("0")}_shipping_contact_mech_id" value="${shippingAddress.contactMechId}" <#if i == 0>checked</#if> /> + <#assign checked='' /> + <#if shipGroup?has_content && (shipGroup.getFacilityId()?has_content && shipGroup.getFacilityId() == facility.facilityId) && (shipGroup.getContactMechId()?has_content && shipGroup.getContactMechId() == shippingAddress.contactMechId) > + <#assign checked='checked' /> + <#elseif i == 0> + <#assign checked='checked' /> + </#if> + <input type="radio" name="${shipGroupIndex?default("0")}_shipping_contact_mech_id" value="${shippingAddress.contactMechId}_@_${facility.facilityId}" ${checked} /> </td> <td nowrap="nowrap"> </td> <td valign="top" width="100%" nowrap="nowrap"> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/servicedef/services_facility.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/servicedef/services_facility.xml?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/servicedef/services_facility.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/servicedef/services_facility.xml Mon Dec 2 20:59:22 2013 @@ -257,10 +257,10 @@ under the License. <attribute name="checkTime" type="Timestamp" mode="IN" optional="true"/> <attribute name="facilityId" type="String" mode="IN" optional="false"/> <attribute name="productId" type="String" mode="IN" optional="false"/> - <attribute name="minimumStock" mode="IN" type="String" optional="true"/> + <attribute name="minimumStock" mode="IN" type="BigDecimal" optional="true"/> <attribute name="statusId" type="String" mode="IN" optional="true"/> - <attribute name="totalQuantityOnHand" mode="OUT" type="String" optional="true"/> - <attribute name="totalAvailableToPromise" mode="OUT" type="String" optional="true"/> + <attribute name="totalQuantityOnHand" mode="OUT" type="BigDecimal" optional="true"/> + <attribute name="totalAvailableToPromise" mode="OUT" type="BigDecimal" optional="true"/> <attribute name="quantityOnOrder" mode="OUT" type="BigDecimal" optional="true"/> <attribute name="offsetQOHQtyAvailable" mode="OUT" type="BigDecimal" optional="true"/> <attribute name="offsetATPQtyAvailable" mode="OUT" type="BigDecimal" optional="true"/> @@ -818,7 +818,7 @@ under the License. <attribute name="partyId" type="String" mode="IN" optional="false"/> <attribute name="roleTypeId" type="String" mode="IN" optional="false"/> </service> - + <service name="createFacilityContent" engine="simple" default-entity-name="FacilityContent" location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="createFacilityContent" auth="true"> <description>Create a Facility Content</description> @@ -826,7 +826,7 @@ under the License. <auto-attributes include="nonpk" mode="IN" optional="true"/> <override name="fromDate" optional="true"/> </service> - + <service name="deleteFacilityContent" engine="simple" default-entity-name="FacilityContent" location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="deleteFacilityContent" auth="true"> <description>Delete Content From Facility</description> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java Mon Dec 2 20:59:22 2013 @@ -21,7 +21,6 @@ package org.ofbiz.product.inventory; import java.math.BigDecimal; import java.math.MathContext; import java.sql.Timestamp; -import com.ibm.icu.util.Calendar; import java.util.List; import java.util.Locale; import java.util.Map; @@ -52,6 +51,8 @@ import org.ofbiz.service.GenericServiceE import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; +import com.ibm.icu.util.Calendar; + /** * Inventory Services */ @@ -864,7 +865,7 @@ public class InventoryServices { Timestamp checkTime = (Timestamp)context.get("checkTime"); String facilityId = (String)context.get("facilityId"); String productId = (String)context.get("productId"); - String minimumStockStr = (String)context.get("minimumStock"); + BigDecimal minimumStock = (BigDecimal)context.get("minimumStock"); String statusId = (String)context.get("statusId"); Map<String, Object> result = FastMap.newInstance(); @@ -894,10 +895,7 @@ public class InventoryServices { } } // filter for quantities - BigDecimal minimumStock = BigDecimal.ZERO; - if (minimumStockStr != null) { - minimumStock = new BigDecimal(minimumStockStr); - } + minimumStock = minimumStock != null ? minimumStock : BigDecimal.ZERO; BigDecimal quantityOnHandTotal = BigDecimal.ZERO; if (resultOutput.get("quantityOnHandTotal") != null) { @@ -912,8 +910,8 @@ public class InventoryServices { BigDecimal offsetATPQtyAvailable = availableToPromiseTotal.subtract(minimumStock); BigDecimal quantityOnOrder = InventoryWorker.getOutstandingPurchasedQuantity(productId, delegator); - result.put("totalQuantityOnHand", resultOutput.get("quantityOnHandTotal").toString()); - result.put("totalAvailableToPromise", resultOutput.get("availableToPromiseTotal").toString()); + result.put("totalQuantityOnHand", resultOutput.get("quantityOnHandTotal")); + result.put("totalAvailableToPromise", resultOutput.get("availableToPromiseTotal")); result.put("quantityOnOrder", quantityOnOrder); result.put("offsetQOHQtyAvailable", offsetQOHQtyAvailable); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy Mon Dec 2 20:59:22 2013 @@ -234,8 +234,8 @@ if (action) { prodsIt = prods.iterator(); while (prodsIt) { oneProd = prodsIt.next(); - offsetQOHQtyAvailable = oneProd.getDouble("offsetQOHQtyAvailable"); - offsetATPQtyAvailable = oneProd.getDouble("offsetATPQtyAvailable"); + offsetQOHQtyAvailable = oneProd.getBigDecimal("offsetQOHQtyAvailable"); + offsetATPQtyAvailable = oneProd.getBigDecimal("offsetATPQtyAvailable"); if (hasOffsetATP) { if (offsetATPQtyAvailable && offsetATPQtyAvailable.doubleValue() > offsetATP) { break; @@ -249,8 +249,8 @@ if (action) { oneInventory = [:]; oneInventory.productId = oneProd.productId; - oneInventory.minimumStock = oneProd.getString("minimumStock"); - oneInventory.reorderQuantity = oneProd.getString("reorderQuantity"); + oneInventory.minimumStock = oneProd.getBigDecimal("minimumStock"); + oneInventory.reorderQuantity = oneProd.getBigDecimal("reorderQuantity"); oneInventory.daysToShip = oneProd.getString("daysToShip"); oneInventory.totalQuantityOnHand = oneProd.totalQuantityOnHandTotal; oneInventory.totalAvailableToPromise = oneProd.totalAvailableToPromiseTotal; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy Mon Dec 2 20:59:22 2013 @@ -168,7 +168,7 @@ if (action) { oneInventory.checkTime = checkTime; oneInventory.facilityId = facilityId; oneInventory.productId = oneProd.productId; - minimumStock = oneProd.minimumStock as String; + minimumStock = oneProd.minimumStock; oneInventory.minimumStock = minimumStock; oneInventory.reorderQuantity = oneProd.reorderQuantity; oneInventory.daysToShip = oneProd.daysToShip; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityScreens.xml Mon Dec 2 20:59:22 2013 @@ -446,7 +446,6 @@ under the License. <set field="internalName" from-field="parameters.internalName"/> <set field="productId" from-field="parameters.productId"/> <set field="statusId" from-field="parameters.statusId"/> - <!-- do not use the CountFacilityInventoryByProduct.groovy script unless the issues mentioned in it are correctly addressed --> <script location="component://product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy"/> <entity-one entity-name="Facility" value-field="facility"/> <property-map resource="ProductUiLabels" map-name="uiLabelMap"/> @@ -850,8 +849,8 @@ under the License. <set field="responseName" value="stateList"/> <set field="dependentKeyName" value="geoId"/> <set field="descName" value="geoName"/> - <set field="selectedDependentOption" from-field="mechMap.postalAddress.stateProvinceGeoId" default-value="_none_"/> - + <set field="selectedDependentOption" from-field="mechMap.postalAddress.stateProvinceGeoId" default-value="_none_"/> + <set field="facilityId" from-field="parameters.facilityId"/> <entity-one entity-name="Facility" value-field="facility"/> <property-map resource="ProductUiLabels" map-name="uiLabelMap"/> @@ -1493,7 +1492,7 @@ under the License. </entity-and> <property-map resource="ProductUiLabels" map-name="uiLabelMap"/> <property-map resource="ContentUiLabels" map-name="uiLabelMap"/> - <set field="title" value="${uiLabelMap.PageTitleEditFacilityContent}"/> + <set field="title" value="${uiLabelMap.PageTitleEditFacilityContent}"/> </actions> <widgets> <decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}"> @@ -1524,7 +1523,7 @@ under the License. <set field="geoChart.dataSourceId" from-field="geoPoint.dataSourceId"/> <set field="geoChart.width" value="600px"/> <set field="geoChart.height" value="500px"/> - <set field="geoChart.points" from-field="geoPoints"/> + <set field="geoChart.points" from-field="geoPoints"/> <property-map resource="ProductUiLabels" map-name="uiLabelMap"/> <set field="title" value="${uiLabelMap.PageTitleFacilityGeoLocation} - ${facility.facilityName}"/> </actions> @@ -1540,7 +1539,7 @@ under the License. </decorator-screen> </widgets> </section> - </screen> + </screen> <screen name="EditFacilityAgreements"> <section> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/dtd/ofbiz-component.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/dtd/ofbiz-component.xsd?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/dtd/ofbiz-component.xsd (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/dtd/ofbiz-component.xsd Mon Dec 2 20:59:22 2013 @@ -198,8 +198,24 @@ under the License. <xs:attribute type="xs:string" name="server" use="required"/> <xs:attribute type="xs:string" name="location" use="required"/> <xs:attribute type="xs:string" name="mount-point"/> + <xs:attribute type="xs:string" name="access-permission"> + <xs:annotation> + <xs:documentation> + A user must have this permission to access the application. + When omitted, the application can be used by anyone. This + attribute takes precedence over the base-permission attribute - + if both attributes are not empty, this attribute will be used. + </xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute type="xs:string" name="base-permission"> - <xs:annotation><xs:documentation>A user must have ALL of the permissions in the list to access the application</xs:documentation></xs:annotation> + <xs:annotation> + <xs:documentation> + Deprecated - use access-permission. + A user must have ALL of the permissions in the list to access the application. + When set to "NONE", the application can be used by anyone. + </xs:documentation> + </xs:annotation> </xs:attribute> <xs:attribute name="privileged" default="false"> <xs:simpleType> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/component/ComponentConfig.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/component/ComponentConfig.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/component/ComponentConfig.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/component/ComponentConfig.java Mon Dec 2 20:59:22 2013 @@ -829,6 +829,7 @@ public final class ComponentConfig { public final boolean privileged; // CatalinaContainer modifies this field. private volatile boolean appBarDisplay; + private final String accessPermission; private WebappInfo(ComponentConfig componentConfig, Element element) { this.componentConfig = componentConfig; @@ -872,6 +873,7 @@ public final class ComponentConfig { this.appBarDisplay = !"false".equals(element.getAttribute("app-bar-display")); this.sessionCookieAccepted = !"false".equals(element.getAttribute("session-cookie-accepted")); this.privileged = !"false".equals(element.getAttribute("privileged")); + this.accessPermission = element.getAttribute("access-permission"); String basePermStr = element.getAttribute("base-permission"); if (!basePermStr.isEmpty()) { this.basePermission = basePermStr.split(","); @@ -921,6 +923,10 @@ public final class ComponentConfig { return this.appBarDisplay; } + public String getAccessPermission() { + return this.accessPermission; + } + public String[] getBasePermission() { return this.basePermission; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/PatternFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/PatternFactory.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/PatternFactory.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/PatternFactory.java Mon Dec 2 20:59:22 2013 @@ -25,29 +25,30 @@ import org.ofbiz.base.util.cache.UtilCac /** * A RegEx compiled pattern factory. - * + * */ public class PatternFactory { - public static final String module = CompilerMatcher.class.getName(); + public static final String module = PatternFactory.class.getName(); private static final UtilCache<String, Pattern> compiledPerl5Patterns = UtilCache.createUtilCache("regularExpression.compiledPerl5Patterns", false); /** * Compiles and caches a Perl5 regexp pattern for the given string pattern. - * + * This would be of no benefits (and may bloat memory usage) if stringPattern is never the same. * @param stringPattern a Perl5 pattern string * @param caseSensitive case sensitive true/false * @return a <code>Pattern</code> instance for the given string pattern * @throws MalformedPatternException */ - public Pattern getPerl5Instance(String stringPattern, boolean caseSensitive) throws MalformedPatternException { + + public static Pattern createOrGetPerl5CompiledPattern(String stringPattern, boolean caseSensitive) throws MalformedPatternException { Pattern pattern = compiledPerl5Patterns.get(stringPattern); if (pattern == null) { Perl5Compiler compiler = new Perl5Compiler(); if (caseSensitive) { - pattern = compiler.compile(stringPattern, Perl5Compiler.READ_ONLY_MASK); + pattern = compiler.compile(stringPattern, Perl5Compiler.READ_ONLY_MASK); // READ_ONLY_MASK guarantees immutability } else { - pattern = compiler.compile(stringPattern, Perl5Compiler.CASE_INSENSITIVE_MASK & Perl5Compiler.READ_ONLY_MASK); + pattern = compiler.compile(stringPattern, Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.READ_ONLY_MASK); } pattern = compiledPerl5Patterns.putIfAbsentAndGet(stringPattern, pattern); if (Debug.verboseOn()) { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/StringUtil.java Mon Dec 2 20:59:22 2013 @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.StringTokenizer; -import java.util.regex.Matcher; import java.util.regex.Pattern; import javolution.context.ObjectFactory; @@ -228,15 +227,15 @@ public class StringUtil { if (delim != null) st = Pattern.compile(delim).split(str, limit); else st = str.split("\\s"); - + if (st != null && st.length > 0) { splitList = FastList.newInstance(); for (int i=0; i < st.length; i++) splitList.add(st[i]); } - + return splitList; } - + /** * Encloses each of a List of Strings in quotes. * @param list List of String(s) to quote. @@ -261,7 +260,7 @@ public class StringUtil { */ public static Map<String, String> strToMap(String str, String delim, boolean trim) { return strToMap(str, delim, trim, null); - + } /** @@ -269,7 +268,7 @@ public class StringUtil { * @param str The string to decode and format * @param delim the delimiter character(s) to join on (null will split on whitespace) * @param trim Trim whitespace off fields - * @param pairsSeparator in case you use not encoded name/value pairs strings + * @param pairsSeparator in case you use not encoded name/value pairs strings * and want to replace "=" to avoid clashes with parameters values in a not encoded URL, default to "=" * @return a Map of name/value pairs */ @@ -334,7 +333,7 @@ public class StringUtil { return strToMap(str, null, false); } - + /** * Creates an encoded String from a Map of name/value pairs (MUST BE STRINGS!) * @param map The Map of name/value pairs @@ -375,7 +374,7 @@ public class StringUtil { } return buf.toString(); } - + /** * Reads a String version of a Map (should contain only strings) and creates a new Map. * Partial Map elements are skipped: <code>{foo=fooValue, bar=}</code> will contain only @@ -546,9 +545,7 @@ public class StringUtil { * Removes all matches of regex from a str */ public static String removeRegex(String str, String regex) { - Pattern pattern = Pattern.compile(regex); - Matcher matcher = pattern.matcher(str); - return matcher.replaceAll(""); + return str.replaceAll(regex, ""); } /** Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilHttp.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilHttp.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilHttp.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/base/src/org/ofbiz/base/util/UtilHttp.java Mon Dec 2 20:59:22 2013 @@ -52,6 +52,9 @@ import javolution.util.FastMap; import org.apache.commons.lang.RandomStringUtils; import org.apache.oro.text.regex.MalformedPatternException; +import org.apache.oro.text.regex.Pattern; +import org.apache.oro.text.regex.PatternMatcher; +import org.apache.oro.text.regex.Perl5Matcher; import org.owasp.esapi.errors.EncodingException; import org.owasp.esapi.errors.IntrusionException; @@ -550,9 +553,9 @@ public class UtilHttp { return; } - StringBuffer fullRequestUrl = UtilHttp.getFullRequestUrl(request); + StringBuffer fullRequestUrl = getFullRequestUrl(request); - session.setAttribute("_WEBAPP_NAME_", UtilHttp.getApplicationName(request)); + session.setAttribute("_WEBAPP_NAME_", getApplicationName(request)); session.setAttribute("_CLIENT_LOCALE_", request.getLocale()); session.setAttribute("_CLIENT_REQUEST_", fullRequestUrl.toString()); session.setAttribute("_CLIENT_USER_AGENT_", request.getHeader("User-Agent") != null ? request.getHeader("User-Agent") : ""); @@ -586,7 +589,7 @@ public class UtilHttp { } public static StringBuffer getFullRequestUrl(HttpServletRequest request) { - StringBuffer requestUrl = UtilHttp.getServerRootUrl(request); + StringBuffer requestUrl = getServerRootUrl(request); requestUrl.append(request.getRequestURI()); if (request.getQueryString() != null) { requestUrl.append("?" + request.getQueryString()); @@ -630,7 +633,7 @@ public class UtilHttp { */ public static Locale getLocale(HttpServletRequest request) { if (request == null) return Locale.getDefault(); - return UtilHttp.getLocale(request, request.getSession(), null); + return getLocale(request, request.getSession(), null); } /** @@ -641,11 +644,11 @@ public class UtilHttp { */ public static Locale getLocale(HttpSession session) { if (session == null) return Locale.getDefault(); - return UtilHttp.getLocale(null, session, null); + return getLocale(null, session, null); } public static void setLocale(HttpServletRequest request, String localeString) { - UtilHttp.setLocale(request.getSession(), UtilMisc.parseLocale(localeString)); + setLocale(request.getSession(), UtilMisc.parseLocale(localeString)); } public static void setLocale(HttpSession session, Locale locale) { @@ -654,12 +657,12 @@ public class UtilHttp { public static void setLocaleIfNone(HttpSession session, String localeString) { if (UtilValidate.isNotEmpty(localeString) && session.getAttribute("locale") == null) { - UtilHttp.setLocale(session, UtilMisc.parseLocale(localeString)); + setLocale(session, UtilMisc.parseLocale(localeString)); } } public static void setTimeZone(HttpServletRequest request, String tzId) { - UtilHttp.setTimeZone(request.getSession(), UtilDateTime.toTimeZone(tzId)); + setTimeZone(request.getSession(), UtilDateTime.toTimeZone(tzId)); } public static void setTimeZone(HttpSession session, TimeZone timeZone) { @@ -768,8 +771,6 @@ public class UtilHttp { col = Arrays.asList(value); } else if (value instanceof Collection) { col = UtilGenerics.cast(value); - } else if (value == null) { - continue; } else if (value.getClass().isArray()) { col = Arrays.asList((Object[]) value); } else { @@ -1286,20 +1287,21 @@ public class UtilHttp { } else { String initialUserAgent = request.getHeader("User-Agent") != null ? request.getHeader("User-Agent") : ""; List<String> spiderList = StringUtil.split(UtilProperties.getPropertyValue("url", "link.remove_lsessionid.user_agent_list"), ","); - if (UtilValidate.isNotEmpty(spiderList)) { - CompilerMatcher compilerMatcher = new CompilerMatcher(); + if (UtilValidate.isNotEmpty(spiderList)) { for (String spiderNameElement : spiderList) { + Pattern pattern = null; try { - if (compilerMatcher.matches(initialUserAgent, "^.*" + spiderNameElement + ".*$", false)) { - request.setAttribute("_REQUEST_FROM_SPIDER_", "Y"); - result = true; - break; - } - } - catch (MalformedPatternException e) { + pattern = PatternFactory.createOrGetPerl5CompiledPattern(spiderNameElement, false); + } catch (MalformedPatternException e) { Debug.logError(e, module); } + PatternMatcher matcher = new Perl5Matcher(); + if (matcher.contains(initialUserAgent, pattern)) { + request.setAttribute("_REQUEST_FROM_SPIDER_", "Y"); + result = true; + break; + } } } } @@ -1327,7 +1329,7 @@ public class UtilHttp { /** Returns the number or rows submitted by a multi form. */ public static int getMultiFormRowCount(HttpServletRequest request) { - return UtilHttp.getMultiFormRowCount(UtilHttp.getParameterMap(request)); + return getMultiFormRowCount(getParameterMap(request)); } /** Returns the number or rows submitted by a multi form. */ @@ -1335,9 +1337,9 @@ public class UtilHttp { // The number of multi form rows is computed selecting the maximum index int rowCount = 0; String maxRowIndex = ""; - int rowDelimiterLength = UtilHttp.MULTI_ROW_DELIMITER.length(); + int rowDelimiterLength = MULTI_ROW_DELIMITER.length(); for (String parameterName: requestMap.keySet()) { - int rowDelimiterIndex = (parameterName != null? parameterName.indexOf(UtilHttp.MULTI_ROW_DELIMITER): -1); + int rowDelimiterIndex = (parameterName != null? parameterName.indexOf(MULTI_ROW_DELIMITER): -1); if (rowDelimiterIndex > 0) { String thisRowIndex = parameterName.substring(rowDelimiterIndex + rowDelimiterLength); if (thisRowIndex.indexOf("_") > -1) { @@ -1368,7 +1370,7 @@ public class UtilHttp { paramMapStore = FastMap.newInstance(); session.setAttribute("_PARAM_MAP_STORE_", paramMapStore); } - Map<String, Object> parameters = UtilHttp.getParameterMap(request); + Map<String, Object> parameters = getParameterMap(request); String paramMapId = RandomStringUtils.randomAlphanumeric(10); paramMapStore.put(paramMapId, parameters); return paramMapId; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Mon Dec 2 20:59:22 2013 @@ -44,6 +44,7 @@ import org.apache.catalina.Host; import org.apache.catalina.LifecycleException; import org.apache.catalina.Manager; import org.apache.catalina.connector.Connector; +import org.apache.catalina.core.JreMemoryLeakPreventionListener; import org.apache.catalina.core.StandardContext; import org.apache.catalina.core.StandardEngine; import org.apache.catalina.core.StandardHost; @@ -140,7 +141,7 @@ import org.xml.sax.SAXException; */ /** - * CatalinaContainer - Tomcat 5 + * CatalinaContainer - Tomcat * */ public class CatalinaContainer implements Container { @@ -206,6 +207,17 @@ public class CatalinaContainer implement tomcat.enableNaming(); } + // https://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html#JRE_Memory_Leak_Prevention_Listener_-_org.apache.catalina.core.JreMemoryLeakPreventionListener + // <<The JRE Memory Leak Prevention Listener provides work-arounds for known places where the Java Runtime environment uses + // the context class loader to load a singleton as this will cause a memory leak if a web application class loader happens + // to be the context class loader at the time.>> + // http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?view=annotate + JreMemoryLeakPreventionListener jreMemoryLeakPreventionListener = new JreMemoryLeakPreventionListener(); + // Mostly use default config, but some specific cases here + jreMemoryLeakPreventionListener.setAppContextProtection(true); // True is the default for Java 1.6, use false for Java from 1.7.0_02 onwards (see sources above) + jreMemoryLeakPreventionListener.setGcDaemonProtection(false); // False because of https://mail-archives.apache.org/mod_mbox/tomcat-users/201008.mbox/%3CAANLkTino=BjP5LsBCwncB2HvNDzyKLr5y-8yWdt15a89@...%3E + jreMemoryLeakPreventionListener.setUrlCacheProtection(false); // False to keep the URLConnection cache, moot point + // configure JNDI in the StandardServer StandardServer server = (StandardServer) tomcat.getServer(); try { @@ -480,7 +492,7 @@ public class CatalinaContainer implement String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1"); String address = ContainerConfig.getPropertyValue(connectorProp, "address", "0.0.0.0"); int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + ClassLoaderContainer.portOffset; - + boolean secure = ContainerConfig.getPropertyValue(connectorProp, "secure", false); if (protocol.toLowerCase().startsWith("ajp")) { protocol = "ajp"; @@ -540,7 +552,7 @@ public class CatalinaContainer implement try { for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) { - if ("port".equals(prop.name)) { + if ("port".equals(prop.name)) { connector.setProperty(prop.name, "" + port); } else { connector.setProperty(prop.name, prop.value); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/webcommon/changePassword.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/webcommon/changePassword.ftl?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/webcommon/changePassword.ftl (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/webcommon/changePassword.ftl Mon Dec 2 20:59:22 2013 @@ -18,6 +18,7 @@ under the License. --> <#assign username = requestParameters.USERNAME?default((sessionAttributes.autoUserLogin.userLoginId)?default(""))> +<#assign tenantId = requestParameters.tenantId!> <center> <div class="screenlet login-screenlet"> @@ -28,6 +29,7 @@ under the License. <form method="post" action="<@ofbizUrl>login</@ofbizUrl>" name="loginform"> <input type="hidden" name="requirePasswordChange" value="Y"/> <input type="hidden" name="USERNAME" value="${username}"/> + <input type="hidden" name="tenantId" value="${tenantId!}"/> <table cellspacing="0"> <tr> <td class="label">${uiLabelMap.CommonUsername}</td> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java Mon Dec 2 20:59:22 2013 @@ -23,9 +23,13 @@ import java.util.Collection; import java.util.List; import java.util.Map; +import org.apache.oro.text.perl.Perl5Util; import org.apache.oro.text.regex.MalformedPatternException; -import org.ofbiz.base.util.CompilerMatcher; +import org.apache.oro.text.regex.Pattern; +import org.apache.oro.text.regex.PatternMatcher; +import org.apache.oro.text.regex.Perl5Matcher; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.PatternFactory; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; @@ -42,19 +46,23 @@ public abstract class EntityComparisonOp public static final String module = EntityComparisonOperator.class.getName(); - protected transient static ThreadLocal<CompilerMatcher> compilerMatcher = CompilerMatcher.getThreadLocal(); - - public static String makeOroPattern(String sqlLike) { + public static Pattern makeOroPattern(String sqlLike) { + Perl5Util perl5Util = new Perl5Util(); try { - sqlLike = compilerMatcher.get().substitute("s/([$^.+*?])/\\\\$1/g", sqlLike); - sqlLike = compilerMatcher.get().substitute("s/%/.*/g", sqlLike); - sqlLike = compilerMatcher.get().substitute("s/_/./g", sqlLike); + sqlLike = perl5Util.substitute("s/([$^.+*?])/\\\\$1/g", sqlLike); + sqlLike = perl5Util.substitute("s/%/.*/g", sqlLike); + sqlLike = perl5Util.substitute("s/_/./g", sqlLike); } catch (Throwable t) { String errMsg = "Error in ORO pattern substitution for SQL like clause [" + sqlLike + "]: " + t.toString(); Debug.logError(t, errMsg, module); throw new IllegalArgumentException(errMsg); } - return sqlLike; + try { + return PatternFactory.createOrGetPerl5CompiledPattern(sqlLike, true); + } catch (MalformedPatternException e) { + Debug.logError(e, module); + } + return null; } @Override @@ -258,19 +266,14 @@ public abstract class EntityComparisonOp } public static final <L,R> boolean compareLike(L lhs, R rhs) { + PatternMatcher matcher = new Perl5Matcher(); if (lhs == null) { if (rhs != null) { return false; } } else if (lhs instanceof String && rhs instanceof String) { //see if the lhs value is like the rhs value, rhs will have the pattern characters in it... - try { - return compilerMatcher.get().matches((String) lhs, makeOroPattern((String) rhs)); - } - catch (MalformedPatternException e) { - Debug.logError(e, module); - return false; - } + return matcher.matches((String) lhs, makeOroPattern((String) rhs)); } return true; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java Mon Dec 2 20:59:22 2013 @@ -337,7 +337,7 @@ public class ModelEntity implements Comp ModelField existingField = this.getField(newField.getName()); if (existingField != null) { // override the existing field's attributes - // TODO: only overrides of type, colName and description are currently supported + // TODO: only overrides of type, colName, description and enable-audit-log are currently supported String type = existingField.getType(); if (!newField.getType().isEmpty()) { type = newField.getType(); @@ -350,9 +350,13 @@ public class ModelEntity implements Comp if (!newField.getDescription().isEmpty()) { description = newField.getDescription(); } + boolean enableAuditLog = existingField.getEnableAuditLog(); + if (UtilValidate.isNotEmpty(fieldElement.getAttribute("enable-audit-log"))) { + enableAuditLog = "true".equals(fieldElement.getAttribute("enable-audit-log")); + } newField = ModelField.create(this, description, existingField.getName(), type, colName, existingField.getColValue(), existingField.getFieldSet(), existingField.getIsNotNull(), existingField.getIsPk(), existingField.getEncrypt(), existingField.getIsAutoCreatedInternal(), - existingField.getEnableAuditLog(), existingField.getValidators()); + enableAuditLog, existingField.getValidators()); } // add to the entity as a new field synchronized (fieldsLock) { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java Mon Dec 2 20:59:22 2013 @@ -75,7 +75,7 @@ import org.w3c.dom.Element; * </li> * </ul> * </p> - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-The{{%3Csimplemethod%3E}}element">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-The{{%3Csimplemethod%3E}}element">Mini-language Reference</a> */ public final class SimpleMethod extends MiniLangElement { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java Mon Dec 2 20:59:22 2013 @@ -27,7 +27,7 @@ import org.w3c.dom.Element; /** * Implements the <field> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cfield%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cfield%3E}}">Mini-language Reference</a> */ public final class FieldObject<T> extends MethodObject<T> { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/MessageElement.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/MessageElement.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/MessageElement.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/MessageElement.java Mon Dec 2 20:59:22 2013 @@ -30,7 +30,7 @@ import org.w3c.dom.Element; /** * Implements the <fail-message> and <fail-property> elements. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{<failmessage>}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{<failmessage>}}">Mini-language Reference</a> */ public final class MessageElement extends MiniLangElement { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java Mon Dec 2 20:59:22 2013 @@ -42,8 +42,8 @@ import bsh.Interpreter; /** * Implements the <call-bsh> element. - * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccallbsh%3E}}">Mini-language Reference</a> + * + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Ccallbsh%3E}}">Mini-language Reference</a> */ public final class CallBsh extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java Mon Dec 2 20:59:22 2013 @@ -40,7 +40,7 @@ import org.w3c.dom.Element; /** * Implements the <call-class-method> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccallclassmethod%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Ccallclassmethod%3E}}">Mini-language Reference</a> */ public final class CallClassMethod extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java Mon Dec 2 20:59:22 2013 @@ -39,7 +39,7 @@ import org.w3c.dom.Element; /** * Implements the <call-object-method> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccallobjectmethod%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Ccallobjectmethod%3E}}">Mini-language Reference</a> */ public final class CallObjectMethod extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallScript.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallScript.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallScript.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallScript.java Mon Dec 2 20:59:22 2013 @@ -34,7 +34,7 @@ import org.w3c.dom.Element; /** * Implements the <script> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cscript%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cscript%3E}}">Mini-language Reference</a> */ public final class CallScript extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java Mon Dec 2 20:59:22 2013 @@ -49,7 +49,7 @@ import org.w3c.dom.Element; /** * Implements the <call-service> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccallservice%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Ccallservice%3E}}">Mini-language Reference</a> */ public final class CallService extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java Mon Dec 2 20:59:22 2013 @@ -38,7 +38,7 @@ import org.w3c.dom.Element; /** * Implements the <call-service-asynch> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccallserviceasynch%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Ccallserviceasynch%3E}}">Mini-language Reference</a> */ public final class CallServiceAsynch extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java Mon Dec 2 20:59:22 2013 @@ -37,7 +37,7 @@ import org.w3c.dom.Element; /** * Implements the <call-map-processor> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccallmapprocessor%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Ccallmapprocessor%3E}}">Mini-language Reference</a> */ public final class CallSimpleMapProcessor extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java Mon Dec 2 20:59:22 2013 @@ -43,7 +43,7 @@ import org.w3c.dom.Element; /** * Implements the <call-simple-method> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccallsimplemethod%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Ccallsimplemethod%3E}}">Mini-language Reference</a> */ public final class CallSimpleMethod extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java Mon Dec 2 20:59:22 2013 @@ -29,7 +29,7 @@ import org.w3c.dom.Element; /** * Implements the <return> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Creturn%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Creturn%3E}}">Mini-language Reference</a> */ public final class Return extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java Mon Dec 2 20:59:22 2013 @@ -41,7 +41,7 @@ import org.w3c.dom.Element; /** * Implements the <set-service-fields> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Csetservicefields%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Csetservicefields%3E}}">Mini-language Reference</a> */ public final class SetServiceFields extends MethodOperation { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CombinedCondition.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CombinedCondition.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CombinedCondition.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CombinedCondition.java Mon Dec 2 20:59:22 2013 @@ -33,7 +33,7 @@ import org.w3c.dom.Element; /** * Implements the <and>, <or>, <not>, and <xor> elements. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-Conditional%2FLoopingStatements">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-Conditional%2FLoopingStatements">Mini-language Reference</a> */ public abstract class CombinedCondition extends MiniLangElement implements Conditional { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareCondition.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareCondition.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareCondition.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareCondition.java Mon Dec 2 20:59:22 2013 @@ -39,7 +39,7 @@ import org.w3c.dom.Element; /** * Implements the <if-compare> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cifcompare%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cifcompare%3E}}">Mini-language Reference</a> */ public final class CompareCondition extends MethodOperation implements Conditional { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareFieldCondition.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareFieldCondition.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareFieldCondition.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareFieldCondition.java Mon Dec 2 20:59:22 2013 @@ -39,7 +39,7 @@ import org.w3c.dom.Element; /** * Implements the <if-compare-field> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cifcomparefield%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cifcomparefield%3E}}">Mini-language Reference</a> */ public final class CompareFieldCondition extends MethodOperation implements Conditional { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java Mon Dec 2 20:59:22 2013 @@ -34,7 +34,7 @@ import org.w3c.dom.Element; /** * Implements the <else-if> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Celseif%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Celseif%3E}}">Mini-language Reference</a> */ public final class ElseIf extends MiniLangElement { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/EmptyCondition.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/EmptyCondition.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/EmptyCondition.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/EmptyCondition.java Mon Dec 2 20:59:22 2013 @@ -35,7 +35,7 @@ import org.w3c.dom.Element; /** * Implements the <if-empty> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cifempty%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cifempty%3E}}">Mini-language Reference</a> */ public final class EmptyCondition extends MethodOperation implements Conditional { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java Mon Dec 2 20:59:22 2013 @@ -37,7 +37,7 @@ import org.w3c.dom.Element; /** * Implements the <if-has-permission> element. * - * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cifhaspermission%3E}}">Mini-language Reference</a> + * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cifhaspermission%3E}}">Mini-language Reference</a> */ public final class HasPermissionCondition extends MethodOperation implements Conditional { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/RegexpCondition.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/RegexpCondition.java?rev=1547192&r1=1547191&r2=1547192&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/RegexpCondition.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/conditional/RegexpCondition.java Mon Dec 2 20:59:22 2013 @@ -22,7 +22,11 @@ import java.util.Collections; import java.util.List; import org.apache.oro.text.regex.MalformedPatternException; -import org.ofbiz.base.util.CompilerMatcher; +import org.apache.oro.text.regex.Pattern; +import org.apache.oro.text.regex.PatternMatcher; +import org.apache.oro.text.regex.Perl5Matcher; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.PatternFactory; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; @@ -44,7 +48,6 @@ import org.w3c.dom.Element; public class RegexpCondition extends MethodOperation implements Conditional { public static final String module = RegexpCondition.class.getName(); - private transient static ThreadLocal<CompilerMatcher> compilerMatcher = CompilerMatcher.getThreadLocal(); private final FlexibleMapAccessor<Object> fieldFma; private final FlexibleStringExpander exprFse; @@ -88,11 +91,23 @@ public class RegexpCondition extends Met } } String regExp = exprFse.expandString(methodContext.getEnvMap()); + Pattern pattern = null; + try { - return compilerMatcher.get().matches((String) fieldVal, regExp); + pattern = PatternFactory.createOrGetPerl5CompiledPattern(regExp, true); } catch (MalformedPatternException e) { + Debug.logError(e, "Regular Expression [" + regExp + "] is mal-formed: " + e.toString(), module); throw new MiniLangRuntimeException(e, this); } + + PatternMatcher matcher = new Perl5Matcher(); + if (matcher.matches((String) fieldVal, pattern)) { + //Debug.logInfo("The string [" + fieldVal + "] matched the pattern expr [" + pattern.getPattern() + "]", module); + return true; + } else { + //Debug.logInfo("The string [" + fieldVal + "] did NOT match the pattern expr [" + pattern.getPattern() + "]", module); + return false; + } } @Override @@ -123,6 +138,7 @@ public class RegexpCondition extends Met } } + @Override public void prettyPrint(StringBuilder messageBuffer, MethodContext methodContext) { messageBuffer.append("regexp["); messageBuffer.append("["); |
Free forum by Nabble | Edit this page |