details: https://code.openbravo.com/erp/devel/pi/rev/35d251a9e659 changeset: 18067:35d251a9e659 user: Shankar Balachandran <shankar.balachandran <at> openbravo.com> date: Thu Sep 27 17:13:54 2012 +0200 summary: Fixes Issue 0010979 : Display Error for unparsed XML Files.
In Import translation process, added an error message with the files that has not been parsed. details: https://code.openbravo.com/erp/devel/pi/rev/e3837a02a9d5 changeset: 18068:e3837a02a9d5 user: Augusto Mauch <augusto.mauch <at> openbravo.com> date: Fri Sep 28 10:09:48 2012 +0200 summary: Related to issue 21697: Numeric filters are executed when they lose the focus Now, the numeric filter will be applied not only when the Enter key is pressed, but also when the focus leaves the filter. diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js | 6 ++ src-db/database/sourcedata/AD_MESSAGE.xml | 12 +++++ src/org/openbravo/erpCommon/ad_forms/TranslationManager.java | 21 ++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diffs (97 lines): diff -r 3b92f8d1358a -r e3837a02a9d5 modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js Thu Sep 27 19:37:28 2012 +0200 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js Fri Sep 28 10:09:48 2012 +0200 @@ -577,6 +577,12 @@ return ret; }, + // If the filter has not been applied yet, apply it when it loses the focus + blur: function () { + this.form.grid.performAction(); + return this.Super('blur', arguments); + }, + convertToStringValue: function (value) { var type = this.typeInstance; if (!isc.isA.String(value)) { diff -r 3b92f8d1358a -r e3837a02a9d5 src-db/database/sourcedata/AD_MESSAGE.xml --- a/src-db/database/sourcedata/AD_MESSAGE.xml Thu Sep 27 19:37:28 2012 +0200 +++ b/src-db/database/sourcedata/AD_MESSAGE.xml Fri Sep 28 10:09:48 2012 +0200 @@ -17873,6 +17873,18 @@ <!--7DB7D480F58F4D3BB81F13B6BDE62AE5--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> <!--7DB7D480F58F4D3BB81F13B6BDE62AE5--></AD_MESSAGE> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--><AD_MESSAGE> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <AD_MESSAGE_ID><![CDATA[7DE20AA77B0341F9B1816B7DF908A2B2]]></AD_MESSAGE_ID> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <VALUE><![CDATA[ERROR_PARSE_FILE]]></VALUE> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <MSGTEXT><![CDATA[Error parsing files : %s . Rectify them and run the process again.]]></MSGTEXT> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <MSGTIP><![CDATA[Error Parsing Files]]></MSGTIP> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <MSGTYPE><![CDATA[E]]></MSGTYPE> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--7DE20AA77B0341F9B1816B7DF908A2B2--></AD_MESSAGE> + <!--7E3E5C3B752A4026A78ADDFA826E4A1C--><AD_MESSAGE> <!--7E3E5C3B752A4026A78ADDFA826E4A1C--> <AD_MESSAGE_ID><![CDATA[7E3E5C3B752A4026A78ADDFA826E4A1C]]></AD_MESSAGE_ID> <!--7E3E5C3B752A4026A78ADDFA826E4A1C--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> diff -r 3b92f8d1358a -r e3837a02a9d5 src/org/openbravo/erpCommon/ad_forms/TranslationManager.java --- a/src/org/openbravo/erpCommon/ad_forms/TranslationManager.java Thu Sep 27 19:37:28 2012 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/TranslationManager.java Fri Sep 28 10:09:48 2012 +0200 @@ -42,6 +42,7 @@ import org.openbravo.erpCommon.ad_process.buildStructure.BuildTranslation; import org.openbravo.erpCommon.utility.BasicUtility; import org.openbravo.erpCommon.utility.OBError; +import org.openbravo.erpCommon.utility.Utility; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.InputSource; @@ -91,6 +92,8 @@ private static final Logger log4j = Logger.getLogger(TranslationManager.class); + private static String unparsedXMLFiles = null; + /** * Export all the trl tables that refers to tables with ad_module_id column or trl tables that * refers to tables with a parent table with ad_module_id column @@ -243,6 +246,7 @@ final int AD_Client_ID = Integer.valueOf(strClient); try { final TranslationData[] tables = TranslationData.trlTables(cp); + unparsedXMLFiles = null; for (int i = 0; i < tables.length; i++) importTrlFile(cp, directory, AD_Client_ID, AD_Language, tables[i].c); importContributors(cp, directory, AD_Language); @@ -263,9 +267,15 @@ return subDirError; } } - - myMessage.setType("Success"); - myMessage.setMessage(BasicUtility.messageBD(cp, "Success", UILanguage)); + if (unparsedXMLFiles != null) { + myMessage.setType("Error"); + String message = String.format(Utility.messageBD(cp, "ERROR_PARSE_FILE", UILanguage), + unparsedXMLFiles); + myMessage.setMessage(message); + } else { + myMessage.setType("Success"); + myMessage.setMessage(BasicUtility.messageBD(cp, "Success", UILanguage)); + } return myMessage; } @@ -632,6 +642,11 @@ // handler.getUpdateCount(); return ""; } catch (final Exception e) { + if (unparsedXMLFiles != null) { + unparsedXMLFiles = unparsedXMLFiles.concat(", " + fileName); + } else { + unparsedXMLFiles = fileName; + } log4j.error("importTrlFile - error parsing file: " + fileName, e); return e.toString(); } ------------------------------------------------------------------------------ Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
