Search in sources :

Example 16 with RequestBody

use of org.springframework.web.bind.annotation.RequestBody in project dhis2-core by dhis2.

the class SystemSettingController method setSystemSettingV29.

@PostMapping(consumes = ContextUtils.CONTENT_TYPE_JSON)
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@ResponseBody
public WebMessage setSystemSettingV29(@RequestBody Map<String, Object> settings) {
    List<String> invalidKeys = settings.keySet().stream().filter((key) -> !SettingKey.getByName(key).isPresent()).collect(Collectors.toList());
    if (!invalidKeys.isEmpty()) {
        return conflict("Key(s) is not supported: " + StringUtils.join(invalidKeys, ", "));
    }
    for (Entry<String, Object> entry : settings.entrySet()) {
        String key = entry.getKey();
        Serializable valueObject = SettingKey.getAsRealClass(key, entry.getValue().toString());
        systemSettingManager.saveSystemSetting(SettingKey.getByName(key).get(), valueObject);
    }
    return ok("System settings imported");
}
Also used : DhisApiVersion(org.hisp.dhis.common.DhisApiVersion) PathVariable(org.springframework.web.bind.annotation.PathVariable) Arrays(java.util.Arrays) RequestParam(org.springframework.web.bind.annotation.RequestParam) WebMessageException(org.hisp.dhis.dxf2.webmessage.WebMessageException) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) RenderService(org.hisp.dhis.render.RenderService) UserSettingKey(org.hisp.dhis.user.UserSettingKey) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Controller(org.springframework.stereotype.Controller) ApiVersion(org.hisp.dhis.webapi.mvc.annotation.ApiVersion) StringUtils(org.apache.commons.lang3.StringUtils) CacheControl(org.springframework.http.CacheControl) CurrentUser(org.hisp.dhis.user.CurrentUser) HashSet(java.util.HashSet) RequestBody(org.springframework.web.bind.annotation.RequestBody) WebMessageUtils.ok(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.ok) HttpServletRequest(javax.servlet.http.HttpServletRequest) UserSettingService(org.hisp.dhis.user.UserSettingService) Locale(java.util.Locale) Map(java.util.Map) User(org.hisp.dhis.user.User) GetMapping(org.springframework.web.bind.annotation.GetMapping) Collections.singletonMap(java.util.Collections.singletonMap) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) DeleteMapping(org.springframework.web.bind.annotation.DeleteMapping) SystemSettingManager(org.hisp.dhis.setting.SystemSettingManager) ContextUtils(org.hisp.dhis.webapi.utils.ContextUtils) PostMapping(org.springframework.web.bind.annotation.PostMapping) HttpServletResponse(javax.servlet.http.HttpServletResponse) Set(java.util.Set) APPLICATION_JSON_VALUE(org.springframework.http.MediaType.APPLICATION_JSON_VALUE) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) Collectors(java.util.stream.Collectors) Serializable(java.io.Serializable) ObjectUtils(org.hisp.dhis.util.ObjectUtils) HttpStatus(org.springframework.http.HttpStatus) List(java.util.List) WebMessageUtils.conflict(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.conflict) Entry(java.util.Map.Entry) Optional(java.util.Optional) ResponseEntity(org.springframework.http.ResponseEntity) SettingKey(org.hisp.dhis.setting.SettingKey) AllArgsConstructor(lombok.AllArgsConstructor) WebMessage(org.hisp.dhis.dxf2.webmessage.WebMessage) Serializable(java.io.Serializable) PostMapping(org.springframework.web.bind.annotation.PostMapping) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 17 with RequestBody

use of org.springframework.web.bind.annotation.RequestBody in project dhis2-core by dhis2.

the class DataValueController method setDataValuesFollowUp.

@PutMapping(value = "/followups")
@ResponseStatus(value = HttpStatus.OK)
public void setDataValuesFollowUp(@RequestBody DataValuesFollowUpRequest request) {
    List<DataValueFollowUpRequest> values = request == null ? null : request.getValues();
    if (values == null || values.isEmpty() || values.stream().anyMatch(e -> e.getFollowup() == null)) {
        throw new IllegalQueryException(ErrorCode.E2033);
    }
    List<DataValue> dataValues = new ArrayList<>();
    for (DataValueFollowUpRequest e : values) {
        DataValue dataValue = dataValueValidation.getAndValidateDataValue(e);
        dataValue.setFollowup(e.getFollowup());
    }
    dataValueService.updateDataValues(dataValues);
}
Also used : ContextUtils.setNoStore(org.hisp.dhis.webapi.utils.ContextUtils.setNoStore) RequestParam(org.springframework.web.bind.annotation.RequestParam) Date(java.util.Date) ValueType(org.hisp.dhis.common.ValueType) WebMessageException(org.hisp.dhis.dxf2.webmessage.WebMessageException) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) RequiredArgsConstructor(lombok.RequiredArgsConstructor) StringUtils(org.apache.commons.lang3.StringUtils) FileResourceStorageStatus(org.hisp.dhis.fileresource.FileResourceStorageStatus) CurrentUser(org.hisp.dhis.user.CurrentUser) Model(org.springframework.ui.Model) PutMapping(org.springframework.web.bind.annotation.PutMapping) FileResourceService(org.hisp.dhis.fileresource.FileResourceService) InputUtils(org.hisp.dhis.dxf2.util.InputUtils) DeleteMapping(org.springframework.web.bind.annotation.DeleteMapping) Status(org.hisp.dhis.feedback.Status) Period(org.hisp.dhis.period.Period) PostMapping(org.springframework.web.bind.annotation.PostMapping) HttpHeaders(org.springframework.http.HttpHeaders) List(java.util.List) FileResourceUtils(org.hisp.dhis.webapi.utils.FileResourceUtils) CategoryOptionCombo(org.hisp.dhis.category.CategoryOptionCombo) WebMessageUtils.conflict(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.conflict) WebMessage(org.hisp.dhis.dxf2.webmessage.WebMessage) DhisApiVersion(org.hisp.dhis.common.DhisApiVersion) WebMessageUtils.notFound(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.notFound) DataSet(org.hisp.dhis.dataset.DataSet) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Controller(org.springframework.stereotype.Controller) IllegalQueryException(org.hisp.dhis.common.IllegalQueryException) ApiVersion(org.hisp.dhis.webapi.mvc.annotation.ApiVersion) ArrayList(java.util.ArrayList) DataElement(org.hisp.dhis.dataelement.DataElement) RequestBody(org.springframework.web.bind.annotation.RequestBody) HttpServletRequest(javax.servlet.http.HttpServletRequest) DataValueService(org.hisp.dhis.datavalue.DataValueService) AuthorizationException(org.jclouds.rest.AuthorizationException) WebMessageUtils.error(org.hisp.dhis.dxf2.webmessage.WebMessageUtils.error) User(org.hisp.dhis.user.User) GetMapping(org.springframework.web.bind.annotation.GetMapping) ErrorCode(org.hisp.dhis.feedback.ErrorCode) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) SystemSettingManager(org.hisp.dhis.setting.SystemSettingManager) DataValuesFollowUpRequest(org.hisp.dhis.webapi.webdomain.DataValuesFollowUpRequest) FileResourceRetentionStrategy(org.hisp.dhis.fileresource.FileResourceRetentionStrategy) FileResource(org.hisp.dhis.fileresource.FileResource) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) OrganisationUnit(org.hisp.dhis.organisationunit.OrganisationUnit) DataValueFollowUpRequest(org.hisp.dhis.webapi.webdomain.DataValueFollowUpRequest) HttpStatus(org.springframework.http.HttpStatus) FileResourceWebMessageResponse(org.hisp.dhis.dxf2.webmessage.responses.FileResourceWebMessageResponse) DataValue(org.hisp.dhis.datavalue.DataValue) MultipartFile(org.springframework.web.multipart.MultipartFile) SettingKey(org.hisp.dhis.setting.SettingKey) FileResourceDomain(org.hisp.dhis.fileresource.FileResourceDomain) DataValueFollowUpRequest(org.hisp.dhis.webapi.webdomain.DataValueFollowUpRequest) DataValue(org.hisp.dhis.datavalue.DataValue) ArrayList(java.util.ArrayList) IllegalQueryException(org.hisp.dhis.common.IllegalQueryException) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) PutMapping(org.springframework.web.bind.annotation.PutMapping)

Example 18 with RequestBody

use of org.springframework.web.bind.annotation.RequestBody in project vorto by eclipse.

the class NamespaceController method requestAccessToNamespace.

@PostMapping("/requestAccess")
@PreAuthorize("isAuthenticated()")
public ResponseEntity<OperationResult> requestAccessToNamespace(@RequestBody @ApiParam(value = "The request body specifying who initiates the request, the namespace, whom the request is intended for, and an optional collection of suggested roles", required = true) NamespaceAccessRequestDTO request) {
    Optional<OperationResult> validationError = NamespaceValidator.validateAccessRequest(request);
    if (validationError.isPresent()) {
        return new ResponseEntity<>(validationError.get(), HttpStatus.BAD_REQUEST);
    }
    // checks namespace exists
    // should only occur if namespace was deleted after user search, but before sending request
    Namespace target;
    try {
        target = namespaceService.getByName(request.getNamespaceName());
    } catch (DoesNotExistException dnee) {
        return new ResponseEntity<>(OperationResult.failure("Namespace not found."), HttpStatus.NOT_FOUND);
    }
    // checks any admin with an e-mail address set
    Set<User> adminsWithEmail = userNamespaceRoleRepository.findAllByNamespace(target).stream().map(UserNamespaceRoles::getUser).filter(u -> !Strings.nullToEmpty(u.getEmailAddress()).trim().isEmpty()).collect(Collectors.toSet());
    if (adminsWithEmail.isEmpty()) {
        return new ResponseEntity<>(OperationResult.failure(String.format("None of the users administrating namespace %s has set their own e-mail. Please contact them directly. ", request.getNamespaceName())), HttpStatus.PRECONDITION_FAILED);
    }
    int successCount = adminsWithEmail.size();
    // attempts to send the e-mails
    // ugly exception handling here, due to the way this was designed in the service
    Collection<IMessage> messages = adminsWithEmail.stream().map(u -> new RequestAccessToNamespaceMessage(request, u, host)).collect(Collectors.toList());
    for (IMessage message : messages) {
        try {
            emailNotificationService.sendNotification(message);
        } catch (NotificationProblem np) {
            successCount--;
        }
    }
    // worked for all recipients
    if (successCount == adminsWithEmail.size()) {
        return new ResponseEntity<>(OperationResult.success(), HttpStatus.OK);
    } else // worked for some recipients
    if (successCount > 0) {
        return new ResponseEntity<>(OperationResult.success("The message could not be sent to all administrators."), HttpStatus.OK);
    } else // did not work for any recipient
    {
        return new ResponseEntity<>(OperationResult.failure("The message could not be sent to any administrator."), HttpStatus.SERVICE_UNAVAILABLE);
    }
}
Also used : OperationResult(org.eclipse.vorto.repository.web.api.v1.dto.OperationResult) PathVariable(org.springframework.web.bind.annotation.PathVariable) DoesNotExistException(org.eclipse.vorto.repository.services.exceptions.DoesNotExistException) NamespaceValidator(org.eclipse.vorto.repository.web.api.v1.util.NamespaceValidator) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) UserNamespaceRoles(org.eclipse.vorto.repository.domain.UserNamespaceRoles) EntityDTOConverter(org.eclipse.vorto.repository.web.api.v1.util.EntityDTOConverter) ApiParam(io.swagger.annotations.ApiParam) Autowired(org.springframework.beans.factory.annotation.Autowired) PrivateNamespaceQuotaExceededException(org.eclipse.vorto.repository.services.exceptions.PrivateNamespaceQuotaExceededException) PutMapping(org.springframework.web.bind.annotation.PutMapping) Map(java.util.Map) SecurityContextHolder(org.springframework.security.core.context.SecurityContextHolder) DeleteMapping(org.springframework.web.bind.annotation.DeleteMapping) RequestAccessToNamespaceMessage(org.eclipse.vorto.repository.notification.message.RequestAccessToNamespaceMessage) PostMapping(org.springframework.web.bind.annotation.PostMapping) Collection(java.util.Collection) UserService(org.eclipse.vorto.repository.services.UserService) Set(java.util.Set) OperationForbiddenException(org.eclipse.vorto.repository.services.exceptions.OperationForbiddenException) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) IRole(org.eclipse.vorto.repository.domain.IRole) User(org.eclipse.vorto.repository.domain.User) Collectors(java.util.stream.Collectors) Namespace(org.eclipse.vorto.repository.domain.Namespace) RestController(org.springframework.web.bind.annotation.RestController) IMessage(org.eclipse.vorto.repository.notification.IMessage) Optional(java.util.Optional) NameSyntaxException(org.eclipse.vorto.repository.services.exceptions.NameSyntaxException) IUserContext(org.eclipse.vorto.repository.core.IUserContext) NotificationProblem(org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) Value(org.springframework.beans.factory.annotation.Value) RequestBody(org.springframework.web.bind.annotation.RequestBody) Strings(com.google.common.base.Strings) UserNamespaceRoleRepository(org.eclipse.vorto.repository.repositories.UserNamespaceRoleRepository) INotificationService(org.eclipse.vorto.repository.notification.INotificationService) Collaborator(org.eclipse.vorto.repository.web.api.v1.dto.Collaborator) GetMapping(org.springframework.web.bind.annotation.GetMapping) InvalidUserException(org.eclipse.vorto.repository.services.exceptions.InvalidUserException) CollisionException(org.eclipse.vorto.repository.services.exceptions.CollisionException) NamespaceDto(org.eclipse.vorto.repository.web.api.v1.dto.NamespaceDto) UserNamespaceRoleService(org.eclipse.vorto.repository.services.UserNamespaceRoleService) NamespaceService(org.eclipse.vorto.repository.services.NamespaceService) UserUtil(org.eclipse.vorto.repository.services.UserUtil) HttpStatus(org.springframework.http.HttpStatus) NamespaceRepository(org.eclipse.vorto.repository.repositories.NamespaceRepository) NamespaceAccessRequestDTO(org.eclipse.vorto.repository.web.api.v1.dto.NamespaceAccessRequestDTO) ResponseEntity(org.springframework.http.ResponseEntity) Comparator(java.util.Comparator) Collections(java.util.Collections) UserContext(org.eclipse.vorto.repository.core.impl.UserContext) DoesNotExistException(org.eclipse.vorto.repository.services.exceptions.DoesNotExistException) User(org.eclipse.vorto.repository.domain.User) IMessage(org.eclipse.vorto.repository.notification.IMessage) OperationResult(org.eclipse.vorto.repository.web.api.v1.dto.OperationResult) RequestAccessToNamespaceMessage(org.eclipse.vorto.repository.notification.message.RequestAccessToNamespaceMessage) Namespace(org.eclipse.vorto.repository.domain.Namespace) ResponseEntity(org.springframework.http.ResponseEntity) UserNamespaceRoles(org.eclipse.vorto.repository.domain.UserNamespaceRoles) NotificationProblem(org.eclipse.vorto.repository.notification.INotificationService.NotificationProblem) PostMapping(org.springframework.web.bind.annotation.PostMapping) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize)

Example 19 with RequestBody

use of org.springframework.web.bind.annotation.RequestBody in project data-prep by Talend.

the class DataSetService method updateDataSet.

/**
 * Updates a data set metadata. If no data set exists for given id, a {@link TDPException} is thrown.
 *
 * @param dataSetId The id of data set to be updated.
 * @param dataSetMetadata The new content for the data set. If empty, existing content will <b>not</b> be replaced.
 * For delete operation, look at {@link #delete(String)}.
 */
@RequestMapping(value = "/datasets/{id}", method = PUT)
@ApiOperation(value = "Update a data set metadata by id", notes = "Update a data set metadata according to the content of the PUT body. Id should be a UUID returned by the list operation. Not valid or non existing data set id return an error response.")
@Timed
public void updateDataSet(@PathVariable(value = "id") @ApiParam(name = "id", value = "Id of the data set to update") String dataSetId, @RequestBody DataSetMetadata dataSetMetadata) {
    if (dataSetMetadata != null && dataSetMetadata.getName() != null) {
        checkDataSetName(dataSetMetadata.getName());
    }
    final DistributedLock lock = dataSetMetadataRepository.createDatasetMetadataLock(dataSetId);
    lock.lock();
    try {
        DataSetMetadata metadataForUpdate = dataSetMetadataRepository.get(dataSetId);
        if (metadataForUpdate == null) {
            // No need to silently create the data set metadata: associated content will most likely not exist.
            throw new TDPException(DataSetErrorCodes.DATASET_DOES_NOT_EXIST, build().put("id", dataSetId));
        }
        LOG.debug("updateDataSet: {}", dataSetMetadata);
        // 
        // Only part of the metadata can be updated, so the original dataset metadata is loaded and updated
        // 
        DataSetMetadata original = metadataBuilder.metadata().copy(metadataForUpdate).build();
        try {
            // update the name
            metadataForUpdate.setName(dataSetMetadata.getName());
            // update the sheet content (in case of a multi-sheet excel file)
            if (metadataForUpdate.getSchemaParserResult() != null) {
                Optional<Schema.SheetContent> sheetContentFound = metadataForUpdate.getSchemaParserResult().getSheetContents().stream().filter(sheetContent -> dataSetMetadata.getSheetName().equals(// 
                sheetContent.getName())).findFirst();
                if (sheetContentFound.isPresent()) {
                    List<ColumnMetadata> columnMetadatas = sheetContentFound.get().getColumnMetadatas();
                    if (metadataForUpdate.getRowMetadata() == null) {
                        metadataForUpdate.setRowMetadata(new RowMetadata(emptyList()));
                    }
                    metadataForUpdate.getRowMetadata().setColumns(columnMetadatas);
                }
                metadataForUpdate.setSheetName(dataSetMetadata.getSheetName());
                metadataForUpdate.setSchemaParserResult(null);
            }
            // Location updates
            if (dataSetMetadata.getLocation() != null) {
                metadataForUpdate.setLocation(dataSetMetadata.getLocation());
            }
            // update parameters & encoding (so that user can change import parameters for CSV)
            metadataForUpdate.getContent().setParameters(dataSetMetadata.getContent().getParameters());
            metadataForUpdate.setEncoding(dataSetMetadata.getEncoding());
            // update limit
            final Optional<Long> newLimit = dataSetMetadata.getContent().getLimit();
            newLimit.ifPresent(limit -> metadataForUpdate.getContent().setLimit(limit));
            // Validate that the new data set metadata and removes the draft status
            final String formatFamilyId = dataSetMetadata.getContent().getFormatFamilyId();
            if (formatFamilyFactory.hasFormatFamily(formatFamilyId)) {
                FormatFamily format = formatFamilyFactory.getFormatFamily(formatFamilyId);
                try {
                    DraftValidator draftValidator = format.getDraftValidator();
                    DraftValidator.Result result = draftValidator.validate(dataSetMetadata);
                    if (result.isDraft()) {
                        // This is not an exception case: data set may remain a draft after update (although rather
                        // unusual)
                        LOG.warn("Data set #{} is still a draft after update.", dataSetId);
                        return;
                    }
                    // Data set metadata to update is no longer a draft
                    metadataForUpdate.setDraft(false);
                } catch (UnsupportedOperationException e) {
                // no need to validate draft here
                }
            }
            // update schema
            formatAnalyzer.update(original, metadataForUpdate);
            // save the result
            metadataForUpdate.getLifecycle().setInProgress(true);
            metadataForUpdate.getContent().setNbRecords(0);
            dataSetMetadataRepository.save(metadataForUpdate);
            // Asks for a in depth schema analysis (for column type information).
            analyzeDataSet(dataSetId, singletonList(FormatAnalysis.class));
        } catch (TDPException e) {
            throw e;
        } catch (Exception e) {
            throw new TDPException(UNABLE_TO_CREATE_OR_UPDATE_DATASET, e);
        }
    } finally {
        lock.unlock();
    }
    publisher.publishEvent(new DatasetUpdatedEvent(dataSetMetadata));
}
Also used : VolumeMetered(org.talend.dataprep.metrics.VolumeMetered) RequestParam(org.springframework.web.bind.annotation.RequestParam) ImportBuilder(org.talend.dataprep.api.dataset.Import.ImportBuilder) FormatFamilyFactory(org.talend.dataprep.schema.FormatFamilyFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) ApiParam(io.swagger.annotations.ApiParam) StringUtils(org.apache.commons.lang3.StringUtils) TEXT_PLAIN_VALUE(org.springframework.http.MediaType.TEXT_PLAIN_VALUE) SortAndOrderHelper.getDataSetMetadataComparator(org.talend.dataprep.util.SortAndOrderHelper.getDataSetMetadataComparator) Collections.singletonList(java.util.Collections.singletonList) SemanticDomain(org.talend.dataprep.api.dataset.statistics.SemanticDomain) BeanConversionService(org.talend.dataprep.conversions.BeanConversionService) PipedInputStream(java.io.PipedInputStream) DistributedLock(org.talend.dataprep.lock.DistributedLock) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) DataprepBundle.message(org.talend.dataprep.i18n.DataprepBundle.message) UserData(org.talend.dataprep.api.user.UserData) TaskExecutor(org.springframework.core.task.TaskExecutor) MAX_STORAGE_MAY_BE_EXCEEDED(org.talend.dataprep.exception.error.DataSetErrorCodes.MAX_STORAGE_MAY_BE_EXCEEDED) DataSet(org.talend.dataprep.api.dataset.DataSet) LocalStoreLocation(org.talend.dataprep.api.dataset.location.LocalStoreLocation) FormatFamily(org.talend.dataprep.schema.FormatFamily) Resource(javax.annotation.Resource) Set(java.util.Set) DatasetUpdatedEvent(org.talend.dataprep.dataset.event.DatasetUpdatedEvent) RestController(org.springframework.web.bind.annotation.RestController) IOUtils(org.apache.commons.io.IOUtils) QuotaService(org.talend.dataprep.dataset.store.QuotaService) SecurityProxy(org.talend.dataprep.security.SecurityProxy) Stream(java.util.stream.Stream) StreamSupport.stream(java.util.stream.StreamSupport.stream) FlagNames(org.talend.dataprep.api.dataset.row.FlagNames) UNEXPECTED_CONTENT(org.talend.dataprep.exception.error.CommonErrorCodes.UNEXPECTED_CONTENT) Analyzers(org.talend.dataquality.common.inference.Analyzers) DatasetImportedEvent(org.talend.dataprep.dataset.event.DatasetImportedEvent) DataSetLocatorService(org.talend.dataprep.api.dataset.location.locator.DataSetLocatorService) Callable(java.util.concurrent.Callable) Schema(org.talend.dataprep.schema.Schema) ArrayList(java.util.ArrayList) Value(org.springframework.beans.factory.annotation.Value) RequestBody(org.springframework.web.bind.annotation.RequestBody) DataSetLocationService(org.talend.dataprep.api.dataset.location.DataSetLocationService) AnalyzerService(org.talend.dataprep.quality.AnalyzerService) UserDataRepository(org.talend.dataprep.user.store.UserDataRepository) Markers(org.talend.dataprep.log.Markers) Api(io.swagger.annotations.Api) DraftValidator(org.talend.dataprep.schema.DraftValidator) HttpResponseContext(org.talend.dataprep.http.HttpResponseContext) Sort(org.talend.dataprep.util.SortAndOrderHelper.Sort) IOException(java.io.IOException) PipedOutputStream(java.io.PipedOutputStream) FormatAnalysis(org.talend.dataprep.dataset.service.analysis.synchronous.FormatAnalysis) ContentAnalysis(org.talend.dataprep.dataset.service.analysis.synchronous.ContentAnalysis) SchemaAnalysis(org.talend.dataprep.dataset.service.analysis.synchronous.SchemaAnalysis) HttpStatus(org.springframework.http.HttpStatus) FilterService(org.talend.dataprep.api.filter.FilterService) Marker(org.slf4j.Marker) NullOutputStream(org.apache.commons.io.output.NullOutputStream) StatisticsAdapter(org.talend.dataprep.dataset.StatisticsAdapter) Timed(org.talend.dataprep.metrics.Timed) ColumnMetadata(org.talend.dataprep.api.dataset.ColumnMetadata) PathVariable(org.springframework.web.bind.annotation.PathVariable) DataSetMetadataBuilder(org.talend.dataprep.dataset.DataSetMetadataBuilder) DataSetErrorCodes(org.talend.dataprep.exception.error.DataSetErrorCodes) PUT(org.springframework.web.bind.annotation.RequestMethod.PUT) BiFunction(java.util.function.BiFunction) LoggerFactory(org.slf4j.LoggerFactory) DatasetDTO(org.talend.dataprep.api.dataset.DatasetDTO) SEMANTIC(org.talend.dataprep.quality.AnalyzerService.Analysis.SEMANTIC) ApiOperation(io.swagger.annotations.ApiOperation) UNABLE_TO_CREATE_OR_UPDATE_DATASET(org.talend.dataprep.exception.error.DataSetErrorCodes.UNABLE_TO_CREATE_OR_UPDATE_DATASET) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DataSetRow(org.talend.dataprep.api.dataset.row.DataSetRow) StrictlyBoundedInputStream(org.talend.dataprep.dataset.store.content.StrictlyBoundedInputStream) DataSetMetadata(org.talend.dataprep.api.dataset.DataSetMetadata) UNSUPPORTED_CONTENT(org.talend.dataprep.exception.error.DataSetErrorCodes.UNSUPPORTED_CONTENT) TimeToLive(org.talend.dataprep.cache.ContentCache.TimeToLive) Order(org.talend.dataprep.util.SortAndOrderHelper.Order) Collections.emptyList(java.util.Collections.emptyList) Predicate(java.util.function.Predicate) PublicAPI(org.talend.dataprep.security.PublicAPI) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) ContentCache(org.talend.dataprep.cache.ContentCache) INVALID_DATASET_NAME(org.talend.dataprep.exception.error.DataSetErrorCodes.INVALID_DATASET_NAME) List(java.util.List) Optional(java.util.Optional) Analyzer(org.talend.dataquality.common.inference.Analyzer) RequestHeader(org.springframework.web.bind.annotation.RequestHeader) Pattern(java.util.regex.Pattern) Security(org.talend.dataprep.security.Security) Spliterator(java.util.Spliterator) RowMetadata(org.talend.dataprep.api.dataset.RowMetadata) ComponentProperties(org.talend.dataprep.parameters.jsonschema.ComponentProperties) TDPException(org.talend.dataprep.exception.TDPException) JsonErrorCodeDescription(org.talend.dataprep.exception.json.JsonErrorCodeDescription) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) UNABLE_CREATE_DATASET(org.talend.dataprep.exception.error.DataSetErrorCodes.UNABLE_CREATE_DATASET) HashMap(java.util.HashMap) GET(org.springframework.web.bind.annotation.RequestMethod.GET) HashSet(java.util.HashSet) Import(org.talend.dataprep.api.dataset.Import) ExceptionContext.build(org.talend.daikon.exception.ExceptionContext.build) ExceptionContext(org.talend.daikon.exception.ExceptionContext) UpdateColumnParameters(org.talend.dataprep.dataset.service.api.UpdateColumnParameters) VersionService(org.talend.dataprep.api.service.info.VersionService) POST(org.springframework.web.bind.annotation.RequestMethod.POST) OutputStream(java.io.OutputStream) DataSetLocation(org.talend.dataprep.api.dataset.DataSetLocation) Logger(org.slf4j.Logger) LocaleContextHolder.getLocale(org.springframework.context.i18n.LocaleContextHolder.getLocale) UpdateDataSetCacheKey(org.talend.dataprep.dataset.service.cache.UpdateDataSetCacheKey) DataSetContentLimit(org.talend.dataprep.dataset.store.content.DataSetContentLimit) APPLICATION_JSON_VALUE(org.springframework.http.MediaType.APPLICATION_JSON_VALUE) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) Certification(org.talend.dataprep.api.dataset.DataSetGovernance.Certification) Comparator(java.util.Comparator) InputStream(java.io.InputStream) ColumnMetadata(org.talend.dataprep.api.dataset.ColumnMetadata) FormatAnalysis(org.talend.dataprep.dataset.service.analysis.synchronous.FormatAnalysis) FormatFamily(org.talend.dataprep.schema.FormatFamily) DataSetMetadata(org.talend.dataprep.api.dataset.DataSetMetadata) IOException(java.io.IOException) TDPException(org.talend.dataprep.exception.TDPException) TDPException(org.talend.dataprep.exception.TDPException) DistributedLock(org.talend.dataprep.lock.DistributedLock) DatasetUpdatedEvent(org.talend.dataprep.dataset.event.DatasetUpdatedEvent) DraftValidator(org.talend.dataprep.schema.DraftValidator) RowMetadata(org.talend.dataprep.api.dataset.RowMetadata) Timed(org.talend.dataprep.metrics.Timed) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

RequestBody (org.springframework.web.bind.annotation.RequestBody)19 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)14 List (java.util.List)13 Collectors (java.util.stream.Collectors)13 PathVariable (org.springframework.web.bind.annotation.PathVariable)10 HttpStatus (org.springframework.http.HttpStatus)9 MediaType (org.springframework.http.MediaType)9 RequestMethod (org.springframework.web.bind.annotation.RequestMethod)9 Set (java.util.Set)8 RequestParam (org.springframework.web.bind.annotation.RequestParam)8 ApiOperation (io.swagger.annotations.ApiOperation)7 Arrays (java.util.Arrays)7 Map (java.util.Map)7 ResponseEntity (org.springframework.http.ResponseEntity)7 RestController (org.springframework.web.bind.annotation.RestController)7 IOException (java.io.IOException)6 ArrayList (java.util.ArrayList)5 HashSet (java.util.HashSet)5 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)5 ApplicationEnvironmentService (alien4cloud.application.ApplicationEnvironmentService)4