svn commit: r927758 - in /ofbiz/trunk: applications/order/servicedef/ applications/order/src/org/ofbiz/order/order/ applications/party/servicedef/ applications/party/src/org/ofbiz/party/communication/ applications/product/servicedef/ framework/common/s...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r927758 - in /ofbiz/trunk: applications/order/servicedef/ applications/order/src/org/ofbiz/order/order/ applications/party/servicedef/ applications/party/src/org/ofbiz/party/communication/ applications/product/servicedef/ framework/common/s...

ashish-18
Author: ashish
Date: Fri Mar 26 10:25:08 2010
New Revision: 927758

URL: http://svn.apache.org/viewvc?rev=927758&view=rev
Log:
The screen was broken for CommunicationEventOrder.
The order was not associating with communication event when the new communication event was generating in system for different mail notifications(like OrderConfirmation, OrderComplete, ShipmentComplete etc.)
Now after this commit it will work without any issues.

Modified:
    ofbiz/trunk/applications/order/servicedef/services.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
    ofbiz/trunk/applications/party/servicedef/services.xml
    ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml
    ofbiz/trunk/framework/common/servicedef/services_email.xml
    ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=927758&r1=927757&r2=927758&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Fri Mar 26 10:25:08 2010
@@ -42,6 +42,7 @@ under the License.
         <attribute name="note" type="String" mode="IN" optional="true"/>
         <attribute name="temporaryAnonymousUserLogin" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
         <attribute name="messageWrapper" type="org.ofbiz.service.mail.MimeMessageWrapper" mode="OUT" optional="true"/>
+        <attribute name="orderId" type="String" mode="OUT" optional="true"/>
         <attribute name="subject" type="String" mode="OUT" optional="true"/>
     </service>
     <service name="sendOrderConfirmation" engine="java" require-new-transaction="true" max-retry="3"

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=927758&r1=927757&r2=927758&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Fri Mar 26 10:25:08 2010
@@ -2458,6 +2458,9 @@ public class OrderServices {
         if (sendResp != null && !ServiceUtil.isError(sendResp)) {
             sendResp.put("emailType", emailType);
         }
+        if (UtilValidate.isNotEmpty(orderId)) {
+            sendResp.put("orderId", orderId);
+        }
         return sendResp;
     }
 

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=927758&r1=927757&r2=927758&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Fri Mar 26 10:25:08 2010
@@ -885,6 +885,7 @@ under the License.
         <attribute name="sendTo" type="String" mode="IN" optional="false"/>
         <attribute name="contentType" type="String" mode="IN" optional="true"/>
         <attribute name="statusId" type="String" mode="IN" optional="true"/>
+        <attribute name="orderId" type="String" mode="IN" optional="true"/>
         <attribute name="communicationEventId" type="String" mode="OUT"/>
     </service>
     <service name="updateCommEventAfterEmail" engine="java"

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=927758&r1=927757&r2=927758&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Fri Mar 26 10:25:08 2010
@@ -495,6 +495,7 @@ public class CommunicationEventServices
         String partyId = (String) context.get("partyId");
         String contentType = (String) context.get("contentType");
         String statusId = (String) context.get("statusId");
+        String orderId = (String) context.get("orderId");
         if (statusId == null) {
             statusId = "COM_PENDING";
         }
@@ -548,6 +549,9 @@ public class CommunicationEventServices
         commEventMap.put("subject", subject);
         commEventMap.put("userLogin", userLogin);
         commEventMap.put("contentMimeTypeId", contentType);
+        if (UtilValidate.isNotEmpty(orderId)) {
+            commEventMap.put("orderId", orderId);
+        }
 
         Map<String, Object> createResult;
         try {

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=927758&r1=927757&r2=927758&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Fri Mar 26 10:25:08 2010
@@ -880,6 +880,7 @@ under the License.
         <attribute name="comments" type="String" mode="IN" optional="true"/>
         <attribute name="body" type="String" mode="OUT" optional="true"/>
         <attribute name="subject" type="String" mode="OUT" optional="true"/>
+        <attribute name="orderId" type="String" mode="OUT" optional="true"/>
         <attribute name="messageWrapper" type="org.ofbiz.service.mail.MimeMessageWrapper" mode="OUT" optional="true"/>
     </service>
     <service name="updateIssuanceShipmentAndPoOnReceiveInventory" engine="simple"

Modified: ofbiz/trunk/framework/common/servicedef/services_email.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_email.xml?rev=927758&r1=927757&r2=927758&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/servicedef/services_email.xml (original)
+++ ofbiz/trunk/framework/common/servicedef/services_email.xml Fri Mar 26 10:25:08 2010
@@ -42,6 +42,7 @@ under the License.
         <attribute name="partyId" type="String" mode="INOUT" optional="true"/>
         <attribute name="messageId" type="String" mode="INOUT" optional="true"/>
         <attribute name="emailType" type="String" mode="INOUT" optional="true"/>
+        <attribute name="orderId" type="String" mode="INOUT" optional="true"/>
         <attribute name="messageWrapper" type="org.ofbiz.service.mail.MimeMessageWrapper" mode="OUT" optional="true"/><!-- mail can be disabled in general.properties so no output -->
         <!--  used for parsing and ECAs -->
         <attribute name="communicationEventId" type="String" mode="INOUT" optional="true"/>        

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java?rev=927758&r1=927757&r2=927758&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java Fri Mar 26 10:25:08 2010
@@ -98,6 +98,7 @@ public class EmailServices {
      */
     public static Map<String, Object> sendMail(DispatchContext ctx, Map<String, ? extends Object> context) {
         String communicationEventId = (String) context.get("communicationEventId");
+        String orderId = (String) context.get("orderId");
         if (communicationEventId != null) {
             Debug.logInfo("SendMail Running, for communicationEventId : " + communicationEventId, module);
         }
@@ -113,6 +114,10 @@ public class EmailServices {
         results.put("communicationEventId", communicationEventId);
         results.put("partyId", partyId);
         results.put("subject", subject);
+        
+        if (UtilValidate.isNotEmpty(orderId)) {
+            results.put("orderId", orderId);
+        }
         if (UtilValidate.isNotEmpty(body)) {
             body = FlexibleStringExpander.expandString(body, context);
             results.put("body", body);
@@ -425,6 +430,8 @@ public class EmailServices {
         if (partyId == null) {
             partyId = (String) bodyParameters.get("partyId");
         }
+        String orderId = (String) bodyParameters.get("orderId");
+        
         bodyParameters.put("communicationEventId", serviceContext.get("communicationEventId"));
         NotificationServices.setBaseUrl(dctx.getDelegator(), webSiteId, bodyParameters);
         String contentType = (String) serviceContext.remove("contentType");
@@ -557,7 +564,10 @@ public class EmailServices {
         Debug.logInfo("Expanded email subject to: " + subject, module);
         serviceContext.put("subject", subject);
         serviceContext.put("partyId", partyId);
-
+        if (UtilValidate.isNotEmpty(orderId)) {
+            serviceContext.put("orderId", orderId);
+        }            
+        
         if (Debug.verboseOn()) Debug.logVerbose("sendMailFromScreen sendMail context: " + serviceContext, module);
 
         Map<String, Object> result = ServiceUtil.returnSuccess();
@@ -580,6 +590,9 @@ public class EmailServices {
         result.put("messageWrapper", sendMailResult.get("messageWrapper"));
         result.put("body", bodyWriter.toString());
         result.put("subject", subject);
+        if (UtilValidate.isNotEmpty(orderId)) {
+            result.put("orderId", orderId);
+        }            
         return result;
     }