Author: jleroux
Date: Mon Jun 23 07:30:14 2014 New Revision: 1604706 URL: http://svn.apache.org/r1604706 Log: Keeps in sync with OFBiz trunk HEAD Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/ (props changed) ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlSetupForms.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlobalGlAccountsForms.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/images/js/ConvertUom.js ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/party/PartyServices.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementServices.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ProductForms.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityMenus.xml 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/common/entitydef/entitymodel.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityCondition.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/entitydef/entitymodel.xml ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/ServiceDispatcher.java ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java Propchange: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1602807-1604702 Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Mon Jun 23 07:30:14 2014 @@ -486,7 +486,7 @@ public class InvoiceServices { } if ("ItemIssuance".equals(currentValue.getEntityName())) { - List<GenericValue> shipmentItemBillings = delegator.findByAnd("ShipmentItemBilling", UtilMisc.toMap("shipmentId", currentValue.get("shipmentId")), null, false); + List<GenericValue> shipmentItemBillings = delegator.findByAnd("ShipmentItemBilling", UtilMisc.toMap("shipmentId", currentValue.get("shipmentId"), "shipmentItemSeqId", currentValue.get("shipmentItemSeqId")), null, false); if (UtilValidate.isEmpty(shipmentItemBillings)) { // create the ShipmentItemBilling record Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlSetupForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlSetupForms.xml?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlSetupForms.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlSetupForms.xml Mon Jun 23 07:30:14 2014 @@ -46,22 +46,30 @@ under the License. <actions> <entity-condition entity-name="GlAccountOrganizationAndClass"> <condition-expr field-name="organizationPartyId" from-field="organizationPartyId"/> - <order-by field-name="glAccountId"/> + <order-by field-name="accountCode"/> </entity-condition> </actions> - <auto-fields-entity entity-name="GlAccount" default-field-type="display"/> - <field name="glAccountId" widget-style="buttontext"> - <hyperlink also-hidden="false" description="${glAccountId}" target="GlAccountNavigate"> + <field name="accountCode" title="${uiLabelMap.CommonCode}" widget-style="buttontext"> + <hyperlink also-hidden="false" description="${accountCode}" target="GlAccountNavigate"> <parameter param-name="glAccountId"/> </hyperlink> </field> - <field name="glAccountClassId"> - <display-entity entity-name="GlAccountClass"/> - </field> - <field name="glAccountTypeId"> - <display-entity entity-name="GlAccountType"/> - </field> <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field> + <field name="parentGlAccountId"> + <display-entity entity-name="GlAccount" description="${accountName}" key-field-name="glAccountId"> + <sub-hyperlink target="GlAccountNavigate" description="[${parentGlAccountId}]" use-when="parentGlAccountId!=null"> + <parameter param-name="glAccountId"/> + </sub-hyperlink> + </display-entity> + </field> + <field name="glAccountTypeId"><display-entity entity-name="GlAccountType"/></field> + <field name="glAccountClassId"><display-entity entity-name="GlAccountClass"/></field> + <field name="glResourceTypeId"><display-entity entity-name="GlResourceType"/></field> + <field name="glXbrlClassId"><display-entity entity-name="GlXbrlClass"/></field> + + <field name="description"><display/></field> + <field name="productId"><display-entity entity-name="Product"/></field> + <field name="externalId"><display/></field> </form> <form name="AddCompany" type="single" target="AdminMain" title="" > Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlobalGlAccountsForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlobalGlAccountsForms.xml?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlobalGlAccountsForms.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/accounting/widget/GlobalGlAccountsForms.xml Mon Jun 23 07:30:14 2014 @@ -73,22 +73,17 @@ under the License. <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" from-field="entityName"/> - <field-map field-name="orderBy" value="glAccountId"/> + <field-map field-name="orderBy" value="accountCode"/> <field-map field-name="noConditionFind" value="Y"/> </service> <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/> </actions> - <!--auto-fields-entity entity-name="GlAccount" default-field-type="display"/--> - <field name="glAccountId" title="${uiLabelMap.CommonEdit}" widget-style="buttontext"> - <hyperlink also-hidden="false" description="${glAccountId}" target="GlAccountNavigate"> + <field name="accountCode" title="${uiLabelMap.CommonCode}" widget-style="buttontext"> + <hyperlink also-hidden="false" description="${accountCode}" target="GlAccountNavigate"> <parameter param-name="glAccountId"/> </hyperlink> </field> <field name="accountName" entry-name="glAccountId"><display-entity entity-name="GlAccount" key-field-name="glAccountId" description="${accountName}"/></field> - <field name="glAccountTypeId"><display-entity entity-name="GlAccountType"/></field> - <field name="glAccountClassId"><display-entity entity-name="GlAccountClass"/></field> - <field name="glResourceTypeId"><display-entity entity-name="GlResourceType"></display-entity></field> - <field name="glXbrlClassId"><display-entity entity-name="GlXbrlClass"></display-entity></field> <field name="parentGlAccountId"> <display-entity entity-name="GlAccount" description="${accountName}" key-field-name="glAccountId"> <sub-hyperlink target="GlAccountNavigate" description="[${parentGlAccountId}]" use-when="parentGlAccountId!=null"> @@ -96,7 +91,14 @@ under the License. </sub-hyperlink> </display-entity> </field> - <field name="accountCode"><hidden/></field> + <field name="glAccountTypeId"><display-entity entity-name="GlAccountType"/></field> + <field name="glAccountClassId"><display-entity entity-name="GlAccountClass"/></field> + <field name="glResourceTypeId"><display-entity entity-name="GlResourceType"/></field> + <field name="glXbrlClassId"><display-entity entity-name="GlXbrlClass"/></field> + + <field name="description"><display/></field> + <field name="productId"><display-entity entity-name="Product"/></field> + <field name="externalId"><display/></field> </form> <form name="EditGlAccount" type="single" target="updateGlAccount" title="" default-map-name="glAccount" Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy Mon Jun 23 07:30:14 2014 @@ -595,6 +595,9 @@ if (product) { accessoryProducts = dispatcher.runSync("getAssociatedProducts", [productId : productId, type : "PRODUCT_ACCESSORY", checkViewAllow : true, prodCatalogId : currentCatalogId]); context.accessoryProducts = accessoryProducts.assocProducts; + /* + The following code is commented out because it is just an example of the business logic to retrieve products with a similar feature. + // get other cross-sell information: product with a common feature commonProductFeatureId = "SYMPTOM"; // does this product have that feature? @@ -633,6 +636,7 @@ if (product) { context.commonFeatureResultIds = commonFeatureResultIds; } } + */ // get the DIGITAL_DOWNLOAD related Content records to show the contentName/description downloadProductContentAndInfoList = delegator.findByAnd("ProductContentAndInfo", [productId : productId, productContentTypeId : "DIGITAL_DOWNLOAD"], null, true); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/images/js/ConvertUom.js URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/images/js/ConvertUom.js?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/images/js/ConvertUom.js (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/order/webapp/ordermgr/images/js/ConvertUom.js Mon Jun 23 07:30:14 2014 @@ -21,7 +21,7 @@ function getConvertedPrice(element, uomI var request = jQuery('#getConvertedPrice').val(); jQuery.ajax({ url: request, - data: { uomId : uomId, uomIdTo : uomIdTo, originalValue : element.value } + data: { uomId : uomId, uomIdTo : uomIdTo, originalValue : element.value }, async: true, type: "POST", success: function(data){ Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/party/PartyServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/party/PartyServices.xml?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/party/PartyServices.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/party/script/org/ofbiz/party/party/PartyServices.xml Mon Jun 23 07:30:14 2014 @@ -154,8 +154,8 @@ under the License. <if-not-empty field="partyNameHistoryCurrent.suffix"> <field-to-result field="partyNameHistoryCurrent.suffix" result-name="suffix"/> </if-not-empty> - <if-not-empty field="partyNameHistoryCurrent.gender"> - <field-to-result field="partyNameHistoryCurrent.gender" result-name="gender"/> + <if-not-empty field="person.gender"> + <field-to-result field="person.gender" result-name="gender"/> </if-not-empty> 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=1604706&r1=1604705&r2=1604706&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 Jun 23 07:30:14 2014 @@ -780,8 +780,8 @@ public class ImageManagementServices { return file; } imageCount++; - String filePath = imagePath.substring(0, imagePath.indexOf(".")); - String type = imagePath.substring(imagePath.indexOf(".") + 1); + String filePath = imagePath.substring(0, imagePath.lastIndexOf(".")); + String type = imagePath.substring(imagePath.lastIndexOf(".") + 1); file = new File(filePath + "(" + imageCount + ")." + type); return checkExistsImage(file); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy Mon Jun 23 07:30:14 2014 @@ -49,7 +49,7 @@ orderHeaderList.each { orderHeader -> inListFlag = false bestSellingProducts.each { bestSellingProduct -> - if ((bestSellingProduct.productId).equals(orderItem.productId)) { + if ((bestSellingProduct.productId).equals(orderItem.productId) && (bestSellingProduct.currencyUom).equals(orderHeader.currencyUom)) { inListFlag = true; bestSellingProduct.amount += amount; bestSellingProduct.qtyOrdered += qtyOrdered; @@ -63,6 +63,7 @@ orderHeaderList.each { orderHeader -> orderItemDetail.productName = contentWrapper.get("PRODUCT_NAME"); orderItemDetail.amount = amount; orderItemDetail.qtyOrdered = qtyOrdered; + orderItemDetail.currencyUom = orderHeader.currencyUom; bestSellingProducts.add(orderItemDetail); } } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ProductForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ProductForms.xml?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ProductForms.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/catalog/ProductForms.xml Mon Jun 23 07:30:14 2014 @@ -2104,7 +2104,7 @@ under the License. <form name="ListBestProduct" type="list" paginate="false" list-name="bestSellingProducts" view-size="5" header-row-style="header-row" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <field name="productName" title="${uiLabelMap.ProductName}"><display description="${productName}"/></field> - <field name="amount"><display type="currency"/></field> + <field name="amount"><display type="currency" currency="${currencyUom}"/></field> <field name="qtyOrdered" title="${uiLabelMap.OrderQtyOrdered}"><display/></field> </form> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityMenus.xml?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityMenus.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/widget/facility/FacilityMenus.xml Mon Jun 23 07:30:14 2014 @@ -161,7 +161,7 @@ under the License. <parameter param-name="facilityId"/> </link> </menu-item> - <menu-item name="EditFacilityAgreements" title="${uiLabelMap.PageTitleEditAgreement}"> + <menu-item name="EditFacilityAgreements" title="${uiLabelMap.PageTitleViewFacilityAgreements}"> <link target="EditFacilityAgreements"> <parameter param-name="facilityId"/> </link> 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=1604706&r1=1604705&r2=1604706&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 Jun 23 07:30:14 2014 @@ -1552,18 +1552,12 @@ under the License. <set field="facilityId" from-field="parameters.facilityId"/> <entity-and entity-name="AgreementItemAndFacilityAppl" list="facilityAgreements"> <field-map field-name="facilityId"/> - <field-map field-name="agreementTypeId" value="FACILITY_AGREEMENT"/> <order-by field-name="fromDate"/> </entity-and> </actions> <widgets> <decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}"> <decorator-section name="body"> - <container> - <link target="/accounting/control/EditAgreement" url-mode="inter-app" text="${uiLabelMap.PageTitleEditAgreement}" style="buttontext"> - <parameter param-name="facilityId"/> - </link> - </container> <screenlet title="${uiLabelMap.FacilityAgreements}"> <include-form name="ListFacilityAgreements" location="component://product/widget/facility/FacilityForms.xml"/> </screenlet> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/entitydef/entitymodel.xml?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/entitydef/entitymodel.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/common/entitydef/entitymodel.xml Mon Jun 23 07:30:14 2014 @@ -75,6 +75,7 @@ under the License. <entity entity-name="EmailTemplateSetting" package-name="org.ofbiz.common.email" title="Email Template Setting Entity"> <field name="emailTemplateSettingId" type="id-ne"></field> + <field name="emailType" type="id-ne"></field> <field name="description" type="description"></field> <field name="bodyScreenLocation" type="long-varchar"><description>if empty defaults to a screen based on the emailType</description></field> <field name="xslfoAttachScreenLocation" type="long-varchar"><description>if specified is used to generate XSL:FO that is transformed to a PDF via Apache FOP and attached to the email</description></field> @@ -84,6 +85,9 @@ under the License. <field name="subject" type="comment"></field> <field name="contentType" type="long-varchar"></field> <prim-key field="emailTemplateSettingId"/> + <relation type="one" fk-name="EMAILSET_ENUM" rel-entity-name="Enumeration"> + <key-map field-name="emailType" rel-field-name="enumId"/> + </relation> </entity> <!-- ========================================================= --> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityCondition.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityCondition.java?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityCondition.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/condition/EntityCondition.java Mon Jun 23 07:30:14 2014 @@ -20,11 +20,11 @@ package org.ofbiz.entity.condition; import static org.ofbiz.base.util.UtilGenerics.cast; +import java.util.ArrayList; import java.util.List; import java.util.Map; import javolution.lang.Reusable; -import javolution.util.FastList; import org.ofbiz.base.lang.IsEmpty; import org.ofbiz.entity.Delegator; @@ -139,7 +139,7 @@ public abstract class EntityCondition ex @Override public String toString() { - return makeWhereString(null, FastList.<EntityConditionParam>newInstance(), null); + return makeWhereString(null, new ArrayList<EntityConditionParam>(), null); } public void accept(EntityConditionVisitor visitor) { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java Mon Jun 23 07:30:14 2014 @@ -18,13 +18,12 @@ */ package org.ofbiz.entity.sql; +import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import javolution.util.FastList; - import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.model.DynamicViewEntity; import org.ofbiz.entity.model.ModelKeyMap; @@ -232,7 +231,7 @@ public class EntityPlanner extends Plann } private static List<ModelKeyMap> buildKeyMaps(Iterable<KeyMap> keyMaps) { - List<ModelKeyMap> entityKeyMaps = FastList.newInstance(); + List<ModelKeyMap> entityKeyMaps = new ArrayList<ModelKeyMap>(); for (KeyMap keyMap: keyMaps) { entityKeyMaps.add(new ModelKeyMap(keyMap.getLeftFieldName(), keyMap.getRightFieldName())); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/entitydef/entitymodel.xml?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/entitydef/entitymodel.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/entitydef/entitymodel.xml Mon Jun 23 07:30:14 2014 @@ -192,6 +192,7 @@ under the License. <entity entity-name="ServiceSemaphore" package-name="org.ofbiz.service.semaphore" title="Semaphore Lock Entity" sequence-bank-size="100"> <field name="serviceName" type="name"></field> + <field name="lockedByInstanceId" type="id"></field> <field name="lockThread" type="name"></field> <field name="lockTime" type="date-time"></field> <prim-key field="serviceName"/> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/ServiceDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/ServiceDispatcher.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/ServiceDispatcher.java Mon Jun 23 07:30:14 2014 @@ -105,6 +105,18 @@ public class ServiceDispatcher { } } + // clean up the service semaphores of same instance + if (delegator != null) { + try { + int rn = delegator.removeByAnd("ServiceSemaphore", "lockedByInstanceId", JobManager.instanceId); + if (rn > 0) { + Debug.logInfo("[ServiceDispatcher.init] : Clean up " + rn + " service semaphors." , module); + } + } catch (GenericEntityException e) { + Debug.logError(e, module); + } + } + // job manager needs to always be running, but the poller thread does not try { Delegator origDelegator = this.delegator; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java?rev=1604706&r1=1604705&r2=1604706&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java Mon Jun 23 07:30:14 2014 @@ -30,6 +30,7 @@ import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.transaction.GenericTransactionException; import org.ofbiz.entity.transaction.TransactionUtil; import org.ofbiz.service.ModelService; +import org.ofbiz.service.job.JobManager; /** * ServiceSemaphore @@ -72,7 +73,9 @@ public class ServiceSemaphore { if (mode == SEMAPHORE_MODE_NONE) return; // remove the lock file - dbWrite(lock, true); + if (lock != null) { + dbWrite(lock, true); + } } private void waitOrFail() throws SemaphoreWaitException, SemaphoreFailException { @@ -123,7 +126,7 @@ public class ServiceSemaphore { } if (semaphore == null) { - semaphore = delegator.makeValue("ServiceSemaphore", "serviceName", model.name, "lockThread", threadName, "lockTime", lockTime); + semaphore = delegator.makeValue("ServiceSemaphore", "serviceName", model.name, "lockedByInstanceId", JobManager.instanceId, "lockThread", threadName, "lockTime", lockTime); // use the special method below so we can reuse the unqiue tx functions dbWrite(semaphore, false); |
Free forum by Nabble | Edit this page |