svn commit: r564601 - in /ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis: OagisInventoryServices.java OagisShipmentServices.java

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

svn commit: r564601 - in /ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis: OagisInventoryServices.java OagisShipmentServices.java

jonesde
Author: jonesde
Date: Fri Aug 10 07:12:13 2007
New Revision: 564601

URL: http://svn.apache.org/viewvc?view=rev&rev=564601
Log:
Changed everything to use the system userlogin instead of accepting one in the context; for the integration there generally isnt a user or the user is a customer with no permissions

Modified:
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java?view=diff&rev=564601&r1=564600&r2=564601
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Fri Aug 10 07:12:13 2007
@@ -63,20 +63,18 @@
     
     public static Map syncInventory(DispatchContext ctx, Map context) {
         Document doc = (Document) context.get("document");
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
         GenericDelegator delegator = ctx.getDelegator();
         LocalDispatcher dispatcher = ctx.getDispatcher();
         Locale locale = (Locale) context.get("locale");
         List errorMapList = FastList.newInstance();
         List inventoryMapList = FastList.newInstance();
         
-        if (userLogin == null) {
-            try {
-                userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
-            } catch (GenericEntityException e){
-                String errMsg = "Error Getting UserLogin: " + e.toString();
-                Debug.logError(e, errMsg, module);
-            }
+        GenericValue userLogin = null;
+        try {
+            userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+        } catch (GenericEntityException e){
+            String errMsg = "Error Getting UserLogin: " + e.toString();
+            Debug.logError(e, errMsg, module);
         }
 
         String facilityId = UtilProperties.getPropertyValue("oagis.properties", "Oagis.Warehouse.SyncInventoryFacilityId");
@@ -322,18 +320,17 @@
     
     public static Map receivePoAcknowledge(DispatchContext ctx, Map context) {
         Document doc = (Document) context.get("document");
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
         LocalDispatcher dispatcher = ctx.getDispatcher();
         GenericDelegator delegator = ctx.getDelegator();
         List errorMapList = FastList.newInstance();
         Map comiCtx = FastMap.newInstance();
-        if (userLogin == null) {
-            try {
-                userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
-            } catch (GenericEntityException e) {
-                String errMsg = "Error Getting UserLogin: " + e.toString();
-                Debug.logError(e, errMsg, module);
-            }
+
+        GenericValue userLogin = null;
+        try {
+            userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+        } catch (GenericEntityException e) {
+            String errMsg = "Error Getting UserLogin: " + e.toString();
+            Debug.logError(e, errMsg, module);
         }
         
         // parse the message
@@ -516,19 +513,18 @@
     
     public static Map receiveRmaAcknowledge(DispatchContext ctx, Map context) {
         Document doc = (Document) context.get("document");
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
         LocalDispatcher dispatcher = ctx.getDispatcher();
         GenericDelegator delegator = ctx.getDelegator();
         List errorMapList = FastList.newInstance();
         
-        if (userLogin == null) {
-            try {
-                userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
-            } catch (GenericEntityException e) {
-                String errMsg = "Error Getting UserLogin: " + e.toString();
-                Debug.logError(e, errMsg, module);
-            }
+        GenericValue userLogin = null;
+        try {
+            userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+        } catch (GenericEntityException e) {
+            String errMsg = "Error Getting UserLogin: " + e.toString();
+            Debug.logError(e, errMsg, module);
         }
+
         // parse the message
         Element receiveRmaElement = doc.getDocumentElement();
         receiveRmaElement.normalize();
@@ -822,5 +818,4 @@
             Debug.logError(e, errMsg, module);
         }
     }
-    
 }

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=564601&r1=564600&r2=564601
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Fri Aug 10 07:12:13 2007
@@ -88,7 +88,7 @@
         Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
         List errorMapList = FastList.newInstance();
             
-        GenericValue userLogin =null;
+        GenericValue userLogin = null;
         try {
             userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));    
         } catch (GenericEntityException e){
@@ -669,7 +669,6 @@
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericDelegator delegator = dctx.getDelegator();
         String returnId = (String) context.get("returnId");
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
         
         String sendToUrl = (String) context.get("sendToUrl");
         if (UtilValidate.isEmpty(sendToUrl)) {
@@ -688,17 +687,18 @@
             saveToDirectory = UtilProperties.getPropertyValue("oagis.properties", "test.save.outgoing.directory");
         }
 
+        GenericValue userLogin = null;
+        try {
+            userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+        } catch (GenericEntityException e) {
+            Debug.logError(e, "Error getting system userLogin", module);
+        }
+
         OutputStream out = (OutputStream) context.get("outputStream");
         
         Map result = ServiceUtil.returnSuccess();
         MapStack bodyParameters =  MapStack.create();
-        if (userLogin == null) {
-            try {
-                userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
-            } catch (GenericEntityException e) {
-                Debug.logError(e, "Error getting system userLogin", module);
-            }
-        }
+
         GenericValue returnHeader = null;
         String statusId = null;
         try {