← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6704: minor fix

 

------------------------------------------------------------
revno: 6704
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-04-23 16:01:34 +0300
message:
  minor fix
modified:
  dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/importsummary/ImportSummary.java
  dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.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-dxf2/src/main/java/org/hisp/dhis/dxf2/importsummary/ImportSummary.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/importsummary/ImportSummary.java	2012-04-11 20:16:18 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/importsummary/ImportSummary.java	2012-04-23 13:01:34 +0000
@@ -57,8 +57,8 @@
     }
 
     @JsonProperty
-    @JacksonXmlElementWrapper
-    @JacksonXmlProperty
+    @JacksonXmlElementWrapper(localName = "conflicts")
+    @JacksonXmlProperty(localName = "conflict")
     public List<ImportConflict> getConflicts()
     {
         return conflicts;

=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2012-04-23 11:13:41 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2012-04-23 13:01:34 +0000
@@ -87,11 +87,11 @@
     // Current import counts
     //-------------------------------------------------------------------------------------------------------
 
-    protected int imported;
-
-    protected int updated;
-
-    protected int ignored;
+    protected int totalImported;
+
+    protected int totalUpdated;
+
+    protected int totalIgnored;
 
     //-------------------------------------------------------------------------------------------------------
     // Generic implementations of newObject and updatedObject
@@ -217,7 +217,7 @@
     @Override
     public ImportCount getCurrentImportCount()
     {
-        return new ImportCount( imported, updated, ignored );
+        return new ImportCount( totalImported, totalUpdated, totalIgnored );
     }
 
     @Override
@@ -262,9 +262,9 @@
 
     private void init( ImportOptions options )
     {
-        imported = 0;
-        updated = 0;
-        ignored = 0;
+        totalImported = 0;
+        totalUpdated = 0;
+        totalIgnored = 0;
 
         if ( options.isDryRun() )
         {
@@ -284,7 +284,7 @@
 
         if ( conflict != null )
         {
-            ignored++;
+            totalIgnored++;
         }
 
         return conflict;
@@ -304,7 +304,7 @@
                 return conflict;
             }
 
-            imported++;
+            totalImported++;
         }
         else if ( ImportStrategy.UPDATES.equals( options.getImportStrategy() ) )
         {
@@ -315,7 +315,7 @@
                 return conflict;
             }
 
-            updated++;
+            totalUpdated++;
         }
         else if ( ImportStrategy.NEW_AND_UPDATES.equals( options.getImportStrategy() ) )
         {
@@ -328,7 +328,7 @@
                     return conflict;
                 }
 
-                updated++;
+                totalUpdated++;
             }
             else
             {
@@ -339,7 +339,7 @@
                     return conflict;
                 }
 
-                imported++;
+                totalImported++;
             }
         }