|
Author: jleroux
Date: Sat Jan 5 13:40:19 2013 New Revision: 1429284 URL: http://svn.apache.org/viewvc?rev=1429284&view=rev Log: Merge trunk HEAD, few conflicts handled by hand I was not sure of the status, so I removed the webhelp generated files which are not needed in branch (see ant -p for help) Added: ofbiz/branches/webhelp-2012-12-07/framework/common/webcommon/includes/ServerHour24HourFormatJs.ftl - copied unchanged from r1429278, ofbiz/trunk/framework/common/webcommon/includes/ServerHour24HourFormatJs.ftl ofbiz/branches/webhelp-2012-12-07/framework/images/webapp/images/date.format-1.2.3 - copied unchanged from r1429278, ofbiz/trunk/framework/images/webapp/images/date.format-1.2.3 ofbiz/branches/webhelp-2012-12-07/framework/images/webapp/images/date.format-1.2.3-min.js - copied unchanged from r1429278, ofbiz/trunk/framework/images/webapp/images/date.format-1.2.3-min.js ofbiz/branches/webhelp-2012-12-07/framework/images/webapp/images/miscAjaxFunctions.js - copied unchanged from r1429278, ofbiz/trunk/framework/images/webapp/images/miscAjaxFunctions.js Removed: ofbiz/branches/webhelp-2012-12-07/framework/images/webapp/images/getDependentDropdownValues.js Modified: ofbiz/branches/webhelp-2012-12-07/ (props changed) ofbiz/branches/webhelp-2012-12-07/LICENSE ofbiz/branches/webhelp-2012-12-07/NOTICE ofbiz/branches/webhelp-2012-12-07/applications/accounting/config/AccountingUiLabels.xml ofbiz/branches/webhelp-2012-12-07/applications/accounting/data/AccountingTypeData.xml ofbiz/branches/webhelp-2012-12-07/applications/content/servicedef/services_website.xml ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/OrderServices.xml ofbiz/branches/webhelp-2012-12-07/applications/order/servicedef/services.xml ofbiz/branches/webhelp-2012-12-07/applications/order/src/org/ofbiz/order/order/OrderServices.java ofbiz/branches/webhelp-2012-12-07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy ofbiz/branches/webhelp-2012-12-07/applications/order/widget/ordermgr/LookupScreens.xml ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductEntityLabels.xml ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductUiLabels.xml ofbiz/branches/webhelp-2012-12-07/applications/product/script/org/ofbiz/product/category/CategoryServices.xml ofbiz/branches/webhelp-2012-12-07/applications/product/servicedef/services_view.xml ofbiz/branches/webhelp-2012-12-07/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy ofbiz/branches/webhelp-2012-12-07/framework/base/src/org/ofbiz/base/util/Debug.java ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonEntityLabels.xml ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonUiLabels.xml ofbiz/branches/webhelp-2012-12-07/framework/common/config/SecurityextUiLabels.xml ofbiz/branches/webhelp-2012-12-07/framework/common/data/GeoData_FR.xml ofbiz/branches/webhelp-2012-12-07/framework/common/entitydef/entitymodel.xml ofbiz/branches/webhelp-2012-12-07/framework/common/script/org/ofbiz/common/CommonServices.xml ofbiz/branches/webhelp-2012-12-07/framework/common/servicedef/services.xml ofbiz/branches/webhelp-2012-12-07/framework/common/src/org/ofbiz/common/login/LoginServices.java ofbiz/branches/webhelp-2012-12-07/framework/common/webcommon/WEB-INF/common-controller.xml ofbiz/branches/webhelp-2012-12-07/framework/common/widget/CommonScreens.xml ofbiz/branches/webhelp-2012-12-07/framework/entity/dtd/entity-config.xsd ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntityFindOptions.java ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java ofbiz/branches/webhelp-2012-12-07/framework/minilang/dtd/simple-methods-v2.xsd ofbiz/branches/webhelp-2012-12-07/framework/security/config/security.properties ofbiz/branches/webhelp-2012-12-07/framework/service/dtd/services.xsd ofbiz/branches/webhelp-2012-12-07/framework/webapp/dtd/site-conf.xsd ofbiz/branches/webhelp-2012-12-07/framework/webtools/widget/ServiceForms.xml ofbiz/branches/webhelp-2012-12-07/framework/webtools/widget/ServiceScreens.xml ofbiz/branches/webhelp-2012-12-07/framework/widget/src/org/ofbiz/widget/WidgetWorker.java ofbiz/branches/webhelp-2012-12-07/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java ofbiz/branches/webhelp-2012-12-07/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java ofbiz/branches/webhelp-2012-12-07/specialpurpose/ebay/data/DemoEbayData.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/ecommerce/data/DemoProduct.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/QuickAnonCustomerEvents.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/misc/AffiliateSimpleEvents.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl ofbiz/branches/webhelp-2012-12-07/specialpurpose/ecommerce/widget/CatalogScreens.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/ecommerce/widget/CommonScreens.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/example/data/ExampleDemoData.xml ofbiz/branches/webhelp-2012-12-07/specialpurpose/webpos/script/org/ofbiz/webpos/event/CartEvents.xml ofbiz/branches/webhelp-2012-12-07/themes/flatgrey/data/FlatGreyThemeData.xml Propchange: ofbiz/branches/webhelp-2012-12-07/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1418871-1429278 Modified: ofbiz/branches/webhelp-2012-12-07/LICENSE URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/LICENSE?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/LICENSE (original) +++ ofbiz/branches/webhelp-2012-12-07/LICENSE Sat Jan 5 13:40:19 2013 @@ -1234,7 +1234,8 @@ ofbiz/trunk/framework/base/lib/slf4j-log ofbiz/trunk/framework/images/webapp/images/jquery/* ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/jquery.hotkeys-0.7.9.min.js ofbiz/trunk/specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js -ofbiz/trunk/applications/content/template/docbook/webhelp/* +ofbiz/trunk/applications/content/template/docbook/webhelp/* +ofbiz/trunk/framework/images/webapp/images/date.format-1.2.3.js ========================================================================= The MIT License Modified: ofbiz/branches/webhelp-2012-12-07/NOTICE URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/NOTICE?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/NOTICE (original) +++ ofbiz/branches/webhelp-2012-12-07/NOTICE Sat Jan 5 13:40:19 2013 @@ -364,8 +364,8 @@ http://creativecommons.org/licenses/by/2 You are free: - * to Share to copy, distribute and transmit the work - * to Remix to adapt the work + * to Share â to copy, distribute and transmit the work + * to Remix â to adapt the work Under the following conditions: @@ -382,6 +382,12 @@ Under the following conditions: * For any reuse or distribution, you must make clear to author's moral rights. ========================================================================= + +This product includes software developed by Steven Levithan +(http://blog.stevenlevithan.com/archives/date-time-format). MIT license +========================================================================= + +========================================================================= == Web-based Help from DocBook XML Notice == ========================================================================= Modified: ofbiz/branches/webhelp-2012-12-07/applications/accounting/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/accounting/config/AccountingUiLabels.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/accounting/config/AccountingUiLabels.xml Sat Jan 5 13:40:19 2013 @@ -2760,7 +2760,7 @@ <value xml:lang="pt">Verifiquar número</value> <value xml:lang="vi">Sá» kiá»m tra</value> <value xml:lang="zh">æ¯ç¥¨å·</value> - <value xml:lang="zh_Tw">æ¯ç¥¨è碼</value> + <value xml:lang="zh_TW">æ¯ç¥¨è碼</value> </property> <property key="AccountingChecks"> <value xml:lang="ar">صÙÙÙ</value> Modified: ofbiz/branches/webhelp-2012-12-07/applications/accounting/data/AccountingTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/accounting/data/AccountingTypeData.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/accounting/data/AccountingTypeData.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/accounting/data/AccountingTypeData.xml Sat Jan 5 13:40:19 2013 @@ -958,7 +958,7 @@ under the License. <CustomMethod customMethodId="QUOTE_HOOK_ENF_SEQ" customMethodTypeId="QUOTE_HOOK" customMethodName="quoteSequence-enforced" description="Enforced Sequence (no gaps, per organization)"/> <!-- order sequencing mode for accounting preferences --> <CustomMethodType customMethodTypeId="ORDER_HOOK" parentTypeId="HOOK" hasTable="N" description="Order Sequence methods"/> - <CustomMethod customMethodId="ORDER_HOOK_ENF_SEQ" customMethodTypeId="ORDER_HOOK" customMethodName="orderSequence-enforced" description="Enforced Sequence (no gaps, per organization)"/> + <CustomMethod customMethodId="ORDER_HOOK_ENF_SEQ" customMethodTypeId="ORDER_HOOK" customMethodName="orderSequence_enforced" description="Enforced Sequence (no gaps, per organization)"/> <!-- Deprecated sequencing mode by enumeration --> <EnumerationType description="Invoice Sequence Mode" enumTypeId="INVOICE_SEQMD" hasTable="N" parentTypeId=""/> <Enumeration description="Standard (faster, may have gaps, per system)" enumCode="STANDARD" enumId="INVSQ_STANDARD" sequenceId="01" enumTypeId="INVOICE_SEQMD"/> Modified: ofbiz/branches/webhelp-2012-12-07/applications/content/servicedef/services_website.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/content/servicedef/services_website.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/content/servicedef/services_website.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/content/servicedef/services_website.xml Sat Jan 5 13:40:19 2013 @@ -92,7 +92,7 @@ <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> - <service name="udpateWebSitePathAlias" default-entity-name="WebSitePathAlias" engine="simple" auth="true" + <service name="updateWebSitePathAlias" default-entity-name="WebSitePathAlias" engine="simple" auth="true" location="component://content/script/org/ofbiz/content/website/WebSiteServices.xml" invoke="updateWebSitePathAlias"> <description>Update a WebSite Path Alias</description> <permission-service service-name="contentManagerPermission" main-action="UPDATE"/> Modified: ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/CheckoutServices.xml Sat Jan 5 13:40:19 2013 @@ -105,7 +105,7 @@ under the License. <string value="SHIPPING_LOCATION"/> <field field="parameters.shipToContactMechId"/> </call-object-method> - <call-object-method obj-field="shoppingCart" method-name="setShippingContactMechId"> + <call-object-method obj-field="shoppingCart" method-name="setAllShippingContactMechId"> <field field="parameters.shipToContactMechId"/> </call-object-method> <call-object-method obj-field="shoppingCart" method-name="setOrderPartyId"> @@ -190,6 +190,7 @@ under the License. </create-object> <set field="callResult" value="${groovy:checkOutHelper.finalizeOrderEntryPayment(paymentMethodId, null, false, false)}"/> <set field="cartPaymentInfo" value="${groovy: org.ofbiz.order.shoppingcart.ShoppingCart.CartPaymentInfo cpi = shoppingCart.getPaymentInfo(paymentMethodId, null, null, null, true); cpi.securityCode = cardSecurityCode; return cpi;}"/> + <check-errors/> </simple-method> <simple-method method-name="setAnonUserLogin" short-description="Set user login in the session" login-required="false"> Modified: ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/OrderServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/OrderServices.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/order/script/org/ofbiz/order/order/OrderServices.xml Sat Jan 5 13:40:19 2013 @@ -492,7 +492,7 @@ under the License. <set field="customMethodName" from-field="customMethod.customMethodName"/> <else><!-- retreive service from deprecated enumeration --> <if-compare operator="equals" value="ODRSQ_ENF_SEQ" field="partyAcctgPreference.oldOrderSequenceEnumId"> - <set field="customMethodName" value="orderSequence-enforced"/> + <set field="customMethodName" value="orderSequence_enforced"/> </if-compare> </else> </if-not-empty> @@ -527,7 +527,7 @@ under the License. <field-to-result field="orderId" result-name="orderId"/> </simple-method> - <simple-method method-name="orderSequence-enforced" short-description="Enforced Sequence (no gaps, per organization)"> + <simple-method method-name="orderSequence_enforced" short-description="Enforced Sequence (no gaps, per organization)"> <log level="info" message="In getNextOrderId sequence enum Enforced"/> <set field="partyAcctgPreference" from-field="parameters.partyAcctgPreference"/> <!-- this is sequential sequencing, we can't skip a number, also it must be a unique sequence per partyIdFrom --> Modified: ofbiz/branches/webhelp-2012-12-07/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/order/servicedef/services.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/order/servicedef/services.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/order/servicedef/services.xml Sat Jan 5 13:40:19 2013 @@ -645,8 +645,8 @@ under the License. <attribute name="orderId" type="String" mode="OUT" optional="false"/> </service> - <service name="orderSequence-enforced" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="orderSequence-enforced"> + <service name="orderSequence_enforced" engine="simple" + location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="orderSequence_enforced"> <implements service="getNextOrderId"/> <attribute name="partyAcctgPreference" type="org.ofbiz.entity.GenericValue" mode="IN"/> <override name="orderId" type="Long" mode="OUT"/> Modified: ofbiz/branches/webhelp-2012-12-07/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Jan 5 13:40:19 2013 @@ -720,6 +720,7 @@ public class OrderServices { String workEffortId = delegator.getNextSeqId("WorkEffort"); // find next available workEffortId workEffort.set("workEffortId", workEffortId); workEffort.set("workEffortTypeId", "ASSET_USAGE"); + workEffort.set("currentStatusId", "_NA_"); // a lot of workefforts selection services expect a value here.... toBeStored.add(workEffort); // store workeffort before workOrderItemFulfillment because of workEffortId key constraint // workOrderItemFulfillment workOrderItemFulfillment.set("workEffortId", workEffortId); Modified: ofbiz/branches/webhelp-2012-12-07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy Sat Jan 5 13:40:19 2013 @@ -27,6 +27,7 @@ import org.ofbiz.entity.*; import org.ofbiz.product.catalog.*; import org.ofbiz.product.category.CategoryWorker; import org.ofbiz.product.category.CategoryContentWrapper; +import org.ofbiz.product.store.ProductStoreWorker; detailScreen = "categorydetail"; catalogName = CatalogWorker.getCatalogName(request); @@ -34,6 +35,8 @@ catalogName = CatalogWorker.getCatalogNa productCategoryId = request.getAttribute("productCategoryId") ?: parameters.category_id; context.productCategoryId = productCategoryId; +context.productStore = ProductStoreWorker.getProductStore(request); + pageTitle = null; metaDescription = null; metaKeywords = null; Modified: ofbiz/branches/webhelp-2012-12-07/applications/order/widget/ordermgr/LookupScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/order/widget/ordermgr/LookupScreens.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/order/widget/ordermgr/LookupScreens.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/order/widget/ordermgr/LookupScreens.xml Sat Jan 5 13:40:19 2013 @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file Modified: ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductEntityLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductEntityLabels.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductEntityLabels.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductEntityLabels.xml Sat Jan 5 13:40:19 2013 @@ -3686,7 +3686,17 @@ <value xml:lang="vi">Khi má»t sá» chia sẻ chi phà váºn chuyá»n ÄÆ°á»£c chi trả dưá»i má»t tà i khoản khác hÆ¡n so vá»i hóa ÄÆ¡n.</value> </property> <property key="FieldDescription.ProductStore.prorateTaxes"> - <value xml:lang="en"></value> + <value xml:lang="de">Steuern Anteilsmässig</value> + <value xml:lang="en">Prorate Taxes</value> + <value xml:lang="es">Prorratear impuestos</value> + <value xml:lang="fr">Taxes au prorata</value> + <value xml:lang="it">Dividi Proporzionalmente le Tasse</value> + <value xml:lang="ja">ç¨ãæå</value> + <value xml:lang="ru">ÐÑопоÑÑионалÑнÑе налоги</value> + <value xml:lang="th">à¹à¸à¹à¸à¸à¸²à¸¡à¸ªà¹à¸§à¸à¸ าษี</value> + <value xml:lang="vi">Thuế theo tá» lá»</value> + <value xml:lang="zh">ç¨æ¶æ¯ä¾</value> + <value xml:lang="zh_TW">ç¨ æ¶æ¯ä¾</value> </property> <property key="FieldDescription.ProductStore.viewCartOnAdd"> <value xml:lang="en">Controls whether the user is taken to the shopping cart immediately after adding a product to his cart.</value> @@ -3785,7 +3795,18 @@ <value xml:lang="vi">Nếu thiết láºp Y thì mục bất kỳ giá» mua hà ng vá»i sá» lượng lá»n hÆ¡n sẽ ÄÆ°á»£c chia thà nh các mục Äặt hà ng riêng biá»t vá»i sá» lượng cá»§a má»i 1 sản phẩm</value> </property> <property key="FieldDescription.ProductStore.checkGcBalance"> - <value xml:lang="en"></value> + <value xml:lang="de">Gutschein Guthaben prüfen</value> + <value xml:lang="en">Check Gc Balance</value> + <value xml:lang="es">Comprobar saldo de la tarjeta de regalo</value> + <value xml:lang="fr">Contrôle du crédit de carte cadeau</value> + <value xml:lang="it">Controlla Bilancio Gc</value> + <value xml:lang="ja">ã®ããã«ã¼ãæ®é«ã確èª</value> + <value xml:lang="ro">Control Bilant Gc GcFormFieldTitle_retryFailedAuths=Mai Incearca, Autorizari Falite</value> + <value xml:lang="ru">ÐÑовеÑиÑÑ Gc баланÑ</value> + <value xml:lang="th">Check Gc Balance</value> + <value xml:lang="vi">Kiá»m tra sá» dư</value> + <value xml:lang="zh">æ£æ¥æ»è´¦è´¦æ·ä½é¢</value> + <value xml:lang="zh_TW">檢æ¥ç¸½å¸³å¸³æ¶é¤é¡</value> </property> <property key="FieldDescription.ProductStore.retryFailedAuths"> <value xml:lang="en">How many times can an unsuccessful attempt to authorize an order be allowed?</value> Modified: ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductUiLabels.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductUiLabels.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/product/config/ProductUiLabels.xml Sat Jan 5 13:40:19 2013 @@ -21225,6 +21225,7 @@ </property> <property key="ProductNoteRequireEmailParty"> <value xml:lang="de">ANMERKUNG: Die "Benötigt E-Mail oder Akteur" Einstellung ist auf N (Nein) eingestellt, alle hier angegebenen E-Mail Adressen oder Akteure werden ignoriert. Um eine E-Mail Adresse oder Akteur von dieser Liste zu verwenden muss die Einstellung auf J (Ja) vorgenommen werden.</value> + <value xml:lang="en">NOTE: The Require Email Or Party flag is set to N (No), so any email addresses or parties listed here will be ignored. To require an email address or party from these lists, set the flag to Y (Yes).</value> <value xml:lang="es">NOTA: El flag "Requerir E-mail" está configurado como N (No). Cualquier dirección de e-mail o participantes listados aquà serán ignorados. Para usar alguna de estas direcciones, debe configurar el flag a Y(Si)</value> <value xml:lang="fr">NOTE: Pour rendre obligatoire et prendre en compte le champ acteur ou courriel, cocher (O), sinon mettre (N)</value> <value xml:lang="it">NOTA: L'email richiesta o se il flag soggetto è impostato a N (No), così qualsiasi indirizzo email o soggetti listati qui saranno ignorati. Per richiedere un'indirizzo email o il soggetto da queste liste, imposta il flag a Y (Si).</value> Modified: ofbiz/branches/webhelp-2012-12-07/applications/product/script/org/ofbiz/product/category/CategoryServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/product/script/org/ofbiz/product/category/CategoryServices.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/product/script/org/ofbiz/product/category/CategoryServices.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/product/script/org/ofbiz/product/category/CategoryServices.xml Sat Jan 5 13:40:19 2013 @@ -847,7 +847,7 @@ under the License. </simple-method> <!-- To help dynamically populate a products dropdown given a product category id from a change in another dropdown, possibly sorted on sequenceNum --> - <simple-method method-name="getAssociatedProductsList" short-description="Set the product options for selected product category, mostly used by getDependentDropdownValues.js" login-required="false"> + <simple-method method-name="getAssociatedProductsList" short-description="Set the product options for selected product category, mostly used by getDependentDropdownValues" login-required="false"> <set field="parameters.categoryId" from-field="parameters.productCategoryId"/> <set-service-fields service-name="getProductCategoryMembers" map="parameters" to-map="getProductCategoryMembersMap"/> <call-service service-name="getProductCategoryMembers" in-map-name="getProductCategoryMembersMap"> Modified: ofbiz/branches/webhelp-2012-12-07/applications/product/servicedef/services_view.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/product/servicedef/services_view.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/product/servicedef/services_view.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/product/servicedef/services_view.xml Sat Jan 5 13:40:19 2013 @@ -119,7 +119,7 @@ under the License. <service name="getAssociatedProductsList" engine="simple" auth="false" location="component://product/script/org/ofbiz/product/category/CategoryServices.xml" invoke="getAssociatedProductsList"> - <description>Set the product options for selected product category, mostly used by getDependentDropdownValues.js</description> + <description>Set the product options for selected product category, mostly used by getDependentDropdownValues</description> <attribute name="productCategoryId" mode="IN" type="String" optional="false"/> <attribute name="products" mode="OUT" type="java.util.List"/> </service> Modified: ofbiz/branches/webhelp-2012-12-07/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy (original) +++ ofbiz/branches/webhelp-2012-12-07/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Month.groovy Sat Jan 5 13:40:19 2013 @@ -58,7 +58,7 @@ if (followingMonthDays < 0) { } numDays += followingMonthDays; Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", "IN", parameters); -serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", getFrom, "numPeriods", numDays, "periodType", Calendar.DATE, "locale", locale, "timeZone", timeZone)); +serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", getFrom, "calendarType", "VOID", "numPeriods", numDays, "periodType", Calendar.DATE, "locale", locale, "timeZone", timeZone)); if (context.entityExprList) { serviceCtx.entityExprList = entityExprList; } Modified: ofbiz/branches/webhelp-2012-12-07/framework/base/src/org/ofbiz/base/util/Debug.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/base/src/org/ofbiz/base/util/Debug.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/base/src/org/ofbiz/base/util/Debug.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/base/src/org/ofbiz/base/util/Debug.java Sat Jan 5 13:40:19 2013 @@ -21,19 +21,22 @@ package org.ofbiz.base.util; import java.io.IOException; import java.io.PrintStream; import java.io.PrintWriter; -import java.text.DateFormat; import java.util.Enumeration; import java.util.Formatter; import java.util.HashMap; +import java.util.Locale; import java.util.Map; +import java.util.TimeZone; import org.apache.avalon.util.exception.ExceptionHelper; +import org.apache.log4j.Appender; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.apache.log4j.RollingFileAppender; -import org.apache.log4j.Appender; import org.apache.log4j.spi.LoggerRepository; +import org.ofbiz.base.conversion.ConversionException; +import org.ofbiz.base.conversion.DateTimeConverters.DateToString; /** * Configurable Debug logging wrapper class @@ -60,8 +63,6 @@ public final class Debug { public static final String[] levelProps = {"", "print.verbose", "print.timing", "print.info", "print.important", "print.warning", "print.error", "print.fatal", "print.notify"}; public static final Level[] levelObjs = {Level.INFO, Level.DEBUG, Level.INFO, Level.INFO, Level.INFO, Level.WARN, Level.ERROR, Level.FATAL, NotifyLevel.NOTIFY}; - private static final DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM); - protected static Map<String, Integer> levelStringMap = new HashMap<String, Integer>(); protected static PrintStream printStream = System.out; @@ -183,7 +184,13 @@ public final class Debug { } else { StringBuilder prefixBuf = new StringBuilder(); - prefixBuf.append(dateFormat.format(new java.util.Date())); + DateToString dateToString = new DateToString(); + try { + prefixBuf.append(dateToString.convert(new java.util.Date(), Locale.getDefault(), + TimeZone.getDefault(), UtilDateTime.DATE_TIME_FORMAT)); + } catch (ConversionException e) { + logFatal(e, Debug.class.getName()); + } prefixBuf.append(" [OFBiz"); if (module != null) { prefixBuf.append(":"); @@ -440,6 +447,12 @@ public final class Debug { levelOnCache[level] = on; } + public static boolean get(int level) { + if (!useLevelOnCache) + return true; + return levelOnCache[level]; + } + public static synchronized Appender getNewFileAppender(String name, String logFile, long maxSize, int backupIdx, String pattern) { if (pattern == null) { pattern = "%-5r[%24F:%-3L:%-5p]%x %m%n"; Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonEntityLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonEntityLabels.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonEntityLabels.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonEntityLabels.xml Sat Jan 5 13:40:19 2013 @@ -1313,7 +1313,7 @@ <property key="Enumeration.description.KW_THES_REL"> <value xml:lang="en">Lang: FR</value> <value xml:lang="es">Idioma: francés</value> - <value xml:lang="fr">Langue : Français</value> + <value xml:lang="fr">Langue : français</value> <value xml:lang="it">Lingua : Francese</value> <value xml:lang="ja">è¨èª: ãã©ã³ã¹èª</value> <value xml:lang="pt_BR">LÃngua: FR</value> @@ -5633,7 +5633,7 @@ <value xml:lang="de">Französisch Guayana</value> <value xml:lang="en">French Guiana</value> <value xml:lang="es">Guayana Francesa</value> - <value xml:lang="fr">Guyane Française</value> + <value xml:lang="fr">Guyane française</value> <value xml:lang="it">Guinea Francese</value> <value xml:lang="ja">ãã©ã³ã¹é ã®ã¢ã</value> <value xml:lang="pt">French Guiana</value> @@ -7046,7 +7046,7 @@ <value xml:lang="de">Französisch-Polynesien</value> <value xml:lang="en">French Polynesia</value> <value xml:lang="es">Polinesia Francesa</value> - <value xml:lang="fr">Polynésie Française</value> + <value xml:lang="fr">Polynésie française</value> <value xml:lang="it">Polinesia Francese</value> <value xml:lang="ja">ãã©ã³ã¹é ããªãã·ã¢</value> <value xml:lang="pt">French Polynesia</value> Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonUiLabels.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonUiLabels.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/config/CommonUiLabels.xml Sat Jan 5 13:40:19 2013 @@ -9152,6 +9152,10 @@ <value xml:lang="zh-CN">åºåç¼å·</value> <value xml:lang="zh-TW">åºèæ¸</value> </property> + <property key="CommonServerHour"> + <value xml:lang="en">Server Hour</value> + <value xml:lang="fr">Heure du serveur </value> + </property> <property key="CommonServiceReturnError"> <value xml:lang="en">Return Error Service : Returning Error</value> <value xml:lang="es">El servicio ha devuelto un error: Devolviendo error</value> Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/config/SecurityextUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/config/SecurityextUiLabels.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/config/SecurityextUiLabels.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/config/SecurityextUiLabels.xml Sat Jan 5 13:40:19 2013 @@ -752,6 +752,13 @@ <value xml:lang="en">Password Reminder (${userLoginId})".</value> <value xml:lang="fr">Rappel du mot de passe (${userLoginId})".</value> </property> + <property key="loginservices.password.pattern.errmsg"> + <value xml:lang="ar">ÙÙÙ Ø© Ø§ÙØ³Ø± ÙÙØ³Øª Ù Ø·Ø§Ø¨ÙØ© ÙÙÙÙ Ø·Ø ÙØ±Ø¬Ù Ø§ÙØ±Ø¬Ùع اÙÙÙ Ø· Ø§ÙØªØ§ÙÙ: ${passwordPatternMessage}</value> + <value xml:lang="en">The password does not match the pattern: ${passwordPatternMessage} </value> + <value xml:lang="fr">Le mot de passe ne correspond pas au modèle: ${passwordPatternMessage}.</value> + <value xml:lang="hi_IN">पासवरà¥à¤¡ पà¥à¤à¤°à¥à¤¨ मिलान नहà¥à¤ हà¥, à¤à¥à¤ªà¤¯à¤¾ निमà¥à¤¨à¤²à¤¿à¤à¤¿à¤¤ पà¥à¤à¤°à¥à¤¨ दà¥à¤à¥à¤: ${passwordPatternMessage}</value> + <value xml:lang="it">La password non è corrispondente al modello, fare riferimento seguente schema: ${passwordPatternMessage}.</value> + </property> <property key="loginservices.since_datetime"> <value xml:lang="de">(seit ${disabledDateTime})</value> <value xml:lang="en">since ${disabledDateTime}.</value> Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/data/GeoData_FR.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/data/GeoData_FR.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/data/GeoData_FR.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/data/GeoData_FR.xml Sat Jan 5 13:40:19 2013 @@ -124,7 +124,7 @@ under the License. <Geo abbreviation="SPM" geoCode="975" geoId="FR-975" geoName="St Pierre et Miquelon" geoTypeId="COUNTY"/> <Geo abbreviation="MAY" geoCode="976" geoId="FR-976" geoName="Mayotte" geoTypeId="COUNTY"/> <Geo abbreviation="WeF" geoCode="986" geoId="FR-986" geoName="Wallis et Futuna" geoTypeId="COUNTY"/> - <Geo abbreviation="POF" geoCode="987" geoId="FR-987" geoName="Polynésie Française" geoTypeId="COUNTY"/> + <Geo abbreviation="POF" geoCode="987" geoId="FR-987" geoName="Polynésie française" geoTypeId="COUNTY"/> <Geo abbreviation="NOC" geoCode="988" geoId="FR-988" geoName="Nouvelle Calédonie" geoTypeId="COUNTY"/> <Geo abbreviation="BEB" geoCode="BEB" geoId="FR-BEB01" geoName="Bourg-en-Bresse" geoTypeId="COUNTY_CITY"/> Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/entitydef/entitymodel.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/entitydef/entitymodel.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/entitydef/entitymodel.xml Sat Jan 5 13:40:19 2013 @@ -193,7 +193,7 @@ under the License. <field name="requirePostalCodeExt" type="indicator"></field> <field name="addressFormat" type="long-varchar"></field> <prim-key field="geoId"/> - <relation rel-entity-name="Geo" type="one"> + <relation type="one" rel-entity-name="Geo" fk-name="CNY_ADR_GEO"> <key-map field-name="geoId"/> </relation> <relation type="one" fk-name="CNY_ADR_GEO_TYPE" rel-entity-name="GeoAssocType" > Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/script/org/ofbiz/common/CommonServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/script/org/ofbiz/common/CommonServices.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/script/org/ofbiz/common/CommonServices.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/script/org/ofbiz/common/CommonServices.xml Sat Jan 5 13:40:19 2013 @@ -345,5 +345,15 @@ under the License. </else> </if-not-empty> <field-to-result field="exist"/> - </simple-method> + </simple-method> + + <simple-method method-name="getServerTimestampAsLong" login-required="false"> + <now field="serverTimestamp" type="java.lang.Long"/> + <field-to-result field="serverTimestamp"/> + </simple-method> + + <simple-method method-name="getServerTimestamp" login-required="false"> + <now field="serverTimestamp" type="java.sql.Timestamp"/> + <field-to-result field="serverTimestamp"/> + </simple-method> </simple-methods> Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/servicedef/services.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/servicedef/services.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/servicedef/services.xml Sat Jan 5 13:40:19 2013 @@ -780,7 +780,17 @@ under the License. <attribute name="geoAssocTypeId" mode="IN" type="String"/> <attribute name="geoList" mode="OUT" type="java.util.List"/> </service> - + + <service name="getServerTimestampAsLong" engine="simple" auth="false" + location="component://common/script/org/ofbiz/common/CommonServices.xml" invoke="getServerTimestampAsLong"> + <attribute name="serverTimestamp" mode="OUT" type="Long"/> + </service> + + <service name="getServerTimestamp" engine="simple" auth="false" + location="component://common/script/org/ofbiz/common/CommonServices.xml" invoke="getServerTimestamp"> + <attribute name="serverTimestamp" mode="OUT" type="TimeStamp"/> + </service> + <service name="createJsLanguageFileMapping" engine="java" auth="false" use-transaction="false" location="org.ofbiz.common.JsLanguageFileMappingCreator" invoke="createJsLanguageFileMapping"> <description>Create or update the JsLanguageFilesMapping.java. You still need to compile thereafter</description> Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/src/org/ofbiz/common/login/LoginServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/src/org/ofbiz/common/login/LoginServices.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/src/org/ofbiz/common/login/LoginServices.java Sat Jan 5 13:40:19 2013 @@ -23,6 +23,8 @@ import java.sql.Timestamp; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.transaction.Transaction; @@ -954,10 +956,29 @@ public class LoginServices { } if (newPassword != null) { - if (!(newPassword.length() >= minPasswordLength)) { - Map<String, String> messageMap = UtilMisc.toMap("minPasswordLength", Integer.toString(minPasswordLength)); - errMsg = UtilProperties.getMessage(resource,"loginservices.password_must_be_least_characters_long", messageMap, locale); - errorMessageList.add(errMsg); + // Matching password with pattern + String passwordPattern = UtilProperties.getPropertyValue("security.properties", "security.login.password.pattern", "^.*(?=.{5,}).*$"); + boolean usePasswordPattern = UtilProperties.getPropertyAsBoolean("security.properties", "security.login.password.pattern.enable", true); + if (usePasswordPattern) { + Pattern pattern = Pattern.compile(passwordPattern); + Matcher matcher = pattern.matcher(newPassword); + boolean matched = matcher.matches(); + if (!matched) { + // This is a mix to handle the OOTB pattern which is only a fixed length + Map<String, String> messageMap = UtilMisc.toMap("minPasswordLength", Integer.toString(minPasswordLength)); + String passwordPatternMessage = UtilProperties.getPropertyValue("security.properties", + "security.login.password.pattern.description", "loginservices.password_must_be_least_characters_long"); + errMsg = UtilProperties.getMessage(resource, passwordPatternMessage, messageMap, locale); + messageMap = UtilMisc.toMap("passwordPatternMessage", errMsg); + errMsg = UtilProperties.getMessage(resource,"loginservices.password.pattern.errmsg", messageMap, locale); + errorMessageList.add(errMsg); + } + } else { + if (!(newPassword.length() >= minPasswordLength)) { + Map<String, String> messageMap = UtilMisc.toMap("minPasswordLength", Integer.toString(minPasswordLength)); + errMsg = UtilProperties.getMessage(resource,"loginservices.password_must_be_least_characters_long", messageMap, locale); + errorMessageList.add(errMsg); + } } if (userLogin != null && newPassword.equalsIgnoreCase(userLogin.getString("userLoginId"))) { errMsg = UtilProperties.getMessage(resource,"loginservices.password_may_not_equal_username", locale); Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/webcommon/WEB-INF/common-controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/webcommon/WEB-INF/common-controller.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/webcommon/WEB-INF/common-controller.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/webcommon/WEB-INF/common-controller.xml Sat Jan 5 13:40:19 2013 @@ -253,6 +253,20 @@ under the License. <response name="error" type="request" value="json"/> </request-map> + <request-map uri="getServerTimestampAsLong"> + <security https="true" auth="true"/> + <event type="service" invoke="getServerTimestampAsLong"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> + </request-map> + + <request-map uri="getServerTimestamp"> + <security https="true" auth="true"/> + <event type="service" invoke="getServerTimestamp"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> + </request-map> + <!--========================== AJAX events =====================--> <!-- View Mappings --> Modified: ofbiz/branches/webhelp-2012-12-07/framework/common/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/common/widget/CommonScreens.xml?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/common/widget/CommonScreens.xml (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/common/widget/CommonScreens.xml Sat Jan 5 13:40:19 2013 @@ -154,9 +154,10 @@ under the License. <!-- jQuery CSSs --> <set field="layoutSettings.styleSheets[+0]" value="/images/jquery/plugins/asmselect/jquery.asmselect-1.0.4a-beta.css" global="true" /> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true" /> + <set field="layoutSettings.javaScripts[]" value="/images/date.format-1.2.3-min.js" global="true" /> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true" /> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true" /> - <set field="layoutSettings.javaScripts[]" value="/images/getDependentDropdownValues.js" global="true" /> + <set field="layoutSettings.javaScripts[]" value="/images/miscAjaxFunctions.js" global="true" /> <set field="layoutSettings.javaScripts[]" value="/images/selectMultipleRelatedValues.js" global="true" /> <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" global="true" /> <service service-name="getVisualThemeResources"> Modified: ofbiz/branches/webhelp-2012-12-07/framework/entity/dtd/entity-config.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/entity/dtd/entity-config.xsd?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/entity/dtd/entity-config.xsd (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/entity/dtd/entity-config.xsd Sat Jan 5 13:40:19 2013 @@ -399,6 +399,15 @@ under the License. </xs:restriction> </xs:simpleType> </xs:attribute> + <xs:attribute name="offset-style" default="none"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="none"/> + <xs:enumeration value="fetch"/> + <xs:enumeration value="limit"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> <xs:attribute type="xs:string" name="table-type"/> <xs:attribute type="xs:string" name="character-set"/> <xs:attribute type="xs:string" name="collate"/> Modified: ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java Sat Jan 5 13:40:19 2013 @@ -72,6 +72,7 @@ public class DatasourceInfo extends Name public boolean dropFkUseForeignKeyKeyword = false; public boolean useBinaryTypeForBlob = false; public boolean useOrderByNulls = false; + public String offsetStyle = null; public String tableType = null; public String characterSet = null; public String collate = null; @@ -158,7 +159,8 @@ public class DatasourceInfo extends Name this.dropFkUseForeignKeyKeyword = "true".equals(datasourceElement.getAttribute("drop-fk-use-foreign-key-keyword")); this.useBinaryTypeForBlob = "true".equals(datasourceElement.getAttribute("use-binary-type-for-blob")); this.useOrderByNulls = "true".equals(datasourceElement.getAttribute("use-order-by-nulls")); - + + this.offsetStyle = datasourceElement.getAttribute("offset-style"); this.tableType = datasourceElement.getAttribute("table-type"); this.characterSet = datasourceElement.getAttribute("character-set"); this.collate = datasourceElement.getAttribute("collate"); Modified: ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java Sat Jan 5 13:40:19 2013 @@ -763,6 +763,9 @@ public class GenericDAO { } sqlBuffer.append(SqlJdbcUtil.makeOrderByClause(modelEntity, orderByExpanded, datasourceInfo)); + // OFFSET clause + makeOffsetString(sqlBuffer, findOptions); + // make the final SQL String String sql = sqlBuffer.toString(); @@ -884,6 +887,29 @@ public class GenericDAO { return havingString; } + protected StringBuilder makeOffsetString(StringBuilder offsetString, EntityFindOptions findOptions) { + if (UtilValidate.isNotEmpty(datasourceInfo.offsetStyle)) { + if (datasourceInfo.offsetStyle.equals("limit")) { + // use the LIMIT/OFFSET style + if (findOptions.getLimit() > -1) { + offsetString.append(" LIMIT " + findOptions.getLimit()); + if (findOptions.getOffset() > -1) { + offsetString.append(" OFFSET " + findOptions.getOffset()); + } + } + } else if (datasourceInfo.offsetStyle.equals("fetch")) { + // use SQL2008 OFFSET/FETCH style by default + if (findOptions.getOffset() > -1) { + offsetString.append(" OFFSET ").append(findOptions.getOffset()).append(" ROWS"); + if (findOptions.getLimit() > -1) { + offsetString.append(" FETCH FIRST ").append(findOptions.getLimit()).append(" ROWS ONLY"); + } + } + } + } + return offsetString; + } + public List<GenericValue> selectByMultiRelation(GenericValue value, ModelRelation modelRelationOne, ModelEntity modelEntityOne, ModelRelation modelRelationTwo, ModelEntity modelEntityTwo, List<String> orderBy) throws GenericEntityException { SQLProcessor sqlP = new SQLProcessor(helperInfo); Modified: ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java Sat Jan 5 13:40:19 2013 @@ -27,6 +27,7 @@ import javolution.util.FastMap; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilGenerics; +import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; @@ -107,24 +108,23 @@ public class PrimaryKeyFinder extends Fi // try a map called "parameters", try it first so values from here are overridden by values in the main context Object parametersObj = context.get("parameters"); if (parametersObj != null && parametersObj instanceof Map<?, ?>) { - tempVal.setAllFields(UtilGenerics.checkMap(parametersObj), true, null, Boolean.TRUE); + Map<String, Object> parameters = UtilMisc.<String, Object>toMap(UtilGenerics.checkMap(parametersObj)); + // need the timeZone and locale for conversion, so add here and remove after + parameters.put("locale", context.get("locale")); + parameters.put("timeZone", context.get("timeZone")); + modelEntity.convertFieldMapInPlace(parameters, delegator); + parameters.remove("timeZone"); + parameters.remove("locale"); + tempVal.setAllFields(parameters, true, null, Boolean.TRUE); } // just get the primary keys, and hopefully will get all of them, if not they must be manually filled in below in the field-maps + modelEntity.convertFieldMapInPlace(context, delegator); tempVal.setAllFields(context, true, null, Boolean.TRUE); entityContext.putAll(tempVal); } EntityFinderUtil.expandFieldMapToContext(fieldMap, context, entityContext); - //Debug.logInfo("PrimaryKeyFinder: entityContext=" + entityContext, module); - // then convert the types... - - // need the timeZone and locale for conversion, so add here and remove after - entityContext.put("locale", context.get("locale")); - entityContext.put("timeZone", context.get("timeZone")); - modelEntity.convertFieldMapInPlace(entityContext, delegator); - entityContext.remove("locale"); - entityContext.remove("timeZone"); // get the list of fieldsToSelect from selectFieldExpanderList Set<String> fieldsToSelect = EntityFinderUtil.makeFieldsToSelect(selectFieldExpanderList, context); Modified: ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java Sat Jan 5 13:40:19 2013 @@ -694,6 +694,20 @@ public class ModelEntity extends ModelIn return nameList; } + /** + * @return field names list, managed by entity-engine + */ + public List<String> getAutomaticFieldNames() { + List<String> nameList = FastList.newInstance(); + if (! this.noAutoStamp) { + nameList.add(STAMP_FIELD); + nameList.add(STAMP_TX_FIELD); + nameList.add(CREATE_STAMP_FIELD); + nameList.add(CREATE_STAMP_TX_FIELD); + } + return nameList; + } + public int getRelationsSize() { return this.relations.size(); } Modified: ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Sat Jan 5 13:40:19 2013 @@ -604,4 +604,96 @@ public class EntityTestSuite extends Ent strBufTemp.append(iNum); return strBufTemp.toString(); } + + + /* + * This test will verify that the LIMIT and OFFSET options can work properly. + * Commented out because it makes the framework dependent on the content component + */ + /*public void testLimitOffsetOptions() throws Exception { + String entityName = "Content"; + DatasourceInfo datasourceInfo = EntityConfigUtil.getDatasourceInfo(delegator.getEntityHelper(entityName).getHelperName()); + if (UtilValidate.isEmpty(datasourceInfo.offsetStyle) || datasourceInfo.offsetStyle.equals("none")) { + Debug.logInfo("The offset-stype configured in datasource is " + datasourceInfo.offsetStyle + ", this test is skipped.", module); + return; + } else { + Debug.logInfo("The offset-stype configured in datasource is " + datasourceInfo.offsetStyle + ".", module); + } + try { + EntityFindOptions findOptions = new EntityFindOptions(); + long count = delegator.findCountByCondition("Content", null, null, null); + Debug.logInfo("Content entity has " + count + " rows", module); + int rowsPerPage = 10; + // use rows/page as limit option + findOptions.setLimit(rowsPerPage); + int pages = (int) count/rowsPerPage; + if (count > pages * rowsPerPage) { + pages += 1; + } + Debug.logInfo("These rows will be displayed in " + pages + " pages, each page has " + rowsPerPage + " rows.", module); + ModelEntity modelEntity = delegator.getModelEntity(entityName); + + long start = UtilDateTime.nowTimestamp().getTime(); + for (int page = 1; page <= pages; page++) { + Debug.logInfo("Page " + page + ":", module); + // set offset option + findOptions.setOffset((page - 1) * rowsPerPage); + EntityListIterator iterator = null; + try { + iterator = delegator.getEntityHelper(entityName).findListIteratorByCondition(modelEntity, null, null, null, UtilMisc.toList("lastUpdatedStamp DESC"), findOptions); + while (iterator != null) { + GenericValue gv = iterator.next(); + if (gv == null) { + break; + } + Debug.logInfo(gv.getString("contentId") + ": " + gv.getString("contentName") + " (updated: " + gv.getTimestamp("lastUpdatedStamp") + ")", module); + } + } catch (GenericEntityException e) { + Debug.logError(e, module); + } finally { + if (iterator != null) { + iterator.close(); + } + } + } + long end = UtilDateTime.nowTimestamp().getTime(); + long time1 = end - start; + Debug.logInfo("Time consumed WITH limit and offset option (ms): " + time1, module); + + start = UtilDateTime.nowTimestamp().getTime(); + for (int page = 1; page <= pages; page++) { + Debug.logInfo("Page " + page + ":", module); + EntityListIterator iterator = null; + try { + iterator = ((GenericHelperDAO) delegator.getEntityHelper(entityName)).findListIteratorByCondition(modelEntity, null, null, null, UtilMisc.toList("lastUpdatedStamp DESC"), null); + if (iterator == null) { + continue; + } + iterator.setDelegator(delegator); + List<GenericValue> gvs = iterator.getCompleteList(); + int fromIndex = (page - 1) * rowsPerPage; + int toIndex = fromIndex + rowsPerPage; + if (toIndex > count) { + toIndex = (int) count; + } + gvs = gvs.subList(fromIndex, toIndex); + for (GenericValue gv : gvs) { + Debug.logInfo(gv.getString("contentId") + ": " + gv.getString("contentName") + " (updated: " + gv.getTimestamp("lastUpdatedStamp") + ")", module); + } + } catch (GenericEntityException e) { + Debug.logError(e, module); + } finally { + if (iterator != null) { + iterator.close(); + } + } + } + end = UtilDateTime.nowTimestamp().getTime(); + long time2 = end - start; + Debug.logInfo("Time consumed WITHOUT limit and offset option (ms): " + time2, module); + Debug.logInfo("Time saved (ms): " + (time2 - time1), module); + } catch (GenericEntityException e) { + Debug.logError(e, module); + } + }*/ } Modified: ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntityFindOptions.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntityFindOptions.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntityFindOptions.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntityFindOptions.java Sat Jan 5 13:40:19 2013 @@ -48,6 +48,12 @@ public class EntityFindOptions implement protected int maxRows = -1; protected boolean distinct = false; + /** LIMIT option */ + protected int limit = -1; + + /** OFFSET option */ + protected int offset = -1; + /** Default constructor. Defaults are as follows: * specifyTypeAndConcur = true * resultSetType = TYPE_FORWARD_ONLY @@ -145,4 +151,25 @@ public class EntityFindOptions implement public void setDistinct(boolean distinct) { this.distinct = distinct; } + + + /** Get the LIMIT number. */ + public int getLimit() { + return limit; + } + + /** Specifies the LIMIT number. */ + public void setLimit(int limit) { + this.limit = limit; + } + + /** Get the OFFSET number. */ + public int getOffset() { + return offset; + } + + /** Specifies the OFFSET number. */ + public void setOffset(int offset) { + this.offset = offset; + } } Modified: ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java?rev=1429284&r1=1429283&r2=1429284&view=diff ============================================================================== --- ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java (original) +++ ofbiz/branches/webhelp-2012-12-07/framework/entity/src/org/ofbiz/entity/util/EntitySaxReader.java Sat Jan 5 13:40:19 2013 @@ -40,12 +40,15 @@ import javolution.xml.sax.XMLReaderImpl; import org.ofbiz.base.location.FlexibleLocation; import org.ofbiz.base.util.Base64; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.template.FreeMarkerWorker; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; +import org.ofbiz.entity.GenericEntityNotFoundException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.datasource.GenericHelper; import org.ofbiz.entity.eca.EntityEcaHandler; import org.ofbiz.entity.model.ModelEntity; import org.ofbiz.entity.model.ModelField; @@ -78,6 +81,11 @@ public class EntitySaxReader implements protected CharSequence currentFieldName = null; protected CharSequence currentFieldValue = null; protected long numberRead = 0; + protected long numberCreated = 0; + protected long numberUpdated = 0; + protected long numberReplaced = 0; + protected long numberDeleted = 0; + protected long numberSkipped = 0; protected int valuesPerWrite = 100; protected int valuesPerMessage = 1000; @@ -88,9 +96,13 @@ public class EntitySaxReader implements protected boolean checkDataOnly = false; protected boolean doCacheClear = true; protected boolean disableEeca = false; + protected enum Action {CREATE, CREATE_UPDATE, CREATE_REPLACE, DELETE}; + protected List<String> actionTags = UtilMisc.toList("create", "create-update", "create-replace", "delete"); + protected Action currentAction = Action.CREATE_UPDATE; protected List<Object> messageList = null; protected List<GenericValue> valuesToWrite = new ArrayList<GenericValue>(valuesPerWrite); + protected List<GenericValue> valuesToDelete = new ArrayList<GenericValue>(valuesPerWrite); protected boolean isParseForTemplate = false; protected CharSequence templatePath = null; @@ -202,6 +214,14 @@ public class EntitySaxReader implements } } + public void setAction(Action action) { + this.currentAction = action; + } + + public Action getAction() { + return this.currentAction; + } + public long parse(String content) throws SAXException, java.io.IOException { if (content == null) { Debug.logWarning("content was null, doing nothing", module); @@ -272,10 +292,14 @@ public class EntitySaxReader implements try { parser.parse(is); // make sure all of the values to write got written... - if (valuesToWrite.size() > 0) { + if (! valuesToWrite.isEmpty()) { writeValues(valuesToWrite); valuesToWrite.clear(); } + if (! valuesToDelete.isEmpty()) { + delegator.removeAll(valuesToDelete); + valuesToDelete.clear(); + } TransactionUtil.commit(beganTransaction); } catch (Exception e) { String errMsg = "An error occurred saving the data, rolling back transaction (" + beganTransaction + ")"; @@ -287,6 +311,11 @@ public class EntitySaxReader implements throw new SAXException("A transaction error occurred reading data", e); } Debug.logImportant("Finished " + numberRead + " values from " + docDescription, module); + if (Debug.verboseOn()) { + Debug.logVerbose(" Detail created : " + numberCreated + ", skipped : " + numberSkipped + + ", updated : " + numberUpdated + ", replaced : " + numberReplaced + + ", deleted : " + numberDeleted, module); + } return numberRead; } @@ -384,6 +413,12 @@ public class EntitySaxReader implements return; } + //Test if end action tag, set action to default + if (actionTags.contains(fullNameString)) { + setAction(Action.CREATE_UPDATE); + return; + } + if (currentValue != null) { if (currentFieldName != null) { if (UtilValidate.isNotEmpty(currentFieldValue)) { @@ -419,22 +454,58 @@ public class EntitySaxReader implements } try { - if (this.useTryInsertMethod && !this.checkDataOnly) { - // this technique is faster for data sets where most, if not all, values do not already exist in the database - try { - currentValue.create(); - } catch (GenericEntityException e1) { - // create failed, try a store, if that fails too we have a real error and the catch outside of this should handle it - currentValue.store(); + boolean exist = true; + boolean skip = false; + //if verbose on, check if entity exist on database for count each action + //It's necessay to check also for specific action CREATE and DELETE to ensure it's ok + if (Action.CREATE == currentAction || Action.DELETE == currentAction || Debug.verboseOn()) { + GenericHelper helper = delegator.getEntityHelper(currentValue.getEntityName()); + if (currentValue.containsPrimaryKey()) { + try { + helper.findByPrimaryKey(currentValue.getPrimaryKey()); + } catch (GenericEntityNotFoundException e) {exist = false;} } - } else { - valuesToWrite.add(currentValue); - if (valuesToWrite.size() >= valuesPerWrite) { - writeValues(valuesToWrite); - valuesToWrite.clear(); + if (Action.CREATE == currentAction && exist) { skip = true; } + else if (Action.DELETE == currentAction && ! exist) { skip = true; } + } + if (! skip) { + if (this.useTryInsertMethod && !this.checkDataOnly) { + if (Action.CREATE == currentAction) { currentValue.create(); } + else if (Action.DELETE == currentAction) { + try { + currentValue.remove(); + } catch (GenericEntityException e1) { + String errMsg = "Error deleting value"; + Debug.logError(e1, errMsg, module); + throw new SAXException(errMsg, e1); + } + } else { + // this technique is faster for data sets where most, if not all, values do not already exist in the database + try { + currentValue.create(); + } catch (GenericEntityException e1) { + // create failed, try a store, if that fails too we have a real error and the catch outside of this should handle it + currentValue.store(); + } + } + } else { + if (Action.DELETE == currentAction) { + valuesToDelete.add(currentValue); + if (valuesToDelete.size() >= valuesPerWrite) { + delegator.removeAll(valuesToDelete, doCacheClear); + valuesToDelete.clear(); + } + } else { + valuesToWrite.add(currentValue); + if (valuesToWrite.size() >= valuesPerWrite) { + writeValues(valuesToWrite); + valuesToWrite.clear(); + } + } } } numberRead++; + if (Debug.verboseOn()) countValue(skip, exist); if ((numberRead % valuesPerMessage) == 0) { Debug.logImportant("Another " + valuesPerMessage + " values imported: now up to " + numberRead, module); } @@ -448,6 +519,15 @@ public class EntitySaxReader implements } } + //Use for detail the loading entities + protected void countValue(boolean skip, boolean exist) { + if (skip) numberSkipped++; + else if (Action.DELETE == currentAction) numberDeleted++; + else if (Action.CREATE == currentAction || ! exist) numberCreated++; + else if (Action.CREATE_REPLACE == currentAction) numberReplaced++; + else numberUpdated++; + } + public void endPrefixMapping(CharArray prefix) throws org.xml.sax.SAXException {} public void ignorableWhitespace(char[] values, int offset, int count) throws org.xml.sax.SAXException { @@ -526,6 +606,15 @@ public class EntitySaxReader implements return; } + //Test if action change + if (actionTags.contains(fullNameString)) { + if ("create".equals(fullNameString)) setAction(Action.CREATE); + if ("create-update".equals(fullNameString)) setAction(Action.CREATE_UPDATE); + if ("create-replace".equals(fullNameString)) setAction(Action.CREATE_REPLACE); + if ("delete".equals(fullNameString)) setAction(Action.DELETE); + return; + } + if (currentValue != null) { // we have a nested value/CDATA element currentFieldName = fullName; @@ -554,6 +643,13 @@ public class EntitySaxReader implements if (currentValue != null) { int length = attributes.getLength(); + List<String> absentFields = null; + if (Action.CREATE_REPLACE == currentAction) { + //get all non pk fields + ModelEntity currentEntity = currentValue.getModelEntity(); + absentFields = currentEntity.getNoPkFieldNames(); + absentFields.removeAll(currentEntity.getAutomaticFieldNames()); + } for (int i = 0; i < length; i++) { CharSequence name = attributes.getLocalName(i); @@ -567,6 +663,7 @@ public class EntitySaxReader implements if (UtilValidate.isNotEmpty(value)) { if (currentValue.getModelEntity().isField(name.toString())) { currentValue.setString(name.toString(), value.toString()); + if (Action.CREATE_REPLACE == currentAction && absentFields != null) absentFields.remove(name); } else { Debug.logWarning("Ignoring invalid field name [" + name + "] found for the entity: " + currentValue.getEntityName() + " with value=" + value, module); } @@ -575,6 +672,11 @@ public class EntitySaxReader implements Debug.logWarning(e, "Could not set field " + entityName + "." + name + " to the value " + value, module); } } + if (Action.CREATE_REPLACE == currentAction && absentFields != null) { + for (String fieldName : absentFields) { + currentValue.set(fieldName, null); + } + } } } } |
| Free forum by Nabble | Edit this page |
