------------------------------------------------------------
revno: 19325
committer: Halvdan Hoem Grelland <halvda...@gmail.com>
branch nick: dhis2
timestamp: Tue 2015-06-09 17:57:08 +0200
message:
  minor: gml import
modified:
  
dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java
  
dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importMetaDataSummary.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java	2015-06-09 15:19:51 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java	2015-06-09 15:57:08 +0000
@@ -31,6 +31,7 @@
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.xerces.impl.io.MalformedByteSequenceException;
 import org.hisp.dhis.dxf2.common.ImportOptions;
 import org.hisp.dhis.dxf2.gml.GmlImportService;
 import org.hisp.dhis.dxf2.gml.GmlPreProcessingResult;
@@ -111,6 +112,7 @@
         StringBuilder sb = new StringBuilder( "GML import failed: " );
 
         Throwable rootThrowable = ExceptionUtils.getRootCause( throwable );
+
         if ( rootThrowable instanceof SAXParseException )
         {
             SAXParseException e = (SAXParseException) rootThrowable;
@@ -125,13 +127,21 @@
                     sb.append( " column " ).append( e.getColumnNumber() );
                 }
             }
-            sb.append( "." );
+        }
+        else if ( rootThrowable instanceof MalformedByteSequenceException )
+        {
+            sb.append( "Malformed GML file." );
         }
         else
         {
             sb.append( rootThrowable.getMessage() );
         }
 
+        if ( sb.charAt( sb.length() - 1 ) != '.' )
+        {
+            sb.append( '.' );
+        }
+
         return HtmlUtils.htmlEscape( sb.toString() );
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importMetaDataSummary.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importMetaDataSummary.vm	2015-06-05 12:56:34 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importMetaDataSummary.vm	2015-06-09 15:57:08 +0000
@@ -57,5 +57,5 @@
 <p>$i18n.getString( "no_conflicts_found" )</p>
 #end
 #else
-    $i18n.getString( "no_summary_available" )
+    $i18n.getString( "no_import_summary_available" )
 #end
\ No newline at end of file

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to