Commit b15b4e02 authored by naji's avatar naji
Browse files

dernier travail edit + getAll + getPua + getPa

parent 29f75950
......@@ -15,7 +15,7 @@ spring:
register: false
data:
mongodb:
uri: mongodb://mongod_dbuser_iam:mongod_dbpwd_iam@10.6.10.23:27018/iam?connectTimeoutMS=2000
uri: mongodb://mongod_dbuser_iam:mongod_dbpwd_iam@10.6.10.78:27018/iam?connectTimeoutMS=2000
server-identity:
identityName: vitamui-dev
......
......@@ -50,4 +50,9 @@ public class PastisRestClientFactory extends BaseRestClientFactory {
public PastisRestClient getPastisRestClient() {
return new PastisRestClient(getRestTemplate(), getBaseUrl());
}
public PastisTransformationRestClient getPastisTransformationRestClient() {
return new PastisTransformationRestClient(getRestTemplate(), getBaseUrl());
}
}
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2020)
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/
package fr.gouv.vitamui.pastis.client;
import fr.gouv.vitam.common.model.AuditOptions;
import fr.gouv.vitamui.commons.api.CommonConstants;
import fr.gouv.vitamui.commons.api.domain.PaginatedValuesDto;
import fr.gouv.vitamui.commons.api.logger.VitamUILogger;
import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory;
import fr.gouv.vitamui.commons.rest.client.BasePaginatingAndSortingRestClient;
import fr.gouv.vitamui.commons.rest.client.ExternalHttpContext;
import fr.gouv.vitamui.pastis.common.dto.ElementProperties;
import fr.gouv.vitamui.pastis.common.dto.profiles.PastisProfile;
import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileNotice;
import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileResponse;
import fr.gouv.vitamui.pastis.common.rest.RestApi;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.util.UriComponentsBuilder;
import java.io.IOException;
import java.util.List;
public class PastisTransformationRestClient extends BasePaginatingAndSortingRestClient<ProfileResponse, ExternalHttpContext> {
private static final VitamUILogger LOGGER =
VitamUILoggerFactory.getInstance(PastisTransformationRestClient.class);
public PastisTransformationRestClient(RestTemplate restTemplate,
String baseUrl) {
super(restTemplate, baseUrl);
}
@Override
protected Class<ProfileResponse> getDtoClass() {
return ProfileResponse.class;
}
@Override
protected ParameterizedTypeReference<List<ProfileResponse>> getDtoListClass() {
return new ParameterizedTypeReference<List<ProfileResponse>>() {
};
}
@Override
protected ParameterizedTypeReference<PaginatedValuesDto<ProfileResponse>> getDtoPaginatedClass() {
return new ParameterizedTypeReference<PaginatedValuesDto<ProfileResponse>>() {
};
}
@Override
public String getPathUrl() {
return RestApi.STANDALONE;
}
public ResponseEntity<ProfileResponse> loadProfile(String id, ExternalHttpContext context) {
LOGGER.debug("Transform profile");
MultiValueMap<String, String> headers = buildSearchHeaders(context);
final HttpEntity<PastisProfile> request = new HttpEntity<>(headers);
final ResponseEntity<ProfileResponse> response =
restTemplate.exchange(getUrl() + RestApi.STANDALONE_TRANSFORM_PROFILE + "?id=" + id , HttpMethod.POST,
request, ProfileResponse.class);
return response;
/* final UriComponentsBuilder uriBuilder =
UriComponentsBuilder.fromHttpUrl(getUrl() + RestApi.STANDALONE_TRANSFORM_PROFILE + CommonConstants.PATH_ID);
final HttpEntity<ProfileResponse> request = new HttpEntity<>(buildHeaders(context));
return restTemplate.exchange(uriBuilder.build(id), HttpMethod.POST, request, ProfileResponse.class);*/
}
public ResponseEntity<ProfileResponse> loadProfileFromFile(MultipartFile file, ExternalHttpContext context) {
LOGGER.debug("Upload profile");
MultiValueMap<String, String> headers = buildSearchHeaders(context);
headers.add("Content-Type", "multipart/form-data");
MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
body.add("file", file);
final HttpEntity<MultiValueMap<String, Object>> request
= new HttpEntity<>(body, headers);
final ResponseEntity<ProfileResponse> response =
restTemplate.exchange(getUrl() + RestApi.STANDALONE_UPLOAD_PROFILE , HttpMethod.POST,
request, ProfileResponse.class);
return response;
}
public ResponseEntity<String> getArchiveProfile(final ElementProperties json, ExternalHttpContext context) throws IOException {
LOGGER.debug("Download archive profile");
MultiValueMap<String, String> headers = buildSearchHeaders(context);
final HttpEntity<ElementProperties> request = new HttpEntity<>(json, headers);
final ResponseEntity<String> response =
restTemplate.exchange(getUrl() + RestApi.STANDALONE_DOWNLOAD_PA, HttpMethod.POST,
request, String.class);
return response;
}
public ResponseEntity<String> getArchiveUnitProfile(final ProfileNotice json, ExternalHttpContext context) throws IOException {
LOGGER.debug("Download Arichivale unit profile");
MultiValueMap<String, String> headers = buildSearchHeaders(context);
final HttpEntity<ProfileNotice> request = new HttpEntity<>(json, headers);
final ResponseEntity<String> response =
restTemplate.exchange(getUrl() + RestApi.STANDALONE_DOWNLOAD_PUA, HttpMethod.POST,
request, String.class);
return response;
}
}
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2020)
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/
package fr.gouv.vitamui.pastis.client;
import com.fasterxml.jackson.databind.JsonNode;
import fr.gouv.vitamui.commons.api.CommonConstants;
import fr.gouv.vitamui.commons.api.exception.BadRequestException;
import fr.gouv.vitamui.commons.api.logger.VitamUILogger;
import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory;
import fr.gouv.vitamui.commons.rest.client.BaseWebClient;
import fr.gouv.vitamui.commons.rest.client.ExternalHttpContext;
import fr.gouv.vitamui.pastis.common.dto.ElementProperties;
import fr.gouv.vitamui.pastis.common.dto.profiles.PastisProfile;
import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileNotice;
import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileResponse;
import fr.gouv.vitamui.pastis.common.rest.RestApi;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.reactive.function.client.WebClient;
import java.io.IOException;
import java.util.AbstractMap;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
public class PastisWebClient extends BaseWebClient<ExternalHttpContext> {
private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(PastisWebClient.class);
public PastisWebClient(final WebClient webClient, final String baseUrl) {
super(webClient, baseUrl);
}
public ProfileResponse loadProfileFromFileVitamui(ExternalHttpContext context, MultipartFile file) {
LOGGER.debug("Import file {}", file != null ? file.getOriginalFilename() : null);
if (file == null) {
throw new BadRequestException("No file to check .");
}
final ProfileResponse response = multipartData(getUrl() + RestApi.VITAMUI_UPLOAD_PROFILE, HttpMethod.POST, context,
Collections.singletonMap("fileName", file.getOriginalFilename()),
Optional.of(new AbstractMap.SimpleEntry<>("file", file)), ProfileResponse.class);
return response;
}
@Override
public String getPathUrl() {
return RestApi.STANDALONE;
}
}
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2020)
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/
package fr.gouv.vitamui.pastis.client;
import fr.gouv.vitamui.commons.rest.client.BaseWebClientFactory;
import fr.gouv.vitamui.commons.rest.client.configuration.HttpPoolConfiguration;
import fr.gouv.vitamui.commons.rest.client.configuration.RestClientConfiguration;
public class PastisWebClientFactory extends BaseWebClientFactory {
public PastisWebClientFactory(final RestClientConfiguration restClientConfiguration) {
super(restClientConfiguration);
}
public PastisWebClientFactory(final RestClientConfiguration restClientConfig,
final HttpPoolConfiguration httpPoolConfig) {
super(restClientConfig, httpPoolConfig);
}
public PastisWebClient getPastisWebClient() {
return new PastisWebClient(getWebClient(), getBaseUrl());
}
@Override
public String getBaseUrl() {
return super.getBaseUrl();
}
}
......@@ -14,5 +14,6 @@ public class RestApi {
public static final String STANDALONE_TRANSFORM_PROFILE = "/edit";
public static final String STANDALONE_DOWNLOAD_PUA = "/getarchiveunitprofile";
public static final String STANDALONE_DOWNLOAD_PA = "/getarchiveprofile";
public static final String VITAMUI_UPLOAD_PROFILE = "/profile";
}
......@@ -88,7 +88,7 @@ class PastisController {
}
}
@Secured(ServicesData.ROLE_GET_PASTIS)
@Secured("ROLE_GET_PROFILES")
@RequestMapping(value = RestApi.STANDALONE_DOWNLOAD_PA, method = RequestMethod.POST, consumes = APPLICATION_JSON_UTF8, produces = MediaType.APPLICATION_XML_VALUE)
ResponseEntity<String> getArchiveProfile(@RequestBody final ElementProperties json) throws IOException {
if (profileService.getArchiveProfile(json) != null) {
......@@ -98,7 +98,7 @@ class PastisController {
}
}
@Secured(ServicesData.ROLE_GET_PASTIS)
@Secured("ROLE_GET_PROFILES")
@RequestMapping(value = RestApi.STANDALONE_DOWNLOAD_PUA, method = RequestMethod.POST, consumes = APPLICATION_JSON_UTF8, produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<String> getArchiveUnitProfile(@RequestBody final ProfileNotice json) throws IOException {
if (profileService.getArchiveUnitProfile(json) != null) {
......@@ -120,7 +120,7 @@ class PastisController {
}
}
@Secured(ServicesData.ROLE_GET_PASTIS)
@Secured("ROLE_GET_PROFILES")
@RequestMapping (value = RestApi.STANDALONE_TRANSFORM_PROFILE, method = RequestMethod.POST)
ResponseEntity<ProfileResponse> loadProfile(@RequestParam(name = "id") String id) throws JsonProcessingException {
if (profileService.loadProfile(id) != null) {
......@@ -130,7 +130,7 @@ class PastisController {
}
}
@Secured(ServicesData.ROLE_GET_PASTIS)
/*@Secured("ROLE_UPDATE_PROFILES")
@RequestMapping (value = RestApi.STANDALONE_UPLOAD_PROFILE, method = RequestMethod.POST,
consumes = "multipart/form-data", produces = "application/json")
ResponseEntity<ProfileResponse> loadProfileFromFile(@RequestParam MultipartFile file) {
......@@ -139,6 +139,13 @@ class PastisController {
} else {
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}*/
@Secured("ROLE_UPDATE_PROFILES")
@RequestMapping (value = RestApi.VITAMUI_UPLOAD_PROFILE, method = RequestMethod.POST,
consumes = "multipart/form-data", produces = "application/json")
ProfileResponse loadProfileFromFileVitamui(@RequestParam MultipartFile file) {
return profileService.loadProfileFromFile(file);
}
@Secured(ServicesData.ROLE_GET_PASTIS)
......
......@@ -9,7 +9,7 @@ spring:
register: false
data:
mongodb:
uri: mongodb://mongod_dbuser_security:mongod_dbpwd_security@10.6.10.23:27018/security?connectTimeoutMS=2000
uri: mongodb://mongod_dbuser_security:mongod_dbpwd_security@10.6.10.78:27018/security?connectTimeoutMS=2000
server-identity:
identityName: vitamui-dev
......
......@@ -61,7 +61,7 @@ cas.authn.pm.reset.crypto.enabled: true
cas.server.prefix: https://dev.vitamui.com:8080/cas
login.url: ${cas.server.prefix}/login
cas.serviceRegistry.mongo.clientUri: mongodb://mongod_dbuser_cas:mongod_dbpwd_cas@10.6.10.23:27018/cas
cas.serviceRegistry.mongo.clientUri: mongodb://mongod_dbuser_cas:mongod_dbpwd_cas@10.6.10.78:27018/cas
#cas.serviceRegistry.mongo.port: 27018
#cas.serviceRegistry.mongo.databaseName: cas
......
/*
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
[dad@cines.fr]
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
profiles based on the french SEDA stardard
(https://redirect.francearchives.fr/seda/).
This software is governed by the CeCILL-C license under French law and
abiding by the rules of distribution of free software. You can use,
abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute the software under the terms of the CeCILL-C
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
"http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited
liability.
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
......@@ -28,9 +28,9 @@ that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-C license and that you accept its terms.
......@@ -38,7 +38,7 @@ knowledge of the CeCILL-C license and that you accept its terms.
import { HttpClient } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { BaseHttpClient, BASE_URL } from 'ui-frontend-common';
import { BASE_URL } from 'ui-frontend-common';
import { environment } from '../../../environments/environment';
@Injectable({
......@@ -56,7 +56,7 @@ export class PastisApiService{
getBaseUrl() {
return this.baseUrl;
}
// Generic GET Method
get<T = any>(path: string, options?: {}): Observable<T> {
console.error("================================ " + this.baseUrl)
......@@ -81,7 +81,7 @@ export class PastisApiService{
post<T>(path: string, body?:{}, options?: {}): Observable<T> {
console.log('Body', body, " path : ", `${environment.apiServerUrl}${path}`);
console.log('On api service post with params: ',options);
return this.http.post<T>(`${environment.apiServerUrl}${path}`, body, options);
return this.http.post<T>(`${this.baseUrl}${path}`, body, options);
}
delete(path: string): Observable<any> {
......
......@@ -41,6 +41,11 @@ import fr.gouv.vitamui.commons.rest.configuration.SwaggerConfiguration;
import fr.gouv.vitamui.iam.external.client.IamExternalWebClientFactory;
import fr.gouv.vitamui.pastis.client.PastisRestClient;
import fr.gouv.vitamui.pastis.client.PastisRestClientFactory;
import fr.gouv.vitamui.pastis.client.PastisTransformationRestClient;
import fr.gouv.vitamui.pastis.client.PastisWebClient;
import fr.gouv.vitamui.pastis.client.PastisWebClientFactory;
import fr.gouv.vitamui.referential.external.client.ReferentialExternalWebClientFactory;
import fr.gouv.vitamui.referential.external.client.RuleExternalWebClient;
import fr.gouv.vitamui.ui.commons.property.UIProperties;
import fr.gouv.vitamui.ui.commons.security.SecurityConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
......@@ -71,10 +76,28 @@ public class PastisContextConfiguration {
restTemplateBuilder);
}
@Bean
@ConditionalOnMissingBean
@DependsOn("uiProperties")
public PastisWebClientFactory pastisWebClientFactory(final PastisApplicationProperties uiProperties) {
return new PastisWebClientFactory(uiProperties.getPastisExternalClient());
}
@Bean
public PastisRestClient pastisRestClient(
final PastisRestClientFactory pastisRestClientFactory) {
return pastisRestClientFactory.getPastisRestClient();
}
@Bean
public PastisWebClient pastisWebClient(final PastisWebClientFactory pastisWebClientFactory) {
return pastisWebClientFactory.getPastisWebClient();
}
@Bean
public PastisTransformationRestClient pastisTransformationRestClient(
final PastisRestClientFactory pastisRestClientFactory) {
return pastisRestClientFactory.getPastisTransformationRestClient();
}
}
package fr.gouv.vitamui.pastis.rest;
import com.fasterxml.jackson.core.JsonProcessingException;
import fr.gouv.vitamui.commons.api.domain.ServicesData;
import fr.gouv.vitamui.commons.api.logger.VitamUILogger;
import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory;
import fr.gouv.vitamui.commons.rest.AbstractUiRestController;
import fr.gouv.vitamui.pastis.common.dto.ElementProperties;
import fr.gouv.vitamui.pastis.common.dto.profiles.PastisProfile;
import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileNotice;
import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileResponse;
import fr.gouv.vitamui.pastis.common.rest.RestApi;
import fr.gouv.vitamui.pastis.service.PastisService;
import fr.gouv.vitamui.pastis.service.PastisTransformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import java.io.IOException;
import java.util.List;
......@@ -28,20 +44,60 @@ import java.util.List;
@Produces("application/json")
public class PastisController extends AbstractUiRestController {
private static final String APPLICATION_JSON_UTF8 = "application/json; charset=utf-8";
static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(PastisController.class);
private final PastisService pastisService;
private final PastisTransformationService pastisTransformationService;
@Autowired
public PastisController(final PastisService pastisService) {
public PastisController(final PastisService pastisService,
PastisTransformationService pastisTransformationService) {
this.pastisService = pastisService;
this.pastisTransformationService = pastisTransformationService;
}
@ApiOperation(value = "get All profiles")
@GetMapping(RestApi.STANDALONE_GET_ALL_PROFILES)
@ResponseStatus(HttpStatus.OK)
public ResponseEntity<List<PastisProfile>> getAllProfiles() {
ResponseEntity<List<PastisProfile>> getAllProfiles() {
LOGGER.debug("Start get profile By ui-pastis-controller");
return pastisService.getAllProfiles(buildUiHttpContext());
}
@RequestMapping (value = RestApi.STANDALONE_TRANSFORM_PROFILE, method = RequestMethod.POST)
ResponseEntity<ProfileResponse> loadProfile(@RequestParam(name = "id") String id) throws JsonProcessingException {
LOGGER.debug("Start get profile By ui-pastis-controller");
return pastisTransformationService.loadProfile(id, buildUiHttpContext());
}
@ApiOperation(value = "Upload Profile Vitamui")
@PostMapping(RestApi.VITAMUI_UPLOAD_PROFILE)
@ResponseStatus(HttpStatus.OK)
ResponseEntity<ProfileResponse> loadProfileFromFileVitamui(@Context HttpServletRequest request, MultipartFile file) {
ProfileResponse profileResponse = pastisTransformationService.loadProfileFromFileVitamui(file, buildUiHttpContext());