← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5645: Incorporated dhis2.6 datavalueset bugfix into trunk to correctly handle multiple datasets.

 

------------------------------------------------------------
revno: 5645
committer: bobjolliffe <bobjolliffe@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-12-30 15:49:52 +0000
message:
  Incorporated dhis2.6 datavalueset bugfix into trunk to correctly handle multiple datasets. 
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/service/StaXDataValueImportService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/resources/transform/cross2dxf2.xsl


--
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/dxf2/service/StaXDataValueImportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/service/StaXDataValueImportService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/service/StaXDataValueImportService.java	2011-12-30 15:49:52 +0000
@@ -199,19 +199,17 @@
             do
             {
                 // look for a  DataValue set
-                try
-                {
-                    reader.moveToStartElement( Dxf.DATAVALUESET );
-                } 
-                catch ( java.util.NoSuchElementException ex )
-                {
-                    // we have to reach here eventuallyperiodId
-                    break;
-                }
                 if ( !reader.isStartElement( Dxf.DATAVALUESET ) )
                 {
-                    // we have to reach here eventually
-                    break;
+                    try
+                    {
+                       reader.moveToStartElement( Dxf.DATAVALUESET );
+                    } 
+                    catch ( java.util.NoSuchElementException ex )
+                    {
+                        // we have to reach here eventuallyperiodId
+                        break;
+                    }
                 }
 
                 // Pick off the attributes
@@ -271,14 +269,8 @@
                 do
                 {
                     // look for a  DataValue
-                    try
-                    {
-                        reader.moveToStartElement( DataValueSet.DATAVALUE );
-                    } catch ( java.util.NoSuchElementException ex )
-                    {
-                        break;
-                    }
-
+                    reader.moveToStartElement();
+                    
                     if ( !reader.isStartElement( DataValueSet.DATAVALUE ) )
                     {
                         // we have to reach here eventually
@@ -342,8 +334,8 @@
 
             } while ( true ); // DataValueSets loop
 
-            log.info( SUCCESS );
-            state.setMessage( SUCCESS );
+            log.info( String.format(COUNTER,cumulativeDataValueCounter));
+            state.setMessage( String.format(COUNTER,cumulativeDataValueCounter));
 
         } 
         catch ( ImportException ex )

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/resources/transform/cross2dxf2.xsl'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/resources/transform/cross2dxf2.xsl	2011-12-25 12:51:38 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/resources/transform/cross2dxf2.xsl	2011-12-30 15:49:52 +0000
@@ -14,8 +14,8 @@
           <xsl:variable name="period" select="@*[local-name()='TIME_PERIOD']"/>
           <d:dataValueSet period='{$period}' idScheme='CODE' dataset='{$dataset}'>
 
-            <xsl:for-each select="//*[local-name()='Section']">
-              <xsl:for-each select="//*[local-name()='OBS_VALUE']">
+            <xsl:for-each select="*[local-name()='Section']">
+              <xsl:for-each select="*[local-name()='OBS_VALUE']">
                 <xsl:variable name="orgunit" select="@*[local-name()='FACILITY']"/>
                 <xsl:variable name="dataElement" select="@*[local-name()='DATAELEMENT']"/>
                 <xsl:variable name="value" select="@*[local-name()='value']"/>