svn commit: r465124 - /incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java

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

svn commit: r465124 - /incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java

hansbak-2
Author: hansbak
Date: Tue Oct 17 19:10:50 2006
New Revision: 465124

URL: http://svn.apache.org/viewvc?view=rev&rev=465124
Log:
better to store the destination address always because they can be modified in the partyTo/contactMechTo fields

Modified:
    incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java

Modified: incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java?view=diff&rev=465124&r1=465123&r2=465124
==============================================================================
--- incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original)
+++ incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Tue Oct 17 19:10:50 2006
@@ -158,6 +158,7 @@
         GenericDelegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         
+        Debug.logInfo("=========== type:" + (String)context.get("dataresourceTypeId") , module);
         // Knowing why a request fails permission check is one of the more difficult
         // aspects of content management. Setting "displayFailCond" to true will
         // put an html table in result.errorMessage that will show what tests were performed
@@ -541,6 +542,9 @@
           if (UtilValidate.isNotEmpty(permissionStatus) && permissionStatus.equalsIgnoreCase("granted")) {
               result = persistDataResourceAndDataMethod(dctx, context);
           }
+          else {
+         return ServiceUtil.returnError("no access to upload image");  
+          }
       } catch (GenericServiceException e) {
           return ServiceUtil.returnError(e.getMessage());
       } catch (GenericEntityException e) {
@@ -668,11 +672,12 @@
           return ServiceUtil.returnError(errorMsg);
       }
       //Map thisResult = DataServices.updateDataResourceMethod(dctx, context);
-      if (Debug.infoOn()) Debug.logInfo("in persist... thisResult.permissionStatus(0):" + thisResult.get("permissionStatus"), null);
+      if (Debug.infoOn()) Debug.logInfo("====in persist... thisResult.permissionStatus(0):" + thisResult.get("permissionStatus"), null);
           //thisResult = DataServices.updateElectronicTextMethod(dctx, context);
       Map fileContext = new HashMap();
       fileContext.put("userLogin", userLogin);
       String forceElectronicText = (String)context.get("forceElectronicText");
+      Debug.logInfo("====dataResourceType" + dataResourceTypeId , module);
       if (dataResourceTypeId.indexOf("_FILE") >=0) {
           boolean hasData = false;
           if (textData != null) {
@@ -697,13 +702,14 @@
           if (byteWrapper != null || "true".equalsIgnoreCase(forceElectronicText)) {
               fileContext.put("dataResourceId", dataResourceId);
               fileContext.put("imageData", byteWrapper);
+              Debug.logInfo("====trying to update image", module);
               thisResult = dispatcher.runSync("updateImage", fileContext);
               errorMsg = ServiceUtil.getErrorMessage(thisResult);
               if (UtilValidate.isNotEmpty(errorMsg)) {
                   return ServiceUtil.returnError(errorMsg);
               }
           } else {
-              //return ServiceUtil.returnError("'byteWrapper' empty when trying to create database image.");
+              return ServiceUtil.returnError("'byteWrapper' empty when trying to create database image.");
           }
       } else if (dataResourceTypeId.equals("SHORT_TEXT")) {
       } else if (dataResourceTypeId.startsWith("SURVEY")) {