=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ExportDataValueAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ExportDataValueAction.java 2014-09-12 15:26:18 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ExportDataValueAction.java 2014-10-07 21:37:53 +0000 @@ -32,6 +32,7 @@ import static org.hisp.dhis.system.util.DateUtils.getMediumDate; import static org.hisp.dhis.util.ContextUtils.CONTENT_TYPE_CSV; import static org.hisp.dhis.util.ContextUtils.CONTENT_TYPE_XML; +import static org.hisp.dhis.util.ContextUtils.CONTENT_TYPE_JSON; import static org.hisp.dhis.util.ContextUtils.getZipOut; import java.io.OutputStreamWriter; @@ -62,10 +63,13 @@ private final static String FILE_PREFIX = "Export"; private final static String FILE_SEPARATOR = "_"; private final static String EXTENSION_XML_ZIP = ".xml.zip"; + private final static String EXTENSION_JSON_ZIP = ".json.zip"; private final static String EXTENSION_CSV_ZIP = ".csv.zip"; private final static String EXTENSION_XML = ".xml"; + private final static String EXTENSION_JSON = ".json"; private final static String EXTENSION_CSV = ".csv"; private final static String FORMAT_CSV = "csv"; + private final static String FORMAT_JSON = "json"; @Autowired private SelectionTreeManager selectionTreeManager; @@ -153,6 +157,13 @@ dataValueSetService.writeDataValueSetCsv( selectedDataSets, getMediumDate( startDate ), getMediumDate( endDate ), orgUnits, true, writer, exportOptions ); } + else if ( FORMAT_JSON.equals( exportFormat ) ) + { + ContextUtils.configureResponse( response, CONTENT_TYPE_JSON, true, getFileName( EXTENSION_JSON_ZIP ), true ); + + dataValueSetService.writeDataValueSetJson( selectedDataSets, getMediumDate( startDate ), + getMediumDate( endDate ), orgUnits, true, getZipOut( response, getFileName( EXTENSION_JSON ) ), exportOptions ); + } else { ContextUtils.configureResponse( response, CONTENT_TYPE_XML, true, getFileName( EXTENSION_XML_ZIP ), true ); === 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 2014-09-12 15:26:18 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties 2014-10-07 21:37:53 +0000 @@ -300,6 +300,7 @@ type=Type count=Count export_as_xml=Export as XML +export_as_json=Export as JSON export_as_csv=Export as CSV csv=CSV xml=XML === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/exportDataValueForm.vm' --- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/exportDataValueForm.vm 2014-09-12 15:26:18 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/exportDataValueForm.vm 2014-10-07 21:37:53 +0000 @@ -126,6 +126,7 @@ +