← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 953: Impl dxf1 export of groupsets. Import next.

 

------------------------------------------------------------
revno: 953
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Sun 2009-11-01 22:32:55 +0100
message:
  Impl dxf1 export of groupsets. Import next.
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java
  dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java
  dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties
  dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/exportMetaDataForm.vm
  dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js


--
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/dxf/converter/IndicatorGroupSetConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java	2009-11-01 20:57:16 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java	2009-11-01 21:32:55 +0000
@@ -51,8 +51,8 @@
 public class IndicatorGroupSetConverter
     extends AbstractIndicatorGroupSetConverter implements XMLConverter
 {
-    public static final String COLLECTION_NAME = "indicatorGroups";
-    public static final String ELEMENT_NAME = "indicatorGroup";
+    public static final String COLLECTION_NAME = "indicatorGroupSets";
+    public static final String ELEMENT_NAME = "indicatorGroupSet";
     
     private static final String FIELD_ID = "id";
     private static final String FIELD_UUID = "uuid";

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java	2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java	2009-11-01 21:32:55 +0000
@@ -63,6 +63,8 @@
 import org.hisp.dhis.importexport.dxf.converter.DataElementConverter;
 import org.hisp.dhis.importexport.dxf.converter.DataElementGroupConverter;
 import org.hisp.dhis.importexport.dxf.converter.DataElementGroupMemberConverter;
+import org.hisp.dhis.importexport.dxf.converter.DataElementGroupSetConverter;
+import org.hisp.dhis.importexport.dxf.converter.DataElementGroupSetMemberConverter;
 import org.hisp.dhis.importexport.dxf.converter.DataSetConverter;
 import org.hisp.dhis.importexport.dxf.converter.DataSetMemberConverter;
 import org.hisp.dhis.importexport.dxf.converter.DataSetSourceAssociationConverter;
@@ -74,6 +76,8 @@
 import org.hisp.dhis.importexport.dxf.converter.IndicatorConverter;
 import org.hisp.dhis.importexport.dxf.converter.IndicatorGroupConverter;
 import org.hisp.dhis.importexport.dxf.converter.IndicatorGroupMemberConverter;
+import org.hisp.dhis.importexport.dxf.converter.IndicatorGroupSetConverter;
+import org.hisp.dhis.importexport.dxf.converter.IndicatorGroupSetMemberConverter;
 import org.hisp.dhis.importexport.dxf.converter.IndicatorTypeConverter;
 import org.hisp.dhis.importexport.dxf.converter.OlapUrlConverter;
 import org.hisp.dhis.importexport.dxf.converter.OrganisationUnitConverter;
@@ -264,12 +268,16 @@
             thread.registerXMLConverter( new CalculatedDataElementConverter( dataElementService ) );
             thread.registerXMLConverter( new DataElementGroupConverter( dataElementService ) );
             thread.registerXMLConverter( new DataElementGroupMemberConverter( dataElementService ) );
+            thread.registerXMLConverter( new DataElementGroupSetConverter( dataElementService ) );
+            thread.registerXMLConverter( new DataElementGroupSetMemberConverter( dataElementService ) );
             
             thread.registerXMLConverter( new IndicatorTypeConverter( indicatorService ) );
             thread.registerXMLConverter( params.isExtendedMode() ? 
                 new ExtendedIndicatorConverter( indicatorService ) : new IndicatorConverter( indicatorService ) );
             thread.registerXMLConverter( new IndicatorGroupConverter( indicatorService ) );
             thread.registerXMLConverter( new IndicatorGroupMemberConverter( indicatorService ) );
+            thread.registerXMLConverter( new IndicatorGroupSetConverter( indicatorService ) );
+            thread.registerXMLConverter( new IndicatorGroupSetMemberConverter( indicatorService ) );
             
             thread.registerXMLConverter( new DataDictionaryConverter( dataDictionaryService ) );
             thread.registerXMLConverter( new DataDictionaryDataElementConverter( dataDictionaryService ) );

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java	2009-11-01 21:11:55 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java	2009-11-01 21:32:55 +0000
@@ -349,28 +349,34 @@
         int dxfVersion = 1;
 
         // move to root element
-        while (!reader.isStartElement( ROOT_NAME ) ) {
-        	reader.next();
-        }
-
-        if (reader.getXmlStreamReader().getNamespaceURI() == DXF2_NAMESPACE_URI) {
-			dxfVersion = 2;
-			log.info("parsing dxf version " + dxfVersion);
-
-			try {
-				V2Parser v2parser = new V2Parser();
-
-				v2parser.getMetadata(reader.getXmlStreamReader());
-				v2parser.getDataValues(reader.getXmlStreamReader());
-			} catch (javax.xml.bind.JAXBException ex) {
-				log.info("Parsing error: " + ex);
-				// report something to GUI ....
-			}
-		} else {
-			dxfVersion = 1;
-			log.info("parsing dxf version " + dxfVersion);
-			parseDXFv1(params, reader);
-		}
+        while ( !reader.isStartElement( ROOT_NAME ) )
+        {
+            reader.next();
+        }
+
+        if ( reader.getXmlStreamReader().getNamespaceURI() == DXF2_NAMESPACE_URI )
+        {
+            dxfVersion = 2;
+            log.info( "parsing dxf version " + dxfVersion );
+
+            try
+            {
+                V2Parser v2parser = new V2Parser();
+                v2parser.getMetadata( reader.getXmlStreamReader() );
+                v2parser.getDataValues( reader.getXmlStreamReader() );
+            }
+            catch ( javax.xml.bind.JAXBException ex )
+            {
+                log.info( "Parsing error: " + ex );
+                // report something to GUI ....
+            }
+        }
+        else
+        {
+            dxfVersion = 1;
+            log.info( "parsing dxf version " + dxfVersion );
+            parseDXFv1( params, reader );
+        }
 
         // setMessage( "import_process_done" );
 
@@ -381,7 +387,6 @@
         NameMappingUtil.clearMapping();
 
         cacheManager.clearCache();
-
     }
 
     private void parseDXFv1( ImportParams params, XMLReader reader )

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java	2009-08-20 08:17:49 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java	2009-11-01 21:32:55 +0000
@@ -143,6 +143,13 @@
         this.dataElementGroups = dataElementGroups;
     }
     
+    private boolean dataElementGroupSets;
+    
+    public void setDataElementGroupSets( boolean dataElementGroupSets )
+    {
+        this.dataElementGroupSets = dataElementGroupSets;
+    }
+
     private boolean dataDictionaries;
 
     public void setDataDictionaries( boolean dataDictionaries )
@@ -170,6 +177,13 @@
     {
         this.indicatorGroups = indicatorGroups;
     }
+    
+    private boolean indicatorGroupSets;
+
+    public void setIndicatorGroupSets( boolean indicatorGroupSets )
+    {
+        this.indicatorGroupSets = indicatorGroupSets;
+    }
 
     private boolean organisationUnits;
 
@@ -249,6 +263,11 @@
             params.setDataElementGroups( null );
         }
         
+        if ( dataElementGroupSets )
+        {
+            params.setDataElementGroupSets( null );
+        }
+        
         if ( indicators || indicatorGroups || reportTables )
         {
             params.setIndicators( null );
@@ -260,6 +279,11 @@
         {
             params.setIndicatorGroups( null );
         }
+        
+        if ( indicatorGroupSets )
+        {
+            params.setIndicatorGroupSets( null );
+        }
 
         if ( dataDictionaries )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties	2009-03-11 15:16:35 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties	2009-11-01 21:32:55 +0000
@@ -427,3 +427,6 @@
 all_data_element_group = All / Data Element Group
 all_indicator_group = All / Indicator Group
 error_data_elements_with_different_period_types = There are data elements registered for data sets with different period types, please go to data integrity checks for more information and then correct this before exporting
+data_element_group_sets = Data element group sets
+indicator_group_sets = Indicator group sets
+

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/exportMetaDataForm.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/exportMetaDataForm.vm	2009-06-30 16:01:53 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/exportMetaDataForm.vm	2009-11-01 21:32:55 +0000
@@ -25,6 +25,10 @@
 		<td><input id="dataElementGroups" name="dataElementGroups" type="checkbox" value="true"></td>
 		<td><label for="dataElementGroups">$i18n.getString( 'data_element_groups' )</label></td>
   	</tr>  	
+    <tr>
+        <td><input id="dataElementGroupSets" name="dataElementGroupSets" type="checkbox" value="true"></td>
+        <td><label for="dataElementGroupSets">$i18n.getString( 'data_element_group_sets' )</label></td>
+    </tr>   
   	<tr>
 		<td><input id="indicators" name="indicators" type="checkbox" value="true"></td>
 		<td><label for="indicators">$i18n.getString( 'indicators' )</label></td>
@@ -33,6 +37,10 @@
 		<td><input id="indicatorGroups" name="indicatorGroups" type="checkbox" value="true"></td>
 		<td><label for="indicatorGroups">$i18n.getString( 'indicator_groups' )</label></td>
   	</tr>
+    <tr>
+        <td><input id="indicatorGroupSets" name="indicatorGroupSets" type="checkbox" value="true"></td>
+        <td><label for="indicatorGroupSets">$i18n.getString( 'indicator_group_sets' )</label></td>
+    </tr>
   	<tr>
   		<td><input id="dataDictionaries" name="dataDictionaries" type="checkbox" value="true"></td>
   		<td><label for="dataDictionaries">$i18n.getString( 'data_dictionaries' )</label></td>

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js	2009-03-11 15:16:35 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js	2009-11-01 21:32:55 +0000
@@ -151,9 +151,11 @@
 	
     document.getElementById( "dataElements" ).checked = toggle;
     document.getElementById( "dataElementGroups" ).checked = toggle;
+    document.getElementById( "dataElementGroupSets" ).checked = toggle;
     document.getElementById( "dataSets" ).checked = toggle;
     document.getElementById( "indicators" ).checked = toggle;
     document.getElementById( "indicatorGroups" ).checked = toggle;
+    document.getElementById( "indicatorGroupSets" ).checked = toggle;
     document.getElementById( "dataDictionaries" ).checked = toggle;
     document.getElementById( "organisationUnits" ).checked = toggle;
     document.getElementById( "organisationUnitGroups" ).checked = toggle;
@@ -172,9 +174,11 @@
 {
     if ( !isChecked( "dataElements" ) &&
          !isChecked( "dataElementGroups" ) &&
+         !isChecked( "dataElementGroupSets" ) &&
          !isChecked( "dataSets" ) &&
          !isChecked( "indicators" ) &&
          !isChecked( "indicatorGroups" ) &&
+         !isChecked( "indicatorGroupSets" ) &&
          !isChecked( "dataDictionaries" ) &&
          !isChecked( "organisationUnits" ) &&
          !isChecked( "organisationUnitGroups" ) &&