You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/04/28 09:49:13 UTC

svn commit: r769274 - in /ofbiz/trunk: applications/order/script/org/ofbiz/order/request/ applications/order/servicedef/ applications/order/widget/ordermgr/ framework/common/script/org/ofbiz/common/email/ framework/common/servicedef/ framework/service/...

Author: hansbak
Date: Tue Apr 28 07:49:12 2009
New Revision: 769274

URL: http://svn.apache.org/viewvc?rev=769274&view=rev
Log:
some more faultfixing on customer request notifications: mainly the partyIdTo was not provided

Modified:
    ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
    ofbiz/trunk/applications/order/servicedef/secas.xml
    ofbiz/trunk/applications/order/servicedef/services_request.xml
    ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml
    ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml
    ofbiz/trunk/framework/common/servicedef/services_email.xml
    ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=769274&r1=769273&r2=769274&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml Tue Apr 28 07:49:12 2009
@@ -363,6 +363,7 @@
         <if-not-empty field="custRequest">
             <field-to-result field="custRequest.statusId" result-name="oldStatusId"/>
             <field-to-result field="custRequest.custRequestId"  result-name="custRequestId"/>
+            <field-to-result field="custRequest.fromPartyId" result-name="fromPartyId"/><!-- for notification -->
             <if-compare-field field="custRequest.statusId" to-field="parameters.statusId" operator="not-equals">
                 <entity-one entity-name="StatusValidChange" value-field="statusChange">
                     <field-map field-name="statusId" from-field="custRequest.statusId"/>

Modified: ofbiz/trunk/applications/order/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?rev=769274&r1=769273&r2=769274&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/secas.xml Tue Apr 28 07:49:12 2009
@@ -327,13 +327,15 @@
         <condition field-name="oldStatusId" operator="not-equals" value="CRQ_ACCEPTED"/>
         <condition field-name="statusId" operator="equals" value="CRQ_ACCEPTED"/>
         <set field-name="bodyParameters.custRequestId" env-name="custRequestId"/>
+        <set field-name="partyIdTo" env-name="fromPartyId"/>
         <set field-name="emailTemplateSettingId" value="CUST_REQ_ACCEPTED"/>
-        <action service="sendMailFromTemplateSetting" mode="sync"/>
+        <action service="sendMailFromTemplateSetting" mode="sync" />
     </eca>
     <eca service="setCustRequestStatus" event="commit">
         <condition field-name="oldStatusId" operator="not-equals" value="CRQ_COMPLETED"/>
         <condition field-name="statusId" operator="equals" value="CRQ_COMPLETED"/>
         <set field-name="bodyParameters.custRequestId" env-name="custRequestId"/>
+        <set field-name="partyIdTo" env-name="fromPartyId"/>
         <set field-name="emailTemplateSettingId" value="CUST_REQ_COMPLETED"/>
         <action service="sendMailFromTemplateSetting" mode="sync"/>
     </eca>

Modified: ofbiz/trunk/applications/order/servicedef/services_request.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_request.xml?rev=769274&r1=769273&r2=769274&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_request.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_request.xml Tue Apr 28 07:49:12 2009
@@ -157,6 +157,7 @@
         <attribute name="custRequestId" type="String" mode="INOUT" optional="false"/>
         <attribute name="statusId" type="String" mode="IN" optional="false"/>
         <attribute name="oldStatusId" type="String" mode="OUT" optional="true"/>
+        <attribute name="fromPartyId" type="String" mode="OUT" optional="true"/><!-- for notification services -->
     </service>
     <service name="createCustRequestFromCommEvent" engine="simple" default-entity-name="CommunicationEvent"
             location="component://order/script/org/ofbiz/order/request/CustRequestServices.xml" invoke="createCustRequestFromCommEvent" auth="true">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml?rev=769274&r1=769273&r2=769274&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml Tue Apr 28 07:49:12 2009
@@ -660,6 +660,7 @@
     </screen>
     <screen name="CreateCustRequestNotification">
         <section>
+            <condition><not><if-empty field="custRequestId"/></not></condition>
             <actions>
                 <entity-one entity-name="CustRequest" value-field="custRequest"/>
                 <entity-one entity-name="PartyNameView" value-field="person">
@@ -670,10 +671,14 @@
             <widgets>
                 <platform-specific><html><html-template location="component://order/webapp/ordermgr/request/CreateCustRequestNotification.ftl"/></html></platform-specific>
             </widgets>
+            <fail-widgets>
+                <label text="Customer requestId is required: ${parameters.custRequestId} value: ${custRequestId}"></label>
+            </fail-widgets>
         </section>
     </screen>
     <screen name="CompletedCustRequestNotification">
         <section>
+            <condition><not><if-empty field="custRequestId"/></not></condition>
             <actions>
                 <entity-one entity-name="CustRequest" value-field="custRequest"/>
                 <entity-one entity-name="PartyNameView" value-field="person">
@@ -684,6 +689,9 @@
             <widgets>
                 <platform-specific><html><html-template location="component://order/webapp/ordermgr/request/CompletedCustRequestNotification.ftl"/></html></platform-specific>
             </widgets>
+            <fail-widgets>
+                <label text="Customer requestId is required: ${parameters.custRequestId} value: ${custRequestId}"></label>
+            </fail-widgets>
         </section>
     </screen>
 

Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml?rev=769274&r1=769273&r2=769274&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml (original)
+++ ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml Tue Apr 28 07:49:12 2009
@@ -21,18 +21,15 @@
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
     <simple-method method-name="sendMailFromTemplateSetting" short-description="Send Mail from Email Template Setting">
-
         <!-- if partyIdTo provided but no emailAddress, get it from the partyContactMech -->
         <if-not-empty field="parameters.partyIdTo">
             <if-empty field="parameters.sendTo">
-                <set-service-fields service-name="getPartyEmail" map="parameters" to-map="getEmail"/>
-                <set field="getMail.partyId" from-field="parameters.partyIdTo"/>
+                <set field="getEmail.partyId" from-field="parameters.partyIdTo"/>
                 <call-service service-name="getPartyEmail" in-map-name="getEmail">
                     <result-to-field result-name="emailAddress" field="parameters.sendTo"/>
                 </call-service>
             </if-empty>
         </if-not-empty>
-
         <entity-one entity-name="EmailTemplateSetting" value-field="emailTemplateSetting"/>
         <if-not-empty field="emailTemplateSetting">
             <set field="emailParams.bodyScreenUri" from-field="emailTemplateSetting.bodyScreenLocation"/>
@@ -45,7 +42,6 @@
 
             <!-- copy the incoming parameter fields AFTER setting the ones from EmailTemplateSetting so they can override things like subject, sendFrom, etc -->
             <set-service-fields service-name="sendMailFromScreen" map="parameters" to-map="emailParams"/>
-
             <call-service service-name="sendMailFromScreen" in-map-name="emailParams">
                 <result-to-result result-name="body"/>
             </call-service>

Modified: ofbiz/trunk/framework/common/servicedef/services_email.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_email.xml?rev=769274&r1=769273&r2=769274&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/servicedef/services_email.xml (original)
+++ ofbiz/trunk/framework/common/servicedef/services_email.xml Tue Apr 28 07:49:12 2009
@@ -51,6 +51,7 @@
         <override name="contentType" mode="INOUT"/>
         <override name="subject" mode="INOUT" optional="false"/>
         <override name="emailType" type="String" mode="INOUT" optional="true"/>
+        <override name="sendTo" optional="false"/><!-- service will give an NPE when not provided -->
     </service>
     <service name="sendMailMultiPart" engine="java"
             location="org.ofbiz.common.email.EmailServices" invoke="sendMail">
@@ -85,6 +86,7 @@
         <description>Send Email From Email Template Setting Service</description>
         <implements service="sendMailInterface"/>
         <attribute name="emailTemplateSettingId" type="String" mode="IN" optional="false"/>
+        <attribute name="partyIdTo" type="String" mode="IN" optional="true"/>
         <attribute name="bodyText" type="String" mode="IN" optional="true" allow-html="any"/>
         <attribute name="attachmentName" type="String" mode="IN" optional="true"/>
         <attribute name="bodyParameters" type="Map" mode="IN" optional="true"/>

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java?rev=769274&r1=769273&r2=769274&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java Tue Apr 28 07:49:12 2009
@@ -56,9 +56,9 @@
     public void eval(Map<String, Object> context) {
         if (fieldName != null) {
             // try to expand the envName
-            if (UtilValidate.isEmpty(value)) {
-                if (UtilValidate.isNotEmpty(envName) && envName.startsWith("${")) {
-                    FlexibleStringExpander exp = FlexibleStringExpander.getInstance(envName);
+            if (UtilValidate.isEmpty(this.value)) {
+                if (UtilValidate.isNotEmpty(this.envName) && this.envName.startsWith("${")) {
+                    FlexibleStringExpander exp = FlexibleStringExpander.getInstance(this.envName);
                     String s = exp.expandString(context);
                     if (UtilValidate.isNotEmpty(s)) {
                         value = s;
@@ -77,7 +77,7 @@
             String newValue = null;
             if (UtilValidate.isNotEmpty(this.value)) {
                 newValue = (String) this.format(this.value, context);
-            } else if (UtilValidate.isNotEmpty(envName) && context.get(this.envName) != null) {
+            } else if (UtilValidate.isNotEmpty(this.envName) && context.get(this.envName) != null) {
                 newValue = (String) this.format((String) context.get(this.envName), context);
             }