Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dad
Cines Vitamui
Commits
55ed7182
Commit
55ed7182
authored
Nov 19, 2021
by
descamps
Browse files
KDE - 22/11/2021 - Ajout ui-pastis
parent
a7e8b3c3
Changes
27
Hide whitespace changes
Inline
Side-by-side
api/api-iam/iam-internal/src/main/resources/application-dev.yml
View file @
55ed7182
...
...
@@ -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
...
...
api/api-iam/iam-internal/src/main/resources/application.yml
View file @
55ed7182
# TECHNICAL PROPERTIES / DON'T put environment properties
# This property can be override by a config file give at run time with spring.config.location
spring
:
application
:
name
:
${server-identity.identityRole}
...
...
@@ -10,16 +11,17 @@ spring:
version
:
v1
mvc
:
favicon
:
enabled
:
false
enabled
=
false
jackson
:
serialization
:
write-dates-as-timestamps
:
false
jmx
:
unique-names
:
true
management
:
endpoints
:
jmx
:
domain
:
${server-identity.identityRole}
unique-names
:
true
web.exposure.include
:
'
*'
endpoint
:
health
:
...
...
api/api-referential/referential-internal/pom.xml
View file @
55ed7182
...
...
@@ -268,11 +268,6 @@
<artifactId>
powermock-module-junit4
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-mongodb
</artifactId>
<version>
2.2.6.RELEASE
</version>
</dependency>
</dependencies>
<build>
...
...
api/api-referential/referential-internal/src/main/config/dev-vitam/access-external-client.conf
View file @
55ed7182
...
...
@@ -3,8 +3,8 @@ serverPort: 8444
secure
:
true
sslConfiguration
:
keystore
:
-
keyPath
:
keystore_access
-
external
.
jks
keyPassword
:
azerty
2
-
keyPath
:
keystore_access
-
external
.
p12
keyPassword
:
azerty
4
truststore
:
-
keyPath
:
truststore_access
-
external
.
jks
keyPassword
:
azerty10
...
...
api/api-referential/referential-internal/src/main/config/dev-vitam/ingest-external-client.conf
View file @
55ed7182
serverHost
:
10
.
6
.
10
.
65
serverPort
:
8443
secure
:
true
sslConfiguration
:
sslConfiguration
:
keystore
:
-
keyPath
:
keystore_access
-
external
.
jks
keyPassword
:
azerty
2
-
keyPath
:
keystore_access
-
external
.
p12
keyPassword
:
azerty
4
truststore
:
-
keyPath
:
truststore_access
-
external
.
jks
keyPassword
:
azerty10
...
...
api/api-referential/referential-internal/src/main/config/dev-vitam/keystore_access-external.jks
deleted
100644 → 0
View file @
a7e8b3c3
File deleted
api/api-referential/referential-internal/src/main/config/dev-vitam/keystore_access-external.p12
View file @
55ed7182
No preview for this file type
api/api-referential/referential-internal/src/main/config/dev-vitam/truststore_access-external.jks
100755 → 100644
View file @
55ed7182
File mode changed from 100755 to 100644
api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/archivalprofileunit/ArchivalProfileUnitInternalService.java
View file @
55ed7182
...
...
@@ -30,7 +30,6 @@ import fr.gouv.vitamui.referential.common.dto.ArchivalProfileUnitDto;
import
fr.gouv.vitamui.referential.common.dto.ArchivalProfileUnitResponseDto
;
import
fr.gouv.vitamui.referential.common.service.VitamArchivalProfileUnitService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.MongoTransactionManager
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -51,8 +50,6 @@ public class ArchivalProfileUnitInternalService {
private
VitamArchivalProfileUnitService
vitamArchivalProfileUnitService
;
private
MongoTransactionManager
mongoTransactionManager
;
private
InternalSecurityService
internalSecurityService
;
@Autowired
...
...
api/api-referential/referential-internal/src/main/java/fr/gouv/vitamui/referential/internal/server/profile/ProfileInternalService.java
View file @
55ed7182
...
...
@@ -65,7 +65,6 @@ import fr.gouv.vitamui.referential.common.dto.ProfileDto;
import
fr.gouv.vitamui.referential.common.dto.ProfileResponseDto
;
import
fr.gouv.vitamui.referential.common.service.VitamProfileService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.MongoTransactionManager
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -88,8 +87,6 @@ public class ProfileInternalService {
private
VitamProfileService
vitamProfileService
;
private
MongoTransactionManager
mongoTransactionManager
;
private
InternalSecurityService
internalSecurityService
;
...
...
api/api-referential/referential-internal/src/main/resources/access-external-client.conf
deleted
100644 → 0
View file @
a7e8b3c3
serverHost
:
10
.
6
.
10
.
34
serverPort
:
8444
secure
:
true
sslConfiguration
:
keystore
:
-
keyPath
:
keystore_ihm
-
demo
.
p12
keyPassword
:
azerty4
truststore
:
-
keyPath
:
truststore_ihm
-
demo
.
jks
keyPassword
:
azerty10
hostnameVerification
:
true
api/api-referential/referential-internal/src/main/resources/ingest-external-client.conf
deleted
100644 → 0
View file @
a7e8b3c3
serverHost
:
ingest
-
external
.
service
.
consul
serverPort
:
8443
secure
:
true
sslConfiguration
:
keystore
:
-
keyPath
:
keystore_ihm
-
demo
.
p12
keyPassword
:
azerty4
truststore
:
-
keyPath
:
truststore_ihm
-
demo
.
jks
keyPassword
:
azerty10
hostnameVerification
:
true
api/api-security/security-internal/src/main/resources/application-dev.yml
View file @
55ed7182
...
...
@@ -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
...
...
cas/cas-server/run.sh
View file @
55ed7182
#!/bin/bash
#mvn clean package -DskipTests
java
-Dspring
.config.additional-location
=
src/main/config/cas-server-application-dev.yml
-jar
-Xms128m
-Xmx512m
target/cas-server.war
$JAVA_HOME
/bin/
java
-Dspring
.config.additional-location
=
src/main/config/cas-server-application-dev.yml
-jar
-Xms128m
-Xmx512m
target/cas-server.war
cas/cas-server/src/main/config/cas-server-application-dev.yml
View file @
55ed7182
...
...
@@ -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
...
...
ui/ui-frontend/projects/pastis/src/app/core/services/api.pastis.service.ts
View file @
55ed7182
/*
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
)
...
...
ui/ui-pastis/run.sh
View file @
55ed7182
...
...
@@ -3,4 +3,4 @@
#retrieve version
version
=
"
$(
grep
-oP
'(?<=>).*?(?=</version>)'
pom.xml |
grep
-v
'version'
|
grep
'SNAPSHOT'
)
"
java
-jar
target/ui-pastis-
$(
echo
$version
)
.jar
-Xms128m
-Xmx512m
--spring
.profiles.active
=
dev,recette
$JAVA_HOME
/bin/java
-agentlib
:jdwp
=
transport
=
dt_socket,server
=
y,suspend
=
n,address
=
localhost:9998
-jar
target/ui-pastis-
5.0-SNAPSHOT
.jar
-Xms128m
-Xmx512m
--spring
.profiles.active
=
dev,recette
ui/ui-pastis/src/main/java/fr/gouv/vitamui/pastis/config/PastisContextConfiguration.java
View file @
55ed7182
...
...
@@ -41,6 +41,7 @@ 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.referential.external.client.*
;
import
fr.gouv.vitamui.ui.commons.property.UIProperties
;
import
fr.gouv.vitamui.ui.commons.security.SecurityConfig
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
...
...
@@ -77,4 +78,24 @@ public class PastisContextConfiguration {
return
pastisRestClientFactory
.
getPastisRestClient
();
}
@Bean
public
ProfileExternalRestClient
profileExternalRestClient
(
final
ReferentialExternalRestClientFactory
factory
)
{
return
factory
.
getProfileExternalRestClient
();
}
@Bean
public
ArchivalProfileUnitExternalRestClient
archivalProfileCrudRestClient
(
final
ReferentialExternalRestClientFactory
referentialExternalRestClientFactory
)
{
return
referentialExternalRestClientFactory
.
getArchivalProfileExternalRestClient
();
}
@Bean
public
ArchivalProfileUnitExternalWebClient
archivalProfileWebRestClient
(
final
ReferentialExternalWebClientFactory
referentialExternalWebClientFactory
)
{
return
referentialExternalWebClientFactory
.
getArchivalProfileExternalWebClient
();
}
@Bean
public
ProfileExternalWebClient
profileExternalWebClient
(
final
ReferentialExternalWebClientFactory
referentialExternalWebClientFactory
)
{
return
referentialExternalWebClientFactory
.
getProfileExternalWebClient
();
}
}
ui/ui-pastis/src/main/java/fr/gouv/vitamui/pastis/rest/ArchivalProfileUnitController.java
0 → 100644
View file @
55ed7182
package
fr.gouv.vitamui.pastis.rest
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
fr.gouv.vitamui.commons.api.CommonConstants
;
import
fr.gouv.vitamui.commons.api.ParameterChecker
;
import
fr.gouv.vitamui.commons.api.domain.DirectionDto
;
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.AbstractUiRestController
;
import
fr.gouv.vitamui.commons.rest.util.RestUtils
;
import
fr.gouv.vitamui.pastis.service.ArchivalProfileUnitService
;
import
fr.gouv.vitamui.referential.common.dto.ArchivalProfileUnitDto
;
import
fr.gouv.vitamui.referential.common.rest.RestApi
;
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.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.Valid
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.Context
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Collection
;
import
java.util.Optional
;
@Api
(
tags
=
"archival-profile"
)
@RestController
@RequestMapping
(
"${ui-pastis.prefix}/archival-profile"
)
@Consumes
(
"application/json"
)
@Produces
(
"application/json"
)
public
class
ArchivalProfileUnitController
extends
AbstractUiRestController
{
protected
final
ArchivalProfileUnitService
service
;
private
static
final
VitamUILogger
LOGGER
=
VitamUILoggerFactory
.
getInstance
(
ArchivalProfileUnitController
.
class
);
@Autowired
public
ArchivalProfileUnitController
(
final
ArchivalProfileUnitService
service
)
{
this
.
service
=
service
;
}
/**
* Get all Archival Unit Profiles
* @param criteria
* @return
*/
@ApiOperation
(
value
=
"Get entity"
)
@GetMapping
@ResponseStatus
(
HttpStatus
.
OK
)
public
Collection
<
ArchivalProfileUnitDto
>
getAll
(
final
Optional
<
String
>
criteria
)
{
LOGGER
.
debug
(
"Get all with criteria={}"
,
criteria
);
RestUtils
.
checkCriteria
(
criteria
);
return
service
.
getAll
(
buildUiHttpContext
(),
criteria
);
}
/**
* Get All Archival Unit Profiles Paginated
* @param page
* @param size
* @param criteria
* @param orderBy
* @param direction
* @return
*/
@ApiOperation
(
value
=
"Get entities paginated"
)
@GetMapping
(
params
=
{
"page"
,
"size"
})
@ResponseStatus
(
HttpStatus
.
OK
)
public
PaginatedValuesDto
<
ArchivalProfileUnitDto
>
getAllPaginated
(
@RequestParam
final
Integer
page
,
@RequestParam
final
Integer
size
,
@RequestParam
final
Optional
<
String
>
criteria
,
@RequestParam
final
Optional
<
String
>
orderBy
,
@RequestParam
final
Optional
<
DirectionDto
>
direction
)
{
LOGGER
.
debug
(
"getAllPaginated page={}, size={}, criteria={}, orderBy={}, ascendant={}"
,
page
,
size
,
criteria
,
orderBy
,
direction
);
return
service
.
getAllPaginated
(
page
,
size
,
criteria
,
orderBy
,
direction
,
buildUiHttpContext
());
}
/**
* Get Archival Unit Profile by Identifier
* @param identifier
* @return
* @throws UnsupportedEncodingException
*/
@ApiOperation
(
value
=
"Get profile by ID"
)
@GetMapping
(
path
=
RestApi
.
PATH_REFERENTIAL_ID
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
ArchivalProfileUnitDto
getById
(
final
@PathVariable
(
"identifier"
)
String
identifier
)
throws
UnsupportedEncodingException
{
LOGGER
.
debug
(
"getById {} / {}"
,
identifier
,
URLEncoder
.
encode
(
identifier
,
StandardCharsets
.
UTF_8
.
toString
()));
ParameterChecker
.
checkParameter
(
"The Identifier is a mandatory parameter: "
,
identifier
);
return
service
.
getOne
(
buildUiHttpContext
(),
URLEncoder
.
encode
(
identifier
,
StandardCharsets
.
UTF_8
.
toString
()));
}
/**
* Modify Archival Unit Profile by Identifier
*
* @param archivalProfileUnitDto
* @return
*/
@ApiOperation
(
value
=
"Update entity"
)
@PutMapping
(
CommonConstants
.
PATH_ID
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
ArchivalProfileUnitDto
update
(
@RequestBody
final
ArchivalProfileUnitDto
archivalProfileUnitDto
)
{
LOGGER
.
debug
(
"update profile {}"
,
archivalProfileUnitDto
.
getId
());
return
service
.
update
(
buildUiHttpContext
(),
archivalProfileUnitDto
);
}
/**
* Create Archival Unit Profile
*
* @param archivalProfileUnitDto
* @return
*/
@ApiOperation
(
value
=
"Create Archival Unit Profile"
)
@PostMapping
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
ArchivalProfileUnitDto
create
(
@Valid
@RequestBody
ArchivalProfileUnitDto
archivalProfileUnitDto
)
{
LOGGER
.
debug
(
"create archival unit profile={}"
,
archivalProfileUnitDto
);
return
service
.
create
(
buildUiHttpContext
(),
archivalProfileUnitDto
);
}
/**
* Import Archival Unit Profile from json file
* @param request HTTP request
* @param file the file to import
* @return the Vitam response
*/
@ApiOperation
(
value
=
"import Archival Unit Profile"
)
@PostMapping
(
CommonConstants
.
PATH_IMPORT
)
public
JsonNode
importProfiles
(
@Context
HttpServletRequest
request
,
MultipartFile
file
)
{
LOGGER
.
debug
(
"Import Archival Unit Profile from a file {}"
,
file
!=
null
?
file
.
getOriginalFilename
()
:
null
);
return
service
.
importArchivalUnitProfiles
(
buildUiHttpContext
(),
file
);
}
/**
* Check access
*
* @param archivalProfileUnitDto
* @return
*/
@ApiOperation
(
value
=
"Check ability to create ontology"
)
@PostMapping
(
path
=
CommonConstants
.
PATH_CHECK
)
public
ResponseEntity
<
Void
>
check
(
@RequestBody
ArchivalProfileUnitDto
archivalProfileUnitDto
)
{
LOGGER
.
debug
(
"check ability to create profile={}"
,
archivalProfileUnitDto
);
final
boolean
exist
=
service
.
check
(
buildUiHttpContext
(),
archivalProfileUnitDto
);
LOGGER
.
debug
(
"response value={}"
+
exist
);
return
RestUtils
.
buildBooleanResponse
(
exist
);
}
}
ui/ui-pastis/src/main/java/fr/gouv/vitamui/pastis/rest/ProfileController.java
0 → 100644
View file @
55ed7182
/**
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020)
* and the signatories of the "VITAM - Accord du Contributeur" agreement.
* <p>
* contact@programmevitam.fr
* <p>
* This software is a computer program whose purpose is to implement
* implement a digital archiving front-office system for the secure and
* efficient high volumetry VITAM solution.
* <p>
* 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,
* 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".
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
*/
package
fr.gouv.vitamui.pastis.rest
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
fr.gouv.vitamui.commons.api.CommonConstants
;
import
fr.gouv.vitamui.commons.api.ParameterChecker
;
import
fr.gouv.vitamui.commons.api.domain.DirectionDto
;
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.AbstractUiRestController
;
import
fr.gouv.vitamui.commons.rest.util.RestUtils
;
import
fr.gouv.vitamui.pastis.service.ProfileService
;
import
fr.gouv.vitamui.referential.common.dto.ProfileDto
;
import
fr.gouv.vitamui.referential.common.rest.RestApi
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.Resource
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.Valid
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.Context
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Collection
;
import
java.util.Optional
;
@Api
(
tags
=
"profile"
)
@RestController
@RequestMapping
(
"pastis-api/profile"
)
@Consumes
(
"application/json"
)
@Produces
(
"application/json"
)
public
class
ProfileController
extends
AbstractUiRestController
{
protected
final
ProfileService
service
;
private
static
final
VitamUILogger
LOGGER
=
VitamUILoggerFactory
.
getInstance
(
ProfileController
.
class
);
@Autowired
public
ProfileController
(
final
ProfileService
service
)
{
this
.
service
=
service
;
}
/**
* Get All Profiles
* @param criteria
* @return
*/
@ApiOperation
(
value
=
"Get entity"
)
@GetMapping
@ResponseStatus
(
HttpStatus
.
OK
)
public
Collection
<
ProfileDto
>
getAll
(
final
Optional
<
String
>
criteria
)
{
LOGGER
.
debug
(
"Test Passage"
,
criteria
);
LOGGER
.
debug
(
"Get all with criteria={}"
,
criteria
);
RestUtils
.
checkCriteria
(
criteria
);
return
service
.
getAll
(
buildUiHttpContext
(),
criteria
);
}
@ApiOperation
(
value
=
"test"
)
@GetMapping
(
value
=
"/test"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
ResponseEntity
<
String
>
test
()
{
LOGGER
.
debug
(
"Test Passage"
);
LOGGER
.
debug
(
"Get all with criteria"
);
return
new
ResponseEntity
<>(
""
,
HttpStatus
.
OK
);
}
/**
* Get all Profiles paginated
* @param page
* @param size
* @param criteria
* @param orderBy
* @param direction
* @return