Commit a79c9e88 authored by naji's avatar naji
Browse files

feat: Deplacer pastis dans external-api

parent a1a143b8
......@@ -7,9 +7,7 @@
<artifactId>api-pastis</artifactId>
<version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>fr.gouv.vitamui</groupId>
<artifactId>pastis-commons</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>pastis-commons</name>
<description>Demo project for Spring Boot</description>
<properties>
......
package fr.gouv.vitamui.pastis.commons;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class PastisCommonsApplication {
public static void main(String[] args) {
SpringApplication.run(PastisCommonsApplication.class, args);
}
}
/*
* 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.commons.rest;
public class RestApi {
public static final String STANDALONE_UPLOAD_PROFILE = "/profile";
public static final String STANDALONE_GET_ARCHIVAL_PROFILE_UNIT = "/getarchiveunitprofile";
public static final String STANDALONE_GET_PROFILE= "/getarchiveprofile";
public static final String STANDALONE_GET_PROFILE_NODE = "/edit";
public static final String STANDALONE_GET_ALL_PROFILE = "/getprofiles";
}
package fr.gouv.vitamui.pastis.commons;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PastisCommonsApplicationTests {
@Test
void contextLoads() {
}
}
......@@ -7,9 +7,7 @@
<artifactId>api-pastis</artifactId>
<version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>fr.gouv.vitamui</groupId>
<artifactId>pastis-external-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>pastis-external-client</name>
<description>Demo project for Spring Boot</description>
<properties>
......
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<baliseXML xmlns:seda="fr:gouv:culture:archivesdefrance:seda:v2.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<baliseXML>
<rng:element name="ArchiveTransfer">
<rng:optional>
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
</rng:optional>
<rng:element name="Date">
<rng:data type="token"/>
</rng:element>
<rng:element name="MessageIdentifier">
<rng:data type="token"/>
</rng:element>
<rng:element name="CodeListVersions">
<rng:data type="token"/>
</rng:element>
<rng:element name="DataObjectPackage">
<rng:optional>
<rng:attribute name="xml:id">
<rng:data type="ID"/>
</rng:attribute>
</rng:optional>
<rng:element name="DataObjectGroup">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:zeroOrMore>
<rng:element name="BinaryDataObject">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:optional>
<rng:element name="DataObjectVersion">
<xsd:annotation>
<xsd:documentation>BinaryMaster par défaut</xsd:documentation>
</xsd:annotation>
<rng:data type="token"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Uri">
<rng:data type="anyURI"/>
</rng:element>
</rng:optional>
<rng:element name="MessageDigest">
<rng:data type="base64Binary"/>
<rng:attribute name="algorithm">
<rng:data type="token"/>
</rng:attribute>
</rng:element>
</rng:element>
</rng:zeroOrMore>
</rng:element>
<rng:element name="DescriptiveMetadata">
<rng:zeroOrMore>
<rng:element name="ArchiveUnit">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:element name="Content">
<rng:optional>
<rng:element name="DescriptionLevel">
<rng:data type="token"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Title">
<rng:data type="string"/>
</rng:element>
</rng:optional>
</rng:element>
</rng:element>
</rng:zeroOrMore>
</rng:element>
<rng:element name="ManagementMetadata">
<rng:optional>
<rng:element name="OriginatingAgencyIdentifier">
<rng:data type="token"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="SubmissionAgencyIdentifier">
<rng:data type="token"/>
</rng:element>
</rng:optional>
</rng:element>
</rng:element>
<rng:element name="ArchivalAgency">
<rng:element name="Identifier">
<rng:data type="string"/>
</rng:element>
</rng:element>
<rng:element name="TransferringAgency">
<rng:element name="Identifier">
<rng:data type="string"/>
</rng:element>
</rng:element>
</rng:element>
</baliseXML>
</baliseXML>
......@@ -7,53 +7,274 @@
<artifactId>api-pastis</artifactId>
<version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>fr.gouv.vitamui</groupId>
<artifactId>pastis-external</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>pastis-external</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<!-- Generic properties -->
<maven.compile.target>1.8</maven.compile.target>
<maven.compile.source>1.8</maven.compile.source>
<java.version>11</java.version>
</properties>
<dependencies>
<!--Start of Jaxb API and it's implementation and dependencies- Java11-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.istack</groupId>
<artifactId>istack-commons-runtime</artifactId>
<version>4.0.0-M2</version>
</dependency>
<!--End of Jaxb API and it's implementation and dependencies- Java11-->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>javax.xml.parsers</groupId>
<artifactId>jaxp-api</artifactId>
<version>1.4.5</version>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- Documentation -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.2</version>
</dependency>
<!-- Start of SpringBoot starter web (Tomcat by default) and starter test-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- End of SpringBoot starter web and starter test-->
<dependency>
<groupId>com.fasterxml</groupId>
<artifactId>jackson-xml-databind</artifactId>
<version>0.6.2</version>
</dependency>
<dependency>
<groupId>com.thaiopensource</groupId>
<artifactId>jing</artifactId>
<version>20091111</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.thaiopensource</groupId>
<artifactId>trang</artifactId>
<version>20091111</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.opengis.cite.xerces</groupId>
<artifactId>xercesImpl-xsd11</artifactId>
<version>2.12-beta-r1667115</version>
</dependency>
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
<!-- Start of profiles -->
<profiles>
<!-- Profile 1 - Production -->
<profile>
<id>prod</id>
<!-- Start of production plugins -->
<build>
<plugins>
<!-- SpringBoot maven plugin-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<configuration>
<mainClass>fr.gouv.vitamui.pastis.PastisRestApplication</mainClass>
</configuration>
</execution>
</executions>
</plugin>
<!-- Read the application.properties files with the properties plug-in -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.basedir}/src/main/resources/application.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<!-- Tests -->
<testResources>
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
</testResource>
</testResources>
</build>
</profile>
<!-- End of Prod profile -->
<!-- Start of Dev profile -->
<profile>
<id>dev</id>
<build>
<!-- Start of dev profile plugins -->
<plugins>
<!-- SpringBoot maven plugin-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
</execution>
<execution>
<id>spring-boot-repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>true</executable>
<attach>false</attach> <!-- Need to use the original jar for integration-tests -->
<mainClass>fr.gouv.vitamui.pastis.PastisRestApplication</mainClass>
<jvmArguments>-Xmx128m</jvmArguments>
<jvmArguments>-Xms512m</jvmArguments>
<arguments>
<argument>--spring.config.additional-location=file:src/main/config/ui-pastis-application-dev.yml</argument>
</arguments>
</configuration>
</plugin>
<!-- Read the application.properties files with the properties plug-in -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.basedir}/src/main/resources/application.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- End of Dev profile -->
</profiles>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- Send debug messages to System.out -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- By default, encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>%d{ISO8601} [[%thread]] [%X{X-Request-Id}] %-5level %logger - %replace(%caller{1..2}){'Caller\+1 at |\n',''} : %msg %rootException%n</pattern>
</encoder>
</appender>
<!-- <appender name="FILE" class="ch.qos.logback.core.FileAppender"> -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>/tmp/vitamui/ui-pastis.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>5GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{ISO8601} [[%thread]] [%X{X-Request-Id}] %-5level %logger - %replace(%caller{1..2}){'Caller\+1 at |\n',''} : %msg %rootException%n</pattern>
</encoder>
</appender>
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
<syslogHost>localhost</syslogHost>
<facility>local0</facility>
<port>5140</port>
<suffixPattern>vitamui-ui-pastis: %d{ISO8601} [[%thread]] [%X{X-Request-Id}] %-5level %logger - %replace(%caller{1..2}){'Caller\+1 at |\n',''} : %msg %rootException%n</suffixPattern>
</appender>
<!-- By default, the level of the root level is set to TRACE -->
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
<appender-ref ref="SYSLOG" />
</root>
<logger name="org.springframework.web" level="INFO"/>
<logger name="fr.gouv.vitamui.pastis" level="INFO"/>
</configuration>
server:
host: dev.vitamui.com
port: 8051
scheme: https
ssl:
key-store: src/main/config/ui-pastis.jks
key-store-password: jkspasswd
key-password: jkspasswd
logging:
level:
fr.gouv.vitamui: DEBUG
org.springframework.web: INFO
management.endpoints.web.exposure.include: "*"
# Uncomment if you want to use you specific logback config.
#logging:
config: src/main/config/logback.xml
cors.allowed-origins: https://dev.vitamui.com:4251
......@@ -2,9 +2,16 @@ package fr.gouv.vitamui.pastis.external;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
public class PastisExternalApplication {
public class PastisExternalApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(PastisExternalApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(PastisExternalApplication.class, args);
......