Search in sources :

Example 1 with StreamingXmlCompleteDataSetRegistrations

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

the class DefaultCompleteDataSetRegistrationExchangeService method saveCompleteDataSetRegistrationsXml.

@Override
public ImportSummary saveCompleteDataSetRegistrationsXml(InputStream in, ImportOptions importOptions, TaskId taskId) {
    try {
        in = StreamUtils.wrapAndCheckCompressionFormat(in);
        CompleteDataSetRegistrations completeDataSetRegistrations = new StreamingXmlCompleteDataSetRegistrations(XMLFactory.getXMLReader(in));
        return saveCompleteDataSetRegistrations(importOptions, taskId, completeDataSetRegistrations);
    } catch (Exception ex) {
        return handleImportError(taskId, ex);
    }
}
Also used : StreamingXmlCompleteDataSetRegistrations(org.hisp.dhis.dxf2.dataset.streaming.StreamingXmlCompleteDataSetRegistrations) StreamingXmlCompleteDataSetRegistrations(org.hisp.dhis.dxf2.dataset.streaming.StreamingXmlCompleteDataSetRegistrations) IllegalQueryException(org.hisp.dhis.common.IllegalQueryException)

Example 2 with StreamingXmlCompleteDataSetRegistrations

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

the class JdbcCompleteDataSetRegistrationExchangeStore method writeCompleteDataSetRegistrationsXml.

//--------------------------------------------------------------------------
// CompleteDataSetRegistrationStore implementation
//--------------------------------------------------------------------------
@Override
public void writeCompleteDataSetRegistrationsXml(ExportParams params, OutputStream outputStream) {
    CompleteDataSetRegistrations cdsr = new StreamingXmlCompleteDataSetRegistrations(XMLFactory.getXMLWriter(outputStream));
    write(params, cdsr);
    IOUtils.closeQuietly(outputStream);
}
Also used : StreamingXmlCompleteDataSetRegistrations(org.hisp.dhis.dxf2.dataset.streaming.StreamingXmlCompleteDataSetRegistrations) StreamingJsonCompleteDataSetRegistrations(org.hisp.dhis.dxf2.dataset.streaming.StreamingJsonCompleteDataSetRegistrations) StreamingXmlCompleteDataSetRegistrations(org.hisp.dhis.dxf2.dataset.streaming.StreamingXmlCompleteDataSetRegistrations)

Aggregations

StreamingXmlCompleteDataSetRegistrations (org.hisp.dhis.dxf2.dataset.streaming.StreamingXmlCompleteDataSetRegistrations)2 IllegalQueryException (org.hisp.dhis.common.IllegalQueryException)1 StreamingJsonCompleteDataSetRegistrations (org.hisp.dhis.dxf2.dataset.streaming.StreamingJsonCompleteDataSetRegistrations)1