Search in sources :

Example 6 with ExportParams

use of org.hisp.dhis.dxf2.dataset.ExportParams in project dhis2-core by dhis2.

the class CompleteDataSetRegistrationController method getCompleteRegistrationsJson.

@ApiVersion({ DhisApiVersion.DEFAULT, DhisApiVersion.V26, DhisApiVersion.V27 })
@RequestMapping(method = RequestMethod.GET, produces = CONTENT_TYPE_JSON)
public void getCompleteRegistrationsJson(@RequestParam Set<String> dataSet, @RequestParam(required = false) Set<String> period, @RequestParam(required = false) Date startDate, @RequestParam(required = false) Date endDate, @RequestParam(required = false, name = "children") boolean includeChildren, @RequestParam(required = false) Set<String> orgUnit, @RequestParam(required = false) Set<String> orgUnitGroup, @RequestParam(required = false) Date created, @RequestParam(required = false) String createdDuration, @RequestParam(required = false) Integer limit, IdSchemes idSchemes, HttpServletRequest request, HttpServletResponse response) throws IOException {
    response.setContentType(CONTENT_TYPE_JSON);
    ExportParams params = registrationExchangeService.paramsFromUrl(dataSet, orgUnit, orgUnitGroup, period, startDate, endDate, includeChildren, created, createdDuration, limit, idSchemes);
    registrationExchangeService.writeCompleteDataSetRegistrationsJson(params, response.getOutputStream());
}
Also used : ExportParams(org.hisp.dhis.dxf2.dataset.ExportParams) DhisApiVersion(org.hisp.dhis.common.DhisApiVersion) ApiVersion(org.hisp.dhis.webapi.mvc.annotation.ApiVersion) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 DhisApiVersion (org.hisp.dhis.common.DhisApiVersion)2 ExportParams (org.hisp.dhis.dxf2.dataset.ExportParams)2 StreamingJsonCompleteDataSetRegistrations (org.hisp.dhis.dxf2.dataset.streaming.StreamingJsonCompleteDataSetRegistrations)2 StreamingXmlCompleteDataSetRegistrations (org.hisp.dhis.dxf2.dataset.streaming.StreamingXmlCompleteDataSetRegistrations)2 MetadataExportParams (org.hisp.dhis.dxf2.metadata.MetadataExportParams)2 ApiVersion (org.hisp.dhis.webapi.mvc.annotation.ApiVersion)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStream (java.io.InputStream)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Transformer (javax.xml.transform.Transformer)1 TransformerFactory (javax.xml.transform.TransformerFactory)1 StreamResult (javax.xml.transform.stream.StreamResult)1 StreamSource (javax.xml.transform.stream.StreamSource)1 IdentifiableObject (org.hisp.dhis.common.IdentifiableObject)1 DataElement (org.hisp.dhis.dataelement.DataElement)1