← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13806: allow changing format in event import

 

------------------------------------------------------------
revno: 13806
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-01-22 16:30:14 +0700
message:
  allow changing format in event import
modified:
  dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/event/ImportEventAction.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/eventImportForm.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/event/ImportEventAction.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/event/ImportEventAction.java	2013-09-19 12:43:34 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/event/ImportEventAction.java	2014-01-22 09:30:14 +0000
@@ -83,6 +83,13 @@
         this.dryRun = dryRun;
     }
 
+    public boolean jsonInput;
+
+    public void setJsonInput( boolean jsonInput )
+    {
+        this.jsonInput = jsonInput;
+    }
+
     // -------------------------------------------------------------------------
     // Action Implementation
     // -------------------------------------------------------------------------
@@ -100,7 +107,7 @@
         ImportOptions importOptions = new ImportOptions();
         importOptions.setDryRun( dryRun );
 
-        scheduler.executeTask( new ImportEventTask( in, eventService, importOptions, taskId, true ) );
+        scheduler.executeTask( new ImportEventTask( in, eventService, importOptions, taskId, jsonInput ) );
 
         return SUCCESS;
     }

=== 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	2013-11-27 10:00:19 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties	2014-01-22 09:30:14 +0000
@@ -293,6 +293,7 @@
 export_as_csv=Export as CSV
 csv=CSV
 xml=XML
+json=JSON
 pdf=PDF
 xml_data_import=XML Data Import
 csv_data_import=CSV Data Import

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/eventImportForm.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/eventImportForm.vm	2013-09-05 09:25:02 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/eventImportForm.vm	2014-01-22 09:30:14 +0000
@@ -17,6 +17,13 @@
 		<option value="true">$i18n.getString( "yes" )</option>
     </select></td>
 </tr>
+<tr>
+	<td>$i18n.getString( "format" )</td>
+	<td><select id="jsonInput" name="jsonInput" style="width:190px">
+		<option value="false">$i18n.getString( "xml" )</option>
+		<option value="true">$i18n.getString( "json" )</option>
+    </select></td>
+</tr>
 
 <tr>
 	<td></td>