← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1898: Minor fix

 

------------------------------------------------------------
revno: 1898
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Tue 2010-05-25 14:10:26 +0200
message:
  Minor fix
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportParams.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xml/importer/DefaultXMLImportService.java


--
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-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportParams.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportParams.java	2010-05-25 10:29:27 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportParams.java	2010-05-25 12:10:26 +0000
@@ -72,22 +72,25 @@
     // Logic
     // -------------------------------------------------------------------------
 
-    public boolean minorVersionGreaterOrEqual( String version )
+    public boolean minorVersionGreaterOrEqual( String requiredVersion )
     {
-        if ( version == null || minorVersion == null )
+        if ( requiredVersion == null || minorVersion == null )
         {
-            return false; // For legacy DXF files without version
+            return false;
         }
         
-        if ( !MathUtils.isNumeric( version ) )
+        if ( !MathUtils.isNumeric( minorVersion ) )
         {
-            throw new IllegalArgumentException( "Invalid version, must be numeric: " + version );            
+            throw new IllegalArgumentException( "Invalid version, must be numeric: " + minorVersion );            
         }
         
         double _minorVersion = Double.parseDouble( minorVersion ) * 1000;
-        double _version = Double.parseDouble( version ) * 1000;
-        
-        return (int)_version >= (int)_minorVersion;
+        double _requiredVersion = Double.parseDouble( requiredVersion ) * 1000;
+        
+        System.out.println( "Minorversion " + _minorVersion );
+        System.out.println( "Req version " + _requiredVersion );
+        
+        return (int)_minorVersion >= (int)_requiredVersion;
     }
     
     public boolean isImport()

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xml/importer/DefaultXMLImportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xml/importer/DefaultXMLImportService.java	2010-05-25 10:29:27 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xml/importer/DefaultXMLImportService.java	2010-05-25 12:10:26 +0000
@@ -200,8 +200,8 @@
             
             dxfReader = new DefaultXMLEventReader( (XMLEventReader2) pipeoutput ); // Set dxfReader to output of pipe
             
-            params.setNamespace( NAMESPACE_10 ); // Use latest namespace and version
-            params.setMinorVersion( MINOR_VERSION_11 );
+            params.setNamespace( NAMESPACE_10 ); // Use default namespace and version, should be upgraded as we go
+            params.setMinorVersion( MINOR_VERSION_10 );
         }
 
         // ---------------------------------------------------------------------