Search in sources :

Example 1 with APPLICATION_JSON_VALUE

use of org.springframework.http.MediaType.APPLICATION_JSON_VALUE in project dhis2-core by dhis2.

the class EnrollmentController method postEnrollmentJson.

// -------------------------------------------------------------------------
// CREATE
// -------------------------------------------------------------------------
@PostMapping(value = "", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
@ResponseBody
public WebMessage postEnrollmentJson(@RequestParam(defaultValue = "CREATE_AND_UPDATE") ImportStrategy strategy, ImportOptions importOptions, HttpServletRequest request) throws IOException {
    importOptions.setStrategy(strategy);
    InputStream inputStream = StreamUtils.wrapAndCheckCompressionFormat(request.getInputStream());
    if (!importOptions.isAsync()) {
        ImportSummaries importSummaries = enrollmentService.addEnrollmentsJson(inputStream, importOptions);
        importSummaries.setImportOptions(importOptions);
        importSummaries.getImportSummaries().stream().filter(importSummary -> !importOptions.isDryRun() && !importSummary.getStatus().equals(ImportStatus.ERROR) && !importOptions.getImportStrategy().isDelete() && (!importOptions.getImportStrategy().isSync() || importSummary.getImportCount().getDeleted() == 0)).forEach(importSummary -> importSummary.setHref(ContextUtils.getRootPath(request) + RESOURCE_PATH + "/" + importSummary.getReference()));
        if (importSummaries.getImportSummaries().size() == 1) {
            ImportSummary importSummary = importSummaries.getImportSummaries().get(0);
            importSummary.setImportOptions(importOptions);
            if (!importSummary.getStatus().equals(ImportStatus.ERROR)) {
                importSummaries(importSummaries).setHttpStatus(HttpStatus.CREATED).setLocation("/api/" + "enrollments" + "/" + importSummary.getReference());
            }
        }
        return importSummaries(importSummaries).setHttpStatus(HttpStatus.CREATED);
    }
    return startAsyncImport(importOptions, enrollmentService.getEnrollmentsJson(inputStream));
}
Also used : ImportStrategy(org.hisp.dhis.importexport.ImportStrategy) PathVariable(org.springframework.web.bind.annotation.PathVariable) APPLICATION_XML_VALUE(org.springframework.http.MediaType.APPLICATION_XML_VALUE) RequestParam(org.springframework.web.bind.annotation.RequestParam) Autowired(org.springframework.beans.factory.annotation.Autowired) NodeUtils(org.hisp.dhis.node.NodeUtils) Model(org.springframework.ui.Model) ImportSummary(org.hisp.dhis.dxf2.importsummary.ImportSummary) PutMapping(org.springframework.web.bind.annotation.PutMapping) Map(java.util.Map) PagerUtils(org.hisp.dhis.common.PagerUtils) JobConfiguration(org.hisp.dhis.scheduling.JobConfiguration) DeleteMapping(org.springframework.web.bind.annotation.DeleteMapping) EnrollmentService(org.hisp.dhis.dxf2.events.enrollment.EnrollmentService) PostMapping(org.springframework.web.bind.annotation.PostMapping) ImportEnrollmentsTask(org.hisp.dhis.dxf2.events.enrollment.ImportEnrollmentsTask) ProgramInstanceQueryParams(org.hisp.dhis.program.ProgramInstanceQueryParams) ContextService(org.hisp.dhis.webapi.service.ContextService) FieldFilterService(org.hisp.dhis.fieldfilter.FieldFilterService) Set(java.util.Set) Collectors(java.util.stream.Collectors) Enrollments(org.hisp.dhis.dxf2.events.enrollment.Enrollments) EnrollmentCriteria(org.hisp.dhis.webapi.controller.event.webrequest.EnrollmentCriteria) List(java.util.List) FieldFilterParams(org.hisp.dhis.fieldfilter.FieldFilterParams) ProgramInstanceService(org.hisp.dhis.program.ProgramInstanceService) AsyncTaskExecutor(org.hisp.dhis.common.AsyncTaskExecutor) Enrollment(org.hisp.dhis.dxf2.events.enrollment.Enrollment) WebMessage(org.hisp.dhis.dxf2.webmessage.WebMessage) RootNode(org.hisp.dhis.node.types.RootNode) DhisApiVersion(org.hisp.dhis.common.DhisApiVersion) WebMessageUtils.notFound(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.notFound) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ENROLLMENT_IMPORT(org.hisp.dhis.scheduling.JobType.ENROLLMENT_IMPORT) Controller(org.springframework.stereotype.Controller) StreamUtils(org.hisp.dhis.commons.util.StreamUtils) ApiVersion(org.hisp.dhis.webapi.mvc.annotation.ApiVersion) HttpServletRequest(javax.servlet.http.HttpServletRequest) Lists(com.google.common.collect.Lists) SlimPager(org.hisp.dhis.common.SlimPager) WebMessageUtils.importSummaries(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.importSummaries) EnrollmentCriteriaMapper(org.hisp.dhis.webapi.controller.event.mapper.EnrollmentCriteriaMapper) WebMessageUtils.importSummary(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.importSummary) GetMapping(org.springframework.web.bind.annotation.GetMapping) WebMessageUtils.jobConfigurationReport(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.jobConfigurationReport) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) ImportStatus(org.hisp.dhis.dxf2.importsummary.ImportStatus) ContextUtils(org.hisp.dhis.webapi.utils.ContextUtils) NotFoundException(org.hisp.dhis.webapi.controller.exception.NotFoundException) IOException(java.io.IOException) APPLICATION_JSON_VALUE(org.springframework.http.MediaType.APPLICATION_JSON_VALUE) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) ImportOptions(org.hisp.dhis.dxf2.common.ImportOptions) ImportSummaries(org.hisp.dhis.dxf2.importsummary.ImportSummaries) HttpStatus(org.springframework.http.HttpStatus) CurrentUserService(org.hisp.dhis.user.CurrentUserService) InputStream(java.io.InputStream) TextUtils(org.hisp.dhis.commons.util.TextUtils) InputStream(java.io.InputStream) ImportSummary(org.hisp.dhis.dxf2.importsummary.ImportSummary) ImportSummaries(org.hisp.dhis.dxf2.importsummary.ImportSummaries) PostMapping(org.springframework.web.bind.annotation.PostMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with APPLICATION_JSON_VALUE

use of org.springframework.http.MediaType.APPLICATION_JSON_VALUE in project molgenis by molgenis.

the class RestControllerV2 method createEntities.

/**
 * Try to create multiple entities in one transaction. If one fails all fails.
 *
 * @param entityTypeId name of the entity where the entities are going to be added.
 * @param request      EntityCollectionCreateRequestV2
 * @param response     HttpServletResponse
 * @return EntityCollectionCreateResponseBodyV2
 */
@Transactional
@PostMapping(value = "/{entityTypeId}", produces = APPLICATION_JSON_VALUE)
public EntityCollectionBatchCreateResponseBodyV2 createEntities(@PathVariable("entityTypeId") String entityTypeId, @RequestBody @Valid EntityCollectionBatchRequestV2 request, HttpServletResponse response) throws Exception {
    final EntityType meta = dataService.getEntityType(entityTypeId);
    if (meta == null) {
        throw createUnknownEntityException(entityTypeId);
    }
    try {
        final List<Entity> entities = request.getEntities().stream().map(e -> this.restService.toEntity(meta, e)).collect(toList());
        final EntityCollectionBatchCreateResponseBodyV2 responseBody = new EntityCollectionBatchCreateResponseBodyV2();
        final List<String> ids = new ArrayList<>();
        // Add all entities
        if (ATTRIBUTE_META_DATA.equals(entityTypeId)) {
            entities.stream().map(attribute -> (Attribute) attribute).forEach(attribute -> dataService.getMeta().addAttribute(attribute));
        } else {
            this.dataService.add(entityTypeId, entities.stream());
        }
        entities.forEach(entity -> {
            restService.updateMappedByEntities(entity);
            String id = entity.getIdValue().toString();
            ids.add(id);
            responseBody.getResources().add(new AutoValue_ResourcesResponseV2(Href.concatEntityHref(RestControllerV2.BASE_URI, entityTypeId, id)));
        });
        responseBody.setLocation(Href.concatEntityCollectionHref(RestControllerV2.BASE_URI, entityTypeId, meta.getIdAttribute().getName(), ids));
        response.setStatus(HttpServletResponse.SC_CREATED);
        return responseBody;
    } catch (Exception e) {
        response.setStatus(HttpServletResponse.SC_NO_CONTENT);
        throw e;
    }
}
Also used : EntityType(org.molgenis.data.meta.model.EntityType) LocaleContextHolder(org.springframework.context.i18n.LocaleContextHolder) ConversionFailedException(org.springframework.core.convert.ConversionFailedException) UriComponentsBuilder(org.springframework.web.util.UriComponentsBuilder) RestService(org.molgenis.data.rest.service.RestService) RepositoryCopier(org.molgenis.data.support.RepositoryCopier) ErrorMessageResponse(org.molgenis.web.ErrorMessageResponse) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) RunAsSystemAspect.runAsSystem(org.molgenis.security.core.runas.RunAsSystemAspect.runAsSystem) PermissionSystemService(org.molgenis.data.security.permission.PermissionSystemService) Attribute(org.molgenis.data.meta.model.Attribute) TEXT_PLAIN_VALUE(org.springframework.http.MediaType.TEXT_PLAIN_VALUE) Valid(javax.validation.Valid) BASE_URI(org.molgenis.data.rest.v2.RestControllerV2.BASE_URI) EntityTypeIdentity(org.molgenis.data.security.EntityTypeIdentity) Collectors.toSet(java.util.stream.Collectors.toSet) LanguageService(org.molgenis.i18n.LanguageService) org.molgenis.data(org.molgenis.data) EntityTypeUtils(org.molgenis.data.support.EntityTypeUtils) Instant(java.time.Instant) EntityType(org.molgenis.data.meta.model.EntityType) String.format(java.lang.String.format) MEDIUM(java.time.format.FormatStyle.MEDIUM) UnexpectedEnumException(org.molgenis.util.UnexpectedEnumException) Stream(java.util.stream.Stream) UserPermissionEvaluator(org.molgenis.security.core.UserPermissionEvaluator) LocalDate(java.time.LocalDate) org.springframework.web.bind.annotation(org.springframework.web.bind.annotation) EntityPager(org.molgenis.data.rest.EntityPager) java.util(java.util) NameValidator(org.molgenis.data.validation.meta.NameValidator) LocalizationService(org.molgenis.data.i18n.LocalizationService) QueryImpl(org.molgenis.data.support.QueryImpl) Lists.transform(com.google.common.collect.Lists.transform) EntityTypePermission(org.molgenis.data.security.EntityTypePermission) Value(org.springframework.beans.factory.annotation.Value) HttpServletRequest(javax.servlet.http.HttpServletRequest) AggregateResult(org.molgenis.data.aggregation.AggregateResult) EntityUtils.getTypedValue(org.molgenis.data.util.EntityUtils.getTypedValue) Objects.requireNonNull(java.util.Objects.requireNonNull) AttributeFilterToFetchConverter.createDefaultAttributeFetch(org.molgenis.data.rest.v2.AttributeFilterToFetchConverter.createDefaultAttributeFetch) Href(org.molgenis.core.ui.data.support.Href) ATTRIBUTE_META_DATA(org.molgenis.data.meta.model.AttributeMetadata.ATTRIBUTE_META_DATA) AttributeType(org.molgenis.data.meta.AttributeType) Logger(org.slf4j.Logger) AggregateQuery(org.molgenis.data.aggregation.AggregateQuery) StringWriter(java.io.StringWriter) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) MethodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException) APPLICATION_JSON_VALUE(org.springframework.http.MediaType.APPLICATION_JSON_VALUE) HttpMessageNotReadableException(org.springframework.http.converter.HttpMessageNotReadableException) ErrorMessage(org.molgenis.web.ErrorMessageResponse.ErrorMessage) HttpStatus(org.springframework.http.HttpStatus) Collectors.toList(java.util.stream.Collectors.toList) DateTimeFormatter(java.time.format.DateTimeFormatter) ZonedDateTime.now(java.time.ZonedDateTime.now) Package(org.molgenis.data.meta.model.Package) Transactional(org.springframework.transaction.annotation.Transactional) Attribute(org.molgenis.data.meta.model.Attribute) ConversionFailedException(org.springframework.core.convert.ConversionFailedException) UnexpectedEnumException(org.molgenis.util.UnexpectedEnumException) IOException(java.io.IOException) MethodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException) HttpMessageNotReadableException(org.springframework.http.converter.HttpMessageNotReadableException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with APPLICATION_JSON_VALUE

use of org.springframework.http.MediaType.APPLICATION_JSON_VALUE in project data-prep by Talend.

the class DataSetAPI method listSummary.

@RequestMapping(value = "/api/datasets/summary", method = GET, produces = APPLICATION_JSON_VALUE)
@ApiOperation(value = "List data sets summary.", produces = APPLICATION_JSON_VALUE, notes = "Returns a list of data sets summary the user can use.")
@Timed
public Callable<Stream<EnrichedDataSetMetadata>> listSummary(@ApiParam(value = "Sort key (by name or date), defaults to 'date'.") @RequestParam(defaultValue = "creationDate") Sort sort, @ApiParam(value = "Order for sort key (desc or asc), defaults to 'desc'.") @RequestParam(defaultValue = "desc") Order order, @ApiParam(value = "Filter on name containing the specified name") @RequestParam(defaultValue = "") String name, @ApiParam(value = "Filter on certified data sets") @RequestParam(defaultValue = "false") boolean certified, @ApiParam(value = "Filter on favorite data sets") @RequestParam(defaultValue = "false") boolean favorite, @ApiParam(value = "Filter on recent data sets") @RequestParam(defaultValue = "false") boolean limit) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("Listing datasets summary (pool: {})...", getConnectionStats());
    }
    return () -> {
        GenericCommand<InputStream> listDataSets = getCommand(DataSetList.class, sort, order, name, certified, favorite, limit);
        return // 
        Flux.from(CommandHelper.toPublisher(UserDataSetMetadata.class, mapper, listDataSets)).map(m -> {
            LOG.debug("found dataset {} in the summary list" + m.getName());
            // Add the related preparations list to the given dataset metadata.
            final PreparationSearchByDataSetId getPreparations = getCommand(PreparationSearchByDataSetId.class, m.getId());
            return // 
            Flux.from(CommandHelper.toPublisher(Preparation.class, mapper, getPreparations)).collectList().map(preparations -> {
                final List<Preparation> list = // 
                preparations.stream().filter(// 
                p -> p.getSteps() != null).collect(Collectors.toList());
                return new EnrichedDataSetMetadata(m, list);
            }).block();
        }).toStream(1);
    };
}
Also used : PathVariable(org.springframework.web.bind.annotation.PathVariable) StringUtils(org.apache.commons.lang.StringUtils) RequestParam(org.springframework.web.bind.annotation.RequestParam) DataSetGet(org.talend.dataprep.command.dataset.DataSetGet) UpdateDataSet(org.talend.dataprep.api.service.command.dataset.UpdateDataSet) PUT(org.springframework.web.bind.annotation.RequestMethod.PUT) ApiParam(io.swagger.annotations.ApiParam) DataSetGetEncodings(org.talend.dataprep.api.service.command.dataset.DataSetGetEncodings) SetFavorite(org.talend.dataprep.api.service.command.dataset.SetFavorite) CommandHelper.toStream(org.talend.dataprep.command.CommandHelper.toStream) TEXT_PLAIN_VALUE(org.springframework.http.MediaType.TEXT_PLAIN_VALUE) CommandHelper.toStreaming(org.talend.dataprep.command.CommandHelper.toStreaming) DataSetGetImports(org.talend.dataprep.api.service.command.dataset.DataSetGetImports) SemanticDomain(org.talend.dataprep.api.dataset.statistics.SemanticDomain) ApiOperation(io.swagger.annotations.ApiOperation) DataSetMetadata(org.talend.dataprep.api.dataset.DataSetMetadata) UserDataSetMetadata(org.talend.dataprep.dataset.service.UserDataSetMetadata) Order(org.talend.dataprep.util.SortAndOrderHelper.Order) MediaType(org.springframework.http.MediaType) UpdateColumn(org.talend.dataprep.api.service.command.dataset.UpdateColumn) PublicAPI(org.talend.dataprep.security.PublicAPI) StreamingResponseBody(org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody) Collectors(java.util.stream.Collectors) RestController(org.springframework.web.bind.annotation.RestController) DataSetPreview(org.talend.dataprep.api.service.command.dataset.DataSetPreview) List(java.util.List) HystrixCommand(com.netflix.hystrix.HystrixCommand) Stream(java.util.stream.Stream) GetDataSetColumnTypes(org.talend.dataprep.api.service.command.dataset.GetDataSetColumnTypes) CommandHelper.toPublisher(org.talend.dataprep.command.CommandHelper.toPublisher) RequestHeader(org.springframework.web.bind.annotation.RequestHeader) PreparationList(org.talend.dataprep.api.service.command.preparation.PreparationList) CopyDataSet(org.talend.dataprep.api.service.command.dataset.CopyDataSet) GenericCommand(org.talend.dataprep.command.GenericCommand) EnrichedDataSetMetadata(org.talend.dataprep.api.service.api.EnrichedDataSetMetadata) SuggestLookupActions(org.talend.dataprep.api.service.command.transformation.SuggestLookupActions) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Callable(java.util.concurrent.Callable) CreateOrUpdateDataSet(org.talend.dataprep.api.service.command.dataset.CreateOrUpdateDataSet) SortAndOrderHelper(org.talend.dataprep.util.SortAndOrderHelper) GET(org.springframework.web.bind.annotation.RequestMethod.GET) PreparationSearchByDataSetId(org.talend.dataprep.api.service.command.preparation.PreparationSearchByDataSetId) DataSetList(org.talend.dataprep.api.service.command.dataset.DataSetList) Import(org.talend.dataprep.api.dataset.Import) CONTENT_TYPE(org.springframework.http.HttpHeaders.CONTENT_TYPE) CompatibleDataSetList(org.talend.dataprep.api.service.command.dataset.CompatibleDataSetList) POST(org.springframework.web.bind.annotation.RequestMethod.POST) Preparation(org.talend.dataprep.api.preparation.Preparation) DataSetGetImportParameters(org.talend.dataprep.api.service.command.dataset.DataSetGetImportParameters) DELETE(org.springframework.web.bind.annotation.RequestMethod.DELETE) HttpResponseContext(org.talend.dataprep.http.HttpResponseContext) CreateDataSet(org.talend.dataprep.api.service.command.dataset.CreateDataSet) Sort(org.talend.dataprep.util.SortAndOrderHelper.Sort) Mono(reactor.core.publisher.Mono) APPLICATION_JSON_VALUE(org.springframework.http.MediaType.APPLICATION_JSON_VALUE) Flux(reactor.core.publisher.Flux) DataSetDelete(org.talend.dataprep.api.service.command.dataset.DataSetDelete) DataSetGetMetadata(org.talend.dataprep.command.dataset.DataSetGetMetadata) ResponseEntity(org.springframework.http.ResponseEntity) CommandHelper(org.talend.dataprep.command.CommandHelper) SuggestDataSetActions(org.talend.dataprep.api.service.command.transformation.SuggestDataSetActions) Timed(org.talend.dataprep.metrics.Timed) InputStream(java.io.InputStream) EnrichedDataSetMetadata(org.talend.dataprep.api.service.api.EnrichedDataSetMetadata) GenericCommand(org.talend.dataprep.command.GenericCommand) PreparationSearchByDataSetId(org.talend.dataprep.api.service.command.preparation.PreparationSearchByDataSetId) List(java.util.List) PreparationList(org.talend.dataprep.api.service.command.preparation.PreparationList) DataSetList(org.talend.dataprep.api.service.command.dataset.DataSetList) CompatibleDataSetList(org.talend.dataprep.api.service.command.dataset.CompatibleDataSetList) DataSetList(org.talend.dataprep.api.service.command.dataset.DataSetList) CompatibleDataSetList(org.talend.dataprep.api.service.command.dataset.CompatibleDataSetList) Timed(org.talend.dataprep.metrics.Timed) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with APPLICATION_JSON_VALUE

use of org.springframework.http.MediaType.APPLICATION_JSON_VALUE in project dhis2-core by dhis2.

the class TrackerImportController method getJobReport.

@GetMapping(value = "/jobs/{uid}/report", produces = APPLICATION_JSON_VALUE)
public TrackerImportReport getJobReport(@PathVariable String uid, @RequestParam(defaultValue = "errors", required = false) String reportMode, HttpServletResponse response) throws HttpStatusCodeException, NotFoundException {
    TrackerBundleReportMode trackerBundleReportMode = TrackerBundleReportMode.getTrackerBundleReportMode(reportMode);
    setNoStore(response);
    return Optional.ofNullable(notifier.getJobSummaryByJobId(JobType.TRACKER_IMPORT_JOB, uid)).map(report -> trackerImportService.buildImportReport((TrackerImportReport) report, trackerBundleReportMode)).orElseThrow(() -> NotFoundException.notFoundUid(uid));
}
Also used : DhisApiVersion(org.hisp.dhis.common.DhisApiVersion) PathVariable(org.springframework.web.bind.annotation.PathVariable) ContextUtils.setNoStore(org.hisp.dhis.webapi.utils.ContextUtils.setNoStore) RequestParam(org.springframework.web.bind.annotation.RequestParam) HttpStatusCodeException(org.springframework.web.client.HttpStatusCodeException) RequiredArgsConstructor(lombok.RequiredArgsConstructor) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) TrackerImportService(org.hisp.dhis.tracker.TrackerImportService) Deque(java.util.Deque) StreamUtils(org.hisp.dhis.commons.util.StreamUtils) ApiVersion(org.hisp.dhis.webapi.mvc.annotation.ApiVersion) CurrentUser(org.hisp.dhis.user.CurrentUser) Notifier(org.hisp.dhis.system.notification.Notifier) RequestBody(org.springframework.web.bind.annotation.RequestBody) WebMessageUtils.ok(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.ok) HttpServletRequest(javax.servlet.http.HttpServletRequest) TrackerStatus(org.hisp.dhis.tracker.report.TrackerStatus) TrackerImportReportRequest(org.hisp.dhis.webapi.controller.tracker.TrackerImportReportRequest) TrackerJobWebMessageResponse(org.hisp.dhis.tracker.job.TrackerJobWebMessageResponse) JobType(org.hisp.dhis.scheduling.JobType) User(org.hisp.dhis.user.User) GetMapping(org.springframework.web.bind.annotation.GetMapping) SecurityContextHolder(org.springframework.security.core.context.SecurityContextHolder) TrackerBundleParams(org.hisp.dhis.webapi.controller.tracker.TrackerBundleParams) Event(org.hisp.dhis.tracker.domain.Event) ContextUtils(org.hisp.dhis.webapi.utils.ContextUtils) PostMapping(org.springframework.web.bind.annotation.PostMapping) NotFoundException(org.hisp.dhis.webapi.controller.exception.NotFoundException) ContextService(org.hisp.dhis.webapi.service.ContextService) CsvEventService(org.hisp.dhis.dxf2.events.event.csv.CsvEventService) Notification(org.hisp.dhis.system.notification.Notification) TrackerImportStrategyHandler(org.hisp.dhis.webapi.strategy.tracker.imports.TrackerImportStrategyHandler) HttpServletResponse(javax.servlet.http.HttpServletResponse) TrackerImportReport(org.hisp.dhis.tracker.report.TrackerImportReport) IOException(java.io.IOException) APPLICATION_JSON_VALUE(org.springframework.http.MediaType.APPLICATION_JSON_VALUE) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RestController(org.springframework.web.bind.annotation.RestController) HttpStatus(org.springframework.http.HttpStatus) List(java.util.List) TrackerBundleReportMode(org.hisp.dhis.tracker.TrackerBundleReportMode) ParseException(org.locationtech.jts.io.ParseException) Optional(java.util.Optional) RESOURCE_PATH(org.hisp.dhis.webapi.controller.tracker.TrackerControllerSupport.RESOURCE_PATH) CodeGenerator(org.hisp.dhis.common.CodeGenerator) ResponseEntity(org.springframework.http.ResponseEntity) WebMessage(org.hisp.dhis.dxf2.webmessage.WebMessage) InputStream(java.io.InputStream) TrackerBundleReportMode(org.hisp.dhis.tracker.TrackerBundleReportMode) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 List (java.util.List)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 APPLICATION_JSON_VALUE (org.springframework.http.MediaType.APPLICATION_JSON_VALUE)3 Collectors (java.util.stream.Collectors)2 Stream (java.util.stream.Stream)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2 DhisApiVersion (org.hisp.dhis.common.DhisApiVersion)2 StreamUtils (org.hisp.dhis.commons.util.StreamUtils)2 HttpStatus (org.springframework.http.HttpStatus)2 TEXT_PLAIN_VALUE (org.springframework.http.MediaType.TEXT_PLAIN_VALUE)2 ResponseEntity (org.springframework.http.ResponseEntity)2 PathVariable (org.springframework.web.bind.annotation.PathVariable)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 RequestParam (org.springframework.web.bind.annotation.RequestParam)2 RestController (org.springframework.web.bind.annotation.RestController)2 Lists (com.google.common.collect.Lists)1 Lists.transform (com.google.common.collect.Lists.transform)1 HystrixCommand (com.netflix.hystrix.HystrixCommand)1