svn commit: r1058781 [3/3] - in /ofbiz/trunk/applications: accounting/config/ accounting/src/org/ofbiz/accounting/finaccount/ accounting/src/org/ofbiz/accounting/invoice/ content/config/ content/src/org/ofbiz/content/compdoc/

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

svn commit: r1058781 [3/3] - in /ofbiz/trunk/applications: accounting/config/ accounting/src/org/ofbiz/accounting/finaccount/ accounting/src/org/ofbiz/accounting/invoice/ content/config/ content/src/org/ofbiz/content/compdoc/

mrisaliti
Modified: ofbiz/trunk/applications/content/config/ContentUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/config/ContentUiLabels.xml?rev=1058781&r1=1058780&r2=1058781&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/config/ContentUiLabels.xml (original)
+++ ofbiz/trunk/applications/content/config/ContentUiLabels.xml Thu Jan 13 22:57:44 2011
@@ -710,10 +710,6 @@
         <value xml:lang="en">Error converting document: ${errorString}</value>
         <value xml:lang="it">Errore durante la conversione del documento: ${errorString}</value>
     </property>
-    <property key="ContentConvertingDocumentByteBuffer">
-        <value xml:lang="en">Error converting document byte buffer: </value>
-        <value xml:lang="it">Errore durante la conversione del documento in byte buffer: </value>
-    </property>
     <property key="ContentCreateContentAssocMethodError">
         <value xml:lang="en">Not 2 out of ContentId/To/From</value>
         <value xml:lang="it">Necessari 2 dei tre parametri ContentId/To/From necessari</value>
@@ -2145,14 +2141,6 @@
         <value xml:lang="zh">回答</value>
         <value xml:lang="zh_TW">回答</value>
     </property>
-    <property key="ContentSurveyErrorBuildingPDF">
-        <value xml:lang="en">Error building PDF from SurveyResponse: </value>
-        <value xml:lang="it">Errore durante la creazione del PDF dalla risposta del sondaggio: </value>
-    </property>
-    <property key="ContentSurveyErrorSettingAcroFields">
-        <value xml:lang="en">Error setting AcroFields from SurveyResponse: </value>
-        <value xml:lang="it">Errore durante l'impostazioni di AcroFields dalla risposta del sondaggio: </value>
-    </property>
     <property key="ContentSurveyResponseSummary">
         <value xml:lang="ar">ماخص الجواب</value>
         <value xml:lang="da">Svar resumé</value>

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java?rev=1058781&r1=1058780&r2=1058781&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java Thu Jan 13 22:57:44 2011
@@ -63,8 +63,7 @@ import com.lowagie.text.pdf.PdfReader;
 
 public class CompDocServices {
     public static final String module = CompDocServices.class.getName();
-    public static final String resource = "ContentUiLabels";
-    
+
     /**
      *
      * @param request
@@ -94,8 +93,8 @@ public class CompDocServices {
                 if (val == null)  contentExists = false;
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Error running serviceName persistContentAndAssoc", module);
-                return ServiceUtil.returnError(UtilProperties.getMessage(CoreEvents.err_resource,
-                        "ContentNoContentFound", UtilMisc.toMap("contentId", contentId), locale));
+                String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.error_modelservice_for_srv_name", locale);
+                return ServiceUtil.returnError(errMsg);
            }
         }
 
@@ -103,18 +102,17 @@ public class CompDocServices {
         try {
             modelService = dispatcher.getDispatchContext().getModelService("persistContentAndAssoc");
         } catch (GenericServiceException e) {
-            Debug.logError("Error getting model service for serviceName, 'persistContentAndAssoc'. " + e.toString(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(CoreEvents.err_resource,
-                    "coreEvents.error_modelservice_for_srv_name", locale));
+            String errMsg = "Error getting model service for serviceName, 'persistContentAndAssoc'. " + e.toString();
+            Debug.logError(errMsg, module);
+            return ServiceUtil.returnError(errMsg);
         }
         Map persistMap = modelService.makeValid(context, ModelService.IN_PARAM);
         persistMap.put("userLogin", userLogin);
         try {
             Map persistContentResult = dispatcher.runSync("persistContentAndAssoc", persistMap);
             if (ServiceUtil.isError(persistContentResult)) {
-                return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                        "ContentContentCreatingError",
-                        UtilMisc.toMap("serviceName", "persistContentAndAssoc"), locale), null, null, persistContentResult);
+                //Debug.logError("Error running service 'persistContentAndAssoc'. " + ServiceUtil.getErrorMessage(persistContentResult), module);
+                return ServiceUtil.returnError("Error saving content information: ", null, null, persistContentResult);
             }
 
             contentId = (String) persistContentResult.get("contentId");
@@ -129,18 +127,16 @@ public class CompDocServices {
 
             Map persistRevResult = dispatcher.runSync("persistContentRevisionAndItem", contentRevisionMap);
             if (ServiceUtil.isError(persistRevResult)) {
-                return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                        "ContentContentCreatingError",
-                        UtilMisc.toMap("serviceName", "persistContentRevisionAndItem"), locale), null, null, persistRevResult);
+                //Debug.logError("Error running service 'persistContentRevisionAndItem'. " + ServiceUtil.getErrorMessage(persistRevResult), module);
+                return ServiceUtil.returnError("Error saving revision information: ", null, null, persistRevResult);
             }
 
             result.putAll(persistRevResult);
             return result;
         } catch (GenericServiceException e) {
-            Debug.logError(e, "Error running serviceName, 'persistContentAndAssoc'. " + e.toString(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                    "ContentContentCreatingError",
-                    UtilMisc.toMap("serviceName", "persistContentAndAssoc"), locale) + e.toString());
+            String errMsg = "Error running serviceName, 'persistContentAndAssoc'. " + e.toString();
+            Debug.logError(e, errMsg, module);
+            return ServiceUtil.returnError(errMsg);
         }
     }
 
@@ -239,8 +235,7 @@ public class CompDocServices {
                             // Create AcroForm PDF
                             Map survey2PdfResults = dispatcher.runSync("buildPdfFromSurveyResponse", UtilMisc.toMap("surveyResponseId", surveyId));
                             if (ServiceUtil.isError(survey2PdfResults)) {
-                                return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                                        "ContentSurveyErrorBuildingPDF", locale), null, null, survey2PdfResults);
+                                return ServiceUtil.returnError("Error building PDF from SurveyResponse: ", null, null, survey2PdfResults);
                             }
 
                             ByteBuffer outByteBuffer = (ByteBuffer) survey2PdfResults.get("outByteBuffer");
@@ -250,8 +245,7 @@ public class CompDocServices {
                             // Fill in acroForm
                             Map survey2AcroFieldResults = dispatcher.runSync("setAcroFieldsFromSurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId));
                             if (ServiceUtil.isError(survey2AcroFieldResults)) {
-                                return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                                        "ContentSurveyErrorSettingAcroFields", locale), null, null, survey2AcroFieldResults);
+                                return ServiceUtil.returnError("Error setting AcroFields from SurveyResponse: ", null, null, survey2AcroFieldResults);
                             }
 
                             ByteBuffer outByteBuffer = (ByteBuffer) survey2AcroFieldResults.get("outByteBuffer");
@@ -269,8 +263,7 @@ public class CompDocServices {
                     Map convertResult = dispatcher.runSync("convertDocumentByteBuffer", convertInMap);
 
                     if (ServiceUtil.isError(convertResult)) {
-                        return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                                "ContentConvertingDocumentByteBuffer", locale), null, null, convertResult);
+                        return ServiceUtil.returnError("Error in Open", null, null, convertResult);
                     }
 
                     ByteBuffer outByteBuffer = (ByteBuffer) convertResult.get("outByteBuffer");
@@ -389,8 +382,7 @@ public class CompDocServices {
                         // Create AcroForm PDF
                         Map survey2PdfResults = dispatcher.runSync("buildPdfFromSurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId));
                         if (ServiceUtil.isError(survey2PdfResults)) {
-                            return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                                    "ContentSurveyErrorBuildingPDF", locale), null, null, survey2PdfResults);
+                            return ServiceUtil.returnError("Error building PDF from SurveyResponse: ", null, null, survey2PdfResults);
                         }
 
                         ByteBuffer outByteBuffer = (ByteBuffer)survey2PdfResults.get("outByteBuffer");
@@ -399,8 +391,7 @@ public class CompDocServices {
                         // Fill in acroForm
                         Map survey2AcroFieldResults = dispatcher.runSync("setAcroFieldsFromSurveyResponse", UtilMisc.toMap("surveyResponseId", surveyResponseId));
                         if (ServiceUtil.isError(survey2AcroFieldResults)) {
-                            return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                                    "ContentSurveyErrorSettingAcroFields", locale), null, null, survey2AcroFieldResults);
+                            return ServiceUtil.returnError("Error setting AcroFields from SurveyResponse: ", null, null, survey2AcroFieldResults);
                         }
 
                         ByteBuffer outByteBuffer = (ByteBuffer) survey2AcroFieldResults.get("outByteBuffer");
@@ -418,8 +409,7 @@ public class CompDocServices {
                 Map convertResult = dispatcher.runSync("convertDocumentByteBuffer", convertInMap);
 
                 if (ServiceUtil.isError(convertResult)) {
-                    return ServiceUtil.returnError(UtilProperties.getMessage(resource,
-                            "ContentConvertingDocumentByteBuffer", locale), null, null, convertResult);
+                    return ServiceUtil.returnError("Error in Open", null, null, convertResult);
                 }
 
                 ByteBuffer outByteBuffer = (ByteBuffer) convertResult.get("outByteBuffer");