details:   /erp/devel/pi/rev/6e943caa9e21
changeset: 7867:6e943caa9e21
user:      Valery Lezhebokov <valery.lezhebokov <at> gmail.com>
date:      Sat Jul 10 10:15:47 2010 +0200
summary:   Fixes issue 0012689 : Improving informational header on Delete 
Client.

details:   /erp/devel/pi/rev/7fb79db72f66
changeset: 7868:7fb79db72f66
user:      Valery Lezhebokov <valery.lezhebokov <at> gmail.com>
date:      Mon Jul 12 22:54:26 2010 +0200
summary:   Fixes issue  0011488: A wrong value in a source.path property 
results in a weird error message

details:   /erp/devel/pi/rev/45cfd6efecba
changeset: 7869:45cfd6efecba
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue Jul 13 08:23:31 2010 +0200
summary:   Related to issue 11488: Check correct files

details:   /erp/devel/pi/rev/dc5a763d6a3a
changeset: 7870:dc5a763d6a3a
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue Jul 13 08:24:07 2010 +0200
summary:   Related to issue 11488: Reformat Java file

diffstat:

 src-db/database/sourcedata/AD_MESSAGE.xml             |  11 ++++++++
 src-db/database/sourcedata/AD_PROCESS.xml             |   8 ++---
 src/org/openbravo/erpCommon/modules/ImportModule.java |  25 +++++++++++++++---
 3 files changed, 34 insertions(+), 10 deletions(-)

diffs (82 lines):

diff -r eee78c7f3614 -r dc5a763d6a3a src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Mon Jul 12 16:55:56 2010 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Tue Jul 13 08:24:07 2010 +0200
@@ -32424,6 +32424,17 @@
 <!--BC598373A34D43049D2C3415C69E65A7-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--BC598373A34D43049D2C3415C69E65A7--></AD_MESSAGE>
 
+<!--BCB10A144F40465993D15709F8C057F2--><AD_MESSAGE>
+<!--BCB10A144F40465993D15709F8C057F2-->  
<AD_MESSAGE_ID><![CDATA[BCB10A144F40465993D15709F8C057F2]]></AD_MESSAGE_ID>
+<!--BCB10A144F40465993D15709F8C057F2-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BCB10A144F40465993D15709F8C057F2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BCB10A144F40465993D15709F8C057F2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BCB10A144F40465993D15709F8C057F2-->  
<VALUE><![CDATA[SourceFileNotFound]]></VALUE>
+<!--BCB10A144F40465993D15709F8C057F2-->  <MSGTEXT><![CDATA[Source file [%s] 
can not be found. Verify 'source.path' property is properly set in 
Openbravo.properties file.]]></MSGTEXT>
+<!--BCB10A144F40465993D15709F8C057F2-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--BCB10A144F40465993D15709F8C057F2-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--BCB10A144F40465993D15709F8C057F2--></AD_MESSAGE>
+
 <!--BDBAEDC585EA4D06BACC9E2469003E4F--><AD_MESSAGE>
 <!--BDBAEDC585EA4D06BACC9E2469003E4F-->  
<AD_MESSAGE_ID><![CDATA[BDBAEDC585EA4D06BACC9E2469003E4F]]></AD_MESSAGE_ID>
 <!--BDBAEDC585EA4D06BACC9E2469003E4F-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r eee78c7f3614 -r dc5a763d6a3a src-db/database/sourcedata/AD_PROCESS.xml
--- a/src-db/database/sourcedata/AD_PROCESS.xml Mon Jul 12 16:55:56 2010 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml Tue Jul 13 08:24:07 2010 +0200
@@ -4363,11 +4363,9 @@
 <!--800147-->  <VALUE><![CDATA[AD_Delete_Client]]></VALUE>
 <!--800147-->  <NAME><![CDATA[Delete Client]]></NAME>
 <!--800147-->  <DESCRIPTION><![CDATA[This process deletes a 
client]]></DESCRIPTION>
-<!--800147-->  <HELP><![CDATA[This process deletes a client and all data 
depending on this client. So be very careful when running it.
-The execution of this process can take a long time.
-
-In case it fails a message indicating which SQL statements have made it crash 
will be shown.
-When it has been correctly executed all DB constraints and triggers should be 
in "ENABLED" status, in case they are not a message will be shown.]]></HELP>
+<!--800147-->  <HELP><![CDATA[This process deletes a client and all of its 
data. This operation cannot be undone so please exercise caution.
+Under certain circumstances, this process fails to complete successfully, 
leaving the system in an inconsistent state that prevents it from working 
correctly. We strongly advise to backup your system before initiating this 
operation.
+This operation can take a long time to complete.]]></HELP>
 <!--800147-->  <ACCESSLEVEL><![CDATA[4]]></ACCESSLEVEL>
 <!--800147-->  <ISUSERSTARTABLE><![CDATA[Y]]></ISUSERSTARTABLE>
 <!--800147-->  <ISREPORT><![CDATA[N]]></ISREPORT>
diff -r eee78c7f3614 -r dc5a763d6a3a 
src/org/openbravo/erpCommon/modules/ImportModule.java
--- a/src/org/openbravo/erpCommon/modules/ImportModule.java     Mon Jul 12 
16:55:56 2010 +0200
+++ b/src/org/openbravo/erpCommon/modules/ImportModule.java     Tue Jul 13 
08:24:07 2010 +0200
@@ -68,6 +68,7 @@
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.erpCommon.utility.Zip;
+import org.openbravo.service.web.ResourceNotFoundException;
 import org.openbravo.services.webservice.Module;
 import org.openbravo.services.webservice.ModuleDependency;
 import org.openbravo.services.webservice.ModuleInstallDetail;
@@ -134,12 +135,26 @@
     vars = _vars;
     obDir = obdir;
     pool = conn;
-    final File[] f = new File[3];
-    f[0] = new File(obDir + "/src-db/database/model/tables/AD_MODULE.xml");
-    f[1] = new File(obDir + 
"/src-db/database/model/tables/AD_MODULE_DEPENDENCY.xml");
-    f[2] = new File(obDir + 
"/src-db/database/model/tables/AD_MODULE_DBPREFIX.xml");
+    final File[] files = new File[3];
+    files[0] = new File(obDir + "/src-db/database/model/tables/AD_MODULE.xml");
+    files[1] = new File(obDir + 
"/src-db/database/model/tables/AD_MODULE_DEPENDENCY.xml");
+    files[2] = new File(obDir + 
"/src-db/database/model/tables/AD_MODULE_DBPREFIX.xml");
 
-    db = DatabaseUtils.readDatabaseNoInit(f);
+    verifyFilesExist(files);
+
+    db = DatabaseUtils.readDatabaseNoInit(files);
+  }
+
+  /**
+   * Verifies that the provided files actually exist.
+   */
+  private void verifyFilesExist(File[] files) {
+    for (File file : files) {
+      if (!file.exists()) {
+        throw new 
ResourceNotFoundException(String.format(Utility.messageBD(pool,
+            "SourceFileNotFound", vars.getLanguage()), file.getPath()));
+      }
+    }
   }
 
   /**

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to