You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by er...@apache.org on 2012/10/25 07:04:29 UTC

svn commit: r1401975 [4/29] - in /ofbiz/branches/20120329_portletWidget: ./ applications/accounting/config/ applications/accounting/data/ applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/script/org/ofbiz/accounting/t...

Modified: ofbiz/branches/20120329_portletWidget/applications/accounting/data/AccountingTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/accounting/data/AccountingTypeData.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/accounting/data/AccountingTypeData.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/accounting/data/AccountingTypeData.xml Thu Oct 25 05:04:09 2012
@@ -728,11 +728,13 @@ under the License.
     <CustomMethodType customMethodTypeId="FIN_CAPTURE" parentTypeId="" hasTable="N" description="FIN account capture methods"/>
     <CustomMethodType customMethodTypeId="FIN_REFUND" parentTypeId="" hasTable="N" description="FIN account refund methods"/>
     <CustomMethodType customMethodTypeId="FIN_RELEASE" parentTypeId="" hasTable="N" description="FIN account release methods"/>
+    <CustomMethodType customMethodTypeId="FIN_PURCHASE" parentTypeId="" hasTable="N" description="FIN account purchase methods"/>
 
     <CustomMethodType customMethodTypeId="GIFT_AUTH" parentTypeId="" hasTable="N" description="GIFT card authorize methods"/>
     <CustomMethodType customMethodTypeId="GIFT_CAPTURE" parentTypeId="" hasTable="N" description="GIFT card capture methods"/>
     <CustomMethodType customMethodTypeId="GIFT_REFUND" parentTypeId="" hasTable="N" description="GIFT card refund methods"/>
     <CustomMethodType customMethodTypeId="GIFT_RELEASE" parentTypeId="" hasTable="N" description="GIFT card release methods"/>
+    <CustomMethodType customMethodTypeId="GIFT_PURCHASE" parentTypeId="" hasTable="N" description="GIFT card purchase methods"/>
 
     <CustomMethodType customMethodTypeId="PAYPAL_AUTH" parentTypeId="" hasTable="N" description="PayPal authorize methods"/>
     <CustomMethodType customMethodTypeId="PAYPAL_CAPTURE" parentTypeId="" hasTable="N" description="PayPal capture methods"/>
@@ -809,6 +811,7 @@ under the License.
     <CustomMethod customMethodId="FIN_CAPTURE_OFBIZ" customMethodTypeId="FIN_CAPTURE" customMethodName="ofbFaCapture" description="FIN account capture"/>
     <CustomMethod customMethodId="FIN_REFUND_OFBIZ" customMethodTypeId="FIN_REFUND" customMethodName="ofbFaRefund" description="FIN account refund"/>
     <CustomMethod customMethodId="FIN_RELEASE_OFBIZ" customMethodTypeId="FIN_RELEASE" customMethodName="ofbFaRelease" description="FIN account release"/>
+    <CustomMethod customMethodId="FIN_PURCH_OFBIZ" customMethodTypeId="FIN_PURCHASE" customMethodName="createPartyFinAccountFromPurchase" description="FIN account purchase"/>
 
     <CustomMethod customMethodId="GIFT_AUTH_OFBIZ" customMethodTypeId="GIFT_AUTH" customMethodName="ofbGcAuthorize" description="GIFT card authorize"/>
     <CustomMethod customMethodId="GIFT_AUTH_ALWAYSAPPR" customMethodTypeId="GIFT_AUTH" customMethodName="alwaysApproveGCProcessor" description="GIFT card always authorize"/>
@@ -820,6 +823,7 @@ under the License.
     <CustomMethod customMethodId="GIFT_RELEASE_OFBIZ" customMethodTypeId="GIFT_RELEASE" customMethodName="ofbGcRelease" description="GIFT card release"/>
     <CustomMethod customMethodId="GIFT_RELEASE_TEST" customMethodTypeId="GIFT_RELEASE" customMethodName="testGCRelease" description="GIFT card test release"/>
     <CustomMethod customMethodId="GIFT_RELEASE_VALUEL" customMethodTypeId="GIFT_RELEASE" customMethodName="valueLinkRelease" description="GIFT card ValueLink release"/>
+    <CustomMethod customMethodId="GIFT_PURCH_OFBIZ" customMethodTypeId="GIFT_PURCHASE" customMethodName="ofbGcPurchase" description="GIFT card Purchase Fulfillment Service"/>
 
     <CustomMethod customMethodId="PAYPAL_AUTH_PFP" customMethodTypeId="PAYPAL_AUTH" customMethodName="payflowPayPalProcessor" description="Payflow PayPal payment authorize"/>
     <CustomMethod customMethodId="PAYPAL_AUTH" customMethodTypeId="PAYPAL_AUTH" customMethodName="payPalProcessor" description="PayPal payment authorize"/>
@@ -947,8 +951,8 @@ under the License.
     <!-- inventory sequencing mode for accounting preferences -->
     <CustomMethodType customMethodTypeId="HOOK" parentTypeId="HOOK" hasTable="N" description="Custom Methode Type define HOOK method to resolve specific sequence"/>
     <CustomMethodType customMethodTypeId="INVOICE_HOOK" parentTypeId="HOOK" hasTable="N" description="Invoice Sequence methods"/>
-    <CustomMethod customMethodId="INV_HOOK_ENF_SEQ" customMethodTypeId="INVOICE_HOOK" customMethodName="invoiceSequence-enforced" description="Enforced Sequence (no gaps, per organization)"/>
-    <CustomMethod customMethodId="INV_HOOK_RES_YR" customMethodTypeId="INVOICE_HOOK" customMethodName="invoiceSequence-restart" description="Restart on Fiscal Year (no gaps, per org, reset to 1 each year)"/>
+    <CustomMethod customMethodId="INV_HOOK_ENF_SEQ" customMethodTypeId="INVOICE_HOOK" customMethodName="invoiceSequenceEnforced" description="Enforced Sequence (no gaps, per organization)"/>
+    <CustomMethod customMethodId="INV_HOOK_RES_YR" customMethodTypeId="INVOICE_HOOK" customMethodName="invoiceSequenceRestart" description="Restart on Fiscal Year (no gaps, per org, reset to 1 each year)"/>
     <!-- quote sequencing mode for accounting preferences -->
     <CustomMethodType customMethodTypeId="QUOTE_HOOK" parentTypeId="HOOK" hasTable="N" description="Quote Sequence methods"/>
     <CustomMethod customMethodId="QUOTE_HOOK_ENF_SEQ" customMethodTypeId="QUOTE_HOOK" customMethodName="quoteSequence-enforced" description="Enforced Sequence (no gaps, per organization)"/>

Modified: ofbiz/branches/20120329_portletWidget/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml Thu Oct 25 05:04:09 2012
@@ -40,10 +40,10 @@ under the License.
             <set field="customMethodName" from-field="customMethod.customMethodName"/>
             <else><!-- retreive service from deprecated enumeration -->
                 <if-compare operator="equals" value="INVSQ_ENF_SEQ" field="partyAcctgPreference.oldInvoiceSequenceEnumId">
-                    <set field="customMethodName" value="invoiceSequence-enforced"/>
+                    <set field="customMethodName" value="invoiceSequenceEnforced"/>
                 </if-compare>
                 <if-compare operator="equals" value="INVSQ_RESTARTYR" field="partyAcctgPreference.oldInvoiceSequenceEnumId">
-                    <set field="customMethodName" value="invoiceSequence-restart"/>
+                    <set field="customMethodName" value="invoiceSequenceRestart"/>
                 </if-compare>
             </else>
         </if-not-empty>        
@@ -74,7 +74,7 @@ under the License.
         <field-to-result field="invoiceId" result-name="invoiceId"/>
     </simple-method>
 
-    <simple-method method-name="invoiceSequence-enforced" short-description="Enforced Sequence (no gaps, per organization)">
+    <simple-method method-name="invoiceSequenceEnforced" short-description="Enforced Sequence (no gaps, per organization)">
         <log level="info" message="In createInvoice 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 -->
@@ -93,7 +93,7 @@ under the License.
         <field-to-result field="invoiceId" result-name="invoiceId"/>
    </simple-method>
 
-    <simple-method method-name="invoiceSequence-restart" short-description="Restart on Fiscal Year (no gaps, per org, reset to 1 each year)">
+    <simple-method method-name="invoiceSequenceRestart" short-description="Restart on Fiscal Year (no gaps, per org, reset to 1 each year)">
         <log level="info" message="In createInvoice sequence enum Restart"/>
         <set field="partyAcctgPreference" from-field="parameters.partyAcctgPreference"/>
         <!-- this is sequential sequencing, we can't skip a number; except that it is restarted each fiscal year -->

Modified: ofbiz/branches/20120329_portletWidget/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml Thu Oct 25 05:04:09 2012
@@ -501,7 +501,7 @@ under the License.
         <log level="info" message="AFTER RUNNING VOID PAYMENT : GENERAL CHECKING ACCOUNT ;debitTotal :${undepositedDebitTotal} ; creditTotal:${undepositedCreditTotal} ; debitCreditDifference : ${undepositedDebitCreditDifference}"/>
     </simple-method>
 
-    <simple-method method-name="disabled-testUpdatePaymentMethodAddress" short-description="Creates a new postal address for Company and then calls updatePaymentMethodAddress with the new contactMechId" login-required="false">
+    <simple-method method-name="disabledTestUpdatePaymentMethodAddress" short-description="Creates a new postal address for Company and then calls updatePaymentMethodAddress with the new contactMechId" login-required="false">
         <entity-one entity-name="UserLogin" value-field="userLogin">
             <field-map field-name="userLoginId" value="flexadmin"/>
         </entity-one>

Modified: ofbiz/branches/20120329_portletWidget/applications/accounting/servicedef/services_invoice.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/accounting/servicedef/services_invoice.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/accounting/servicedef/services_invoice.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/accounting/servicedef/services_invoice.xml Thu Oct 25 05:04:09 2012
@@ -33,15 +33,15 @@ under the License.
         <attribute name="invoiceId" type="String" mode="OUT" optional="false"/>
     </service>
 
-    <service name="invoiceSequence-enforced" engine="simple"
-        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="invoiceSequence-enforced">
+    <service name="invoiceSequenceEnforced" engine="simple"
+        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="invoiceSequenceEnforced">
         <implements service="getNextInvoiceId"/>
         <attribute name="partyAcctgPreference" type="org.ofbiz.entity.GenericValue" mode="IN"/>
         <override name="invoiceId" type="Long" mode="OUT"/>
     </service>
 
-    <service name="invoiceSequence-restart" engine="simple"
-        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="invoiceSequence-restart">
+    <service name="invoiceSequenceRestart" engine="simple"
+        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="invoiceSequenceRestart">
         <implements service="getNextInvoiceId"/>
         <attribute name="partyAcctgPreference" type="org.ofbiz.entity.GenericValue" mode="IN"/>
     </service>

Modified: ofbiz/branches/20120329_portletWidget/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Thu Oct 25 05:04:09 2012
@@ -588,8 +588,8 @@ public class PaymentGatewayServices {
                 }
             }
         } catch (GenericServiceException e) {
-            Debug.logError(e, "Error occurred on: " + serviceName + " => " + processContext, module);
-            throw new GeneralException("Problems invoking payment processor! Will retry later. Order ID is: [" + orh.getOrderId() + "", e);
+            Debug.logError(e, "Error occurred on: " + serviceName + ", Order ID is: [" + orh.getOrderId() + "]", module);
+            throw new GeneralException("Problems invoking payment processor! Will retry later. Order ID is: [" + orh.getOrderId() + "]", e);
         }
 
         if (processorResult != null) {

Modified: ofbiz/branches/20120329_portletWidget/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl (original)
+++ ofbiz/branches/20120329_portletWidget/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl Thu Oct 25 05:04:09 2012
@@ -128,7 +128,7 @@ function runAction() {
     <span class="label">${uiLabelMap.AccountingRunningTotalOutstanding} :</span>
     <span class="label" id="showInvoiceRunningTotal"></span>
   </div>
-  <form name="listPurchaseInvoices" id="listPurchaseInvoices"  method="post" action="javascript:void();">
+  <form name="listPurchaseInvoices" id="listPurchaseInvoices"  method="post" action="javascript:void(0);">
     <div align="right">
       <!-- May add some more options in future like cancel selected invoices-->
       <select name="serviceName" id="serviceName" onchange="javascript:setServiceName(this);">

Modified: ofbiz/branches/20120329_portletWidget/applications/accounting/widget/AgreementForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/accounting/widget/AgreementForms.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/accounting/widget/AgreementForms.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/accounting/widget/AgreementForms.xml Thu Oct 25 05:04:09 2012
@@ -205,7 +205,7 @@ under the License.
             </hyperlink>
         </field>
     </form>
-    <form name="ListAgreementTerms" target="updateAgreementTerm" list-name="agreementTerms" paginate-target="ListAgreementTerms" title="" type="list"
+    <form name="ListAgreementTerms" target="updateAgreementTerm" list-name="agreementTerms" paginate-target="EditAgreementTerms" title="" type="list"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <actions>
             <entity-and entity-name="AgreementTerm" list="agreementTerms">
@@ -594,7 +594,7 @@ under the License.
             </hyperlink>
         </field>
     </form>
-    <form name="ListAgreementRoles" list-name="agreementRoles" type="list" paginate-target="FindAgreementRoles"
+    <form name="ListAgreementRoles" list-name="agreementRoles" type="list" paginate-target="EditAgreementRoles"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <actions>
             <entity-and entity-name="AgreementRole" use-cache="true" list="agreementRoles">

Modified: ofbiz/branches/20120329_portletWidget/applications/commonext/data/EntityDiagramGroupData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/commonext/data/EntityDiagramGroupData.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/commonext/data/EntityDiagramGroupData.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/commonext/data/EntityDiagramGroupData.xml Thu Oct 25 05:04:09 2012
@@ -259,8 +259,6 @@ under the License.
     <EntityGroupEntry entityGroupId="6920" entityOrPackage="org.ofbiz.content.website" applEnumId="ESIA_INCLUDE"/>
     <EntityGroup entityGroupId="6930" entityGroupName="Technical: Login and Security"/>
     <EntityGroupEntry entityGroupId="6930" entityOrPackage="org.ofbiz.security" applEnumId="ESIA_INCLUDE"/>
-    <EntityGroup entityGroupId="6940" entityGroupName="Technical: Workflow"/>
-    <EntityGroupEntry entityGroupId="6940" entityOrPackage="org.ofbiz.workflow" applEnumId="ESIA_INCLUDE"/>
     <EntityGroup entityGroupId="6990" entityGroupName="Technical: POS, OAGIS, Other"/>
     <EntityGroupEntry entityGroupId="6990" entityOrPackage="org.ofbiz.pos.terminal" applEnumId="ESIA_INCLUDE"/>
     <EntityGroupEntry entityGroupId="6990" entityOrPackage="org.ofbiz.specialpurpose.oagis" applEnumId="ESIA_INCLUDE"/>

Modified: ofbiz/branches/20120329_portletWidget/applications/content/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/entitydef/entitymodel.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/entitydef/entitymodel.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/entitydef/entitymodel.xml Thu Oct 25 05:04:09 2012
@@ -159,7 +159,10 @@ under the License.
       <field name="dataSourceId" type="id"></field>
       <field name="statusId" type="id"></field>
       <field name="privilegeEnumId" type="id"></field>
-      <field name="serviceName" type="long-varchar"></field>
+      <field name="serviceName" type="long-varchar">
+          <description>Deprecated : use customMethod pattern instead of. Kept for backward compatibility</description>
+      </field>
+      <field name="customMethodId" type="id"></field>
       <field name="contentName" type="name"></field>
       <field name="description" type="description"></field>
       <field name="localeString" type="very-short"></field>
@@ -187,6 +190,9 @@ under the License.
       <relation type="one" fk-name="CONTENT_PRIVENM" title="Privilege" rel-entity-name="Enumeration">
         <key-map field-name="privilegeEnumId" rel-field-name="enumId"/>
       </relation>
+      <relation type="one" fk-name="CONTENT_CUSTMET" rel-entity-name="CustomMethod">
+        <key-map field-name="customMethodId"/>
+      </relation>
       <!-- the relationship to MimeType is one-nofk so that you can still do a lookup on MimeType but a new
       and unexpected mime type would not cause a foreign key constraint violation, so MimeType can store the
       most common mime types instead of an exhaustive list of all possible mime types -->

Modified: ofbiz/branches/20120329_portletWidget/applications/content/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/ofbiz-component.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/ofbiz-component.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/ofbiz-component.xml Thu Oct 25 05:04:09 2012
@@ -72,4 +72,13 @@ under the License.
         location="webapp/content"
         base-permission="CONTENTMGR"
         mount-point="/content"/>
+
+    <!-- 
+    <webapp name="ofbizhelp"
+        title="OFBiz Help"
+        server="default-server"
+        location="webapp/ofbizhelp"
+        base-permission="OFBTOOLS"
+        mount-point="/ofbizhelp"/>
+     -->
 </ofbiz-component>

Modified: ofbiz/branches/20120329_portletWidget/applications/content/script/org/ofbiz/content/ContentManagementMapProcessors.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/script/org/ofbiz/content/ContentManagementMapProcessors.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/script/org/ofbiz/content/ContentManagementMapProcessors.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/script/org/ofbiz/content/ContentManagementMapProcessors.xml Thu Oct 25 05:04:09 2012
@@ -27,6 +27,7 @@ under the License.
       <process field="dataResourceId"><copy to-field="dataResourceId" replace="true" set-if-null="false"/></process>
       <process field="dataSourceId"><copy to-field="dataSourceId" replace="true" set-if-null="false"/></process>
       <process field="statusId"><copy to-field="statusId" replace="true" set-if-null="false"/></process>
+      <process field="customMethodId"><copy to-field="customMethodId" replace="true" set-if-null="false"/></process>
       <process field="serviceName"><copy to-field="serviceName" replace="true" set-if-null="false"/></process>
       <process field="contentName"><copy to-field="contentName" replace="true" set-if-null="false"/></process>
       <process field="description"><copy to-field="description" replace="true" set-if-null="false"/></process>
@@ -112,6 +113,7 @@ under the License.
       <process field="dataResourceId"><copy to-field="dataResourceId" replace="true" set-if-null="false"/></process>
       <process field="dataSourceId"><copy to-field="dataSourceId" replace="true" set-if-null="false"/></process>
       <process field="statusId"><copy to-field="statusId" replace="true" set-if-null="false"/></process>
+      <process field="customMethodId"><copy to-field="customMethodId" replace="true" set-if-null="false"/></process>
       <process field="serviceName"><copy to-field="serviceName" replace="true" set-if-null="false"/></process>
       <process field="contentName"><copy to-field="contentName" replace="true" set-if-null="false"/></process>
       <process field="description"><copy to-field="description" replace="true" set-if-null="false"/></process>

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/ContentManagementEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/ContentManagementEvents.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/ContentManagementEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/ContentManagementEvents.java Thu Oct 25 05:04:09 2012
@@ -46,6 +46,7 @@ import org.ofbiz.security.Security;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ModelService;
+import org.ofbiz.webapp.website.WebSiteWorker;
 
 
 
@@ -61,7 +62,7 @@ public class ContentManagementEvents {
         Security security = (Security)request.getAttribute("security");
         GenericValue userLogin = (GenericValue)session.getAttribute("userLogin");
         ServletContext servletContext = session.getServletContext();
-        String webSiteId = (String) servletContext.getAttribute("webSiteId");
+        String webSiteId = WebSiteWorker.getWebSiteId(request);
         Delegator delegator = (Delegator)request.getAttribute("delegator");
         LocalDispatcher dispatcher = (LocalDispatcher)request.getAttribute("dispatcher");
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
@@ -157,7 +158,7 @@ public class ContentManagementEvents {
         Security security = (Security)request.getAttribute("security");
         GenericValue userLogin = (GenericValue)session.getAttribute("userLogin");
         ServletContext servletContext = session.getServletContext();
-        String webSiteId = (String) servletContext.getAttribute("webSiteId");
+        String webSiteId = WebSiteWorker.getWebSiteId(request);
         Delegator delegator = (Delegator)request.getAttribute("delegator");
         LocalDispatcher dispatcher = (LocalDispatcher)request.getAttribute("dispatcher");
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java Thu Oct 25 05:04:09 2012
@@ -48,6 +48,7 @@ import org.ofbiz.service.ModelService;
 import org.ofbiz.service.ServiceAuthException;
 import org.ofbiz.service.ServiceUtil;
 import org.ofbiz.webapp.event.CoreEvents;
+import org.ofbiz.webapp.website.WebSiteWorker;
 
 
 /**
@@ -151,15 +152,12 @@ public class CompDocEvents {
         String contentId = (String)paramMap.get("contentId");
         Locale locale = UtilHttp.getLocale(request);
         String rootDir = null;
-        String webSiteId = null;
+        String webSiteId = WebSiteWorker.getWebSiteId(request);
         String https = null;
 
         if (UtilValidate.isEmpty(rootDir)) {
             rootDir = servletContext.getRealPath("/");
         }
-        if (UtilValidate.isEmpty(webSiteId)) {
-            webSiteId = (String) servletContext.getAttribute("webSiteId");
-        }
         if (UtilValidate.isEmpty(https)) {
             https = (String) servletContext.getAttribute("https");
         }
@@ -225,15 +223,12 @@ public class CompDocEvents {
         String contentId = (String)paramMap.get("contentId");
         Locale locale = UtilHttp.getLocale(request);
         String rootDir = null;
-        String webSiteId = null;
+        String webSiteId = WebSiteWorker.getWebSiteId(request);
         String https = null;
 
         if (UtilValidate.isEmpty(rootDir)) {
             rootDir = servletContext.getRealPath("/");
         }
-        if (UtilValidate.isEmpty(webSiteId)) {
-            webSiteId = (String) servletContext.getAttribute("webSiteId");
-        }
         if (UtilValidate.isEmpty(https)) {
             https = (String) servletContext.getAttribute("https");
         }

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/content/ContentWorker.java Thu Oct 25 05:04:09 2012
@@ -177,7 +177,12 @@ public class ContentWorker implements or
             Map<String,Object>templateContext, Locale locale, String mimeTypeId, boolean cache, List<GenericValue> webAnalytics) throws GeneralException, IOException {
         // if the content has a service attached run the service
 
-        String serviceName = content.getString("serviceName");
+        String serviceName = content.getString("serviceName"); //Kept for backward compatibility
+        GenericValue custMethod = null;
+        if (UtilValidate.isNotEmpty(content.getString("customMethodId"))) {
+            custMethod = delegator.findOne("CustomMethod", UtilMisc.toMap("customMethodId", content.get("customMethodId")), true);
+        }
+        if (custMethod != null) serviceName = custMethod.getString("customMethodName");
         if (dispatcher != null && UtilValidate.isNotEmpty(serviceName)) {
             DispatchContext dctx = dispatcher.getDispatchContext();
             ModelService service = dctx.getModelService(serviceName);

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/data/DataEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/data/DataEvents.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/data/DataEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/data/DataEvents.java Thu Oct 25 05:04:09 2012
@@ -42,6 +42,7 @@ import org.ofbiz.entity.GenericValue;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
+import org.ofbiz.webapp.website.WebSiteWorker;
 
 /**
  * DataEvents Class
@@ -279,7 +280,7 @@ public class DataEvents {
                 response.setContentType(mimeType);
             }
             OutputStream os = response.getOutputStream();
-            DataResourceWorker.streamDataResource(os, delegator, dataResourceId, "", application.getInitParameter("webSiteId"), UtilHttp.getLocale(request), application.getRealPath("/"));
+            DataResourceWorker.streamDataResource(os, delegator, dataResourceId, "", WebSiteWorker.getWebSiteId(request), UtilHttp.getLocale(request), application.getRealPath("/"));
             os.flush();
         } catch (GenericEntityException e) {
             String errMsg = "Error downloading digital product content: " + e.toString();

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Thu Oct 25 05:04:09 2012
@@ -818,8 +818,10 @@ public class DataResourceWorker  impleme
             writeText(dataResource, text, templateContext, mimeTypeId, locale, out);
         } else if ("ELECTRONIC_TEXT".equals(dataResourceTypeId)) {
             GenericValue electronicText = delegator.findOne("ElectronicText", UtilMisc.toMap("dataResourceId", dataResourceId), cache);
-            String text = electronicText.getString("textData");
-            writeText(dataResource, text, templateContext, mimeTypeId, locale, out);
+            if (electronicText != null) {
+                String text = electronicText.getString("textData");
+                writeText(dataResource, text, templateContext, mimeTypeId, locale, out);
+            }
 
         // object types
         } else if (dataResourceTypeId.endsWith("_OBJECT")) {

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/SearchWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/SearchWorker.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/SearchWorker.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/search/SearchWorker.java Thu Oct 25 05:04:09 2012
@@ -19,13 +19,14 @@
 package org.ofbiz.content.search;
 
 import java.io.File;
-import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
 import javolution.util.FastList;
 import javolution.util.FastMap;
 
+import org.apache.lucene.index.*;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilGenerics;
@@ -41,16 +42,11 @@ import org.ofbiz.service.LocalDispatcher
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.LockObtainFailedException;
 import org.apache.lucene.util.Version;
 
-
-
 /**
  * SearchWorker Class
  */
@@ -58,8 +54,9 @@ public class SearchWorker {
 
     public static final String module = SearchWorker.class.getName();
 
-    public static Map<String, Object> indexTree(LocalDispatcher dispatcher, Delegator delegator, String siteId, Map<String, Object> context, String path) throws Exception {
+    public static final Version LUCENE_VERSION = Version.LUCENE_36;
 
+    public static Map<String, Object> indexTree(LocalDispatcher dispatcher, Delegator delegator, String siteId, Map<String, Object> context, String path) throws Exception {
         Map<String, Object> results = FastMap.newInstance();
         GenericValue content = delegator.makeValue("Content", UtilMisc.toMap("contentId", siteId));
         if (Debug.infoOn()) Debug.logInfo("in indexTree, siteId:" + siteId + " content:" + content, module);
@@ -75,11 +72,8 @@ public class SearchWorker {
                     for (GenericValue subContent : subContentList) {
                         contentIdList.add(subContent.getString("contentId"));
                     }
-
-                    indexContentList(contentIdList, delegator, dispatcher, context);
-
-                    String subSiteId = siteContent.getString("contentId");
-                    indexTree(dispatcher, delegator, subSiteId, context, path);
+                    indexContentList(dispatcher, delegator, context, contentIdList, null);
+                    indexTree(dispatcher, delegator, siteContentId, context, path);
                 } else {
                     List<String> badIndexList = UtilGenerics.checkList(context.get("badIndexList"));
                     badIndexList.add(siteContentId + " had no sub-entities.");
@@ -95,32 +89,47 @@ public class SearchWorker {
         return results;
     }
 
-    public static void indexContentList(List<String> idList, Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> context) throws Exception {
-        String path = null;
-        indexContentList(dispatcher, delegator, context, idList, path);
+    public static String getIndexPath(String path) {
+        String indexAllPath = path;
+        if (UtilValidate.isEmpty(indexAllPath)) {
+            indexAllPath = UtilProperties.getPropertyValue("search", "defaultIndex", "index");
+        }
+        return indexAllPath;
     }
 
-    public static void indexContentList(LocalDispatcher dispatcher, Delegator delegator, Map<String, Object> context,List<String> idList, String path) throws Exception {
-        Directory directory = FSDirectory.open(new File(getIndexPath(path)));
-        if (Debug.infoOn()) Debug.logInfo("in indexContent, indexAllPath: " + directory.toString(), module);
-        GenericValue content = null;
-        // Delete existing documents
-        List<GenericValue> contentList = null;
-        IndexReader reader = null;
+    private static IndexWriter getDefaultIndexWriter(Directory directory) {
+        IndexWriter writer = null;
+        long savedWriteLockTimeout = IndexWriterConfig.getDefaultWriteLockTimeout();
+        Analyzer analyzer = new StandardAnalyzer(LUCENE_VERSION);
+        IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, analyzer);
+        IndexWriterConfig.setDefaultWriteLockTimeout(2000);
         try {
-            reader = IndexReader.open(directory, false);
-        } catch (Exception e) {
-            // ignore
+            writer  = new IndexWriter(directory, conf);
+        } catch (CorruptIndexException e) {
+            Debug.logError("Corrupted lucene index: "  + e.getMessage(), module);
+        } catch (LockObtainFailedException e) {
+            Debug.logError("Could not obtain Lock on lucene index "  + e.getMessage(), module);
+        } catch (IOException e) {
+            Debug.logError(e.getMessage(), module);
+        } finally {
+            IndexWriterConfig.setDefaultWriteLockTimeout(savedWriteLockTimeout);
         }
+        return writer;
+    }
 
-        contentList = FastList.newInstance();
+    public static void indexContentList(LocalDispatcher dispatcher, Delegator delegator, Map<String, Object> context,List<String> idList, String path) throws Exception {
+        Directory directory = FSDirectory.open(new File(getIndexPath(path)));
+        if (Debug.infoOn()) Debug.logInfo("in indexContentList, indexAllPath: " + directory.toString(), module);
+        // Delete existing documents
+        IndexWriter writer = getDefaultIndexWriter(directory);
+        List<GenericValue> contentList = FastList.newInstance();
         for (String id : idList) {
-            if (Debug.infoOn()) Debug.logInfo("in indexContent, id:" + id, module);
+            if (Debug.infoOn()) Debug.logInfo("in indexContentList, id:" + id, module);
             try {
-                content = delegator.findOne("Content", UtilMisc .toMap("contentId", id), true);
+                GenericValue content = delegator.findOne("Content", UtilMisc .toMap("contentId", id), true);
                 if (content != null) {
-                    if (reader != null) {
-                        deleteContentDocument(content, reader);
+                    if (writer != null) {
+                        deleteContentDocuments(content, writer);
                     }
                     contentList.add(content);
                 }
@@ -129,85 +138,42 @@ public class SearchWorker {
                 return;
             }
         }
-        if (reader != null) {
-            reader.close();
-        }
-        // Now create
-        IndexWriter writer = null;
-        long savedWriteLockTimeout = IndexWriterConfig.getDefaultWriteLockTimeout();
-        Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_34);
-        IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_34, analyzer);
-
-        try {
-            IndexWriterConfig.setDefaultWriteLockTimeout(2000);
-            writer  = new IndexWriter(directory, conf);
-        } finally {
-            IndexWriterConfig.setDefaultWriteLockTimeout(savedWriteLockTimeout);
-        }
-
         for (GenericValue gv : contentList) {
             indexContent(dispatcher, delegator, context, gv, writer);
         }
-        writer.forceMerge(1);
+        try {
+            writer.forceMerge(1);
+        } catch (NullPointerException e) {
+            Debug.logError(e, module);
+        }
         writer.close();
     }
 
-    public static void deleteContentDocument(GenericValue content, String path) throws Exception {
-        Directory directory = FSDirectory.open(new File(getIndexPath(path)));
-        IndexReader reader = IndexReader.open(directory);
-        deleteContentDocument(content, reader);
-        reader.close();
-    }
-
-    public static void deleteContentDocument(GenericValue content, IndexReader reader) throws Exception {
+    private static void deleteContentDocuments(GenericValue content, IndexWriter writer) throws Exception {
         String contentId = content.getString("contentId");
         Term term = new Term("contentId", contentId);
-        if (Debug.infoOn()) Debug.logInfo("in indexContent, term:" + term, module);
-        int qtyDeleted = reader.deleteDocuments(term);
-        if (Debug.infoOn()) Debug.logInfo("in indexContent, qtyDeleted:" + qtyDeleted, module);
+        deleteDocumentsByTerm(term, writer);
         String dataResourceId = content.getString("dataResourceId");
         if (dataResourceId != null) {
-            deleteDataResourceDocument(dataResourceId, reader);
+            term = new Term("dataResourceId", dataResourceId);
+            deleteDocumentsByTerm(term, writer);
         }
     }
 
-    public static void deleteDataResourceDocument(String dataResourceId, IndexReader reader) throws Exception {
-        Term term = new Term("dataResourceId", dataResourceId);
-        if (Debug.infoOn()) Debug.logInfo("in indexContent, term:" + term, module);
-        int qtyDeleted = reader.deleteDocuments(term);
-        if (Debug.infoOn()) Debug.logInfo("in indexContent, qtyDeleted:" + qtyDeleted, module);
-    }
+    private static void deleteDocumentsByTerm(Term term, IndexWriter writer) throws Exception {
+        IndexReader reader = IndexReader.open(writer, false);
+        int qtyBefore = reader.docFreq(term);
 
-    public static void indexContent(LocalDispatcher dispatcher, Delegator delegator, Map<String, Object> context, GenericValue content, String path) throws Exception {
-        Directory directory = FSDirectory.open(new File(getIndexPath(path)));
-        long savedWriteLockTimeout = IndexWriterConfig.getDefaultWriteLockTimeout();
-        Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_35);
-        IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_35, analyzer);
-        IndexWriter writer = null;
-        try {
-            try {
-                IndexWriterConfig.setDefaultWriteLockTimeout(2000);
-                writer  = new IndexWriter(directory, conf);
-            } finally {
-                IndexWriterConfig.setDefaultWriteLockTimeout(savedWriteLockTimeout);
-            }
-            if (Debug.infoOn()) Debug.logInfo("Used old directory:" + directory.toString(), module);
-        } catch (FileNotFoundException e) {
-            try {
-                IndexWriterConfig.setDefaultWriteLockTimeout(2000);
-                writer  = new IndexWriter(directory, conf);
-            } finally {
-                IndexWriterConfig.setDefaultWriteLockTimeout(savedWriteLockTimeout);
-            }
-            if (Debug.infoOn()) Debug.logInfo("Created new directory:" + directory.toString(), module);
-        }
+        //deletes documents, all the rest is for logging
+        writer.deleteDocuments(term);
 
-        indexContent(dispatcher, delegator, context, content, writer);
-        writer.forceMerge(1);
-        writer.close();
+        int qtyAfter = reader.docFreq(term);
+        reader.close();
+
+        if (Debug.infoOn()) Debug.logInfo("For term " + term.toString() + ", documents deleted: " + qtyBefore + ", remaining: " + qtyAfter, module);
     }
 
-    public static void indexContent(LocalDispatcher dispatcher, Delegator delegator, Map<String, Object> context, GenericValue content, IndexWriter writer) throws Exception {
+    private static void indexContent(LocalDispatcher dispatcher, Delegator delegator, Map<String, Object> context, GenericValue content, IndexWriter writer) throws Exception {
         Document doc = ContentDocument.Document(content, context, dispatcher);
 
         if (doc != null) {
@@ -219,44 +185,10 @@ public class SearchWorker {
         /*
             String dataResourceId = content.getString("dataResourceId");
             if (UtilValidate.isNotEmpty(dataResourceId)) {
-                indexDataResource(delegator, context, dataResourceId, writer);
+                doc = DataResourceDocument.Document(dataResourceId, delegator, context);
+                writer.addDocument(doc);
             }
          */
     }
 
-    public static void indexDataResource(Delegator delegator, Map<String, Object> context, String id) throws Exception {
-        String path = null;
-        indexDataResource(delegator, context, id, path);
-    }
-
-    public static void indexDataResource(Delegator delegator, Map<String, Object> context, String id, String path) throws Exception {
-        Directory directory = FSDirectory.open(new File(getIndexPath(path)));
-        long savedWriteLockTimeout = IndexWriterConfig.getDefaultWriteLockTimeout();
-        Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_35);
-        IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_35, analyzer);
-        IndexWriter writer = null;
-
-        try {
-            IndexWriterConfig.setDefaultWriteLockTimeout(2000);
-            writer  = new IndexWriter(directory, conf);
-        } finally {
-            IndexWriterConfig.setDefaultWriteLockTimeout(savedWriteLockTimeout);
-        }
-        indexDataResource(delegator, context, id, writer);
-        writer.forceMerge(1);
-        writer.close();
-    }
-
-    public static void indexDataResource(Delegator delegator, Map<String, Object> context, String id, IndexWriter writer) throws Exception {
-        Document doc = DataResourceDocument.Document(id, delegator, context);
-        writer.addDocument(doc);
-    }
-
-    public static String getIndexPath(String path) {
-        String indexAllPath = path;
-        if (UtilValidate.isEmpty(indexAllPath)) {
-            indexAllPath = UtilProperties.getPropertyValue("search", "defaultIndex", "index");
-        }
-        return indexAllPath;
-    }
 }

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/test/LuceneTests.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/test/LuceneTests.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/test/LuceneTests.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/test/LuceneTests.java Thu Oct 25 05:04:09 2012
@@ -36,7 +36,6 @@ import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TopScoreDocCollector;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
-import org.apache.lucene.util.Version;
 import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.content.search.SearchWorker;
@@ -76,7 +75,7 @@ public class LuceneTests extends OFBizTe
         Directory directory = FSDirectory.open(new File(SearchWorker.getIndexPath(null)));
         IndexReader r = null;
         try {
-            r = IndexReader.open(directory, false);
+            r = IndexReader.open(directory);
         } catch (Exception e) {
             // ignore
         }
@@ -85,9 +84,9 @@ public class LuceneTests extends OFBizTe
         String queryLine = "hand";
 
         IndexSearcher searcher = new IndexSearcher(r);
-        Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_35);
+        Analyzer analyzer = new StandardAnalyzer(SearchWorker.LUCENE_VERSION);
 
-        QueryParser parser = new QueryParser(Version.LUCENE_35, "content", analyzer);
+        QueryParser parser = new QueryParser(SearchWorker.LUCENE_VERSION, "content", analyzer);
         Query query = parser.parse(queryLine);
         combQuery.add(query, BooleanClause.Occur.MUST);
 

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java Thu Oct 25 05:04:09 2012
@@ -43,6 +43,7 @@ import org.ofbiz.entity.GenericEntityExc
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.webapp.view.AbstractViewHandler;
 import org.ofbiz.webapp.view.ViewHandlerException;
+import org.ofbiz.webapp.website.WebSiteWorker;
 
 /**
  * Uses XSL-FO formatted templates to generate PDF views
@@ -71,15 +72,12 @@ public class SimpleContentViewHandler ex
         String mimeTypeId = request.getParameter("mimeTypeId");
         Locale locale = UtilHttp.getLocale(request);
         String rootDir = null;
-        String webSiteId = null;
+        String webSiteId = WebSiteWorker.getWebSiteId(request);
         String https = null;
 
         if (UtilValidate.isEmpty(rootDir)) {
             rootDir = servletContext.getRealPath("/");
         }
-        if (UtilValidate.isEmpty(webSiteId)) {
-            webSiteId = (String) servletContext.getAttribute("webSiteId");
-        }
         if (UtilValidate.isEmpty(https)) {
             https = (String) servletContext.getAttribute("https");
         }

Modified: ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java Thu Oct 25 05:04:09 2012
@@ -39,6 +39,7 @@ import org.ofbiz.content.content.Content
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.service.LocalDispatcher;
+import org.ofbiz.webapp.website.WebSiteWorker;
 
 import freemarker.core.Environment;
 import freemarker.template.TemplateTransformModel;
@@ -134,7 +135,7 @@ public class RenderSubContentTransform i
                 // Timestamp fromDate = UtilDateTime.nowTimestamp();
                 ServletContext servletContext = request.getSession().getServletContext();
                 String rootDir = servletContext.getRealPath("/");
-                String webSiteId = (String) servletContext.getAttribute("webSiteId");
+                String webSiteId = WebSiteWorker.getWebSiteId(request);
                 String https = (String) servletContext.getAttribute("https");
                 templateContext.put("webSiteId", webSiteId);
                 templateContext.put("https", https);

Modified: ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/WEB-INF/actions/cms/Search.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/WEB-INF/actions/cms/Search.groovy?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/WEB-INF/actions/cms/Search.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/WEB-INF/actions/cms/Search.groovy Thu Oct 25 05:04:09 2012
@@ -24,7 +24,6 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.Term
 import org.apache.lucene.queryParser.QueryParser
 import org.apache.lucene.store.FSDirectory
-import org.apache.lucene.util.Version
 import org.ofbiz.base.util.Debug
 import org.ofbiz.base.util.UtilHttp
 import org.ofbiz.content.search.SearchWorker
@@ -56,7 +55,7 @@ try {
     Debug.logInfo("in search, indexPath:" + directory.toString(), "");
     searcher = new IndexSearcher(reader);
     Debug.logInfo("in search, searcher:" + searcher, "");
-    analyzer = new StandardAnalyzer(Version.LUCENE_30);
+    analyzer = new StandardAnalyzer(SearchWorker.LUCENE_VERSION);
 } catch (java.io.FileNotFoundException e) {
     request.setAttribute("errorMsgReq", "No index file exists.");
     Debug.logError("in search, error:" + e.getMessage(), "");
@@ -66,7 +65,7 @@ try {
 if (queryLine || siteId) {
     Query query = null;
     if (queryLine) {
-        QueryParser parser = new QueryParser(Version.LUCENE_30, "content", analyzer);
+        QueryParser parser = new QueryParser(SearchWorker.LUCENE_VERSION, "content", analyzer);
         query = parser.parse(queryLine);
         combQuery.add(query, BooleanClause.Occur.MUST);
     }

Modified: ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/content/ContentNav.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/content/ContentNav.ftl?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/content/ContentNav.ftl (original)
+++ ofbiz/branches/20120329_portletWidget/applications/content/webapp/content/content/ContentNav.ftl Thu Oct 25 05:04:09 2012
@@ -38,7 +38,7 @@ var rawdata = [
                 <#assign content  = delegator.findOne("Content",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo), false)/>
                 {
                 "data": {"title" : unescapeHtmlText("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}},
-                <#assign assocChilds  = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD", null, false))/>
+                <#assign assocChilds  = delegator.findByAnd("ContentAssoc",Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId",assoc.contentIdTo,"contentAssocTypeId", "TREE_CHILD"), null, false)/>
                     "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "AssocType" : "${assoc.contentAssocTypeId}", "fromDate" : "${assoc.fromDate}"}
                 <#if assocChilds?has_content>
                     ,"children": [

Modified: ofbiz/branches/20120329_portletWidget/applications/humanres/widget/forms/EmplLeaveForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/humanres/widget/forms/EmplLeaveForms.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/humanres/widget/forms/EmplLeaveForms.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/humanres/widget/forms/EmplLeaveForms.xml Thu Oct 25 05:04:09 2012
@@ -71,7 +71,7 @@
         <field name="approverPartyId">
             <display-entity entity-name="PartyNameView" description="${firstName} ${lastName}" key-field-name="partyId">
                 <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="${approverPartyId}" link-style="buttontext">
-                    <parameter param-name="approverPartyId" from-field="approverPartyId"/>
+                    <parameter param-name="partyId" from-field="approverPartyId"/>
                 </sub-hyperlink>
             </display-entity>
         </field>
@@ -151,7 +151,7 @@
         <field name="approverPartyId" field-name="approverPartyId">
             <display-entity entity-name="PartyNameView" description="${firstName} ${lastName}" key-field-name="partyId">
                 <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="${approverPartyId}" link-style="buttontext">
-                    <parameter param-name="approverPartyId" from-field="approverPartyId"/>
+                    <parameter param-name="partyId" from-field="approverPartyId"/>
                 </sub-hyperlink>
             </display-entity>
         </field>

Modified: ofbiz/branches/20120329_portletWidget/applications/humanres/widget/forms/RecruitmentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/humanres/widget/forms/RecruitmentForms.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/humanres/widget/forms/RecruitmentForms.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/humanres/widget/forms/RecruitmentForms.xml Thu Oct 25 05:04:09 2012
@@ -178,21 +178,24 @@ under the License.
             <hyperlink target="EditInternalJobPosting" description="${applicationId}">
                 <parameter param-name="applicationId"/>
             </hyperlink>
-        </field>
-        <field name="applyingPartyId" field-name="partyId">
-            <display-entity entity-name="PartyNameView" description="${firstName} ${lastName}">
-                <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="${applyingPartyId}" link-style="buttontext">
-                    <parameter param-name="partyId" from-field="applyingPartyId"/>
-                </sub-hyperlink>
-            </display-entity>
-        </field>
-        <field name="approverPartyId" field-name="partyId">
-            <display-entity entity-name="PartyNameView" description="${firstName} ${lastName}">
+        </field>        
+
+        <field name="approverPartyId">
+            <display-entity entity-name="PartyNameView" description="${firstName} ${lastName}" key-field-name="partyId">
                 <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="${approverPartyId}" link-style="buttontext">
                     <parameter param-name="partyId" from-field="approverPartyId"/>
                 </sub-hyperlink>
             </display-entity>
+        </field>      
+
+        <field name="applyingPartyId">
+            <display-entity entity-name="PartyNameView" description="${firstName} ${lastName}" key-field-name="partyId">
+                <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="${applyingPartyId}" link-style="buttontext">
+                    <parameter param-name="partyId" from-field="applyingPartyId"/>
+                </sub-hyperlink>
+            </display-entity>
         </field>
+
         <field name="statusId" title="${uiLabelMap.HumanResIJPStatus}"><display/></field>
         <field name="jobRequisitionId" widget-style="buttontext">
             <hyperlink target="EditJobRequisition" description="${jobRequisitionId}">

Modified: ofbiz/branches/20120329_portletWidget/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl (original)
+++ ofbiz/branches/20120329_portletWidget/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl Thu Oct 25 05:04:09 2012
@@ -156,8 +156,8 @@ document.lookupinventory.productId.focus
                 <#assign errorEvents = delegator.findByAnd("MrpEvent", Static["org.ofbiz.base.util.UtilMisc"].toMap("mrpEventTypeId", "ERROR", "productId", inven.productId), null, false)>
                 <#assign qohEvents = delegator.findByAnd("MrpEvent", Static["org.ofbiz.base.util.UtilMisc"].toMap("mrpEventTypeId", "INITIAL_QOH", "productId", inven.productId), null, false)>
                 <#assign additionalErrorMessage = "">
-                <#assign initialQohEvent = null>
-                <#assign productFacility = null>
+                <#assign initialQohEvent = "">
+                <#assign productFacility = "">
                 <#if qohEvents?has_content>
                     <#assign initialQohEvent = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(qohEvents)>
                 </#if>

Modified: ofbiz/branches/20120329_portletWidget/applications/marketing/config/MarketingEntityLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/marketing/config/MarketingEntityLabels.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/marketing/config/MarketingEntityLabels.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/marketing/config/MarketingEntityLabels.xml Thu Oct 25 05:04:09 2012
@@ -86,6 +86,7 @@
     </property>
     <property key="TrackingCodeType.description.ACCESS">
         <value xml:lang="en">Access Code</value>
+        <value xml:lang="fr">Code d'accès</value>
         <value xml:lang="it">Codice di accesso</value>
         <value xml:lang="pt_BR">Código de acesso</value>
         <value xml:lang="vi">Mã truy nhập</value>

Modified: ofbiz/branches/20120329_portletWidget/applications/marketing/config/MarketingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/marketing/config/MarketingUiLabels.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/marketing/config/MarketingUiLabels.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/marketing/config/MarketingUiLabels.xml Thu Oct 25 05:04:09 2012
@@ -53,6 +53,7 @@
     </property>
     <property key="FormFieldTitle_changeNote">
         <value xml:lang="en">Change Note</value>
+        <value xml:lang="fr">Note du changement</value>
         <value xml:lang="it">Nota per variazione</value>
         <value xml:lang="pt_BR">Comunicação de mudança</value>
         <value xml:lang="vi">Cập nhật Ghi chú</value>
@@ -604,6 +605,7 @@
     </property>
     <property key="MarketingContactListPartiesImport">
         <value xml:lang="en">Import Parties</value>
+        <value xml:lang="fr">Import d'acteurs</value>
         <value xml:lang="th">นำเข้ากลุ่มผู้ใช้</value>
         <value xml:lang="vi">Nhập vào các Tác nhân</value>
     </property>
@@ -697,6 +699,7 @@
     </property>
     <property key="MarketingCreatePermissionError">
         <value xml:lang="en">Security Error: to run ${resourceDescription} you must have the MARKETING_CREATE or MARKETING_ADMIN permission</value>
+        <value xml:lang="fr">Erreur de sécurité : pour lancer ${resourceDescription}, vous devez avoir la permission MARKETING_CREATE ou MARKETING_ADMIN</value>
         <value xml:lang="it">Errore di sicurezza: per eseguire ${resourceDescription} devi avere il permesso MARKETING_CREATE o MARKETING_ADMIN</value>
         <value xml:lang="vi">Lỗi phân quyền: để thực thi ${resourceDescription} bạn cần có quyền MARKETING_CREATE hoặc quyền MARKETING_ADMIN</value>
     </property>
@@ -715,12 +718,14 @@
     </property>
     <property key="MarketingDeletePermissionError">
         <value xml:lang="en">Security Error: to run ${resourceDescription} you must have the MARKETING_DELETE or MARKETING_ADMIN permission</value>
+        <value xml:lang="fr">Erreur de sécurité : pour lancer ${resourceDescription}, vous devez avoir la permission MARKETING_DELETE ou MARKETING_ADMIN</value>
         <value xml:lang="it">Errore di sicurezza: per eseguire ${resourceDescription} devi avere il permesso MARKETING_DELETE o MARKETING_ADMIN</value>
         <value xml:lang="vi">Lỗi phân quyền: để thực thi ${resourceDescription} bạn cần có quyền MARKETING_DELETE hoặc quyền MARKETING_ADMIN</value>
     </property>
     <property key="MarketingEmailStatusReport">
         <value xml:lang="de">E-Mail Statusbericht</value>
         <value xml:lang="en">Email Status Report</value>
+        <value xml:lang="fr">Rapport du statut des courriels</value>
         <value xml:lang="it">Report stato e-mail</value>
         <value xml:lang="pt_BR">Relatório de estado de e-mail</value>
         <value xml:lang="vi">Báo cáo tình trạng thư điện tử</value>
@@ -850,6 +855,7 @@
     </property>
     <property key="MarketingPartyStatusReport">
         <value xml:lang="en">Party Status Report</value>
+        <value xml:lang="fr">Rapport du statut des acteurs</value>
         <value xml:lang="it">Report stato soggetti</value>
         <value xml:lang="pt_BR">Relatório de estado de participante</value>
         <value xml:lang="vi">Báo cáo tình trạng Tác nhân</value>
@@ -916,6 +922,7 @@
     </property>
     <property key="MarketingSegmentGroupDeletePermissionError">
         <value xml:lang="en">Error on delete Segment Group</value>
+        <value xml:lang="fr">Erreur dans la suppression d'un groupe de segment</value>
         <value xml:lang="it">Errore durante la cancellazione di un gruppo segmento</value>
         <value xml:lang="pt_BR">Erro ao excluir grupo de segmento</value>
         <value xml:lang="vi">Lỗi trong việc xóa nhóm phân đoạn</value>
@@ -951,6 +958,7 @@
     </property>
     <property key="MarketingSegmentGroupMgrViewPermissionError">
         <value xml:lang="en">Segment Group View Permission Error</value>
+        <value xml:lang="fr">Permission de visualisation d'un groupe de segment refusé</value>
         <value xml:lang="it">Errore permesso di visualizzare i gruppi segmento</value>
         <value xml:lang="pt_BR">Erro de permissões para visualização de grupo de segmento</value>
         <value xml:lang="vi">Lỗi quyền xem Nhóm phân đoạn</value>
@@ -972,6 +980,7 @@
     </property>
     <property key="MarketingSegmentGroupPartyClassificationGroupId">
         <value xml:lang="en">Segment GroupParty ClassificationGroup Id</value>
+        <value xml:lang="fr">Réf du groupe de classification d'acteur</value>
         <value xml:lang="it">Soggetto gruppo segmento classificazione</value>
         <value xml:lang="nl">ID Classificatiegroep Segmentgroep</value>
         <value xml:lang="pt_BR">ID de segmento de grupo de participante classificação de grupo</value>
@@ -1614,14 +1623,17 @@
     </property>
     <property key="MarketingWebSiteContactList">
         <value xml:lang="en">WebSites</value>
+        <value xml:lang="fr">Sites Web</value>
         <value xml:lang="vi">Trang thông tin (website)</value>
     </property>
     <property key="MarketingWebSiteContactListCreate">
         <value xml:lang="en">Create WebSite</value>
+        <value xml:lang="fr">Créer un site Web</value>
         <value xml:lang="vi">Tạo mới trang thông tin</value>
     </property>
     <property key="MarketingWebSiteContactListView">
         <value xml:lang="en">WebSites View</value>
+        <value xml:lang="fr">Visualiser les sites Web</value>
         <value xml:lang="vi">Xem Trang thông tin</value>
     </property>
     <property key="PageTitleAccountSummary">
@@ -1683,12 +1695,14 @@
     </property>
     <property key="PageTitleAssignAccountFromExisting">
         <value xml:lang="en">Assign Existing Account</value>
+        <value xml:lang="fr">Associer un compte existant</value>
         <value xml:lang="pt_BR">Designar uma conta existente</value>
         <value xml:lang="th">กำหนด Account ที่มีอยู่</value>
         <value xml:lang="vi">Gán Tài khoản đã có</value>
     </property>
     <property key="PageTitleAssignLeadFromExisting">
         <value xml:lang="en">Assign Existing Lead</value>
+        <value xml:lang="fr">Associer un prospect existant</value>
         <value xml:lang="pt_BR">Designar um Lead existente</value>
         <value xml:lang="th">กำหนด Lead ที่มีอยู่</value>
         <value xml:lang="vi">Gán Đầu mối đã có</value>
@@ -1964,6 +1978,7 @@
     </property>
     <property key="PageTitleFindImportContactListParties">
         <value xml:lang="en">Find Import Contact List Parties</value>
+        <value xml:lang="fr">Rechercher des acteurs importés sur une liste de contact</value>
         <value xml:lang="th">ค้นหารายการติดต่อกลุ่มผู้ใช้เพื่อการนำเข้า</value>
         <value xml:lang="vi">Tìm Danh sách liên hệ của Tác nhân đã nhập khẩu</value>
     </property>
@@ -2581,21 +2596,25 @@
     </property>
     <property key="SfaExportVCardError">
         <value xml:lang="en">Error during export data from VCard: ${errorString}</value>
+        <value xml:lang="fr">Erreur durant l'export de la VCard : ${errorString}</value>
         <value xml:lang="it">Errore durante l'esportazione dei dati da VCard: ${errorString}</value>
         <value xml:lang="vi">Lỗi xảy ra khi kết xuất dữ liệu từ VCard: ${errorString}</value>
     </property>
     <property key="SfaExportVCardErrorOpeningFile">
         <value xml:lang="en">Error during export data from VCard, unable to open file for writing: ${errorString}</value>
+        <value xml:lang="fr">Erreur durant l'export de la VCard, impossible d'ouvrir le fichier en écriture : ${errorString}</value>
         <value xml:lang="it">Errore durante l'esportazione dei dati da VCard, non è possibile aprire il file in scrittura: ${errorString}</value>
         <value xml:lang="vi">Lỗi xảy ra khi kết xuất dữ liệu từ VCard, không thể mở tập tin để ghi: ${errorString}</value>
     </property>
     <property key="SfaExportVCardErrorWritingFile">
         <value xml:lang="en">Error during export data from VCard, unable to write data to: ${errorString}</value>
+        <value xml:lang="fr">Erreur durant l'export de la VCard, impossible d'écrire les données : ${errorString}</value>
         <value xml:lang="it">Errore durante l'esportazione dei dati da VCard, non è possibile scrivere i dati in: ${errorString}</value>
         <value xml:lang="vi">Lỗi xảy ra khi kết xuất dữ liệu từ VCard, không thể ghi dữ liệu tới: ${errorString}</value>
     </property>
     <property key="SfaFindAccountLeads">
         <value xml:lang="en">Find Account Leads</value>
+        <value xml:lang="fr">Recherche de prospects</value>
         <value xml:lang="pt_BR">Buscar contas de Leads</value>
         <value xml:lang="th">ค้นหา Account Leads</value>
         <value xml:lang="vi">Tìm kiếm Tài khoản đầu mối</value>
@@ -2603,6 +2622,7 @@
     <property key="SfaFindAccounts">
         <value xml:lang="de">Finde Konten</value>
         <value xml:lang="en">Find Accounts</value>
+        <value xml:lang="fr">Recherche de compte</value>
         <value xml:lang="pt_BR">Buscar contas</value>
         <value xml:lang="th">ค้นหา Accounts</value>
         <value xml:lang="vi">Tìm kiếm Tài khoản</value>
@@ -2661,6 +2681,7 @@
     <property key="SfaFirstNameLastNameAndCompanyNameMissingError">
         <value xml:lang="de">Bitte geben Sie den Vornamen, Nachnamen oder Firmennamen ein</value>
         <value xml:lang="en">Please enter Person First name or Last name or Company name</value>
+        <value xml:lang="fr">Merci de saisir le prénom ou le nom pour une personne ou le nom pour une société</value>
         <value xml:lang="pt_BR">Por favor, digite o nome da pessoa, sobrenome ou nome da empresa</value>
         <value xml:lang="vi">Bạn hãy nhập Tên hoặc Họ hoặc Tên công ty</value>
     </property>
@@ -2687,6 +2708,7 @@
     </property>
     <property key="SfaImportVCardError">
         <value xml:lang="en">Error during import data from VCard: ${errorString}</value>
+        <value xml:lang="fr">Erreur durant l'import de la VCard : ${errorString}</value>
         <value xml:lang="it">Errore durante l'importazione dei dati da VCard: ${errorString}</value>
         <value xml:lang="vi">Lỗi xảy ra khi nhập khẩu dữ liệu từ VCard: ${errorString}</value>
     </property>
@@ -2967,6 +2989,7 @@
     </property>
     <property key="SfaSelectLeadOwners">
         <value xml:lang="en">Select Lead Owners</value>
+        <value xml:lang="fr">Selection de vos propects</value>
         <value xml:lang="pt_BR">Selecionar donos do Lead</value>
         <value xml:lang="vi">Chọn Sở hữu Đầu mối</value>
     </property>

Modified: ofbiz/branches/20120329_portletWidget/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/servicedef/services.xml?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/servicedef/services.xml (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/servicedef/services.xml Thu Oct 25 05:04:09 2012
@@ -25,11 +25,6 @@ under the License.
     <version>1.0</version>
 
     <!-- Order processing services -->
-    <service name="processOrderWf" engine="workflow" location="org.ofbiz.order" invoke="ProcessOrder">
-        <description>Service for testing the workflow engine</description>
-        <attribute name="orderId" type="String" mode="IN" optional="false"/>
-    </service>
-
     <service name="orderNotificationInterface" engine="interface" location="" invoke="">
         <attribute name="orderId" type="String" mode="IN" optional="false"/>
         <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderEvents.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderEvents.java Thu Oct 25 05:04:09 2012
@@ -40,6 +40,7 @@ import org.ofbiz.entity.GenericValue;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
+import org.ofbiz.webapp.website.WebSiteWorker;
 
 import javolution.util.FastMap;
 
@@ -75,7 +76,7 @@ public class OrderEvents {
                 response.setContentType(orderRoleAndProductContentInfo.getString("mimeTypeId"));
             }
             OutputStream os = response.getOutputStream();
-            DataResourceWorker.streamDataResource(os, delegator, dataResourceId, "", application.getInitParameter("webSiteId"), UtilHttp.getLocale(request), application.getRealPath("/"));
+            DataResourceWorker.streamDataResource(os, delegator, dataResourceId, "", WebSiteWorker.getWebSiteId(request), UtilHttp.getLocale(request), application.getRealPath("/"));
             os.flush();
         } catch (GenericEntityException e) {
             String errMsg = "Error downloading digital product content: " + e.toString();

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Oct 25 05:04:09 2012
@@ -42,6 +42,7 @@ import javolution.util.FastSet;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.GeneralRuntimeException;
+import org.ofbiz.base.util.ObjectType;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilFormatOut;
 import org.ofbiz.base.util.UtilGenerics;
@@ -3337,8 +3338,18 @@ public class OrderServices {
 
                         String fulfillmentType = productContentItem.getString("productContentTypeId");
                         if ("FULFILLMENT_EXTASYNC".equals(fulfillmentType) || "FULFILLMENT_EXTSYNC".equals(fulfillmentType)) {
-                            // enternal service fulfillment
-                            String fulfillmentService = (String) content.get("serviceName");
+                            // external service fulfillment
+                            String fulfillmentService = (String) content.get("serviceName"); // Kept for backward compatibility
+                            GenericValue custMethod = null;
+                            if (UtilValidate.isNotEmpty(content.getString("customMethodId"))) {
+                                try {
+                                    custMethod = delegator.findOne("CustomMethod", UtilMisc.toMap("customMethodId", content.get("customMethodId")), true);
+                                } catch (GenericEntityException e) {
+                                    Debug.logError(e,"ERROR: Cannot get CustomMethod associate to Content entity: " + e.getMessage(),module);
+                                    continue;
+                                }
+                            }
+                            if (custMethod != null) fulfillmentService = custMethod.getString("customMethodName");
                             if (fulfillmentService == null) {
                                 Debug.logError("ProductContent of type FULFILLMENT_EXTERNAL had Content with empty serviceName, can not run fulfillment", module);
                             }
@@ -3629,8 +3640,8 @@ public class OrderServices {
             String quantityStr = itemQtyMap.get(key);
             BigDecimal groupQty = BigDecimal.ZERO;
             try {
-                groupQty = new BigDecimal(quantityStr);
-            } catch (NumberFormatException e) {
+                groupQty = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
+            } catch (GeneralException e) {
                 Debug.logError(e, module);
                 return ServiceUtil.returnError(e.getMessage());
             }
@@ -3673,8 +3684,14 @@ public class OrderServices {
                 if (overridePriceMap.containsKey(itemSeqId)) {
                     String priceStr = itemPriceMap.get(itemSeqId);
                     if (UtilValidate.isNotEmpty(priceStr)) {
-                        BigDecimal price = new BigDecimal("-1");
-                        price = new BigDecimal(priceStr).setScale(orderDecimals, orderRounding);
+                        BigDecimal price = null;
+                        try {
+                            price = (BigDecimal) ObjectType.simpleTypeConvert(priceStr, "BigDecimal", null, locale);
+                        } catch (GeneralException e) {
+                            Debug.logError(e, module);
+                            return ServiceUtil.returnError(e.getMessage());
+                        }
+                        price = price.setScale(orderDecimals, orderRounding);
                         cartItem.setBasePrice(price);
                         cartItem.setIsModifiedPrice(true);
                         Debug.logInfo("Set item price: [" + itemSeqId + "] " + price, module);
@@ -3713,24 +3730,31 @@ public class OrderServices {
         // Create Estimated Delivery dates
         for (Map.Entry<String, String> entry : itemEstimatedDeliveryDateMap.entrySet()) {
             String itemSeqId =  entry.getKey();
-            String estimatedDeliveryDate = entry.getValue();
-            if (UtilValidate.isNotEmpty(estimatedDeliveryDate)) {
-                Timestamp deliveryDate = Timestamp.valueOf(estimatedDeliveryDate);
-                ShoppingCartItem cartItem = cart.findCartItem(itemSeqId);
-                cartItem.setDesiredDeliveryDate(deliveryDate);
+
+            // ignore internationalised variant of dates
+            if (!itemSeqId.endsWith("_i18n")) {
+                String estimatedDeliveryDate = entry.getValue();
+                if (UtilValidate.isNotEmpty(estimatedDeliveryDate)) {
+                    Timestamp deliveryDate = Timestamp.valueOf(estimatedDeliveryDate);
+                    ShoppingCartItem cartItem = cart.findCartItem(itemSeqId);
+                    cartItem.setDesiredDeliveryDate(deliveryDate);
+                }
             }
         }
 
         // Create Estimated ship dates
         for (Map.Entry<String, String> entry : itemEstimatedShipDateMap.entrySet()) {
             String itemSeqId =  entry.getKey();
-            String estimatedShipDate = entry.getValue();
-            if (UtilValidate.isNotEmpty(estimatedShipDate)) {
-                Timestamp shipDate = Timestamp.valueOf(estimatedShipDate);
-                ShoppingCartItem cartItem = cart.findCartItem(itemSeqId);
-                cartItem.setEstimatedShipDate(shipDate);
-            }
 
+            // ignore internationalised variant of dates
+            if (!itemSeqId.endsWith("_i18n")) {
+                String estimatedShipDate = entry.getValue();
+                if (UtilValidate.isNotEmpty(estimatedShipDate)) {
+                    Timestamp shipDate = Timestamp.valueOf(estimatedShipDate);
+                    ShoppingCartItem cartItem = cart.findCartItem(itemSeqId);
+                    cartItem.setEstimatedShipDate(shipDate);
+                }
+            }
         }
 
         // update the group amounts
@@ -3738,8 +3762,8 @@ public class OrderServices {
             String quantityStr = itemQtyMap.get(key);
             BigDecimal groupQty = BigDecimal.ZERO;
             try {
-                groupQty = new BigDecimal(quantityStr);
-            } catch (NumberFormatException e) {
+                groupQty = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
+            } catch (GeneralException e) {
                 Debug.logError(e, module);
                 return ServiceUtil.returnError(e.getMessage());
             }
@@ -5569,6 +5593,7 @@ public class OrderServices {
         boolean processAllOrders = context.get("processAllOrders") == null ? false : (Boolean) context.get("processAllOrders");
         if (orderEntryFromDateTime == null && !processAllOrders) {
             // No from date supplied, check to see when this service last ran and use the startDateTime
+            // FIXME: This code is unreliable - the JobSandbox value might have been purged. Use another mechanism to persist orderEntryFromDateTime.
             EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toMap("statusId", "SERVICE_FINISHED", "serviceName", "createAlsoBoughtProductAssocs"));
             EntityFindOptions efo = new EntityFindOptions();
             efo.setMaxRows(1);

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Thu Oct 25 05:04:09 2012
@@ -54,6 +54,7 @@ import org.ofbiz.service.LocalDispatcher
 import org.ofbiz.service.ModelService;
 import org.ofbiz.service.ServiceUtil;
 import org.ofbiz.webapp.stats.VisitHandler;
+import org.ofbiz.webapp.website.WebSiteWorker;
 
 /**
  * Events used for processing checkout and orders.
@@ -446,7 +447,7 @@ public class CheckOutEvents {
         String distributorId = (String) session.getAttribute("_DISTRIBUTOR_ID_");
         String affiliateId = (String) session.getAttribute("_AFFILIATE_ID_");
         String visitId = VisitHandler.getVisitId(session);
-        String webSiteId = CatalogWorker.getWebSiteId(request);
+        String webSiteId = WebSiteWorker.getWebSiteId(request);
 
         callResult = checkOutHelper.createOrder(userLogin, distributorId, affiliateId, trackingCodeOrders, areOrderItemsExploded, visitId, webSiteId);
         if (callResult != null) {
@@ -828,7 +829,8 @@ public class CheckOutEvents {
                     if (UtilValidate.isNotEmpty(request.getParameter(shipGroupIndex + "_ship_estimate"))) {
                         shipEstimate = new BigDecimal(request.getParameter(shipGroupIndex + "_ship_estimate"));
                     }
-                    
+                    cart.clearOrderNotes();
+                    cart.clearInternalOrderNotes();
                     if (shipEstimate == null) {  // allow ship estimate to be set manually if a purchase order
                         callResult = checkOutHelper.finalizeOrderEntryOptions(shipGroupIndex, shippingMethod, shippingInstructions, maySplit, giftMessage, isGift, internalCode, shipBeforeDate, shipAfterDate, internalOrderNotes, shippingNotes);
                     } else {

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1401975&r1=1401974&r2=1401975&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Thu Oct 25 05:04:09 2012
@@ -667,7 +667,8 @@ public class ShoppingCartHelper {
         for(String parameterName : context.keySet()) {
             int underscorePos = parameterName.lastIndexOf('_');
 
-            if (underscorePos >= 0) {
+            // ignore localized date input elements, just use their counterpart without the _i18n suffix
+            if (underscorePos >= 0 && (!parameterName.endsWith("_i18n"))) {
                 try {
                     String indexStr = parameterName.substring(underscorePos + 1);
                     int index = Integer.parseInt(indexStr);