svn commit: r551913 - in /ofbiz/trunk: applications/product/script/org/ofbiz/shipment/shipment/ applications/product/servicedef/ specialpurpose/oagis/ specialpurpose/oagis/servicedef/ specialpurpose/oagis/src/org/ofbiz/oagis/ specialpurpose/oagis/webap...

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

svn commit: r551913 - in /ofbiz/trunk: applications/product/script/org/ofbiz/shipment/shipment/ applications/product/servicedef/ specialpurpose/oagis/ specialpurpose/oagis/servicedef/ specialpurpose/oagis/src/org/ofbiz/oagis/ specialpurpose/oagis/webap...

apatel-2
Author: apatel
Date: Fri Jun 29 07:58:33 2007
New Revision: 551913

URL: http://svn.apache.org/viewvc?view=rev&rev=551913
Log:
Improvement and clean up in processShipment service.

Removed:
    ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/actions/message/ProcessShipment.bsh
Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml
    ofbiz/trunk/specialpurpose/oagis/build.xml
    ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml
    ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml
    ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
    ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl
    ofbiz/trunk/specialpurpose/oagis/widget/MessageInfoScreens.xml

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml Fri Jun 29 07:58:33 2007
@@ -1369,7 +1369,7 @@
             <set field="createShipmentContext.originFacilityId" from-field="productStore.inventoryFacilityId"/>
             <set field="createShipmentContext.userLogin" from-field="parameters.userLogin"/>
             <call-service service-name="createShipment" in-map-name="createShipmentContext">
-                <result-to-field result-name="shipmentId" field-name="shipmentId"/>
+                <result-to-field result-name="shipmentId" field-name="parameters.shipmentId"/>
             </call-service>            
             <entity-one entity-name="Shipment" value-name="shipment"/>
             <get-related value-name="orderHeader" relation-name="OrderItem" list-name="orderItems"/>
@@ -1378,11 +1378,12 @@
                 <clear-field field-name="addOrderShipmentToShipmentCtx"/>
                 <set field="addOrderShipmentToShipmentCtx.orderId" from-field="orderHeader.orderId"/>
                 <set field="addOrderShipmentToShipmentCtx.orderItemSeqId" from-field="orderItem.orderItemSeqId"/>
-                <set field="addOrderShipmentToShipmentCtx.shipmentId" from-field="shipmentId"/>
+                <set field="addOrderShipmentToShipmentCtx.shipmentId" from-field="parameters.shipmentId"/>
                 <set field="addOrderShipmentToShipmentCtx.quantity" from-field="orderItem.quantity"/>
                 <set field="addOrderShipmentToShipmentCtx.userLogin" from-field="parameters.userLogin"/>
                 <call-service service-name="addOrderShipmentToShipment" in-map-name="addOrderShipmentToShipmentCtx"/>            
             </iterate>
+            <field-to-result field-name="shipmentId" map-name="parameters"/>
         </iterate>
     </simple-method>
     
@@ -1822,5 +1823,6 @@
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
 -->
+
 
 

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Fri Jun 29 07:58:33 2007
@@ -64,6 +64,7 @@
             location="org/ofbiz/shipment/shipment/ShipmentServices.xml" invoke="createOrderShipmentPlan" auth="true">
         <description>Create Shipment, ShipmentItems and OrderShipment</description>
         <attribute name="orderId" type="String" mode="IN" optional="false"/>
+        <attribute name="shipmentId" type="String" mode="OUT" optional="true"/>
     </service>
 
     <service name="quickShipEntireOrder" engine="simple"

Modified: ofbiz/trunk/specialpurpose/oagis/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/build.xml?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/build.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/build.xml Fri Jun 29 07:58:33 2007
@@ -52,6 +52,7 @@
             <fileset dir="../../framework/widget/build/lib" includes="*.jar"/>
             <fileset dir="../../applications/party/build/lib" includes="*.jar"/>
             <fileset dir="../../applications/product/build/lib" includes="*.jar"/>
+            <fileset dir="../../applications/order/build/lib" includes="*.jar"/>
         </path>
     </target>
 

Modified: ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/ofbiz-component.xml Fri Jun 29 07:58:33 2007
@@ -31,9 +31,9 @@
     <entity-resource type="data" reader-name="seed" loader="main" location="data/OagisTypeData.xml"/>
     
     <service-resource type="model" loader="main" location="servicedef/services.xml"/>
-    <!-- Uncomment To activate automatic messaging to the partner  
+    <!-- Uncomment To activate automatic messaging to the partner -->
     <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>      
-     -->
+    
     <webapp name="oagis"
         title="Oagis"
         server="default-server"

Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml Fri Jun 29 07:58:33 2007
@@ -22,11 +22,14 @@
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
     <!-- order status changes -->
     
-    <eca service="changeOrderStatus" event="commit" run-on-error="false">
+    <!--eca service="changeOrderStatus" event="commit" run-on-error="false">
         <condition field-name="statusId" operator="equals" value="ORDER_APPROVED"/>
         <condition field-name="orderTypeId" operator="equals" value="SALES_ORDER"/>
         <condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
         <action service="processShipment" mode="sync"/>
+    </eca-->
+    <eca service="processShipment" event="commit" run-on-error="false">
+        <action service="createOagisMessageInfo" mode="sync"/>
     </eca>
     
 </service-eca>

Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml Fri Jun 29 07:58:33 2007
@@ -21,6 +21,25 @@
 <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
     
+    <service name="oagisMessageInfoInterface" engine="interface" location="" invoke="">
+        <attribute name="logicalId" type="String" mode="OUT" optional="false"/>
+        <attribute name="component" type="String" mode="OUT" optional="false"/>
+        <attribute name="task" type="String" mode="OUT" optional="false"/>
+        <attribute name="referenceId" type="String" mode="OUT" optional="false"/>
+        <attribute name="authId" type="String" mode="OUT" optional="true"/>
+        <attribute name="outgoingMessage" type="String" mode="OUT" optional="true"/>
+        <attribute name="sentDate" type="Timestamp" mode="OUT" optional="true"/>
+        <attribute name="receivedDate" type="Timestamp" mode="OUT" optional="true"/>
+        <attribute name="confirmation" type="String" mode="OUT" optional="true"/>
+        <attribute name="bsrVerb" type="String" mode="OUT" optional="true"/>
+        <attribute name="bsrNoun" type="String" mode="OUT" optional="true"/>
+        <attribute name="bsrRevision" type="String" mode="OUT" optional="true"/>
+        <attribute name="processingStatusId" type="String" mode="OUT" optional="true"/>        
+        <attribute name="orderId" type="String" mode="INOUT" optional="true"/>        
+        <attribute name="returnId" type="String" mode="INOUT" optional="true"/>        
+        <attribute name="shipmentId" type="String" mode="INOUT" optional="true"/>
+    </service>
+
     <service name="createOagisMessageInfo" engine="simple" default-entity-name="OagisMessageInfo"
             location="org/ofbiz/oagis/OagisMessageServices.xml" invoke="createOagisMessageInfo" auth="true">
          <description>Create MessageInfo</description>
@@ -88,8 +107,9 @@
     <service name="processShipment" max-retry="0" engine="java"
         location="org.ofbiz.oagis.OagisShipmentServices" invoke="processShipment">
         <description>Process Shipment</description>
-        <attribute name="orderId" mode="IN" type="String" optional="false"/>
+        <implements service="oagisMessageInfoInterface"/>
         <attribute name="outputStream" type="java.io.OutputStream" mode="IN"/>
+        <override name="orderId" mode="INOUT" type="String" optional="false"/>
     </service>
     <service name="sendProcessShipmentMsg" max-retry="0" engine="simple"
         location="org/ofbiz/oagis/OagisMessageServices.xml" invoke="sendProcessShipmentMsg">

Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Fri Jun 29 07:58:33 2007
@@ -21,42 +21,46 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 import java.io.Writer;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Locale;
 import java.util.Set;
 import java.util.TreeSet;
-import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
-import java.text.DateFormat;
 
-import javolution.util.FastMap;
 import javolution.util.FastList;
+import javolution.util.FastMap;
 
-import org.w3c.dom.Document;
-
-import org.ofbiz.service.DispatchContext;
-import org.ofbiz.service.GenericServiceException;
-import org.ofbiz.service.LocalDispatcher;
-import org.ofbiz.service.ServiceUtil;
-import org.ofbiz.base.util.*;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.UtilDateTime;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.base.util.collections.MapStack;
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityConditionList;
+import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityUtil;
-
-import org.w3c.dom.Element;
-
+import org.ofbiz.order.order.OrderReadHelper;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.GenericServiceException;
+import org.ofbiz.service.LocalDispatcher;
+import org.ofbiz.service.ServiceUtil;
 import org.ofbiz.widget.fo.FoFormRenderer;
-import org.ofbiz.widget.screen.ScreenRenderer;
 import org.ofbiz.widget.html.HtmlScreenRenderer;
+import org.ofbiz.widget.screen.ScreenRenderer;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 
 public class OagisShipmentServices {
@@ -228,7 +232,6 @@
         return ServiceUtil.returnError("Service not Implemented");
         
     }
-    
 
     public static Map processShipment(DispatchContext ctx, Map context) {
         LocalDispatcher dispatcher = ctx.getDispatcher();
@@ -236,85 +239,115 @@
         String orderId = (String) context.get("orderId");
         String shipmentId = (String) context.get("shipmentId");
         GenericValue userLogin = (GenericValue) context.get("userLogin");
-        Locale locale = (Locale) context.get("locale");
-
+        Map result = ServiceUtil.returnSuccess();
+        MapStack bodyParameters =  MapStack.create();
+        if (userLogin == null) {
+            try {
+                userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "admin"));
+            } catch (GenericEntityException e) {
+                Debug.logError(e, "Error getting userLogin", module);
+            }
+        }
         GenericValue orderHeader = null;
+        GenericValue orderItemShipGroup = null;
         try {
             orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.getMessage());
         }
-        GenericValue orderItemShipGroup = null;
-        GenericValue productStore =null;
         GenericValue shipment =null;
         if (orderHeader != null) {
             String orderStatusId = orderHeader.getString("statusId");
             if (orderStatusId.equals("ORDER_APPROVED")) {
                 try {
-                    // There can be more then one ship Groups
-                    orderItemShipGroup = EntityUtil.getFirst(delegator.findByAnd("OrderItemShipGroup", UtilMisc.toMap("orderId", orderId), UtilMisc.toList("shipGroupSeqId")));
-                    String productStoreId = orderHeader.getString("productStoreId");
-                    productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
-                    String originFacilityId = productStore.getString("inventoryFacilityId");
-                    String statusId = "SHIPMENT_INPUT";
-                    
-                    Map  result= dispatcher.runSync("createShipment", UtilMisc.toMap("primaryOrderId", orderId,"primaryShipGroupSeqId",orderItemShipGroup.get("shipGroupSeqId") ,"statusId", statusId ,"originFacilityId", originFacilityId ,"userLogin", userLogin));
-                    shipmentId = (String) result.get("shipmentId");
-                    shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId));
-
-                    List orderItems = new ArrayList();
-                    Map orderItemCtx = new HashMap();
-                    orderItems = delegator.findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId));
-                    Iterator oiIter = orderItems.iterator();
-                    while (oiIter.hasNext()) {
-                        GenericValue orderItem = (GenericValue) oiIter.next();
-                        orderItemCtx.put("orderId", orderId);
-                        orderItemCtx.put("orderItemSeqId", orderItem.get("orderItemSeqId"));
-                        orderItemCtx.put("shipmentId", shipmentId);
-                        orderItemCtx.put("quantity", orderItem.get("quantity"));
-                        orderItemCtx.put("userLogin", userLogin);
-                        dispatcher.runSync("addOrderShipmentToShipment", orderItemCtx);
-                    }
+                    Map  cospResult= dispatcher.runSync("createOrderShipmentPlan", UtilMisc.toMap("orderId", orderId, "userLogin", userLogin));
+                    shipmentId = (String) cospResult.get("shipmentId");
                 } catch (GeneralException e) {
                     Debug.logError(e, module);
                     return ServiceUtil.returnError(e.getMessage());
                 }
+                try {
+                    shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId));
+                    bodyParameters.put("shipment", shipment);
+                    OrderReadHelper orderReadHelper = new OrderReadHelper(orderHeader);
+                    if(orderReadHelper.hasShippingAddress()) {
+                        GenericValue  address = EntityUtil.getFirst(orderReadHelper.getShippingLocations());
+                        bodyParameters.put("address", address);
+                    }
+                    String emailString = orderReadHelper.getOrderEmailString();
+                    bodyParameters.put("emailString", emailString);
+
+                    String contactMechId = shipment.getString("destinationTelecomNumberId");
+                    GenericValue telecomNumber = delegator.findByPrimaryKey("TelecomNumber", UtilMisc.toMap("contactMechId", contactMechId));
+                    bodyParameters.put("telecomNumber", telecomNumber);
+
+                    List shipmentItems = delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", shipmentId));
+                    bodyParameters.put("shipmentItems", shipmentItems);
+                    
+                    orderItemShipGroup = EntityUtil.getFirst(delegator.findByAnd("OrderItemShipGroup", UtilMisc.toMap("orderId", orderId)));
+                    bodyParameters.put("orderItemShipGroup", orderItemShipGroup);
+                } catch (GenericEntityException e) {
+                    Debug.logError(e, module);
+                }
                 Set correspondingPoIdSet = new TreeSet();
                 try {
-                    List orderItems = orderHeader.getRelated("OrderItem");
+                    List orderItems = delegator.findByAnd("OrderItem", UtilMisc.toMap("orderId", shipment.getString("primaryOrderId")));
                     Iterator oiIter = orderItems.iterator();
                     while (oiIter.hasNext()) {
                         GenericValue orderItem = (GenericValue) oiIter.next();
                         String correspondingPoId = orderItem.getString("correspondingPoId");
                         correspondingPoIdSet.add(correspondingPoId);
+                        bodyParameters.put("correspondingPoIdSet", correspondingPoIdSet);
                     }
                 } catch (GenericEntityException e) {
                     Debug.logError(e, module);
                 }
                 Set externalIdSet = new TreeSet();
                 try {
-                    GenericValue shipmentOrderHeader = shipment.getRelatedOne("PrimaryOrderHeader");
-                    externalIdSet.add(shipmentOrderHeader.getString("externalId"));
+                    GenericValue primaryOrderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", shipment.getString("primaryOrderId")));
+                    externalIdSet.add(primaryOrderHeader.getString("externalId"));
+                    bodyParameters.put("externalIdSet", externalIdSet);
+                } catch (GenericEntityException e) {
+                    Debug.logError(e, module);
+                }
+                // if order was a return replacement order (associated with return)
+                List returnItemResponses =  null;
+                List returnItemRespExprs = UtilMisc.toList(new EntityExpr("replacementOrderId", EntityOperator.NOT_EQUAL, null));
+                EntityCondition returnItemRespCond = new EntityConditionList(returnItemRespExprs, EntityOperator.AND);
+                // list of fields to select (initial list)
+                List fieldsToSelect = FastList.newInstance();
+                fieldsToSelect.add("replacementOrderId");
+                try {
+                    returnItemResponses = delegator.findByCondition("ReturnItemResponse", returnItemRespCond, fieldsToSelect, null);
+                    Iterator rirIter = returnItemResponses.iterator();
+                    while (rirIter.hasNext()) {
+                        if (rirIter.next().equals(shipment.getString("primaryOrderId"))) {
+                            bodyParameters.put("shipnotes", "RETURNLABEL");
+                        }
+                    }
                 } catch (GenericEntityException e) {
                     Debug.logError(e, module);
                 }
-                
                 String logicalId = UtilProperties.getPropertyValue("oagis.properties", "CNTROLAREA.SENDER.LOGICALID");
-                String authId = UtilProperties.getPropertyValue("oagis.properties", "CNTROLAREA.SENDER.AUTHID");
-    
-                MapStack bodyParameters =  MapStack.create();
                 bodyParameters.put("logicalId", logicalId);
+                result.put("logicalId", logicalId);
+                
+                String authId = UtilProperties.getPropertyValue("oagis.properties", "CNTROLAREA.SENDER.AUTHID");
                 bodyParameters.put("authId", authId);
+                result.put("authId", authId);
 
                 String referenceId = delegator.getNextSeqId("OagisMessageInfo");
                 bodyParameters.put("referenceId", referenceId);
+                result.put("referenceId", referenceId);
                     
                 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSS'Z'Z");
                 Timestamp timestamp = UtilDateTime.nowTimestamp();
                 String sentDate = dateFormat.format(timestamp);
                 bodyParameters.put("sentDate", sentDate);
-                
+                result.put("sentDate", timestamp);
+              
+                // tracking shipper account
                 String partyId = shipment.getString("partyIdTo");
                 List partyCarrierAccounts = new ArrayList();
                 try {
@@ -336,8 +369,6 @@
                 }
                 bodyParameters.put("shipmentId", shipmentId);
                 bodyParameters.put("orderId", orderId);
-                bodyParameters.put("correspondingPoIdSet", correspondingPoIdSet);
-                bodyParameters.put("externalIdSet", externalIdSet);
                 bodyParameters.put("userLogin", userLogin);
                 String bodyScreenUri = UtilProperties.getPropertyValue("oagis.properties", "Oagis.Template.ProcessShipment");
                 OutputStream out = (OutputStream) context.get("outputStream");
@@ -349,32 +380,20 @@
                       Debug.logError(e, "Error rendering [text/xml]: ", module);
                 }
                 // prepare map to Create Oagis Message Info
-                Map comiCtx = new HashMap();
-                comiCtx.put("logicalId", logicalId);
-                comiCtx.put("component", "INVENTORY");
-                comiCtx.put("task", "SHIPREQUES"); // Actual value of task is "SHIPREQUEST" which is more than 10 char
-                comiCtx.put("referenceId", referenceId);
-                comiCtx.put("authId", authId);
-                comiCtx.put("outgoingMessage", "Y");
-                comiCtx.put("sentDate", timestamp);
-                comiCtx.put("confirmation", "1");
-                comiCtx.put("bsrVerb", "PROCESS");
-                comiCtx.put("bsrNoun", "SHIPMENT");
-                comiCtx.put("bsrRevision", "001");
-                comiCtx.put("processingStatusId", orderStatusId);
-                comiCtx.put("orderId", orderId);
-                comiCtx.put("shipmentId", shipmentId);
-                comiCtx.put("userLogin", userLogin);
-                try {
-                    dispatcher.runSync("createOagisMessageInfo", comiCtx);
-                } catch (GenericServiceException e) {
-                    String errMsg = UtilProperties.getMessage(resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", locale);
-                    Debug.logError(e, errMsg, module);
-                    return ServiceUtil.returnError(errMsg);
-                }
+                result.put("component", "INVENTORY");
+                result.put("task", "SHIPREQUES"); // Actual value of task is "SHIPREQUEST" which is more than 10 char
+                result.put("outgoingMessage", "Y");
+                result.put("confirmation", "1");
+                result.put("bsrVerb", "PROCESS");
+                result.put("bsrNoun", "SHIPMENT");
+                result.put("bsrRevision", "001");
+                result.put("processingStatusId", orderStatusId);
+                result.put("orderId", orderId);
+                result.put("shipmentId", shipmentId);
+                result.put("userLogin", userLogin);
             }
         }
-        return ServiceUtil.returnSuccess("Service Completed Successfully");
+        return result;
     }
     
     public static Map receiveDelivery(DispatchContext dctx, Map context) {

Modified: ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl (original)
+++ ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl Fri Jun 29 07:58:33 2007
@@ -45,12 +45,12 @@
         </#if>
         <N2:CARRIER>${orderItemShipGroup.carrierPartyId?if_exists}</N2:CARRIER>
         <#if shipperId?has_content>
-          <N2:FRGHTTERMS>PREPAID</N2:FRGHTTERMS><#-- TODO: if SHIPPERID?has_content then set to COLLECT -->
+          <N2:FRGHTTERMS>COLLECT</N2:FRGHTTERMS><#-- TODO: if SHIPPERID?has_content then set to COLLECT -->
         <#else>
-          <N2:FRGHTTERMS>COLLECT</N2:FRGHTTERMS>
+          <N2:FRGHTTERMS>PREPAID</N2:FRGHTTERMS>
         </#if>
         <N2:NOTES>${orderItemShipGroup.shippingInstructions?if_exists}</N2:NOTES>
-        <N2:SHIPNOTES></N2:SHIPNOTES><#-- if order was a return replacement order (associated with return), then set to RETURNLABEL otherwise leave blank -->
+        <N2:SHIPNOTES>${shipnotes?if_exists}</N2:SHIPNOTES><#-- if order was a return replacement order (associated with return), then set to RETURNLABEL otherwise leave blank -->
         <N2:TRANSMETHD>${orderItemShipGroup.shipmentMethodTypeId?if_exists}</N2:TRANSMETHD>
         <N1:PARTNER>
           <#if address?has_content>
@@ -71,7 +71,7 @@
               <N2:TELEPHONE><#if telecomNumber.countryCode?has_content>${telecomNumber.countryCode}-</#if>${telecomNumber.areaCode?if_exists}-${telecomNumber.contactNumber?if_exists}</N2:TELEPHONE>
             </N1:ADDRESS>
             <N1:CONTACT>
-              <N2:NAME>${address.attnName?if_exists}</N2:NAME>
+              <N2:NAME>${address.toName?if_exists}</N2:NAME>
               <N2:EMAIL>${emailString?if_exists}</N2:EMAIL>
               <N2:FAX></N2:FAX>
               <N2:TELEPHONE><#if telecomNumber.countryCode?has_content>${telecomNumber.countryCode}-</#if>${telecomNumber.areaCode?if_exists}-${telecomNumber.contactNumber?if_exists}</N2:TELEPHONE>
@@ -99,14 +99,14 @@
         <#list externalIdSet?if_exists as externalId>
         <n:DOCUMNTREF>
           <N2:DOCTYPE>PARTNER_SO</N2:DOCTYPE>
-          <N2:DOCUMENTID>${externalId}</N2:DOCUMENTID>
+          <N2:DOCUMENTID>${externalId?if_exists}</N2:DOCUMENTID>
         </n:DOCUMNTREF>
         </#list>
         <#-- TODO: data preparation code to create the correspondingPoIdSet -->
         <#list correspondingPoIdSet?if_exists as correspondingPoId>
         <n:DOCUMNTREF>
           <N2:DOCTYPE>CUST_PO</N2:DOCTYPE>
-          <N2:DOCUMENTID>${correspondingPoId}</N2:DOCUMENTID>
+          <N2:DOCUMENTID>${correspondingPoId?if_exists}</N2:DOCUMENTID>
         </n:DOCUMNTREF>
         </#list>
       </n:SHIPMENT>

Modified: ofbiz/trunk/specialpurpose/oagis/widget/MessageInfoScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/widget/MessageInfoScreens.xml?view=diff&rev=551913&r1=551912&r2=551913
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/widget/MessageInfoScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/widget/MessageInfoScreens.xml Fri Jun 29 07:58:33 2007
@@ -105,9 +105,6 @@
     
     <screen name="ProcessShipment">
         <section>
-            <actions>
-                <script location="component://oagis/webapp/oagis/WEB-INF/actions/message/ProcessShipment.bsh"/>
-            </actions>
             <widgets>
                 <platform-specific>
                     <html><html-template location="component://oagis/webapp/oagis/message/ProcessShipment.ftl"/></html>