diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..68892eeb5dc1217422888f8d8eae53fb2f8bf24f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +variables: + GIT_SSL_NO_VERIFY: "true" + +stages: + - tata + +.machine: &runner-shell + tags: + - vitamui, shell + +test_tata: + stage: tata + only: + - main + <<: *runner-shell + script: + # Pour éviter de faire des modifications à distance accidentellement, on supprime le lien vers le référentiel d'origine, on détache la branche de sa remote. + - git remote rm origin + # La commande "git remote add" est utilisée pour créer un dépôt distant. Le premier argument est le nom du dépôt distant et le deuxième son URL + - git remote add origin https://$TOKEN:x-oauth-basic@$LIEN_CIBLE + # on se place dans la branche du dépôt distant + - git checkout -b $BRANCHE_CIBLE + # on met à jour la branche distante (Logiquement, elle devrait toujours être au même niveau que la master local) + - git pull origin $BRANCHE_CIBLE + # on push sur github sur la branche choisie + - git push --set-upstream origin $BRANCHE_CIBLE diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bcf5da4af3a9f9b7c823d5092d2b1dfb7f04684f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,309 @@ +FROM maven:3.6.3-jdk-11 as dependencies +MAINTAINER Zakaria NAJI +LABEL name=dependencies +RUN mkdir -p /root/.m2 +USER root +COPY ./tools/docker/cines/repository /root/.m2/repository +COPY . /app +WORKDIR /app +RUN mvn clean install -DskipTests +WORKDIR /app/ui/ui-pastis +RUN mvn clean install -Pdev + +FROM adoptopenjdk/openjdk11 AS security-internal +MAINTAINER Zakaria NAJI +LABEL name=security-internal +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/api/api-security/security-commons /app/api/api-security/security-commons +COPY --from=dependencies /app/commons/commons-mongo /app/commons/commons-mongo +COPY --from=dependencies /app/api/api-security/security-internal/target /app/api/api-security/security-internal/target +COPY --from=dependencies /app/api/api-security/security-internal/run.sh /app/api/api-security/security-internal/run.sh +COPY --from=dependencies /app/api/api-security/security-internal/src/main/resources /app/api/api-security/security-internal/src/main/resources +COPY --from=dependencies /app/api/api-security/security-internal/pom.xml /app/api/api-security/security-internal/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/api/api-security/security-internal +RUN chmod +x run.sh +EXPOSE 8084 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS iam-internal +MAINTAINER Zakaria NAJI +LABEL name=iam-internal +COPY --from=dependencies /app/commons/commons-vitam /app/commons/commons-vitam +COPY --from=dependencies /app/commons/commons-logbook /app/commons/commons-logbook +COPY --from=dependencies /app/commons/commons-mongo /app/commons/commons-mongo +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/api/api-iam/iam-commons/target /app/api/api-iam/iam-commons/target +COPY --from=dependencies /app/api/api-iam/iam-commons/pom.xml /app/api/api-iam/iam-commons/pom.xml +COPY --from=dependencies /app/api/api-iam/iam-security /app/api/api-iam/iam-security +COPY --from=dependencies /app/api/api-security/security-client /app/api/api-security/security-client +COPY --from=dependencies /app/api/api-iam/iam-internal/target /app/api/api-iam/iam-internal/target +COPY --from=dependencies /app/api/api-iam/iam-internal/run.sh /app/api/api-iam/iam-internal/run.sh +COPY --from=dependencies /app/api/api-iam/iam-internal/src/main/config /app/api/api-iam/iam-internal/src/main/config +COPY --from=dependencies /app/api/api-iam/iam-internal/src/main/resources /app/api/api-iam/iam-internal/src/main/resources +COPY --from=dependencies /app/api/api-iam/iam-internal/pom.xml /app/api/api-iam/iam-internal/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/api/api-iam/iam-internal +RUN chmod +x run.sh +EXPOSE 7083 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS iam-external +MAINTAINER Zakaria NAJI +LABEL name=iam-external +COPY --from=dependencies /app/commons/commons-vitam /app/commons/commons-vitam +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/api/api-iam/iam-commons/target /app/api/api-iam/iam-commons/target +COPY --from=dependencies /app/api/api-iam/iam-commons/pom.xml /app/api/api-iam/iam-commons/pom.xml +COPY --from=dependencies /app/api/api-iam/iam-security /app/api/api-iam/iam-security +COPY --from=dependencies /app/api/api-security/security-client /app/api/api-security/security-client +COPY --from=dependencies /app/api/api-iam/iam-internal-client/target /app/api/api-iam/iam-internal-client/target +COPY --from=dependencies /app/api/api-iam/iam-internal-client/pom.xml /app/api/api-iam/iam-internal-client/pom.xml +COPY --from=dependencies /app/api/api-iam/iam-external/target /app/api/api-iam/iam-external/target +COPY --from=dependencies /app/api/api-iam/iam-external/run.sh /app/api/api-iam/iam-external/run.sh +COPY --from=dependencies /app/api/api-iam/iam-external/src/main/resources /app/api/api-iam/iam-external/src/main/resources +COPY --from=dependencies /app/api/api-iam/iam-external/pom.xml /app/api/api-iam/iam-external/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/api/api-iam/iam-external +RUN chmod +x run.sh +EXPOSE 8083 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS referential-external +MAINTAINER Zakaria NAJI +LABEL name=referential-external +COPY --from=dependencies /app/api/api-referential/referential-commons/target /app/api/api-referential/referential-commons/target +COPY --from=dependencies /app/api/api-referential/referential-commons/pom.xml /app/api/api-referential/referential-commons/pom.xml +COPY --from=dependencies /app/commons/commons-vitam /app/commons/commons-vitam +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/api/api-iam/iam-security /app/api/api-iam/iam-security +COPY --from=dependencies /app/api/api-security/security-client /app/api/api-security/security-client +COPY --from=dependencies /app/api/api-iam/iam-internal-client/target /app/api/api-iam/iam-internal-client/target +COPY --from=dependencies /app/api/api-iam/iam-internal-client/pom.xml /app/api/api-iam/iam-internal-client/pom.xml +COPY --from=dependencies /app/api/api-referential/referential-internal-client/target /app/api/api-referential/referential-internal-client/target +COPY --from=dependencies /app/api/api-referential/referential-internal-client/pom.xml /app/api/api-referential/referential-internal-client/pom.xml +COPY --from=dependencies /app/api/api-referential/referential-external/target /app/api/api-referential/referential-external/target +COPY --from=dependencies /app/api/api-referential/referential-external/run.sh /app/api/api-referential/referential-external/run.sh +COPY --from=dependencies /app/api/api-referential/referential-external/src/main/resources /app/api/api-referential/referential-external/src/main/resources +COPY --from=dependencies /app/api/api-referential/referential-external/pom.xml /app/api/api-referential/referential-external/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/api/api-referential/referential-external +RUN chmod +x run.sh +EXPOSE 8087 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS referential-internal +MAINTAINER Zakaria NAJI +LABEL name=referential-internal +COPY --from=dependencies /app/api/api-iam/iam-security /app/api/api-iam/iam-security +COPY --from=dependencies /app/api/api-security/security-client /app/api/api-security/security-client +COPY --from=dependencies /app/commons/commons-vitam /app/commons/commons-vitam +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/api/api-referential/referential-commons/target /app/api/api-referential/referential-commons/target +COPY --from=dependencies /app/api/api-referential/referential-commons/pom.xml /app/api/api-referential/referential-commons/pom.xml +COPY --from=dependencies /app/api/api-referential/referential-internal/target /app/api/api-referential/referential-internal/target +COPY --from=dependencies /app/api/api-referential/referential-internal/run.sh /app/api/api-referential/referential-internal/run.sh +COPY --from=dependencies /app/api/api-referential/referential-internal/src/main/resources /app/api/api-referential/referential-internal/src/main/resources +COPY --from=dependencies /app/api/api-referential/referential-internal/pom.xml /app/api/api-referential/referential-internal/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/api/api-referential/referential-internal +RUN chmod +x run.sh +EXPOSE 7087 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS pastis-external +MAINTAINER Zakaria NAJI +LABEL name=pastis-external +COPY --from=dependencies /app/api/api-iam/iam-security /app/api/api-iam/iam-security +COPY --from=dependencies /app/api/api-security/security-client /app/api/api-security/security-client +COPY --from=dependencies /app/api/api-iam/iam-internal-client/target /app/api/api-iam/iam-internal-client/target +COPY --from=dependencies /app/api/api-iam/iam-internal-client/pom.xml /app/api/api-iam/iam-internal-client/pom.xml +COPY --from=dependencies /app/commons/commons-vitam /app/commons/commons-vitam +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/api/api-pastis/pastis-commons/target /app/api/api-pastis/pastis-commons/target +COPY --from=dependencies /app/api/api-pastis/pastis-commons/pom.xml /app/api/api-pastis/pastis-commons/pom.xml +COPY --from=dependencies /app/api/api-pastis/pastis-client/target /app/api/api-pastis/pastis-client/target +COPY --from=dependencies /app/api/api-pastis/pastis-client/pom.xml /app/api/api-pastis/pastis-client/pom.xml +COPY --from=dependencies /app/api/api-pastis/pastis-external/target /app/api/api-pastis/pastis-external/target +COPY --from=dependencies /app/api/api-pastis/pastis-external/run.sh /app/api/api-pastis/pastis-external/run.sh +COPY --from=dependencies /app/api/api-pastis/pastis-external/src/main/resources /app/api/api-pastis/pastis-external/src/main/resources +COPY --from=dependencies /app/api/api-pastis/pastis-external/pom.xml /app/api/api-pastis/pastis-external/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/api/api-pastis/pastis-external +RUN chmod +x run.sh +EXPOSE 8015 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS cas-server +MAINTAINER Zakaria NAJI +LABEL name=cas-server +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/api/api-iam/iam-commons/target /app/api/api-iam/iam-commons/target +COPY --from=dependencies /app/api/api-iam/iam-commons/pom.xml /app/api/api-iam/iam-commons/pom.xml +COPY --from=dependencies /app/api/api-iam/iam-external-client/target /app/api/api-iam/iam-external-client/target +COPY --from=dependencies /app/api/api-iam/iam-external-client/pom.xml /app/api/api-iam/iam-external-client/pom.xml +COPY --from=dependencies /app/cas/cas-server/target /app/cas/cas-server/target +COPY --from=dependencies /app/cas/cas-server/run.sh /app/cas/cas-server/run.sh +COPY --from=dependencies /app/cas/cas-server/src/main/config /app/cas/cas-server/src/main/config +COPY --from=dependencies /app/cas/cas-server/pom.xml /app/cas/cas-server/pom.xml +COPY --from=dependencies /app/cas/pom.xml /app/cas/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/cas/cas-server +RUN chmod +x run.sh +EXPOSE 8080 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS ui-portal +MAINTAINER Zakaria NAJI +LABEL name=ui-portal +COPY --from=dependencies /app/api/api-iam/iam-external-client/target /app/api/api-iam/iam-external-client/target +COPY --from=dependencies /app/api/api-iam/iam-external-client/pom.xml /app/api/api-iam/iam-external-client/pom.xml +COPY --from=dependencies /app/ui/ui-frontend/target /app/ui/ui-frontend/target +COPY --from=dependencies /app/ui/ui-frontend/dist /app/ui/ui-frontend/dist +COPY --from=dependencies /app/ui/ui-frontend/pom.xml /app/ui/ui-frontend/pom.xml +COPY --from=dependencies /app/ui/ui-commons/target /app/ui/ui-commons/target +COPY --from=dependencies /app/ui/ui-commons/pom.xml /app/ui/ui-commons/pom.xml +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/api/api-iam/iam-commons/target /app/api/api-iam/iam-commons/target +COPY --from=dependencies /app/api/api-iam/iam-commons/pom.xml /app/api/api-iam/iam-commons/pom.xml +COPY --from=dependencies /app/ui/ui-portal/target /app/ui/ui-portal/target +COPY --from=dependencies /app/ui/ui-portal/run.sh /app/ui/ui-portal/run.sh +COPY --from=dependencies /app/ui/ui-portal/src/main/resources /app/ui/ui-portal/src/main/resources +COPY --from=dependencies /app/ui/ui-portal/pom.xml /app/ui/ui-portal/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/ui/ui-portal +RUN chmod +x run.sh +EXPOSE 9000 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS ui-identity +MAINTAINER Zakaria NAJI +LABEL name=ui-identity +COPY --from=dependencies /app/api/api-iam/iam-external-client/target /app/api/api-iam/iam-external-client/target +COPY --from=dependencies /app/api/api-iam/iam-external-client/pom.xml /app/api/api-iam/iam-external-client/pom.xml +COPY --from=dependencies /app/ui/ui-frontend/target /app/ui/ui-frontend/target +COPY --from=dependencies /app/ui/ui-frontend/dist /app/ui/ui-frontend/dist +COPY --from=dependencies /app/ui/ui-frontend/pom.xml /app/ui/ui-frontend/pom.xml +COPY --from=dependencies /app/ui/ui-commons/target /app/ui/ui-commons/target +COPY --from=dependencies /app/ui/ui-commons/pom.xml /app/ui/ui-commons/pom.xml +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/commons/commons-security /app/commons/commons-security +COPY --from=dependencies /app/api/api-iam/iam-commons/target /app/api/api-iam/iam-commons/target +COPY --from=dependencies /app/api/api-iam/iam-commons/pom.xml /app/api/api-iam/iam-commons/pom.xml +COPY --from=dependencies /app/ui/ui-identity/target /app/ui/ui-identity/target +COPY --from=dependencies /app/ui/ui-identity/run.sh /app/ui/ui-identity/run.sh +COPY --from=dependencies /app/ui/ui-identity/src/main/resources /app/ui/ui-identity/src/main/resources +COPY --from=dependencies /app/ui/ui-identity/pom.xml /app/ui/ui-identity/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/ui/ui-identity +RUN chmod +x run.sh +EXPOSE 9001 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS ui-referential +MAINTAINER Zakaria NAJI +LABEL name=ui-referential +COPY --from=dependencies /app/api/api-referential/referential-commons/target /app/api/api-iamreferential/referential-commons/target +COPY --from=dependencies /app/api/api-referential/referential-commons/pom.xml /app/api/api-referential/referential-commons/pom.xml +COPY --from=dependencies /app/api/api-referential/referential-external-client/target /app/api/api-referential/referential-external-client/target +COPY --from=dependencies /app/api/api-referential/referential-external-client/pom.xml /app/api/api-referential/referential-external-client/pom.xml +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/ui/ui-commons/target /app/ui/ui-commons/target +COPY --from=dependencies /app/ui/ui-commons/pom.xml /app/ui/ui-commons/pom.xml +COPY --from=dependencies /app/ui/ui-frontend/target /app/ui/ui-frontend/target +COPY --from=dependencies /app/ui/ui-frontend/dist /app/ui/ui-frontend/dist +COPY --from=dependencies /app/ui/ui-frontend/pom.xml /app/ui/ui-frontend/pom.xml +COPY --from=dependencies /app/ui/ui-referential/target /app/ui/ui-referential/target +COPY --from=dependencies /app/ui/ui-referential/run.sh /app/ui/ui-referential/run.sh +COPY --from=dependencies /app/ui/ui-referential/src/main/resources /app/ui/ui-referential/src/main/resources +COPY --from=dependencies /app/ui/ui-referential/pom.xml /app/ui/ui-referential/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/ui/ui-referential +RUN chmod +x run.sh +EXPOSE 9002 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM adoptopenjdk/openjdk11 AS ui-pastis +MAINTAINER Zakaria NAJI +LABEL name=ui-pastis +COPY --from=dependencies /app/api/api-iam/iam-external-client/target /app/api/api-iam/iam-external-client/target +COPY --from=dependencies /app/api/api-iam/iam-external-client/pom.xml /app/api/api-iam/iam-external-client/pom.xml +COPY --from=dependencies /app/api/api-iam/iam-commons/target /app/api/api-iam/iam-commons/target +COPY --from=dependencies /app/api/api-iam/iam-commons/pom.xml /app/api/api-iam/iam-commons/pom.xml +COPY --from=dependencies /app/commons/commons-rest /app/commons/commons-rest +COPY --from=dependencies /app/commons/commons-api /app/commons/commons-api +COPY --from=dependencies /app/ui/ui-commons/target /app/ui/ui-commons/target +COPY --from=dependencies /app/ui/ui-commons/pom.xml /app/ui/ui-commons/pom.xml +COPY --from=dependencies /app/api/api-pastis/pastis-client/target /app/api/api-pastis/pastis-client/target +COPY --from=dependencies /app/api/api-pastis/pastis-client/pom.xml /app/api/api-pastis/pastis-client/pom.xml +COPY --from=dependencies /app/api/api-pastis/pastis-commons/target /app/api/api-iampastis/pastis-commons/target +COPY --from=dependencies /app/api/api-pastis/pastis-commons/pom.xml /app/api/api-pastis/pastis-commons/pom.xml +COPY --from=dependencies /app/ui/ui-frontend/target /app/ui/ui-frontend/target +COPY --from=dependencies /app/ui/ui-frontend/dist /app/ui/ui-frontend/dist +COPY --from=dependencies /app/ui/ui-frontend/pom.xml /app/ui/ui-frontend/pom.xml +COPY --from=dependencies /app/ui/ui-pastis/target /app/ui/ui-pastis/target +COPY --from=dependencies /app/ui/ui-pastis/run.sh /app/ui/ui-pastis/run.sh +COPY --from=dependencies /app/ui/ui-pastis/src/main/resources /app/ui/ui-pastis/src/main/resources +COPY --from=dependencies /app/ui/ui-pastis/pom.xml /app/ui/ui-pastis/pom.xml +COPY --from=dependencies /app/dev-deployment/environments/certs/server/hosts/localhost /app/dev-deployment/environments/certs/server/hosts/localhost +COPY --from=dependencies /app/dev-deployment/environments/keystores/server /app/dev-deployment/environments/keystores/server +WORKDIR /app/ui/ui-pastis +RUN chmod +x run.sh +EXPOSE 9015 +ENTRYPOINT ["/bin/bash", "./run.sh"] + +FROM node:12.16.1 AS PORTAL +MAINTAINER Zakaria NAJI +LABEL name=portal-front +COPY --from=dependencies /app/ui/ui-frontend /app/ui-frontend +COPY --from=dependencies /app/dev-deployment /app/ui-frontend/dev-deployment +WORKDIR /app/ui-frontend +EXPOSE 4200 +ENTRYPOINT ["npm", "run", "start:portal"] + +FROM node:12.16.1 AS IDENTITY +MAINTAINER Zakaria NAJI +LABEL name=identity-front +COPY --from=dependencies /app/ui/ui-frontend /app/ui-frontend +COPY --from=dependencies /app/dev-deployment /app/ui-frontend/dev-deployment +WORKDIR /app/ui-frontend +EXPOSE 4201 +ENTRYPOINT ["npm", "run", "start:identity"] + +FROM node:12.16.1 AS REFERENTIAL +MAINTAINER Zakaria NAJI +LABEL name=referential-front +COPY --from=dependencies /app/ui/ui-frontend /app/ui-frontend +COPY --from=dependencies /app/dev-deployment /app/ui-frontend/dev-deployment +WORKDIR /app/ui-frontend +EXPOSE 4202 +ENTRYPOINT ["npm", "run", "start:referential"] + +FROM node:12.16.1 AS PASTIS +MAINTAINER Zakaria NAJI +LABEL name=pastis-front +COPY --from=dependencies /app/ui/ui-frontend /app/ui-frontend +COPY --from=dependencies /app/ui/ui-frontend-common /app/ui-frontend-common +COPY --from=dependencies /app/dev-deployment /app/ui-frontend/dev-deployment +WORKDIR /app/ui-frontend +EXPOSE 4251 +ENTRYPOINT ["npm", "run", "start:pastis"] diff --git a/api/api-iam/iam-external/run.sh b/api/api-iam/iam-external/run.sh index c57d981d86ce6bee149bbd0c8098e46941c2b7da..a7651271bd7d806fca501886ff0b3d1d4c2d7e8f 100755 --- a/api/api-iam/iam-external/run.sh +++ b/api/api-iam/iam-external/run.sh @@ -7,4 +7,4 @@ cp -r src/main/config target/src/main/config #retrieve version version="$(grep -oP '(?<=>).*?(?=)' pom.xml | grep -v 'version')" -./target/iam-external-$(echo $version).jar -Xms128m -Xmx512m --spring.profiles.active=dev +java -jar target/iam-external-$(echo $version).jar -Xms128m -Xmx512m --spring.profiles.active=dev diff --git a/api/api-iam/iam-external/src/main/resources/application-dev.yml b/api/api-iam/iam-external/src/main/resources/application-dev.yml index 7f2951644e4154ba52cd7f00ffab8c7a599e676e..09efadd24f585f477e303cce9fe865ea67b888fd 100644 --- a/api/api-iam/iam-external/src/main/resources/application-dev.yml +++ b/api/api-iam/iam-external/src/main/resources/application-dev.yml @@ -25,10 +25,10 @@ server: host: port: 8083 ssl: - key-store: src/main/resources/dev/keystore_iam-external.jks + key-store: ../../../dev-deployment/environments/keystores/server/localhost/keystore_iam-external.jks key-store-password: changeme key-password: changeme - trust-store: src/main/resources/dev/truststore_server.jks + trust-store: ../../../dev-deployment/environments/keystores/server/truststore_server.jks trust-store-password: changeme client-auth: need enabled-protocols: TLSv1.1,TLSv1.2,TLSv1.3 diff --git a/api/api-iam/iam-internal/run.sh b/api/api-iam/iam-internal/run.sh index 126742a2ab340221fb8e1124949804ee05f64b2d..7dab01e11c8f2e40a79d574f87f844c99da51c18 100755 --- a/api/api-iam/iam-internal/run.sh +++ b/api/api-iam/iam-internal/run.sh @@ -7,4 +7,4 @@ cp -r src/main/config target/src/main/config #retrieve version version="$(grep -oP '(?<=>).*?(?=)' pom.xml | grep -v 'version')" -java -Dvitam.config.folder=src/main/resources/dev/vitam -jar target/iam-internal-$(echo $version).jar -Xms128m -Xmx512m --spring.profiles.active=dev +java -Dvitam.config.folder=src/main/config/dev-vitam -jar target/iam-internal-$(echo $version).jar -Xms128m -Xmx512m --spring.profiles.active=dev diff --git a/api/api-iam/iam-internal/src/main/config/dev-vitam/access-external-client.conf b/api/api-iam/iam-internal/src/main/config/dev-vitam/access-external-client.conf new file mode 100755 index 0000000000000000000000000000000000000000..e55c06df2b9ab9042d8a09970409aa62dceeaa57 --- /dev/null +++ b/api/api-iam/iam-internal/src/main/config/dev-vitam/access-external-client.conf @@ -0,0 +1,11 @@ +serverHost: 10.6.10.43 +serverPort: 8444 +secure: true +sslConfiguration : + keystore : + - keyPath: src/main/config/dev-vitam/keystore_vitamui.p12 + keyPassword: azerty4 + truststore : + - keyPath: src/main/config/dev-vitam/truststore_vitam.jks + keyPassword: azerty10 +hostnameVerification: true diff --git a/api/api-iam/iam-internal/src/main/config/dev-vitam/ingest-external-client.conf b/api/api-iam/iam-internal/src/main/config/dev-vitam/ingest-external-client.conf new file mode 100755 index 0000000000000000000000000000000000000000..8e3c42239aa2bad4a730cb44e8b5304afbefc980 --- /dev/null +++ b/api/api-iam/iam-internal/src/main/config/dev-vitam/ingest-external-client.conf @@ -0,0 +1,11 @@ +serverHost: ingest-external.service.consul +serverPort: 8443 +secure: true +sslConfiguration : + keystore : + - keyPath: src/main/config/dev-vitam/keystore_vitamui.p12 + keyPassword: azerty4 + truststore : + - keyPath: src/main/config/dev-vitam/truststore_vitam.jks + keyPassword: azerty10 +hostnameVerification: true diff --git a/api/api-iam/iam-internal/src/main/config/dev-vitam/keystore_vitamui.p12 b/api/api-iam/iam-internal/src/main/config/dev-vitam/keystore_vitamui.p12 new file mode 100755 index 0000000000000000000000000000000000000000..6307b111d22ae85d636ea1a7d9f2d1fd26727cdd Binary files /dev/null and b/api/api-iam/iam-internal/src/main/config/dev-vitam/keystore_vitamui.p12 differ diff --git a/api/api-iam/iam-internal/src/main/config/dev-vitam/truststore_vitam.jks b/api/api-iam/iam-internal/src/main/config/dev-vitam/truststore_vitam.jks new file mode 100755 index 0000000000000000000000000000000000000000..cc137286b97dfba8fa84a03aaed764c9c5b7e7dc Binary files /dev/null and b/api/api-iam/iam-internal/src/main/config/dev-vitam/truststore_vitam.jks differ diff --git a/api/api-iam/iam-internal/src/main/resources/access-external-client.conf b/api/api-iam/iam-internal/src/main/resources/access-external-client.conf new file mode 100644 index 0000000000000000000000000000000000000000..c76a21bbf482ec15d16a2cf87564987a4f04b05e --- /dev/null +++ b/api/api-iam/iam-internal/src/main/resources/access-external-client.conf @@ -0,0 +1,11 @@ +serverHost: 10.6.10.65 +serverPort: 8444 +secure: true +sslConfiguration : + keystore : + - keyPath: keystore_access-external.p12 + keyPassword: azerty4 + truststore : + - keyPath: truststore_access-external.jks + keyPassword: azerty10 +hostnameVerification: true diff --git a/api/api-iam/iam-internal/src/main/resources/application-dev.yml b/api/api-iam/iam-internal/src/main/resources/application-dev.yml index 3786846a8ccbd8f60b767116a6c1f1fec98900cc..3962279f4d806eeb8eacccb7e33bc6fc43e17d22 100644 --- a/api/api-iam/iam-internal/src/main/resources/application-dev.yml +++ b/api/api-iam/iam-internal/src/main/resources/application-dev.yml @@ -15,7 +15,7 @@ spring: register: false data: mongodb: - uri: mongodb://mongod_dbuser_iam:mongod_dbpwd_iam@localhost: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 @@ -43,10 +43,10 @@ cas-client: secure: true ssl-configuration: truststore: - key-path: src/main/resources/dev/keystore_iam-internal.jks + key-path: ../../../dev-deployment/environments/keystores/server/localhost/keystore_iam-internal.jks key-password: changeme keystore: - key-path: src/main/resources/dev/keystore_iam-internal.jks + key-path: ../../../dev-deployment/environments/keystores/server/localhost/keystore_iam-internal.jks key-password: changeme type: JKS hostname-verification: false @@ -97,11 +97,11 @@ provisioning-client: secure: true ssl-configuration: keystore: - key-path: src/main/resources/dev/keystore_iam-internal.jks + key-path: ../../../dev-deployment/environments/keystores/server/localhost/keystore_iam-internal.jks key-password: changeme type: JKS truststore: - key-path: src/main/resources/dev/truststore_server.jks + key-path: ../../../dev-deployment/environments/keystores/server/truststore_server.jks key-password: changeme type: JKS hostname-verification: false @@ -111,11 +111,11 @@ provisioning-client: secure: true ssl-configuration: keystore: - key-path: src/main/resources/dev/keystore_iam-internal.jks + key-path: ../../../dev-deployment/environments/keystores/server/localhost/keystore_iam-internal.jks key-password: changeme type: JKS truststore: - key-path: src/main/resources/dev/truststore_server.jks + key-path: ../../../dev-deployment/environments/keystores/server/truststore_server.jks key-password: changeme type: JKS hostname-verification: false diff --git a/api/api-iam/iam-internal/src/main/resources/application.yml b/api/api-iam/iam-internal/src/main/resources/application.yml index 3e2e3d8e9776581665ef266b810d512d0d9479fb..1d643440968cfc01d6d5994faab0df33c0d424d3 100644 --- a/api/api-iam/iam-internal/src/main/resources/application.yml +++ b/api/api-iam/iam-internal/src/main/resources/application.yml @@ -1,6 +1,7 @@ # 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: diff --git a/api/api-iam/iam-internal/src/main/resources/dev/customer-init.yml b/api/api-iam/iam-internal/src/main/resources/dev/customer-init.yml index 25ce9eec9180d9918fa585ac81ef5c0c10518aac..981d1605a2d22c9ef23857e96f20ee29f376eb72 100644 --- a/api/api-iam/iam-internal/src/main/resources/dev/customer-init.yml +++ b/api/api-iam/iam-internal/src/main/resources/dev/customer-init.yml @@ -165,6 +165,16 @@ customer-init: - ROLE_GET_ALL_ARCHIVE_SEARCH - ROLE_SEARCH_WITH_RULES + - name: Profil pour la gestion des pua/pa de pastis + description: Gestion de Pastis dans Vitam + app-name: PASTIS_APP + level: + roles: + - ROLE_GET_PASTIS + - ROLE_CREATE_PASTIS + - ROLE_UPDATE_PASTIS + - ROLE_DELETE_PASTIS + - name: Archiviste description: Profil pour la recherche et consultation des archives dans Vitam avec mises à jour des règles de gestion, avec export DIP et sans élimination app-name: ARCHIVE_SEARCH_MANAGEMENT_APP diff --git a/api/api-iam/iam-internal/src/main/resources/ingest-external-client.conf b/api/api-iam/iam-internal/src/main/resources/ingest-external-client.conf new file mode 100644 index 0000000000000000000000000000000000000000..8c5071e7d6094474a67ec232ccb6d4fdf403a11e --- /dev/null +++ b/api/api-iam/iam-internal/src/main/resources/ingest-external-client.conf @@ -0,0 +1,11 @@ +serverHost: 10.6.10.65 +serverPort: 8443 +secure: true +sslConfiguration: + keystore : + - keyPath: keystore_access-external.p12 + keyPassword: azerty4 + truststore : + - keyPath: truststore_access-external.jks + keyPassword: azerty10 +hostnameVerification: true diff --git a/api/api-iam/iam-internal/src/main/resources/keystore_access-external.p12 b/api/api-iam/iam-internal/src/main/resources/keystore_access-external.p12 new file mode 100644 index 0000000000000000000000000000000000000000..5fd263182b6203b61759063663c661ec5909a121 Binary files /dev/null and b/api/api-iam/iam-internal/src/main/resources/keystore_access-external.p12 differ diff --git a/api/api-iam/iam-internal/src/main/resources/truststore_access-external.jks b/api/api-iam/iam-internal/src/main/resources/truststore_access-external.jks new file mode 100644 index 0000000000000000000000000000000000000000..fa8b31eab210560f9d16a02eb23d476ae5d5e55f Binary files /dev/null and b/api/api-iam/iam-internal/src/main/resources/truststore_access-external.jks differ diff --git a/api/api-ingest/ingest-internal/pom.xml b/api/api-ingest/ingest-internal/pom.xml index 7d61283fed9cf7af62c81e6b9a9f5e885d68000f..75e6cc815018b35417c21c2a726d8caabc77ebe4 100644 --- a/api/api-ingest/ingest-internal/pom.xml +++ b/api/api-ingest/ingest-internal/pom.xml @@ -215,7 +215,6 @@ simple-odf - diff --git a/api/api-ingest/pom.xml b/api/api-ingest/pom.xml index ad790d980a85d9f9f84f7dcf97020a35192be079..bc17fe68c6c515f1ec32a6a95ef986b82c3c45a6 100644 --- a/api/api-ingest/pom.xml +++ b/api/api-ingest/pom.xml @@ -14,7 +14,6 @@ VITAMUI Ingest API - ingest-internal ingest-external ingest-internal-client ingest-external-client diff --git a/api/api-pastis/pastis-client/pom.xml b/api/api-pastis/pastis-client/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..d29d0ac336bc77f31806ec530330ddf4a3a9384b --- /dev/null +++ b/api/api-pastis/pastis-client/pom.xml @@ -0,0 +1,105 @@ + + + + api-pastis + fr.gouv.vitamui + 5.0-SNAPSHOT + + 4.0.0 + + pastis-client + jar + VITAMUI Pastis Client API + + + + + + + fr.gouv.vitamui.commons + commons-api + + + + fr.gouv.vitamui.commons + commons-rest + + + + fr.gouv.vitamui + pastis-commons + 5.0-SNAPSHOT + + + + + + com.fasterxml.jackson.core + jackson-databind + + + + com.fasterxml.jackson.core + jackson-core + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-webflux + + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.mockito + mockito-core + test + + + + org.easymock + easymock + test + + + + org.powermock + powermock-api-easymock + test + + + + org.powermock + powermock-module-junit4 + test + + + + org.springframework.boot + spring-boot-starter-test + test + + + + fr.gouv.vitamui.commons + commons-test + test-jar + test + + + + + diff --git a/api/api-pastis/pastis-client/src/main/java/fr/gouv/vitamui/pastis/client/PastisRestClientFactory.java b/api/api-pastis/pastis-client/src/main/java/fr/gouv/vitamui/pastis/client/PastisRestClientFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..69e1c1226b776fb35bc589c6c5da88c93413afac --- /dev/null +++ b/api/api-pastis/pastis-client/src/main/java/fr/gouv/vitamui/pastis/client/PastisRestClientFactory.java @@ -0,0 +1,66 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.client; + +import fr.gouv.vitamui.commons.rest.client.BaseRestClientFactory; +import fr.gouv.vitamui.commons.rest.client.configuration.HttpPoolConfiguration; +import fr.gouv.vitamui.commons.rest.client.configuration.RestClientConfiguration; +import org.springframework.boot.web.client.RestTemplateBuilder; + + +public class PastisRestClientFactory extends BaseRestClientFactory { + + public PastisRestClientFactory( + RestClientConfiguration restClientConfiguration, + RestTemplateBuilder restTemplateBuilder) { + super(restClientConfiguration, restTemplateBuilder); + } + + public PastisRestClientFactory( + RestClientConfiguration restClientConfig, + HttpPoolConfiguration httpPoolConfig, + RestTemplateBuilder restTemplateBuilder) { + super(restClientConfig, httpPoolConfig, restTemplateBuilder); + } + + public PastisTransformationRestClient getPastisTransformationRestClient() { + return new PastisTransformationRestClient(getRestTemplate(), getBaseUrl()); + } + +} diff --git a/api/api-pastis/pastis-client/src/main/java/fr/gouv/vitamui/pastis/client/PastisTransformationRestClient.java b/api/api-pastis/pastis-client/src/main/java/fr/gouv/vitamui/pastis/client/PastisTransformationRestClient.java new file mode 100644 index 0000000000000000000000000000000000000000..9d30c7f0603b378677dbdd5335bc2330a89931f4 --- /dev/null +++ b/api/api-pastis/pastis-client/src/main/java/fr/gouv/vitamui/pastis/client/PastisTransformationRestClient.java @@ -0,0 +1,169 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.client; + +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.Notice; +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.common.util.FileSystemResource; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.io.Resource; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +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 { + + private static final VitamUILogger LOGGER = + VitamUILoggerFactory.getInstance(PastisTransformationRestClient.class); + + public PastisTransformationRestClient(RestTemplate restTemplate, + String baseUrl) { + super(restTemplate, baseUrl); + } + + @Override + protected Class getDtoClass() { + return ProfileResponse.class; + } + + @Override + protected ParameterizedTypeReference> getDtoListClass() { + return new ParameterizedTypeReference>() { + }; + } + + @Override + protected ParameterizedTypeReference> getDtoPaginatedClass() { + return new ParameterizedTypeReference>() { + }; + } + + @Override + public String getPathUrl() { + return RestApi.PASTIS; + } + + public ResponseEntity loadProfile(Notice notice, ExternalHttpContext context) + throws IOException { + LOGGER.debug("Transform profile"); + MultiValueMap headers = buildSearchHeaders(context); + final HttpEntity request = new HttpEntity<>(notice, headers); + final ResponseEntity response = + restTemplate.exchange(getUrl() + RestApi.PASTIS_TRANSFORM_PROFILE, HttpMethod.POST, + request, ProfileResponse.class); + return response; + } + + public ResponseEntity loadProfileFromFile(MultipartFile file, ExternalHttpContext context) + throws IOException { + LOGGER.debug("Upload profile"); + final UriComponentsBuilder uriBuilder = + UriComponentsBuilder.fromHttpUrl(getUrl() + RestApi.PASTIS_UPLOAD_PROFILE); + MultiValueMap bodyMap = new LinkedMultiValueMap<>(); + bodyMap.add("file", new FileSystemResource(file.getBytes(), file.getOriginalFilename())); + final HttpEntity> request = new HttpEntity<>(bodyMap, buildHeaders(context)); + return restTemplate.exchange(getUrl() + RestApi.PASTIS_UPLOAD_PROFILE, + HttpMethod.POST, + request, + ProfileResponse.class); + } + + public ResponseEntity getArchiveProfile(final ElementProperties json, ExternalHttpContext context) + throws IOException { + LOGGER.debug("Download archive profile"); + MultiValueMap headers = buildSearchHeaders(context); + final HttpEntity request = new HttpEntity<>(json, headers); + final ResponseEntity response = + restTemplate.exchange(getUrl() + RestApi.PASTIS_DOWNLOAD_PA, HttpMethod.POST, + request, String.class); + return response; + } + + public ResponseEntity getArchiveUnitProfile(final ProfileNotice json, ExternalHttpContext context) + throws IOException { + LOGGER.debug("Download Arichivale unit profile"); + MultiValueMap headers = buildSearchHeaders(context); + final HttpEntity request = new HttpEntity<>(json, headers); + final ResponseEntity response = + restTemplate.exchange(getUrl() + RestApi.PASTIS_DOWNLOAD_PUA, HttpMethod.POST, + request, String.class); + return response; + } + + + public ResponseEntity loadProfilePA(Resource resource, ExternalHttpContext context) + throws IOException { + LOGGER.debug("Upload profile"); + MultiValueMap bodyMap = new LinkedMultiValueMap<>(); + bodyMap.add("file", new FileSystemResource(resource.getInputStream().readAllBytes(), "test_eeee.rng")); + final HttpEntity> request = new HttpEntity<>(bodyMap, buildHeaders(context)); + return restTemplate.exchange(getUrl() + RestApi.PASTIS_TRANSFORM_PROFILE_PA, + HttpMethod.POST, + request, + ElementProperties.class); + } + + public ResponseEntity createProfile(String profileType, ExternalHttpContext context) + throws IOException { + LOGGER.debug("Transform profile"); + MultiValueMap headers = buildSearchHeaders(context); + final HttpEntity request = new HttpEntity<>(headers); + final ResponseEntity response = + restTemplate.exchange(getUrl() + RestApi.PASTIS_CREATE_PROFILE + "?type=" + profileType, HttpMethod.GET, + request, ProfileResponse.class); + return response; + } +} diff --git a/api/api-pastis/pastis-commons/pom.xml b/api/api-pastis/pastis-commons/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..f1b229ebc27bc5e33f53212b50756aaa151749ff --- /dev/null +++ b/api/api-pastis/pastis-commons/pom.xml @@ -0,0 +1,150 @@ + + + + api-pastis + fr.gouv.vitamui + 5.0-SNAPSHOT + + 4.0.0 + + pastis-commons + VITAMUI Pastis Commons + + + + + + fr.gouv.vitamui.commons + commons-api + + + fr.gouv.vitamui.commons + commons-vitam + + + + org.projectlombok + lombok + compile + + + + + + + javax.xml.bind + jaxb-api + 2.3.1 + + + + com.sun.xml.bind + jaxb-impl + 2.3.1 + + + + com.sun.istack + istack-commons-runtime + 4.0.0-M2 + + + + + + org.json + json + 20180813 + + + + javax.xml.parsers + jaxp-api + 1.4.5 + + + + com.fasterxml + jackson-xml-databind + 0.6.2 + + + + com.thaiopensource + jing + 20091111 + + + xml-apis + xml-apis + + + net.sf.saxon + saxon + + + xerces + xercesImpl + + + + + + com.thaiopensource + trang + 20091111 + + + xml-apis + xml-apis + + + net.sf.saxon + saxon + + + xerces + xercesImpl + + + + + + org.opengis.cite.xerces + xercesImpl-xsd11 + 2.12-beta-r1667115 + + + + xml-resolver + xml-resolver + 1.2 + + + org.skyscreamer + jsonassert + compile + + + com.google.code.gson + gson + + + + org.springframework.boot + spring-boot-starter-tomcat + + + + diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/ElementProperties.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/ElementProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..fd008a7eff220fa68843667e3a56e63dbd61dd52 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/ElementProperties.java @@ -0,0 +1,147 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +@Data +@NoArgsConstructor +public class ElementProperties implements Serializable { + + private static final long serialVersionUID = -5093112183496503253L; + + String name; + String type; + String cardinality; + String groupOrChoice; + String valueOrData; + String dataType; + String value; + String documentation; + + @JsonIgnore + Object sedaData; + + int level; + Long id; + Long parentId; + + @JsonIgnore + ElementProperties parent; + + List choices = new ArrayList(); + + List children = new ArrayList(); + + PuaData puaData; + + + public void setCardinality(String cardinality) { + if(null != RNGConstants.CardinalityMap.get(cardinality)) { + this.cardinality = RNGConstants.CardinalityMap.get(cardinality); + }else { + this.cardinality = cardinality; + } + } + + public String getGroupOrChoice() { + return groupOrChoice; + } + + public void setGroupOrChoice(String groupOrChoice) { + if(null != RNGConstants.GroupOrChoiceMap.get(groupOrChoice)) { + this.groupOrChoice = RNGConstants.GroupOrChoiceMap.get(groupOrChoice); + }else { + this.groupOrChoice = groupOrChoice; + } + } + + @JsonIgnore + public Object getSedaData() { + return sedaData; + } + + @JsonIgnore + public void setSedaData(Object sedaData) { + this.sedaData = sedaData; + } + + @JsonIgnore + public ElementProperties getParent() { + return parent; + } + + @JsonIgnore + public void setParent(ElementProperties parent) { + this.parent = parent; + } + + + + public void init() { + this.setName(""); + this.setCardinality(""); + this.setValueOrData(""); + this.setGroupOrChoice(""); + this.setValue(""); + this.setType(""); + this.setDataType(""); + + } + public void initTree(ElementProperties json) { + for(ElementProperties child : json.getChildren()) { + child.setParent(json); + initTree(child); + } + } + + public Stream flattened() { + return Stream.concat( + Stream.of(this), + children.stream().flatMap(ElementProperties::flattened)); + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/ElementRNG.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/ElementRNG.java new file mode 100644 index 0000000000000000000000000000000000000000..9ef6377177f6915eb523bdcdf8dce43af3aa3441 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/ElementRNG.java @@ -0,0 +1,214 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto; + +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; +import java.util.ArrayList; +import java.util.List; + +import static fr.gouv.vitamui.pastis.common.util.RNGConstants.TypesMap; + +/** + * @author Paulo Pimenta + */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.FIELD) +@Data +@NoArgsConstructor +public class ElementRNG { + + + String name; + + String type; + + String dataType; + + String value; + + ElementRNG parent; + + private static Logger LOGGER = LoggerFactory.getLogger(ElementRNG.class); + + + public static ElementProperties elementStatic = new ElementProperties(); + + public static ElementProperties elementStaticRoot = new ElementProperties(); + + private static long idCounter = 0; + + List children = new ArrayList(); + + @XmlAttribute + public String getName() { + return name; + } + + @XmlElement + public String getType() { + return type; + } + + + @XmlAttribute(name = "type") + public String getDataType() { + return dataType; + } + + + @XmlElement(name = "rng:value") + public String getValue() { + return value; + } + + + @XmlTransient + public ElementRNG getParent() { + return parent; + } + + + @XmlAnyElement + public List getChildren() { + return children; + } + + public static void setDataForParentElementOrAttribute(ElementProperties parentNode, ElementRNG node) { + if (null != parentNode.getType() && (RNGConstants.MetadaDataType.element.toString().equals(parentNode.getType()) + || RNGConstants.MetadaDataType.attribute.toString().equals(parentNode.getType()))) { + parentNode.setValueOrData(node.getType()); + if (TypesMap.containsKey(parentNode.getName())) { + parentNode.setDataType(TypesMap.get(parentNode.getName()).getLabel()); + } + parentNode.setValue(node.getValue()); + } else { + setDataForParentElementOrAttribute(parentNode.getParent(), node); + } + } + + + public static void setDocumentationForParentElement(ElementProperties parentNode, ElementRNG node) { + if (null != parentNode.getType() && + RNGConstants.MetadaDataType.element.toString().equals(parentNode.getType())) { + parentNode.setDocumentation(node.getValue()); + } else { + setDocumentationForParentElement(parentNode.getParent(), node); + } + } + + public static void setElementsForGroupOrChoice(ElementProperties parentNode, ElementRNG node) { + + if (null != parentNode.getType() && (RNGConstants.GroupOrChoice.group.toString().equals(parentNode.getType()) + || RNGConstants.GroupOrChoice.choice.toString().equals(parentNode.getType()))) { + parentNode.setGroupOrChoice(node.getType()); + } else { + setElementsForGroupOrChoice(parentNode.getParent(), node); + } + } + + // Build the a tree of properties given : + // a node + //the level of the node + //the parent of the node + public static ElementProperties buildElementPropertiesTree(ElementRNG node, int profondeur, + ElementProperties parentNode) { + ElementProperties local = new ElementProperties(); + LOGGER.info("Generating JSON element {}", node.getName()); + if (null != node.getType() && RNGConstants.MetadaDataType.element.toString().equals(node.getType()) + || RNGConstants.MetadaDataType.attribute.toString().equals(node.getType())) { + + local.setCardinality(elementStatic.getCardinality()); + local.setGroupOrChoice(elementStatic.getGroupOrChoice()); + local.setName(node.getName()); + local.setType(node.getType()); + local.setLevel(profondeur); + local.setValue(node.getValue()); + + + elementStatic = new ElementProperties(); + + if (null != parentNode) { + local.setParent(parentNode); + local.setParentId(parentNode.getId()); + local.setId(ElementRNG.idCounter++); + parentNode.getChildren().add(local); + } else { + local.setId(ElementRNG.idCounter++); + local.setParentId(null); + elementStaticRoot = local; + } + } else { + + if (RNGConstants.isValueOrData(node.getType())) { + setDataForParentElementOrAttribute(parentNode, node); + } else if (RNGConstants.isCardinality(node.getType())) { + elementStatic.setCardinality(node.getType()); + } else if (RNGConstants.hasGroupOrChoice(node.getType())) { + elementStatic.setGroupOrChoice(node.getType()); + } else if ("documentation".equals(node.getType())) { + if (null != node.getValue()) { + setDocumentationForParentElement(parentNode, node); + } + } + + local = parentNode; + } + + for (ElementRNG next : node.getChildren()) { + if (null != next.getType() && (RNGConstants.MetadaDataType.element.toString().equals(next.getType()) + || RNGConstants.MetadaDataType.attribute.toString().equals(next.getType()))) { + buildElementPropertiesTree(next, profondeur + 1, local); + } else { + buildElementPropertiesTree(next, profondeur, local); + } + } + return local; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/JsonFromRng.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/JsonFromRng.java new file mode 100644 index 0000000000000000000000000000000000000000..061e423894afae122137d2e3ea399d7ab0716d24 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/JsonFromRng.java @@ -0,0 +1,82 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class JsonFromRng { + + String name; + + String type; + + String cardinality; + + String valuleOrData; + + String dataType; + + String value; + + String documentation; + + int level; + + Long id; + + Long parentId; + + @JsonIgnore + ElementProperties parent; + + List children = new ArrayList(); + + public void setCardinality(String cardinality) { + if(null != RNGConstants.CardinalityMap.get(cardinality)) { + this.cardinality = RNGConstants.CardinalityMap.get(cardinality); + }else { + this.cardinality = cardinality; + } + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/PuaData.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/PuaData.java new file mode 100644 index 0000000000000000000000000000000000000000..b7d70a36dae223fa66744ce13a4d875be09474c5 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/PuaData.java @@ -0,0 +1,58 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class PuaData { + + Boolean AdditionalProperties; + List Enum; + String Pattern; + Integer MinLenght; + Integer MaxLenght; + Integer Minimum; + Integer Maximum; + Boolean ExclusiveMinimum; + Boolean ExclusiveMaximum; + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AbstractTagFactory.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AbstractTagFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..425ba9fc8e325427e4d1693ddfc8247a2b55bee8 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AbstractTagFactory.java @@ -0,0 +1,51 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; + +import java.util.Map; + +public interface AbstractTagFactory { + + T createTag(ElementProperties node, Tag tag, int level); + + Map createTagWithTag(ElementProperties node, RngTag tag, RngTag currentTag, int level); + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AnnotationTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AnnotationTag.java new file mode 100644 index 0000000000000000000000000000000000000000..7d3a7fd0f06926e5135f7c892fa874a77ba2b01e --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AnnotationTag.java @@ -0,0 +1,55 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "xsd:annotation") +@Setter +public class AnnotationTag extends RngTag { + DocumentationTag documentationTag; + + @XmlElement(name = "xsd:documentation") + public DocumentationTag getDocumentationTag() { + return documentationTag; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AttributeTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AttributeTag.java new file mode 100644 index 0000000000000000000000000000000000000000..d7e166fe6cfef146c3ff6c09f5d9146aafcee786 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/AttributeTag.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:attribute") +public class AttributeTag extends RngTag { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/CardinalityTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/CardinalityTag.java new file mode 100644 index 0000000000000000000000000000000000000000..97c314500a235391f604b190c89fe10f278d7795 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/CardinalityTag.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlSeeAlso; + +@XmlSeeAlso({OneOrMoreTag.class, ZeroOrMoreTag.class, OptionalTag.class}) +public class CardinalityTag extends RngTag { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/CardinalityTagFactory.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/CardinalityTagFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..77ec1dcfba1794ace647ca83ce6eed193360ee74 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/CardinalityTagFactory.java @@ -0,0 +1,83 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +public class CardinalityTagFactory implements AbstractTagFactory { + + private static final Logger LOGGER = LoggerFactory.getLogger(CardinalityTagFactory.class); + + @Override + public CardinalityTag createTag(ElementProperties node, Tag cardinalityTag, int level) { + if (node.getCardinality().equals(RNGConstants.Cardinality.zeroOrMore.getLabel())) { + return new ZeroOrMoreTag(); + } else if (node.getCardinality().equals(RNGConstants.Cardinality.oneOrMore.getLabel())) { + return new OneOrMoreTag(); + } else if (node.getCardinality().equals(RNGConstants.Cardinality.optional.getLabel())) { + return new OptionalTag(); + } + return null; + } + + @Override + public Map createTagWithTag(ElementProperties node, RngTag tag, RngTag currentTag, int level) { + return null; + } + + public RNGConstants.Cardinality checkCardinalityType(String cardinalityType) { + if (cardinalityType.equals("ZeroOrMoreTag")) { + return RNGConstants.Cardinality.zeroOrMore; + } + if (cardinalityType.equals("OneOrMoreTag")) { + return RNGConstants.Cardinality.oneOrMore; + } + if (cardinalityType.equals("OptionalTag")) { + return RNGConstants.Cardinality.optional; + } + return null; + } + + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ChoiceTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ChoiceTag.java new file mode 100644 index 0000000000000000000000000000000000000000..e90c3aae1837a6e60385eb03ebee89efd6261350 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ChoiceTag.java @@ -0,0 +1,45 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:choice") +public class ChoiceTag extends RngTag { +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DataTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DataTag.java new file mode 100644 index 0000000000000000000000000000000000000000..fcdd5a4ea5146efd119c9b5b15b1e735367984f5 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DataTag.java @@ -0,0 +1,54 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import lombok.NoArgsConstructor; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:data") +@NoArgsConstructor +public class DataTag extends RngTag { + + public DataTag(RNGConstants.DataType dataType, RngTag parent) { + this.setDataType(dataType.getLabel()); + this.setParent(parent); + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DataTagFactory.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DataTagFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..9fbc9659890523cb1b3f466a097b73a099bab4e9 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DataTagFactory.java @@ -0,0 +1,72 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; + +import java.util.HashMap; +import java.util.Map; + +public class DataTagFactory implements AbstractTagFactory { + + + @Override + public Object createTag(ElementProperties node, Tag tag, int level) { + return null; + } + + @Override + public Map createTagWithTag(ElementProperties node, RngTag dataRNG, RngTag currentTag, int level) { + + Map rngMapTags = new HashMap<>(); + + if (!currentTag.getChildren().isEmpty() && + (currentTag.getChildren().get(0) instanceof ElementTag + || currentTag.getChildren().get(0) instanceof AttributeTag)) { + RngTag currentTagFirstChild = (RngTag) currentTag.getChildren().get(0); + currentTagFirstChild.getChildren().add(dataRNG); + dataRNG.setParent(currentTag); + } else { + currentTag.getChildren().add(dataRNG); + dataRNG.setParent(currentTag); + } + rngMapTags.put(dataRNG, currentTag); + return rngMapTags; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DocumentationTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DocumentationTag.java new file mode 100644 index 0000000000000000000000000000000000000000..aea5423fc7783ab1e45c1fd0b7e1568355a523f1 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/DocumentationTag.java @@ -0,0 +1,54 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlElement; + +@Setter +public class DocumentationTag extends RngTag { + + String documentation; + + @XmlElement(name = "xsd:documentation") + public String getDocumentation() { + return documentation; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ElementTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ElementTag.java new file mode 100644 index 0000000000000000000000000000000000000000..1787417c9bae8a7a5a384c096b987a6b26a3fb41 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ElementTag.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:element") +public class ElementTag extends RngTag { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/GrammarTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/GrammarTag.java new file mode 100644 index 0000000000000000000000000000000000000000..597f05f133ef282b9a3d4a01c0658716fcc7bf1a --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/GrammarTag.java @@ -0,0 +1,60 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:grammar") +public class GrammarTag extends RngTag { + + @XmlAttribute(name = "datatypeLibrary") + private String datatypeLibrary = "http://www.w3.org/2001/XMLSchema-datatypes"; + + @XmlAttribute(name = "ns") + private String ns = "fr:gouv:culture:archivesdefrance:seda:v2.1"; + + @XmlAttribute(name = "xmlns") + private String xmlns = "fr:gouv:culture:archivesdefrance:seda:v2.1"; + + @XmlAttribute(name = "xmlns:xsd") + private String xd = "http://www.w3.org/2001/XMLSchema"; + + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/GroupTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/GroupTag.java new file mode 100644 index 0000000000000000000000000000000000000000..1520ef2a580964499bfdb633f8878041a1294564 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/GroupTag.java @@ -0,0 +1,45 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:group") +public class GroupTag extends RngTag { +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/OneOrMoreTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/OneOrMoreTag.java new file mode 100644 index 0000000000000000000000000000000000000000..5e582bcece5602fd5fa08a4b78fc6840426bc54c --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/OneOrMoreTag.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:oneOrMore") +public class OneOrMoreTag extends CardinalityTag { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/OptionalTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/OptionalTag.java new file mode 100644 index 0000000000000000000000000000000000000000..cdce8a36c77db2463955ebffc3b31bb42f71c26f --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/OptionalTag.java @@ -0,0 +1,45 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:optional") +public class OptionalTag extends CardinalityTag { +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/PastisFactoryTagProvider.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/PastisFactoryTagProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..d6206acdeff7f7305bfb56246c1ff912a53c2905 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/PastisFactoryTagProvider.java @@ -0,0 +1,59 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +public class PastisFactoryTagProvider { + + public static AbstractTagFactory getFactory(String factoryType) { + + if ("RngTag".equalsIgnoreCase(factoryType)) { + return new RngTagFactory(); + } + if ("Cardinality".equalsIgnoreCase(factoryType)) { + return new CardinalityTagFactory(); + } + if ("DataTag".equalsIgnoreCase(factoryType)) { + return new DataTagFactory(); + } else if ("Value".equalsIgnoreCase(factoryType)) { + return new ValueTagFactory(); + } + + return null; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/RngTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/RngTag.java new file mode 100644 index 0000000000000000000000000000000000000000..bbc0c5322bed2927cb84e14a76efb4e8f2cfbb75 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/RngTag.java @@ -0,0 +1,85 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import lombok.Getter; +import lombok.Setter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSeeAlso; + +@XmlRootElement +@XmlSeeAlso({GrammarTag.class, StartTag.class, ElementTag.class, CardinalityTag.class, DataTag.class, + AttributeTag.class, + ValueTag.class, DocumentationTag.class, AnnotationTag.class, GroupTag.class, ChoiceTag.class}) +@Setter +@Getter +public class RngTag extends Tag { + + private static final Logger LOGGER = LoggerFactory.getLogger(RngTag.class); + + String name; + String dataType; + String groupOrChoice; + ValueTag valueTag; + + + @XmlAttribute + public String getName() { + return name; + } + + @XmlAttribute(name = "type") + public String getDataType() { + return dataType; + } + + @XmlElement(name = "rng:value") + public ValueTag getValueTag() { + return valueTag; + } + + +} + + diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/RngTagFactory.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/RngTagFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..fa2043f6630ef2389d2b9de3c8174293b8231672 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/RngTagFactory.java @@ -0,0 +1,234 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +public class RngTagFactory implements AbstractTagFactory { + + private static final Logger LOGGER = LoggerFactory.getLogger(RngTagFactory.class); + + static RngTag rngTree; + + + @Override + public RngTag createTag(ElementProperties node, Tag parentNode, int profondeur) { + + ValueTag valueRNG = null; + DataTag dataRNG = null; + CardinalityTag cardinalityRNG = null; + RngTag elementOrAttributeRNG = null; + AnnotationTag annotationRNG = null; + DocumentationTag documentationRNG = null; + GroupTag groupTag = null; + ChoiceTag choiceTag = null; + + // 0 . Create objects according to node data; + // If the node has a value + if (null != node.getValue() && !node.getValue().equals("undefined")) { + valueRNG = new ValueTag(); + valueRNG.setValue(node.getValue()); + } + + if (node.getChildren().stream().filter(c -> !c.getType().equals(RNGConstants.MetadaDataType.element)).count() == + 0) { + if (valueRNG == null && RNGConstants.TypesMap.containsKey(node.getName())) { + dataRNG = new DataTag(); + dataRNG.setDataType(RNGConstants.TypesMap.get(node.getName()).getLabel()); + } + } + + // When a value is declared in a profile element, the tag must be suppressed + // to assure that the generated profile is successfully imported by VITAM + if (null != node.getValueOrData() && !node.getValueOrData().equals("undefined") && node.getValue() == null) { + if (node.getValueOrData().equals("data")) { + dataRNG = new DataTag(); + } + } + // Sets the type of data (if value or data) + if (null != node.getDataType() && !node.getDataType().equals("undefined")) { + if (null != valueRNG) { + valueRNG.setDataType(node.getDataType()); + } else if (null != dataRNG) { + dataRNG.setDataType(node.getDataType()); + } + } + // Set annotation and documentation tags (if exists) + if (null != node.getDocumentation()) { + annotationRNG = new AnnotationTag(); + documentationRNG = new DocumentationTag(); + documentationRNG.setDocumentation(node.getDocumentation()); + annotationRNG.setDocumentationTag(documentationRNG); + } + + if (null != node.getType() && !node.getType().equals("undefined")) { + if (node.getType().equals("element")) { + elementOrAttributeRNG = new ElementTag(); + } else if (node.getType().equals("attribute")) { + elementOrAttributeRNG = new AttributeTag(); + } + if (null != node.getName() && !node.getName().equals("undefined")) { + elementOrAttributeRNG.setName(node.getName()); + } + } + + if (null != documentationRNG) { + elementOrAttributeRNG.getChildren().add(annotationRNG); + annotationRNG.setParent(elementOrAttributeRNG); + } + + // Check node's and its children's cardinality + if (node.getCardinality() != null) { + CardinalityTagFactory cardinalityFactory = new CardinalityTagFactory(); + CardinalityTag cardinalityTag = cardinalityFactory.createTag(node, parentNode, profondeur); + LOGGER.info("Parsing " + cardinalityTag.getTagName()); + cardinalityRNG = cardinalityTag; + } + + RngTag currentTag = null; + // 1. Once the objects are created, arrange them accordingly + // 1. Check if it is an element + if (null != elementOrAttributeRNG) { + + if (parentNode != null) + LOGGER.info("Parsing " + elementOrAttributeRNG.getName()); + // 1.1 Check if the element has cardinality + if (null != cardinalityRNG) { + cardinalityRNG.getChildren().add(elementOrAttributeRNG); + elementOrAttributeRNG.setParent(cardinalityRNG); + currentTag = cardinalityRNG; + + } else { + currentTag = elementOrAttributeRNG; + //1.2. Check if it's the first grammar node (Archive transfer) + if (parentNode == null) { + GrammarTag grammarTag = new GrammarTag(); + StartTag startTag = new StartTag(); + startTag.setParent(grammarTag); + grammarTag.getChildren().add(startTag); + currentTag = grammarTag; + } + } + + // 2. Check data tag + if (null != dataRNG) { + DataTagFactory dataTagFactory = new DataTagFactory(); + HashMap dataAndCurrentTagMap = + new HashMap(dataTagFactory.createTagWithTag(node, dataRNG, currentTag, profondeur)); + + currentTag = (RngTag) new ArrayList(dataAndCurrentTagMap.values()).get(0); + + } + // 3. Check value tag + if (null != valueRNG) { + // If Children is empty + if (currentTag.getChildren().isEmpty()) { + if (currentTag instanceof ElementTag) { + currentTag.setValueTag(valueRNG); + valueRNG.setParent(currentTag); + + } else if (currentTag instanceof AttributeTag) { + currentTag.setValueTag(valueRNG); + valueRNG.setParent(currentTag); + } + // If children is Element or Attribute, set accordingly + } else if (currentTag instanceof ElementTag) { + currentTag.setValueTag(valueRNG); + valueRNG.setParent(currentTag); + + } else if (currentTag instanceof AttributeTag) { + currentTag.setValueTag(valueRNG); + valueRNG.setParent(currentTag); + } else { + // Set the value to an simple element + elementOrAttributeRNG.setValueTag(valueRNG); + valueRNG.setParent(elementOrAttributeRNG); + } + } + } + + if (null != currentTag) { + + if (null != parentNode) { + RngTag optionalWithChildren; + optionalWithChildren = (RngTag) parentNode.getChildren() + .stream().filter(cardinality -> cardinality instanceof CardinalityTag) + .findAny() + .orElse(null); + + Boolean optionalHasAlreadyCurrentTag = optionalWithChildren == null + ? false : optionalWithChildren.children.contains(currentTag); + + if (!optionalHasAlreadyCurrentTag) { + currentTag.setParent(parentNode); + parentNode.getChildren().add(currentTag); + } + + } else { + rngTree = currentTag; + } + } + + if (currentTag instanceof GrammarTag) { + this.createTag(node, (RngTag) currentTag.getChildren().get(0), profondeur + 1); + } else { + for (ElementProperties next : node.getChildren()) { + if (currentTag instanceof CardinalityTag) { + this.createTag(next, (RngTag) currentTag.getChildren().get(0), profondeur + 1); + } else { + this.createTag(next, currentTag, profondeur + 1); + } + } + } + return rngTree; + } + + @Override + public Map createTagWithTag(ElementProperties node, RngTag tag, RngTag currentTag, int level) { + return null; + } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/StartTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/StartTag.java new file mode 100644 index 0000000000000000000000000000000000000000..996e73df4c43cabdc55cca1efac5cb17e4c67744 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/StartTag.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:start") +public class StartTag extends RngTag { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/Tag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/Tag.java new file mode 100644 index 0000000000000000000000000000000000000000..9c114c341d16b29d7a8bc557ca351c25672cf8c8 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/Tag.java @@ -0,0 +1,70 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlTransient; +import java.util.ArrayList; +import java.util.List; + +@Setter +public abstract class Tag { + + Tag parent; + List children = new ArrayList<>(); + + //@XmlTransient to avoid circular loop parent <-> child + @XmlTransient + public Tag getParent() { + return parent; + } + + @XmlAnyElement + public List getChildren() { + return children; + } + + String getTagName() { + return this.getClass().getSimpleName(); + } + + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ValueTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ValueTag.java new file mode 100644 index 0000000000000000000000000000000000000000..a11d85b5c6c6945fc385cec107c58e3682b3e054 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ValueTag.java @@ -0,0 +1,70 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlValue; + +@Setter +public class ValueTag { + + private String dataType; + private String value; + + private Tag parent; + + @XmlAttribute(name = "type") + public String getDataType() { + return dataType; + } + + @XmlValue + public String getValue() { + return value; + } + + @XmlTransient + public Tag getParent() { + return parent; + } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ValueTagFactory.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ValueTagFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..99076ac77635f51bb745d952ac8a6997886d85e5 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ValueTagFactory.java @@ -0,0 +1,56 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; + +import java.util.Map; + +public class ValueTagFactory implements AbstractTagFactory { + + @Override + public Tag createTag(ElementProperties node, Tag tag, int level) { + return null; + } + + @Override + public Map createTagWithTag(ElementProperties node, RngTag tag, RngTag currentTag, int level) { + return null; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ZeroOrMoreTag.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ZeroOrMoreTag.java new file mode 100644 index 0000000000000000000000000000000000000000..ab32390e1652db0076fc03e827e87d9188b30805 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/ZeroOrMoreTag.java @@ -0,0 +1,45 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:zeroOrMore") +public class ZeroOrMoreTag extends CardinalityTag { +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/package-info.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..9f76ab661afbb68cdba8c4258a18bb767af3ae87 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/factory/package-info.java @@ -0,0 +1,54 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +@XmlSchema( + + xmlns = { + @XmlNs(prefix = "a", namespaceURI = "http://relaxng.org/ns/compatibility/annotations/1.0"), + @XmlNs(prefix = "rng", namespaceURI = "http://relaxng.org/ns/structure/1.0"), + @XmlNs(prefix = "seda", namespaceURI = "fr:gouv:culture:archivesdefrance:seda:v2.1"), + @XmlNs(prefix = "xlink", namespaceURI = "http://www.w3.org/1999/xlink"), + @XmlNs(prefix = "xsd", namespaceURI = "http://www.w3.org/2001/XMLSchema"), + }, + elementFormDefault = XmlNsForm.QUALIFIED) + +package fr.gouv.vitamui.pastis.common.dto.factory; + +import javax.xml.bind.annotation.XmlNs; +import javax.xml.bind.annotation.XmlNsForm; +import javax.xml.bind.annotation.XmlSchema; diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AnnotationXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AnnotationXML.java new file mode 100644 index 0000000000000000000000000000000000000000..4ca727118295289ca51cdf3cb574aebfc7f52f01 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AnnotationXML.java @@ -0,0 +1,56 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "xsd:annotation") +@Setter +public class AnnotationXML extends BaliseXML { + + DocumentationXML documentationXML; + + @XmlElement(name = "xsd:documentation") + public DocumentationXML getDocumentationXML() { + return documentationXML; + } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AnyNameXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AnyNameXML.java new file mode 100644 index 0000000000000000000000000000000000000000..3b2dc088416cb9428b4fc24633b5577713f39186 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AnyNameXML.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:anyName") +public class AnyNameXML extends BaliseXML { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AttributeXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AttributeXML.java new file mode 100644 index 0000000000000000000000000000000000000000..656ec72e3c4204edd8e11102d3b4d1dbfe7663e2 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/AttributeXML.java @@ -0,0 +1,56 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:attribute") +@Setter +public class AttributeXML extends BaliseXML { + + ValueXML valueXML; + + @XmlElement(name = "rng:value") + public ValueXML getValueXML() { + return valueXML; + } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/BaliseXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/BaliseXML.java new file mode 100644 index 0000000000000000000000000000000000000000..fd52b0406d28f1b570f7cf067d7b24c5da9aa590 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/BaliseXML.java @@ -0,0 +1,342 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; +import java.util.ArrayList; +import java.util.List; + + +@XmlRootElement +@Data +@NoArgsConstructor +public class BaliseXML { + + + private static final Logger LOGGER = LoggerFactory.getLogger(BaliseXML.class); + public static BaliseXML baliseXMLStatic; + String name; + String dataType; + String cardinality; + String groupOrChoice; + BaliseXML parent; + ValueXML valueXML; + List children = new ArrayList<>(); + + /** + * @param node node représentant l'arbre ElementProperties correspondant au json reçu du front + * @param profondeur profondeur du noeud utile pour le front angular + * @param parentNode noeud parent utilisé dans la récursivité pour lié parent & children + */ + public static void buildBaliseXMLTree(ElementProperties node, int profondeur, BaliseXML parentNode) { + + if (node.getName() != null) { + ValueXML valueRNG = null; + DataXML dataRNG = null; + BaliseXML cardinalityRNG = null; + BaliseXML elementOrAttributeRNG = null; + AnnotationXML annotationXML = null; + DocumentationXML documentationXML = null; + BaliseXML groupOrChoice = null; + + // If the node has a value + if (null != node.getValue() && !node.getValue().equals("undefined")) { + valueRNG = new ValueXML(); + valueRNG.setValue(node.getValue()); + } + + // When a value is declared in a profile element, the tag must be suppressed + // to assure that the generated profile is successfully imported by VITAM + if (null != node.getValueOrData() && !node.getValueOrData().equals("undefined") && + node.getValue() == null) { + if (node.getValueOrData().equals("data")) { + dataRNG = new DataXML(); + } + } + + if (node.getName() != null && (node.getName().equals("CodeListVersions") || + node.getChildren().stream().filter(c -> c.getType().equals(RNGConstants.MetadaDataType.attribute)) + .count() == 0)) { + if (valueRNG == null && RNGConstants.TypesMap.containsKey(node.getName())) { + dataRNG = new DataXML(); + dataRNG.setDataType(RNGConstants.TypesMap.get(node.getName()).getLabel()); + } + } + + // Sets the type of data (if value or data) + if (null != node.getDataType() && !node.getDataType().equals("undefined")) { + if (null != valueRNG) { + valueRNG.setDataType(node.getDataType()); + } else if (null != dataRNG) { + dataRNG.setDataType(node.getDataType()); + } + } + // Set annotation and documentation tags (if exists) + if (null != node.getDocumentation()) { + annotationXML = new AnnotationXML(); + documentationXML = new DocumentationXML(); + documentationXML.setDocumentation(node.getDocumentation()); + annotationXML.setDocumentationXML(documentationXML); + } + + if (null != node.getType() && !node.getType().equals("undefined")) { + if (node.getType().equals("element")) { + elementOrAttributeRNG = new ElementXML(); + } else if (node.getType().equals("attribute")) { + elementOrAttributeRNG = new AttributeXML(); + } + if (null != node.getName() && !node.getName().equals("undefined")) { + elementOrAttributeRNG.setName(node.getName()); + } + } + + if (null != documentationXML) { + elementOrAttributeRNG.getChildren().add(annotationXML); + annotationXML.setParent(elementOrAttributeRNG); + } + + // Check node's and its children's cardinality + if (node.getCardinality() != null) { + + if (node.getCardinality().equals(RNGConstants.Cardinality.zeroOrMore.getLabel())) { + cardinalityRNG = new ZeroOrMoreXML(); + if (elementOrAttributeRNG != null) { + elementOrAttributeRNG.setCardinality(RNGConstants.Cardinality.zeroOrMore); + } + } else if (node.getCardinality().equals(RNGConstants.Cardinality.oneOrMore.getLabel())) { + cardinalityRNG = new OneOrMoreXML(); + if (elementOrAttributeRNG != null) { + elementOrAttributeRNG.setCardinality(RNGConstants.Cardinality.oneOrMore); + } + } else if (node.getCardinality().equals(RNGConstants.Cardinality.optional.getLabel())) { + cardinalityRNG = new OptionalXML(); + if (elementOrAttributeRNG != null) { + elementOrAttributeRNG.setCardinality(RNGConstants.Cardinality.optional); + } + } + } + + BaliseXML currentXmlTag = null; + + // 1. Check if it is an element + if (null != elementOrAttributeRNG) { + + LOGGER.info("Parsing " + elementOrAttributeRNG.getName()); + // 1.1 Check if the element has cardinality + if (null != cardinalityRNG) { + cardinalityRNG.getChildren().add(elementOrAttributeRNG); + elementOrAttributeRNG.setParent(cardinalityRNG); + currentXmlTag = cardinalityRNG; + + } else { + currentXmlTag = elementOrAttributeRNG; + //1.2. Check if it's the first grammarnode (Archive transfer) + if (parentNode == null) { + GrammarXML grammar = new GrammarXML(); + StartXML start = new StartXML(); + start.setParent(grammar); + grammar.getChildren().add(start); + currentXmlTag = grammar; + } + } + + // 2. Check data tag + if (null != dataRNG) { + if (!currentXmlTag.getChildren().isEmpty() && + (currentXmlTag.getChildren().get(0) instanceof ElementXML + || currentXmlTag.getChildren().get(0) instanceof AttributeXML)) { + currentXmlTag.getChildren().get(0).getChildren().add(dataRNG); + dataRNG.setParent(currentXmlTag); + + } else { + currentXmlTag.getChildren().add(dataRNG); + dataRNG.setParent(currentXmlTag); + } + } + // 3. Check value tag + if (null != valueRNG) { + // If Children is empty + if (currentXmlTag.getChildren().isEmpty()) { + if (currentXmlTag instanceof ElementXML) { + ((ElementXML) currentXmlTag).setValueXML(valueRNG); + valueRNG.setParent(currentXmlTag); + + } else if (currentXmlTag instanceof AttributeXML) { + ((AttributeXML) currentXmlTag).setValueXML(valueRNG); + valueRNG.setParent(currentXmlTag); + } + // If children is Element or Attribute, set accordingly + } else if (currentXmlTag instanceof ElementXML) { + ((ElementXML) currentXmlTag).setValueXML(valueRNG); + valueRNG.setParent(currentXmlTag); + + } else if (currentXmlTag instanceof AttributeXML) { + ((AttributeXML) currentXmlTag).setValueXML(valueRNG); + valueRNG.setParent(currentXmlTag); + } else { + // Set the value to an simple element + elementOrAttributeRNG.setValueXML(valueRNG); + valueRNG.setParent(elementOrAttributeRNG); + } + } + } + + if (null != currentXmlTag) { + + if (null != parentNode) { + BaliseXML optionalWithChildren = parentNode.getChildren() + .stream().filter(cardinality -> cardinality instanceof OptionalXML + || cardinality instanceof ZeroOrMoreXML + || cardinality instanceof OneOrMoreXML) + .findAny() + .orElse(null); + + Boolean optionalHasAlreadyCurrentTag = optionalWithChildren == null + ? false : optionalWithChildren.children.contains(currentXmlTag); + + if (!optionalHasAlreadyCurrentTag) { + currentXmlTag.setParent(parentNode); + parentNode.getChildren().add(currentXmlTag); + } + + + } else { + baliseXMLStatic = currentXmlTag; + } + } + + if (currentXmlTag instanceof GrammarXML) { + buildBaliseXMLTree(node, profondeur + 1, currentXmlTag.getChildren().get(0)); + } else { + for (ElementProperties next : node.getChildren()) { + if (currentXmlTag instanceof OptionalXML || currentXmlTag instanceof OneOrMoreXML + || currentXmlTag instanceof ZeroOrMoreXML) { + buildBaliseXMLTree(next, profondeur + 1, currentXmlTag.getChildren().get(0)); + } else { + buildBaliseXMLTree(next, profondeur + 1, currentXmlTag); + } + } + } + } + + } + + public static void addRecipTags() { + + /* Add this arboresenc to current json tree + + + + + + + + + + + + */ + + ZeroOrMoreXML zeroOrMoreRNG = new ZeroOrMoreXML(); + AttributeXML attributeRNG = new AttributeXML(); + AnyNameXML anyNameRNG = new AnyNameXML(); + ExceptXML exceptRNG = new ExceptXML(); + NsNameXML nsNameRNG = new NsNameXML(); + NsNameXML nsNameRNGNs = new NsNameXML(); + nsNameRNGNs.setNs(""); + attributeRNG.setCardinality(RNGConstants.Cardinality.zeroOrMore); + exceptRNG.getChildren().add(nsNameRNG); + exceptRNG.getChildren().add(nsNameRNGNs); + anyNameRNG.getChildren().add(exceptRNG); + attributeRNG.getChildren().add(anyNameRNG); + zeroOrMoreRNG.getChildren().add(attributeRNG); + baliseXMLStatic.getChildren().get(0).getChildren().get(0).getChildren().add(0, zeroOrMoreRNG); + } + + @XmlAttribute + public String getName() { + return name; + } + + @XmlAttribute(name = "type") + public String getDataType() { + return dataType; + } + + //@XmlTransient to avoid circular loop parent <-> child + @XmlTransient + public BaliseXML getParent() { + return parent; + } + + // XmlAnyElement pour etre le plus generique + @XmlAnyElement + public List getChildren() { + return children; + } + + public String setCardinality(RNGConstants.Cardinality cardinality) { + return this.cardinality = cardinality.getLabel(); + } + + @XmlElement(name = "rng:value") + public ValueXML getValueXML() { + return valueXML; + } + + @Override + public String toString() { + // TODO Auto-generated method stub + return this.name; + } + + + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ChoiceXml.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ChoiceXml.java new file mode 100644 index 0000000000000000000000000000000000000000..69653694b5d312f68371329959f6e945310691f7 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ChoiceXml.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:choice") +public class ChoiceXml extends BaliseXML { + + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/DataXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/DataXML.java new file mode 100644 index 0000000000000000000000000000000000000000..eef2937866e4da9c21c8db589bf3657f7bd199f9 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/DataXML.java @@ -0,0 +1,55 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:data") +@Data +@NoArgsConstructor +public class DataXML extends BaliseXML { + + public DataXML(RNGConstants.DataType dataType, BaliseXML parent) { + this.setDataType(dataType.getLabel()); + this.setParent(parent); + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/DocumentationXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/DocumentationXML.java new file mode 100644 index 0000000000000000000000000000000000000000..3a4ec5ca5a243cc20458cfe139f9b5b4577dbe70 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/DocumentationXML.java @@ -0,0 +1,61 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlValue; + +@Setter +public class DocumentationXML { + + String documentation; + BaliseXML parent; + + @XmlValue + public String getDocumentation() { + return documentation; + } + + @XmlTransient + public BaliseXML getParent() { + return parent; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ElementXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ElementXML.java new file mode 100644 index 0000000000000000000000000000000000000000..0ef53e4eafcb3f6ce348b27963fe6fa63b365c37 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ElementXML.java @@ -0,0 +1,58 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + + +@XmlRootElement(name = "rng:element") +@Setter +public class ElementXML extends BaliseXML { + + ValueXML valueXML; + + + @XmlElement(name = "rng:value") + public ValueXML getValueXML() { + return valueXML; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ExceptXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ExceptXML.java new file mode 100644 index 0000000000000000000000000000000000000000..1dee43742dc9228229a8185dcf3759396c5a72cb --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ExceptXML.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:except") +public class ExceptXML extends BaliseXML { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/GrammarXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/GrammarXML.java new file mode 100644 index 0000000000000000000000000000000000000000..1bf41ab289895dedbff7d416d208fd0e3e045bc9 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/GrammarXML.java @@ -0,0 +1,68 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:grammar") +public class GrammarXML extends BaliseXML { + + StartXML start; + + @XmlAttribute(name = "datatypeLibrary") + private String datatypeLibrary = "http://www.w3.org/2001/XMLSchema-datatypes"; + + @XmlAttribute(name = "ns") + private String ns = "fr:gouv:culture:archivesdefrance:seda:v2.1"; + + @XmlAttribute(name = "xmlns") + private String xmlns = "fr:gouv:culture:archivesdefrance:seda:v2.1"; + + @XmlAttribute(name = "xmlns:xsd") + private String xd = "http://www.w3.org/2001/XMLSchema"; + + public StartXML getStart() { + return start; + } + + public void setStart(StartXML start) { + this.start = start; + } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/GroupXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/GroupXML.java new file mode 100644 index 0000000000000000000000000000000000000000..29fb8ca0255bd764a22bf709dbcd69c53ff74532 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/GroupXML.java @@ -0,0 +1,45 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:group") +public class GroupXML extends BaliseXML { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/NsNameXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/NsNameXML.java new file mode 100644 index 0000000000000000000000000000000000000000..690099b2c00ad19bc92ca23dffa07341723bfea1 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/NsNameXML.java @@ -0,0 +1,52 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:nsName") +@Setter +public class NsNameXML extends BaliseXML { + + @XmlAttribute(name = "ns") + String ns; +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/OneOrMoreXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/OneOrMoreXML.java new file mode 100644 index 0000000000000000000000000000000000000000..71cb6d9a3886c43e053b78195fca25ddec47a062 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/OneOrMoreXML.java @@ -0,0 +1,45 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:oneOrMore") +public class OneOrMoreXML extends BaliseXML { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/OptionalXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/OptionalXML.java new file mode 100644 index 0000000000000000000000000000000000000000..7d13cff97da78a0db063d30835a4b323f9ea344e --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/OptionalXML.java @@ -0,0 +1,45 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:optional") +public class OptionalXML extends BaliseXML { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/StartXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/StartXML.java new file mode 100644 index 0000000000000000000000000000000000000000..b205f26ae2fd262cd3499bcde1e04efb39bd86d9 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/StartXML.java @@ -0,0 +1,45 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:start") +public class StartXML extends BaliseXML { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ValueXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ValueXML.java new file mode 100644 index 0000000000000000000000000000000000000000..81e053be5a5f0e3b510fe1f134a0408000f0fadd --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ValueXML.java @@ -0,0 +1,71 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import lombok.Setter; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlValue; + +@Setter +public class ValueXML { + + String value; + + String dataType; + + BaliseXML parent; + + @XmlValue + public String getValue() { + return value; + } + + @XmlTransient + public BaliseXML getParent() { + return parent; + } + + @XmlAttribute(name = "type") + public String getDataType() { + return dataType; + } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ZeroOrMoreXML.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ZeroOrMoreXML.java new file mode 100644 index 0000000000000000000000000000000000000000..054d45e099ec9f9b9caee68178cb52033d8e8b8d --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/ZeroOrMoreXML.java @@ -0,0 +1,46 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "rng:zeroOrMore") + +public class ZeroOrMoreXML extends BaliseXML { + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/package-info.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..ee298d6b6d438a40eb9aaff3c5f93d26bc69156f --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/jaxb/package-info.java @@ -0,0 +1,54 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +@XmlSchema( + + xmlns = { + @XmlNs(prefix = "a", namespaceURI = "http://relaxng.org/ns/compatibility/annotations/1.0"), + @XmlNs(prefix = "rng", namespaceURI = "http://relaxng.org/ns/structure/1.0"), + @XmlNs(prefix = "seda", namespaceURI = "fr:gouv:culture:archivesdefrance:seda:v2.1"), + @XmlNs(prefix = "xlink", namespaceURI = "http://www.w3.org/1999/xlink"), + @XmlNs(prefix = "xsd", namespaceURI = "http://www.w3.org/2001/XMLSchema"), + }, + elementFormDefault = XmlNsForm.QUALIFIED) + +package fr.gouv.vitamui.pastis.common.dto.jaxb; + +import javax.xml.bind.annotation.XmlNs; +import javax.xml.bind.annotation.XmlNsForm; +import javax.xml.bind.annotation.XmlSchema; diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/Notice.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/Notice.java new file mode 100644 index 0000000000000000000000000000000000000000..18bcd2d56515056f1d85d51bc05e696fb0619c36 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/Notice.java @@ -0,0 +1,154 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.profiles; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.module.afterburner.AfterburnerModule; +import fr.gouv.vitam.common.model.administration.ArchiveUnitProfileStatus; +import fr.gouv.vitam.common.model.administration.ProfileFormat; +import fr.gouv.vitamui.commons.api.domain.IdDto; +import fr.gouv.vitamui.pastis.common.util.NoticeUtils; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.json.JSONArray; +import org.json.JSONObject; +import org.json.JSONTokener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.Resource; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.List; +import java.util.Random; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Notice extends IdDto implements Serializable { + + @Autowired NoticeUtils notice; + @JsonProperty("identifier") + String identifier; + @JsonProperty("name") + String name; + @JsonProperty("description") + String description; + @JsonProperty("status") + ArchiveUnitProfileStatus status; + @JsonProperty("creationDate") + String creationDate; + @JsonProperty("lastUpdate") + String lastUpdate; + @JsonProperty("activationDate") + String activationDate; + @JsonProperty("deactivationDate") + String deactivationDate; + @JsonProperty("controlSchema") + String controlSchema; + @JsonProperty("tenant") + Integer tenant; + @JsonProperty("version") + Integer version; + @JsonProperty("fields") + List fields; + @JsonProperty("path") + private String path; + @JsonProperty("format") + private ProfileFormat format; + + public Notice(Resource r) throws IOException { + String fileName = r.getFilename(); + Long lastUpdate = r.lastModified(); + this.setId(String.valueOf(Math.abs(new Random().nextLong()) / 1000)); + this.identifier = getFileBaseName(fileName); + this.status = ArchiveUnitProfileStatus.ACTIVE; + this.lastUpdate = new Timestamp(lastUpdate).toString(); + this.deactivationDate = new Timestamp(lastUpdate).toString(); + this.activationDate = new Timestamp(lastUpdate).toString(); + this.creationDate = new Timestamp(lastUpdate).toString(); + this.tenant = 1; + this.version = 1; + this.name = getFileBaseName(fileName); + if (getFileType(fileName).equals(ProfileType.PUA)) { + InputStream inputStream = getClass().getClassLoader().getResourceAsStream("rng/" + + fileName); + JSONTokener tokener = new JSONTokener(new InputStreamReader(inputStream)); + JSONObject profileJson = new JSONObject(tokener); + this.controlSchema = profileJson.getString("controlSchema"); + this.fields = notice.convert((JSONArray) profileJson.get("fields")); + this.description = profileJson.getString("description"); + } else { + + this.path = fileName; + this.format = ProfileFormat.RNG; + } + } + + private String getFileBaseName(String fileName) { + String[] tokens = fileName.split("\\.(?=[^\\.]+$)"); + return tokens[0]; + } + + public ProfileType getFileType(String fileName) { + String[] tokens = fileName.split("\\.(?=[^\\.]+$)"); + return tokens[1].equals("rng") ? ProfileType.PA : ProfileType.PUA; + } + + + public String serialiseString() throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + mapper.registerModule(new AfterburnerModule()); + String json = mapper.writeValueAsString(this); + return json; + } + +/* public void deserialize(JSONObject jsonObject) { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.readValue(jsonObject, Notice.class); + }*/ + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/PastisProfile.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/PastisProfile.java new file mode 100644 index 0000000000000000000000000000000000000000..0d2a9780e7ac6b50baf31a1b3b54ca48058c64ff --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/PastisProfile.java @@ -0,0 +1,93 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.profiles; + +import fr.gouv.vitamui.commons.api.domain.IdDto; +import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.json.JSONObject; + +import java.sql.Timestamp; +import java.util.Random; + +@Data +@NoArgsConstructor +@Setter +@Getter +public class PastisProfile extends IdDto { + + String type; + String fileName; + String baseName; + String status; + String lastModified; + + public PastisProfile(String fileName, String status, Long lastModified) { + this.type = this.getFileType(fileName); + this.setId(String.valueOf(Math.abs(new Random().nextLong()) / 1000)); + this.fileName = fileName; + this.baseName = getFileBaseName(fileName); + this.status = status; + this.lastModified = new Timestamp(lastModified).toString(); + } + + private String getFileType(String fileName) { + String[] tokens = fileName.split("\\.(?=[^\\.]+$)"); + return tokens[1].equals("rng") ? "PA" : "PUA"; + } + + private String getFileBaseName(String fileName) { + String[] tokens = fileName.split("\\.(?=[^\\.]+$)"); + return tokens[0]; + } + + + public void deserialise(JSONObject jsonObject) { + + this.setId((String) jsonObject.get("#id")); + this.setStatus((String) jsonObject.get("status")); + this.setLastModified((String) jsonObject.get("lastModified")); + this.setFileName((String) jsonObject.get("fileName")); + this.setBaseName((String) jsonObject.get("baseName")); + this.setType((String) jsonObject.get("type")); + } +} + diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileNotice.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileNotice.java new file mode 100644 index 0000000000000000000000000000000000000000..4c9a716dbc9eb20c5cb8d3e8e498b2d280c81bda --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileNotice.java @@ -0,0 +1,54 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.profiles; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class ProfileNotice { + + ElementProperties elementProperties; + Notice notice; + public ProfileNotice() { + super(); + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileResponse.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileResponse.java new file mode 100644 index 0000000000000000000000000000000000000000..daba2b06ad1b6e746199b4190ba3dba8bd4dae28 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileResponse.java @@ -0,0 +1,51 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.profiles; + +import fr.gouv.vitamui.commons.api.domain.IdDto; +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import lombok.Data; + +@Data +public class ProfileResponse extends IdDto { + String name; + ElementProperties profile; + Notice notice; + ProfileType type; +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileTransformationRequest.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileTransformationRequest.java new file mode 100644 index 0000000000000000000000000000000000000000..188be2788a87708b25857274df06513226b47d92 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileTransformationRequest.java @@ -0,0 +1,57 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.profiles; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.core.io.Resource; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class ProfileTransformationRequest { + @JsonProperty("notice") + Notice notice; + @JsonProperty("resource") + Resource resource; +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileType.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileType.java new file mode 100644 index 0000000000000000000000000000000000000000..a30700f6734fc3a1e8520220e64f9dfb83d2023d --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/profiles/ProfileType.java @@ -0,0 +1,47 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.profiles; + +public enum ProfileType { + PA, + PUA; + + private ProfileType() { + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/pua/PuaMetadata.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/pua/PuaMetadata.java new file mode 100644 index 0000000000000000000000000000000000000000..8b22f1a25c138a869d692ea086b17a71610b5b03 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/pua/PuaMetadata.java @@ -0,0 +1,62 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.pua; + +import com.google.gson.JsonElement; + +import java.util.HashMap; +import java.util.Map; + +public class PuaMetadata extends JsonElement { + + public Map puaDetails = new HashMap(); + + public Map getPuaDetails() { + return puaDetails; + } + + public void setPuaDetails(Map puaDetails) { + this.puaDetails = puaDetails; + } + + @Override + public JsonElement deepCopy() { + return null; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/pua/PuaMetadataDetails.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/pua/PuaMetadataDetails.java new file mode 100644 index 0000000000000000000000000000000000000000..2214356dc005d0b1bbd1fb90f72ed0fbcb767f4a --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/pua/PuaMetadataDetails.java @@ -0,0 +1,59 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.pua; + + +import lombok.Data; +import org.json.JSONObject; + +import java.util.List; + +@Data +public class PuaMetadataDetails { + + String type; + String description; + Integer minItems; + Integer maxItems; + Boolean additionalProperties; + JSONObject properties; + List required; + PuaMetadata items; + List enums; +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/seda/SedaNode.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/seda/SedaNode.java new file mode 100644 index 0000000000000000000000000000000000000000..d51d2a9f0f6b6b86b74a738fbbb94e875dd763f6 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/dto/seda/SedaNode.java @@ -0,0 +1,65 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.dto.seda; + +import lombok.Data; + +import java.util.List; +import java.util.stream.Stream; + +@Data +public class SedaNode { + private String Name; + private String Element; + private String Cardinality; + private String Type; + private String Choice; + private String Extensible; + private List Enumeration; + private String Definition; + private String Collection; + private List Children; + + + public Stream flattened() { + return Stream.concat( + Stream.of(this), + Children.stream().flatMap(SedaNode::flattened)); + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/rest/RestApi.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/rest/RestApi.java new file mode 100644 index 0000000000000000000000000000000000000000..f8e30f80564421d40b4092b804d225b36528ea34 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/rest/RestApi.java @@ -0,0 +1,59 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.rest; + +/** + * The URLs of the REST API. + * + * + */ +public class RestApi { + + // Return + public static final String PASTIS_GET_ALL_PROFILES = "/getprofiles"; + public static final String PASTIS_UPLOAD_PROFILE = "/profile"; + public static final String PASTIS_TRANSFORM_PROFILE = "/edit"; + public static final String PASTIS_GET_PROFILE_FILE = "/getfile"; + public static final String PASTIS_TRANSFORM_PROFILE_PA = "/editpa"; + public static final String PASTIS_DOWNLOAD_PUA = "/getarchiveunitprofile"; + public static final String PASTIS_DOWNLOAD_PA = "/getarchiveprofile"; + public static final String PASTIS_CREATE_PROFILE= "/createprofile"; + public static final String PASTIS = "/pastis"; + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/JsonFromPUA.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/JsonFromPUA.java new file mode 100644 index 0000000000000000000000000000000000000000..2e010886fb1e3b03004854c2a8cf3a729753d418 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/JsonFromPUA.java @@ -0,0 +1,332 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.service; + +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.dto.PuaData; +import fr.gouv.vitamui.pastis.common.dto.seda.SedaNode; +import fr.gouv.vitamui.pastis.common.util.RNGConstants; +import org.json.JSONObject; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import static fr.gouv.vitamui.pastis.common.util.RNGConstants.typeElement; + +@Service +public class JsonFromPUA { + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(JsonFromPUA.class); + + private Long idCounter = 0L; + + /** + * Generates a Profile from a PUA file + * @param jsonPUA the JSON Object representing the PUA + * @return + */ + public ElementProperties getProfileFromPUA(JSONObject jsonPUA) throws IOException { + String controlSchemaString = (String) jsonPUA.get("controlSchema"); + JSONObject controlSchema = new JSONObject(controlSchemaString); + + idCounter = 0L; + // Adding root element DescriptiveMetadata + ElementProperties root = new ElementProperties(); + root.setName("DescriptiveMetadata"); + root.setId(idCounter++); + root.setLevel(0); + root.setType(String.valueOf(RNGConstants.MetadaDataType.element)); + + // Adding ArchiveUnit Element + ElementProperties archiveUnit = createChildren(root, "ArchiveUnit"); + archiveUnit.setType(String.valueOf(RNGConstants.MetadaDataType.element)); + + // Adding id element + ElementProperties id = createChildren(archiveUnit, "id"); + id.setType(String.valueOf(RNGConstants.MetadaDataType.attribute)); + id.setValueOrData("data"); + id.setDataType(String.valueOf(RNGConstants.DataType.ID)); + + SedaNode sedaNode = getArchiveUnitSedaNode(); + + buildProfile(controlSchema, sedaNode, archiveUnit); + + sortTreeWithSeda(archiveUnit, sedaNode); + + return root; + } + + /** + * Sort the ElementProperties tree based on the Seda + * @param tree + * @param sedaNode + */ + public void sortTreeWithSeda(ElementProperties tree, SedaNode sedaNode){ + tree.getChildren().sort(Comparator.comparing(c->sedaNode.getChildren().stream().map(s->s.getName()).collect(Collectors.toList()).indexOf(c.getName()))); + for (ElementProperties e :tree.getChildren()){ + sortTreeWithSeda(e,sedaNode.getChildren().stream().filter(s->s.getName().equals(e.getName())).findFirst().get()); + } + } + + private List getRequiredFields(JSONObject controlSchema) { + List required = new ArrayList<>(); + if (controlSchema.has("required")){ + required.addAll(controlSchema.getJSONArray("required").toList().stream().map(o->(String) o).collect(Collectors.toList())); + } + return required; + } + + private SedaNode getArchiveUnitSedaNode() throws IOException { + InputStream inputStream = getClass().getClassLoader().getResourceAsStream("pua_validation/archiveUnitSeda.json"); + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); + return objectMapper.readValue(inputStream,SedaNode.class); + } + + /** + * Get children definition of node by name + * @param sedaNode node to look for children + * @param name name of children to look for + * @return + */ + private SedaNode getChildrenSedaNode(SedaNode sedaNode, String name){ + String realName = sanitizeNodeName(name); + return sedaNode.getChildren().stream().filter(c->c.getName().equals(realName)).findAny().orElse(null); + } + + private String sanitizeNodeName(String name) { + String realName = name.replace("_",""); + if (realName.equals("#management")) { + realName = "Management"; + } + return realName; + } + + /** + * Build the profile based on the PUA JSON file and the definition of an ArchiveUnit + * Recursive + * @param jsonPUA + * @param sedaNode + * @param parent + */ + private void buildProfile(JSONObject jsonPUA, SedaNode sedaNode, ElementProperties parent) { + List requiredFields = getRequiredFields(jsonPUA); + if (jsonPUA.has("properties")) { + JSONObject properties = jsonPUA.getJSONObject("properties"); + if (properties.length() != 0) { + for(String propertyName:properties.keySet()){ + Set childrensNames; + JSONObject propertiesNew; + List requiredFieldsActual; + // If property's name equal 'Rules' + // Then we have to retrieve all the the sub-childrens in the Rules->items property + if (propertyName.equals("Rules")){ + requiredFieldsActual = getRequiredFields(properties.getJSONObject(propertyName).getJSONObject("items")); + propertiesNew = properties.getJSONObject(propertyName).getJSONObject("items").getJSONObject("properties"); + childrensNames = propertiesNew.keySet(); + } else { + requiredFieldsActual = requiredFields; + propertiesNew = properties; + childrensNames = Collections.singleton(propertyName); + } + childrensNames.forEach(childName -> { + JSONObject childPua = propertiesNew.getJSONObject(childName); + SedaNode childrenSedaNode = getChildrenSedaNode(sedaNode, childName); + + ElementProperties childrenParent; + // In a PUA the Content node in ArchiveUnit node is omitted. + // So if we are in the ArchiveUnit Node, then we must check for the children in Content Node as well + if (childrenSedaNode == null && parent.getName().equals("ArchiveUnit")) { + childrenSedaNode = getChildrenSedaNode(getChildrenSedaNode(sedaNode, "Content"), childName); + + ElementProperties content = parent.getChildren().stream().filter(c->c.getName().equals("Content")).findAny().orElse(null); + // Create "Content" ElementProperties if not created yet + if (content == null) { + content = createChildren(parent, "Content"); + content.setType(String.valueOf(RNGConstants.MetadaDataType.element)); + } + childrenParent = content; + } else { + childrenParent = parent; + } + // If the childrenDefinition is found then process the childPua and add it to the childProfile + if (childrenSedaNode != null) { + ElementProperties childProfile = getElementProperties(childrenSedaNode, childrenParent, childName, childPua, requiredFieldsActual.contains(childName)); + + buildProfile(childPua, childrenSedaNode, childProfile); + } + }); + }; + } + } + } + + /** + * Build and retrieve an ElementProperties node + * @param sedaNode + * @param parent + * @param key + * @param childPua + * @return + */ + private ElementProperties getElementProperties(SedaNode sedaNode, ElementProperties parent, String key, JSONObject childPua, Boolean required) { + ElementProperties childProfile = createChildren(parent, key); + childProfile.setType(typeElement.get(sedaNode.getElement())); + childProfile.setDataType(sedaNode.getType()); + + Integer minItems = null; + Integer maxItems = null; + + for (String k : childPua.keySet()){ + switch (k){ + case "$ref": + addPuaDataToElementIfNotPresent(childProfile); + addRefToElement(childProfile, childPua.getString(k)); + break; + case "enum": + addPuaDataToElementIfNotPresent(childProfile); + List enume = childPua.getJSONArray(k).toList().stream().map(o->(String)o).collect(Collectors.toList()); + childProfile.getPuaData().setEnum(enume); + break; + case "pattern": + addPuaDataToElementIfNotPresent(childProfile); + childProfile.getPuaData().setPattern(childPua.getString(k)); + break; + case "minLength": + addPuaDataToElementIfNotPresent(childProfile); + childProfile.getPuaData().setMinLenght(childPua.getInt(k)); + break; + case "maxLength": + addPuaDataToElementIfNotPresent(childProfile); + childProfile.getPuaData().setMaxLenght(childPua.getInt(k)); + break; + case "minimum": + addPuaDataToElementIfNotPresent(childProfile); + childProfile.getPuaData().setMinimum(childPua.getInt(k)); + break; + case "maximum": + addPuaDataToElementIfNotPresent(childProfile); + childProfile.getPuaData().setMaximum(childPua.getInt(k)); + break; + case "additionalProperties": + addPuaDataToElementIfNotPresent(childProfile); + childProfile.getPuaData().setAdditionalProperties(childPua.getBoolean(k)); + break; + case "exclusiveMinimum": + addPuaDataToElementIfNotPresent(childProfile); + childProfile.getPuaData().setExclusiveMinimum(childPua.getBoolean(k)); + break; + case "exclusiveMaximum": + addPuaDataToElementIfNotPresent(childProfile); + childProfile.getPuaData().setExclusiveMaximum(childPua.getBoolean(k)); + break; + case "description": + childProfile.setDocumentation(childPua.getString(k)); + break; + case "minItems": + minItems = childPua.getInt(k); + break; + case "maxItems": + maxItems = childPua.getInt(k); + break; + default:break; + } + } + childProfile.setCardinality(getCardinality(minItems, maxItems, required, sedaNode)); + + return childProfile; + } + + private String getCardinality(Integer minItems, Integer maxItems, Boolean required, SedaNode sedaNode){ + if (required){ + switch (sedaNode.getCardinality()){ + case "1-N": + case "0-N": + return "1-N"; + case "1": + case "0-1": + return "1"; + } + return "1"; + } else if (minItems!=null && maxItems!=null) { + return minItems + "-" + maxItems; + } else { + return sedaNode.getCardinality(); + } + } + + private void addPuaDataToElementIfNotPresent(ElementProperties childProfile) { + if (childProfile.getPuaData() == null) { + childProfile.setPuaData(new PuaData()); + } + } + + private void addRefToElement(ElementProperties el, String ref){ + ref = ref.substring(ref.lastIndexOf('/') + 1); + el.getPuaData().setPattern(ref); + } + + /** + * + * @param parent tree of {@link ElementProperties} + * @param name name of new {@link ElementProperties} + * @return new child of {@link ElementProperties} + */ + private ElementProperties createChildren(ElementProperties parent, String name){ + String realName = sanitizeNodeName(name); + ElementProperties children = new ElementProperties(); + children.setName(realName); + children.setId(idCounter++); + children.setParent(parent); + children.setParentId(parent.getId()); + children.setLevel(parent.getLevel() + 1); + parent.getChildren().add(children); + return children; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaDefinitions.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaDefinitions.java new file mode 100644 index 0000000000000000000000000000000000000000..0b276c3a05a3b378a2777f5d51138d0204431d4e --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaDefinitions.java @@ -0,0 +1,76 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.service; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +@Service +public class PuaDefinitions { + + @Value("${pua.definitions.file}") + private String defintionsFile; + + protected Map definitions; + + @JsonAnyGetter + public Map getDefinitions() { + return definitions; + } + + @JsonAnySetter + public void setDefinitions(String key, Object value) { + if (definitions == null) { + definitions = new HashMap(); + } + if (key != null) { + if (value != null) { + definitions.put(key, value); + } else { + definitions.remove(key); + } + } + + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaFromJSON.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaFromJSON.java new file mode 100644 index 0000000000000000000000000000000000000000..923c8a50b996332dd465d1911d4e125122ab1783 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaFromJSON.java @@ -0,0 +1,121 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.service; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import org.json.JSONArray; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +@Service +public class PuaFromJSON { + + @Autowired + private PuaPastisValidator puaPastisValidator; + + private static final Logger LOGGER = LoggerFactory.getLogger(JsonFromPUA.class); + + private static final String schema = "http://json-schema.org/draft-04/schema"; + + private static final String type = "object"; + + private static final Boolean additionalProperties = false; + + + public String getControlSchemaFromElementProperties(ElementProperties elementProperties) throws IOException { + // We use a JSONObject instead of POJO, since Jackson and Gson will add unnecessary + // backslashes during mapping string object values back to string; + JSONObject controlSchema = puaPastisValidator.sortedJSONObject(); + // 1. Add Schema + controlSchema.put("$schema",schema); + // 2. Add type + controlSchema.put("type",type); + // 3. Add additionProperties + controlSchema.put("additionalProperties",additionalProperties); + // 4. Check if tree contains Management metadata + controlSchema = addPatternProperties(elementProperties,controlSchema); + List elementsForTree = puaPastisValidator.ignoreMetadata(elementProperties); + + controlSchema.put("required",puaPastisValidator.getHeadRequired(elementsForTree)); + + //controlSchema.put("required",puaPastisValidator.getRequiredProperties(elementProperties)); + // 5. Add definitions; + JSONObject definitionsFromBasePua = puaPastisValidator.getDefinitionsFromExpectedProfile(); + controlSchema.put("definitions",definitionsFromBasePua); + // 6. Add ArchiveUnitProfile and the rest of the tree + + JSONArray allElements = puaPastisValidator.getJSONObjectFromAllTree(elementsForTree); + JSONObject sortedElements = getJSONObjectsFromJSonArray(allElements); + controlSchema.put("properties",sortedElements); + // 7. Remove excessive backslashes from mapping strings to objects and vice-versa; + String cleanedJSON = controlSchema.toString().replaceAll("[\\\\]+",""); + return cleanedJSON; + } + + public String getDefinitions(){ + return puaPastisValidator.getDefinitionsFromExpectedProfile().toString(); + } + + private JSONObject getJSONObjectsFromJSonArray(JSONArray array){ + JSONObject sortedJSONObject = puaPastisValidator.sortedJSONObject(); + Iterator iterator = array.iterator(); + while(iterator.hasNext()){ + JSONObject jsonObject = (JSONObject) iterator.next(); + for(String key : jsonObject.keySet()){ + sortedJSONObject.put(key,jsonObject.get(key)); + } + } + return sortedJSONObject; + } + + private JSONObject addPatternProperties(ElementProperties elementProperties, JSONObject controlSchema) throws IOException { + if (!puaPastisValidator.containsManagement(elementProperties )){ + controlSchema.put("patternProperties", new JSONObject().put("#management",new JSONObject() )); + } + return controlSchema; + } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaPastisValidator.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaPastisValidator.java new file mode 100644 index 0000000000000000000000000000000000000000..bdae85f2d20e68aa219ac48763c73a8f337af17a --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/service/PuaPastisValidator.java @@ -0,0 +1,550 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.service; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.dto.pua.PuaMetadataDetails; +import fr.gouv.vitamui.pastis.common.dto.seda.SedaNode; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.json.JSONTokener; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import static java.util.stream.Collectors.toList; +import static java.util.stream.Collectors.toSet; + +@Service +public class PuaPastisValidator { + + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(PuaPastisValidator.class); + + private static JSONObject profileJsonExpected; + + private static SedaNode archiveUnitSeda; + + private JSONObject getProfileJsonExpected() { + if (profileJsonExpected == null) { + InputStream inputStream = getClass().getClassLoader().getResourceAsStream("pua_validation/valid_pua.json"); + + assert inputStream != null; + JSONTokener tokener = new JSONTokener(new InputStreamReader(inputStream)); + profileJsonExpected = new JSONObject(tokener); + } + return profileJsonExpected; + } + + private SedaNode getArchiveUnitSeda() throws IOException { + if (archiveUnitSeda == null) { + InputStream inputStream = getClass().getClassLoader().getResourceAsStream("pua_validation/archiveUnitSeda.json"); + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); + archiveUnitSeda = objectMapper.readValue(inputStream, SedaNode.class); + } + return archiveUnitSeda; + } + + /** + * Validate a PUA JSON file against a template file + * using LENIENT comparison mode + * + * @param pua The string containing the JSON file to be validated + * @throws IOException + * @throws AssertionError + */ + public void validatePUA(JSONObject pua) throws IOException, AssertionError { + JSONObject profileJsonExpected = getProfileJsonExpected(); + + // Compare list of field at the root level + Set actualFieldList = pua.keySet().stream().collect(toSet()); + Set expectedFieldList = profileJsonExpected.keySet().stream().collect(Collectors.toSet()); + if (!actualFieldList.equals(expectedFieldList)) { + throw new AssertionError("PUA field list does not contains the expected values"); + } + + // Next tests are controlling the ControlSchema + String controlSchemaString = pua.getString("controlSchema"); + JSONObject controlSchemaActual = new JSONObject(controlSchemaString); + controlSchemaString = profileJsonExpected.getString("controlSchema"); + JSONObject controlSchemaExpected = new JSONObject(controlSchemaString); + + // Checking that the whole structure is respected. Doesn't care that the pua contains extended fields. + JSONAssert.assertEquals(controlSchemaExpected, controlSchemaActual, JSONCompareMode.LENIENT); + + // Checking that the definitions list is exactly the same as expected + JSONAssert.assertEquals(controlSchemaExpected.getJSONObject("definitions"), controlSchemaActual.getJSONObject("definitions"), JSONCompareMode.STRICT); + + // Checking that #management object is present and at the correct position + if (controlSchemaActual.has("patternProperties")) { + JSONObject patternProperties = controlSchemaActual.getJSONObject("patternProperties"); + if (patternProperties.has("#management")) { + JSONAssert.assertEquals(new JSONObject(), patternProperties.getJSONObject("#management"), JSONCompareMode.STRICT); + + // Check that #management is not in both header and 'properties' object + JSONObject properties = controlSchemaActual.getJSONObject("properties"); + if (properties.has("#management")) { + throw new AssertionError("Can't have both '#management' key in header and in 'properties' object"); + } + } + } else { + JSONObject properties = controlSchemaActual.getJSONObject("properties"); + if (!properties.has("#management")) { + throw new AssertionError("Missing '#management' key in 'properties' object"); + } + // TODO Verify #management rules structure + // #HAVEFUN + } + } + public JSONObject getDefinitionsFromExpectedProfile() { + + JSONObject baseProfile = getProfileJsonExpected(); + String controlSchema = baseProfile.get("controlSchema").toString(); + JSONObject controlSchemaAsJSON = new JSONObject(controlSchema); + + return controlSchemaAsJSON.getJSONObject("definitions"); + } + + /** + *

Finds the seda type of a element based on his name

+ * @param elementName the name of the element to search on the archiveUnitSeda.json file + * @return the seda type of an element + */ + private String getPUAMetadataType(String elementName) throws IOException { + SedaNode sedaElement = getSedaMetadata(elementName); + return sedaElement != null ? + resolvePuaType(sedaElement) : + "undefined"; + } + + /** + *

Resolve the Pua element type based on VITAM given rules

+ * @param sedaElement the seda element type of the metadata + * @return The type of a pua element + */ + private String resolvePuaType(SedaNode sedaElement) { + String sedaType = sedaElement.getType(); + String sedaElementType = sedaElement.getElement(); + String sedaName = sedaElement.getName(); + String sedaCardinality = sedaElement.getCardinality(); + + + if (sedaElementType.equals("Simple") && + (sedaCardinality.equals("0-1") || sedaCardinality.equals("1"))) { + return "string"; + } + if ((sedaElement.getElement().equals("Complex") && + (sedaCardinality.equals("0-1") || sedaCardinality.equals("1"))) || sedaName.equals("Title") || sedaName.equals("Description")) { + return "object"; + } + if (sedaType.equals("boolean") && (sedaCardinality.equals("0-1") || sedaCardinality.equals("1"))) { + return "boolean"; + } + if (sedaCardinality.equals("1-N") || sedaCardinality.equals("0-N")) { + return "array"; + } + return "undefined"; + } + + /** + *

Find and create a single JSONObject based on a given ElementProperties tree if it contains a Management metadata

+ * @param elementProperties an ElementProperties object containing Management as root element + * @return a JSONObject containing a PUA representation of a Management metadata + */ + private JSONObject getJSONObjectFromMetadata(ElementProperties elementProperties) throws IOException { + + JSONObject puaJSONObject = new JSONObject(); + SedaNode sedaElement = getSedaMetadata("Management"); + + ElementProperties elementFound = elementProperties.flattened() + .filter(childName -> childName.getName().equals("Management") + && childName.getType().equals("element")).findAny().orElse(null); + + if (elementFound != null && sedaElement != null) { + PuaMetadataDetails puaMetadataDetails = new PuaMetadataDetails(); + // get pua type; + puaMetadataDetails.setType(resolvePuaType(sedaElement)); + puaMetadataDetails.setDescription((elementFound.getDocumentation())); + // Create a Map + Map puaMap = new HashMap<>(); + puaMap.put("Management",puaMetadataDetails); + puaJSONObject.put("properties",puaMap); + return puaJSONObject; + } + return puaJSONObject; + + } + + /** + *

Recursively generates a tree of JSON objects based on a given ElementProperties object type

+ * @param elementsFromTree an ElementProperties List + * @return a JSONArray representing all PUA elements of an ArchiveUnitProfile and its siblings + */ + public JSONArray getJSONObjectFromAllTree(List elementsFromTree) { + + JSONArray jsonArray = sortedJSONArray(); + List rulesToIgnore = Arrays.asList("StorageRule", "AppraisalRule", "AccessRule", "DisseminationRule", + "ReuseRule", "ClassificationRule"); + + for (ElementProperties el: elementsFromTree){ + try { + if (el.getName().equals("Management")) { + JSONObject management = getJSONFromManagement(el); + jsonArray.put(management); + } if (jsonArray.length() > 0 && + jsonArray.toString().contains(el.getName())) { + ElementProperties element = getElementById(elementsFromTree, el.getParentId()); + if(element != null && element.getName().equals("Content")){ + JSONObject notManagementMapElement = getJSONObjectFromElement(el); + jsonArray.put(notManagementMapElement); + }else{ + continue; + } + } else if (!rulesToIgnore.contains(el.getName()) && !el.getName().equals("Content") && + !el.getName().equals("Management")) { + JSONObject notManagementMapElement = getJSONObjectFromElement(el); + jsonArray.put(notManagementMapElement); + } + + } catch (IOException e) { + LOGGER.info(e.getMessage()); + } + } + return jsonArray; + } + + /** + *

Recursively generates a tree of JSON objects starting from the Management metadata

+ * @param element an ElementProperties object + * @return a JSONArray representing all PUA elements of an Management metadata and its specific rules + */ + public JSONObject getJSONFromManagement(ElementProperties element) throws IOException { + List rulesMetadata = Arrays.asList("StorageRule", "AppraisalRule", "AccessRule", "DisseminationRule", "ReuseRule", "ClassificationRule"); + List childrenToEncapsulate = Arrays.asList("Rule","StartDate"); + List rulesFound = new ArrayList<>(); + + JSONObject pua = sortedJSONObject(); + if (element.getChildren().size() > 0) { + for (ElementProperties childElement : element.getChildren()) { + JSONObject childrenOfRule = sortedJSONObject(); + JSONObject grandChildrenOfRule = sortedJSONObject(); + JSONObject propertiesRules = sortedJSONObject(); + // 1. Check special cases + if (rulesMetadata.contains(childElement.getName())) { + PuaMetadataDetails ruleTypeMetadataDetails = new PuaMetadataDetails(); + PuaMetadataDetails nonSpecialChildOfRuleDetails = new PuaMetadataDetails(); + SedaNode sedaElement = getSedaMetadata(childElement.getName()); + if(childElement.getCardinality().equals("1") && sedaElement.getElement().equals("Complex")) + rulesFound.add(childElement.getName()); + getMetaDataFromSeda(childElement, ruleTypeMetadataDetails, sedaElement); + Map ruleTypeMetadataMap = new HashMap(); + Map nonSpecialChildOfRule = new HashMap(); + + List requiredNonSpecialChildren = new ArrayList<>(); + List requiredChildren = new ArrayList<>(); + // 2. If special cases have children, encapsulate them into "Rules : { items : {childName : { ..." + if (childElement.getChildren().size() > 0 ) { + for (ElementProperties grandChild : childElement.getChildren()) { + SedaNode node = getSedaMetadata(grandChild.getName()); + if (childrenToEncapsulate.contains(grandChild.getName())) { + PuaMetadataDetails childOfRuleDetails = new PuaMetadataDetails(); + getMetaDataFromSeda(grandChild, childOfRuleDetails, node); + if(grandChild.getCardinality().equals("0-1") || grandChild.getCardinality().equals("1")) + requiredChildren.add(grandChild.getName()); + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + JSONObject childProperties = new JSONObject(mapper.writeValueAsString(childOfRuleDetails)); + grandChildrenOfRule.put(grandChild.getName(), childProperties); + ruleTypeMetadataDetails.setProperties(grandChildrenOfRule); + } else { + getMetaDataFromSeda(grandChild, nonSpecialChildOfRuleDetails, node); + nonSpecialChildOfRule.put(grandChild.getName(),nonSpecialChildOfRuleDetails); + //Required field + requiredNonSpecialChildren.add(grandChild.getName()); + } + ruleTypeMetadataMap.put(childElement.getName(),ruleTypeMetadataDetails); + } + } + // 2. Once the children of special cases are processed, we put them into Rules -> items + if(!grandChildrenOfRule.isEmpty()) { + JSONObject propretyOfItems = new JSONObject().put("properties", grandChildrenOfRule); + propretyOfItems.put("required", requiredChildren); + childrenOfRule.put("items", propretyOfItems); + propertiesRules.put("Rules", childrenOfRule); + } + + // 3. Convert to jsonobject via map and update its property + JSONObject ruleTypeMetadata = new JSONObject(ruleTypeMetadataMap); + ruleTypeMetadata.getJSONObject(childElement.getName()).put("properties",propertiesRules); + if(!requiredNonSpecialChildren.isEmpty()) { + ruleTypeMetadata.getJSONObject(childElement.getName()).put("required", requiredNonSpecialChildren); + } + nonSpecialChildOfRule.keySet().forEach(e-> { + Object details = nonSpecialChildOfRule.get(e); + ruleTypeMetadata.getJSONObject(childElement.getName()).getJSONObject("properties").put(e.toString(),details); + }); + // 5. We retrieve parent properties and add more elements to root element properties + pua.accumulate("properties", ruleTypeMetadata.toMap()); + if(!rulesFound.isEmpty()) pua.put("required", rulesFound); + } + } + } + return retrieveAccumulatedJsonManagementProperties(pua); + } + + /** + * Retrieve the accumulated JSONArray properties from pua + * @param pua is JSONObjet that contains Management section of PUA + * Convert it into a JSONObject and put it into a #mangagement key + */ + public JSONObject retrieveAccumulatedJsonManagementProperties(JSONObject pua){ + + JSONObject managementAsJSONObject = new JSONObject(); + if(pua.keySet().contains("properties")){ + JSONObject properties = pua; + try{ + JSONArray accumulatedProperties = pua.getJSONArray("properties"); + String propertiesAsString = accumulatedProperties.toString() + .substring(1,accumulatedProperties.toString().length() -1) + .replaceAll("(},\\{)",","); + properties = new JSONObject(propertiesAsString); + JSONObject propertiesRequiredJson = new JSONObject(); + propertiesRequiredJson.put("properties",properties); + if(pua.keySet().contains("required")) + propertiesRequiredJson.put("required",pua.getJSONArray("required")); + managementAsJSONObject.put("#management",propertiesRequiredJson); + }catch (JSONException e){ + LOGGER.info(e.getMessage()); + managementAsJSONObject.put("#management",pua); + } + }else{ + managementAsJSONObject.put("#management",new JSONObject()); + } + return managementAsJSONObject; + } + + /** + *

Recursively searches for a seda node metadata based on a name

+ * @param elementName the name of the seda element to be found + * @return a SedaNode object representation of a given seda element + */ + + private SedaNode getSedaMetadata(String elementName) throws IOException { + SedaNode sedaTree = getArchiveUnitSeda(); + + return sedaTree.flattened() + .filter(childName -> childName.getName().equals(elementName)).findAny().orElse(null); + } + + /** + *

Order a JSONObject

+ * @return an ordered JSONObject + */ + public JSONObject sortedJSONObject() { + JSONObject jsonObj = new JSONObject(); + try { + Field changeMap = jsonObj.getClass().getDeclaredField("map"); + changeMap.setAccessible(true); + changeMap.set(jsonObj, new LinkedHashMap<>()); + changeMap.setAccessible(false); + } catch (IllegalAccessException | NoSuchFieldException e) { + } + return jsonObj; + } + + /** + *

Order a JSONOArray

+ * @return an ordered JSONArray + */ + public JSONArray sortedJSONArray() { + JSONArray jsonArray = new JSONArray(); + try { + Field changeMap = jsonArray.getClass().getDeclaredField("map"); + changeMap.setAccessible(true); + changeMap.set(jsonArray, new LinkedHashMap<>()); + changeMap.setAccessible(false); + } catch (IllegalAccessException | NoSuchFieldException e) { + LOGGER.info(e.getMessage()); + } + return jsonArray; + } + + /** + *

Checks if an object of type ElementProperties contains, and its children, contains a Management

+ * @return true if an given ElementProperties object contains a Management metadata + */ + public boolean containsManagement(ElementProperties elementProperties) throws IOException { + return getJSONObjectFromMetadata(elementProperties).length() > 0; + } + + /** + *

Recursively converts an ElementProperty tree and its children, into a Map

+ * @return a HashMap containing a tree of Pua metadata and its children + */ + public JSONObject getJSONObjectFromElement(ElementProperties elementProperties) + throws IOException { + SedaNode sedaElement = getSedaMetadata(elementProperties.getName()); + PuaMetadataDetails puaMetadataDetails = new PuaMetadataDetails(); + getMetaDataFromSeda(elementProperties, puaMetadataDetails, sedaElement); + if(!elementProperties.getChildren().isEmpty() && !getRequiredProperties(elementProperties).isEmpty()) { + puaMetadataDetails.setRequired(getRequiredProperties(elementProperties)); + } + JSONObject json = new JSONObject(); + json.put(elementProperties.getName(),new JSONObject(puaMetadataDetails)); + if(!elementProperties.getChildren().isEmpty()) { + json.getJSONObject(elementProperties.getName()).put("properties", new JSONObject()); + getJSONObjectFromElement(elementProperties, json.getJSONObject(elementProperties.getName()).getJSONObject("properties")); + } + return json; + } + + public void getJSONObjectFromElement(ElementProperties elementProperties, JSONObject json) + throws IOException { + if (elementProperties.getChildren().size() > 0) { + for (ElementProperties el:elementProperties.getChildren()){ + PuaMetadataDetails puaMetadataDetails = new PuaMetadataDetails(); + puaMetadataDetails.setType(getPUAMetadataType(el.getName())); + puaMetadataDetails.setDescription(el.getDocumentation()); + json.put(el.getName(),new JSONObject(puaMetadataDetails)); + if (!el.getChildren().isEmpty()) { + json.getJSONObject(el.getName()).put("properties",new JSONObject()); + getJSONObjectFromElement(el, json.getJSONObject(el.getName()).getJSONObject("properties")); + } + } + } + } + + public List getRequiredProperties(ElementProperties elementProperties){ + List listRequired = new ArrayList<>(); + elementProperties.getChildren().forEach(child -> { + try { + SedaNode sedaElement = getSedaMetadata(child.getName()); + if((child.getCardinality().equals("1-N") && sedaElement.getCardinality().equals("0-N")) + || (child.getCardinality().equals("1") && !sedaElement.getCardinality().equals("1")) + || sedaElement.getCardinality().equals("1")) + listRequired.add(child.getName()); + } catch (IOException e) { + LOGGER.info(e.getMessage()); + } + }); + return listRequired; + } + + public List ignoreMetadata(ElementProperties elementProperties){ + List metadataToIgnore = Arrays.asList("DescriptiveMetadata","ArchiveUnit"); + List elementsFromTree = + elementProperties.flattened() + .filter(child -> !metadataToIgnore.contains(child.getName()) + && child.getType().equals("element")).collect(toList()); + return elementsFromTree; + } + + public List getHeadRequired(List elementsFromTree) { + List list = new ArrayList<>(); + elementsFromTree.forEach((element) -> { + try { + SedaNode sedaElement = getSedaMetadata(element.getName()); + ElementProperties parent = getElementById(elementsFromTree, element.getParentId()); + if ( (parent!= null && + (parent.getName().equals("Content") || element.getName().equals("ArchiveUnitProfile")))) { + if((element.getCardinality().equals("1-N") && sedaElement.getCardinality().equals("0-N")) + || (element.getCardinality().equals("1") && !sedaElement.getCardinality().equals("1")) + || sedaElement.getCardinality().equals("1")) { + list.add(element.getName()); + } + } + } catch (IOException e) { + LOGGER.info(e.getMessage()); + } + }); + return list; + } + + public void getMetaDataFromSeda(ElementProperties el, PuaMetadataDetails puaMetadataDetails, SedaNode sedaElement){ + // get pua type; + puaMetadataDetails.setType(resolvePuaType(sedaElement)); + puaMetadataDetails.setDescription((el.getDocumentation())); + if(sedaElement.getElement().equals("Complex") && el.getPuaData() != null){ + if(el.getPuaData().getAdditionalProperties() != null){ + puaMetadataDetails.setAdditionalProperties(el.getPuaData().getAdditionalProperties()); + } + } + if((el.getCardinality() != null && + el.getCardinality().equals("0-1") && sedaElement.getCardinality().equals("0-N"))) { + puaMetadataDetails.setMinItems(0); + puaMetadataDetails.setMaxItems(1); + } + if(!sedaElement.getEnumeration().isEmpty() && el.getValue() == null){ + puaMetadataDetails.setEnums(sedaElement.getEnumeration()); + } + if(el.getValue() != null){ + ArrayList list = new ArrayList(); + list.add(el.getValue()); + puaMetadataDetails.setEnums(list); + } + + } + + public ElementProperties getElementById(List elementProperties, Long id){ + + for (ElementProperties el: elementProperties){ + if(el.getId() == id) return el; + } + return null; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/FileSystemResource.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/FileSystemResource.java new file mode 100644 index 0000000000000000000000000000000000000000..9f6d39f114aee8da7936755713ea4ed1a2edc1b0 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/FileSystemResource.java @@ -0,0 +1,55 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.util; + +import org.springframework.core.io.ByteArrayResource; + +public final class FileSystemResource extends ByteArrayResource { + + private String fileName; + + public FileSystemResource(byte[] byteArray , String filename) { + super(byteArray); + this.fileName = filename; + } + + public String getFilename() { return fileName; } + public void setFilename(String fileName) { this.fileName= fileName; } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/ManifestValidator.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/ManifestValidator.java new file mode 100644 index 0000000000000000000000000000000000000000..a4499211ac72efdbc211c3a21b030221c0fed6c9 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/ManifestValidator.java @@ -0,0 +1,110 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.util; + +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import org.apache.tomcat.util.http.fileupload.IOUtils; +import org.apache.xerces.util.XMLCatalogResolver; +import org.xml.sax.SAXException; + +import javax.xml.XMLConstants; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +public class ManifestValidator { + + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(ManifestValidator.class); + + public static final String RNG_FACTORY = "com.thaiopensource.relaxng.jaxp.XMLSyntaxSchemaFactory"; + public static final String RNG_PROPERTY_KEY = "javax.xml.validation.SchemaFactory:" + XMLConstants.RELAXNG_NS_URI; + private static final String RNG_SUFFIX = ".rng"; + public static final String HTTP_WWW_W3_ORG_XML_XML_SCHEMA_V1_1 = "http://www.w3.org/XML/XMLSchema/v1.1"; + /** + * Filename of the catalog file ; should be found in the classpath. + */ + public static final String CATALOG_FILENAME = "xsd_validation/catalog.xml"; + + /** + * @param manifestFile + * @param rngFile + * @return true if validated + * @throws SAXException + * @throws IOException + */ + public boolean checkFileRNG(InputStream manifestFile, File rngFile) { + try { + if (rngFile.length() > 0) { + final Schema schema = getSchema(rngFile); + final Validator validator = schema.newValidator(); + validator.validate(new StreamSource(manifestFile)); + return true; + } + LOGGER.error("Le fichier RNG est vide"); + return false; + } catch (SAXException|IOException e) { + LOGGER.error("Erreur validation du manifest",e); + return false; + } finally { + IOUtils.closeQuietly(manifestFile); + } + } + + private Schema getSchema(File file) throws SAXException { + SchemaFactory factory; + if (file.getName().endsWith(RNG_SUFFIX)) { + System.setProperty(RNG_PROPERTY_KEY, + RNG_FACTORY); + factory = SchemaFactory.newInstance(XMLConstants.RELAXNG_NS_URI); + } else { + factory = SchemaFactory.newInstance(HTTP_WWW_W3_ORG_XML_XML_SCHEMA_V1_1); + } + + // Load catalog to resolve external schemas even offline. + final URL catalogUrl = ManifestValidator.class.getClassLoader().getResource(CATALOG_FILENAME); + factory.setResourceResolver(new XMLCatalogResolver(new String[] {catalogUrl.toString()}, false)); + + return factory.newSchema(file); + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/NoticeUtils.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/NoticeUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..dad76ad7fe56281b24d84c434c81394c8f508529 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/NoticeUtils.java @@ -0,0 +1,105 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.util; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.module.afterburner.AfterburnerModule; +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import fr.gouv.vitamui.pastis.common.dto.profiles.Notice; +import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileResponse; +import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileType; +import org.json.JSONArray; +import org.json.JSONObject; +import org.springframework.stereotype.Service; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class NoticeUtils { + + private NoticeUtils(){} + + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(NoticeUtils.class); + + public static Notice getNoticeFromPUA(JSONObject jsonPUA) throws IOException { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + return objectMapper.readValue(jsonPUA.toString(), Notice.class); + } + + public static ProfileResponse convertToProfileResponse(Notice notice){ + ProfileResponse profileResponse = new ProfileResponse(); + try { + profileResponse.setId(notice.getId()); + profileResponse.setType(getFileType(notice)); + profileResponse.setName(notice.getIdentifier()); + profileResponse.setNotice(getNoticeFromPUA(new JSONObject(notice.serialiseString()))); + } catch (JsonProcessingException e) { + LOGGER.info("Error while convert notice to profileResponse {}", notice); + } catch (IOException e) { + LOGGER.info("Error while convert notice to profileResponse {}", notice); + } + + return profileResponse; + } + + public static ArrayList convert(JSONArray jsonArray) throws JsonProcessingException { + ArrayList list = new ArrayList(); + ObjectMapper objectMapper = new ObjectMapper(); + list = (ArrayList) objectMapper.readValue(jsonArray.toString(), new TypeReference>(){}); + return list; + } + + public static ProfileType getFileType(Notice notice){ + return notice.getPath() != null && notice.getControlSchema()==null ? ProfileType.PA : ProfileType.PUA; + } + + public static String serialiseString(Object o) throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + mapper.registerModule(new AfterburnerModule()); + String json = mapper.writeValueAsString(o); + return json; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/OrderedJSONObjectFactory.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/OrderedJSONObjectFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..d0aa797acb7b5399f7a890b01c1f756d7041b4f0 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/OrderedJSONObjectFactory.java @@ -0,0 +1,75 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.util; + +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import org.json.JSONObject; + +import java.lang.reflect.Field; +import java.util.LinkedHashMap; + +public class OrderedJSONObjectFactory { + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(OrderedJSONObjectFactory.class); + private static boolean setupDone = false; + private static Field JSONObjectMapField = null; + + public static void setupFieldAccessor() { + if( !setupDone ) { + setupDone = true; + try { + JSONObjectMapField = JSONObject.class.getDeclaredField("map"); + JSONObjectMapField.setAccessible(true); + } catch (NoSuchFieldException ignored) { + LOGGER.warn("JSONObject implementation has changed, returning unmodified instance"); + } + } + } + + public static JSONObject create() { + setupFieldAccessor(); + JSONObject result = new JSONObject(); + try { + if (JSONObjectMapField != null) { + JSONObjectMapField.set(result, new LinkedHashMap<>()); + } + }catch (IllegalAccessException ignored) {} + return result; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisCustomCharacterEscapeHandler.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisCustomCharacterEscapeHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..698fdefbbde5769ad0bf5df987abb2ad38f73d02 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisCustomCharacterEscapeHandler.java @@ -0,0 +1,94 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.util; + +import com.sun.xml.bind.marshaller.CharacterEscapeHandler; + +import java.io.IOException; +import java.io.Writer; + +public class PastisCustomCharacterEscapeHandler implements CharacterEscapeHandler{ + + public PastisCustomCharacterEscapeHandler() { + super(); + } + + /** + * @param ch The array of characters. + * @param start The starting position. + * @param length The number of characters to use. + * @param isAttVal true if this is an attribute value literal. + */ + public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException { + int limit = start + length; + for (int i = start; i < limit; i++) { + char c = ch[i]; + if (c == '&' || c == '<' || c == '>' || (c == '\"' && isAttVal) + || (c == '\'' && isAttVal)) { + if (i != start) { + out.write(ch, start, i - start); + } + start = i + 1; + switch (ch[i]) { + case '&': + out.write("&"); + break; + + case '<': + out.write("<"); + break; + + case '>': + out.write(">"); + break; + + case '\"': + out.write("\""); + break; + + case '\'': + out.write("'"); + break; + } + } + } + if (start != limit) { + out.write(ch, start, limit - start); + } + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisGetXmlJsonTree.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisGetXmlJsonTree.java new file mode 100644 index 0000000000000000000000000000000000000000..0e2d173689aa2e0833c740e47e938b9f71a3b8ad --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisGetXmlJsonTree.java @@ -0,0 +1,132 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.util; + +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.dto.ElementRNG; +import fr.gouv.vitamui.pastis.common.dto.jaxb.*; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +public class PastisGetXmlJsonTree { + + //ElementRNG elementRNGRoot; + public String jsonParsed = ""; + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(PastisGetXmlJsonTree.class); + + + public ElementProperties getJsonParsedTree(ElementRNG elementRNGRoot) { + ElementRNG.buildElementPropertiesTree(elementRNGRoot,0, null); + return ElementRNG.elementStaticRoot; + } + + // Test an xml to json and a json to xml. + // TODO Move this code in test package + public String getJsonParsedTreeTest(ElementRNG elementRNGRoot) throws JAXBException, FileNotFoundException { + + //vWhen the handler is called, the proprities tree (json) is build + // using its ElementRNG(elementRngRoot) object. + // The elementRngRoot is filled when the xml file is read, by passing + // it to the contentHanler of the Xml reader. + // The methods used are the 5 main methods of a DefaultHandler type + // See methods bellow + ElementRNG.buildElementPropertiesTree(elementRNGRoot,0, null); + ElementProperties eparent = ElementRNG.elementStaticRoot; + + + // The eparentRng is an object of type BalizeXML. It is built using the + // object eparent (of type ElementProperties) that, in fact, represent the json + // prouced during the parser's first call. + BaliseXML.buildBaliseXMLTree(eparent,0, null); + BaliseXML eparentRng = BaliseXML.baliseXMLStatic; + + + // Transforms java objects to Xml file (Marshalling) + JAXBContext contextObj = JAXBContext.newInstance(AttributeXML.class, ElementXML.class, DataXML.class, ValueXML.class, OptionalXML.class, OneOrMoreXML.class, + ZeroOrMoreXML.class, AnnotationXML.class, DocumentationXML.class, ChoiceXml.class); + Marshaller marshallerObj = contextObj.createMarshaller(); + marshallerObj.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + marshallerObj.setProperty("com.sun.xml.bind.marshaller.CharacterEscapeHandler", + new PastisCustomCharacterEscapeHandler()); + + marshallerObj.marshal(eparentRng, new FileOutputStream("generated_test.xml")); + + + ObjectMapper mapper = new ObjectMapper(); + String jsonString = ""; + try { + jsonString = mapper.writeValueAsString(eparent); + } catch (JsonGenerationException e1) { + e1.printStackTrace(); + } catch (JsonMappingException e1) { + e1.printStackTrace(); + } catch (IOException e1) { + e1.printStackTrace(); + } + return "["+jsonString+"]"; + } + + + public String getXmlParsedTree(String jsonString) throws IOException { + + ObjectMapper objectMapper = new ObjectMapper(); + ObjectMapper xmlMapper = new ObjectMapper(); + JsonNode tree = objectMapper.readTree(jsonString); + String jsonAsXml = xmlMapper.writeValueAsString(tree); + + return jsonAsXml; + } + + + public void setJsonParsed(String jsonParsed) { + this.jsonParsed = jsonParsed; + } + + + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisMarshaller.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisMarshaller.java new file mode 100644 index 0000000000000000000000000000000000000000..6ca8af3bc3080accd2f4379031708ff1c4c771c4 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisMarshaller.java @@ -0,0 +1,84 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.common.util; + +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.dto.factory.RngTag; +import fr.gouv.vitamui.pastis.common.dto.factory.RngTagFactory; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; + +public class PastisMarshaller { + + public static final String CHAR_ESCAPE_HANDLER = "com.sun.xml.bind.marshaller.CharacterEscapeHandler"; + public static final String MARSHALLER_FORMAT = Marshaller.JAXB_FORMATTED_OUTPUT; + + + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(PastisMarshaller.class); + + public String getMarshalledObject(ElementProperties mappedJson) throws IOException, JAXBException { + + RngTagFactory tagFactory = new RngTagFactory(); + RngTag rngTree = tagFactory.createTag(mappedJson, null, 0); + + JAXBContext contextObj = JAXBContext.newInstance(RngTag.class); + Marshaller marshallerObj = contextObj.createMarshaller(); + marshallerObj.setProperty(MARSHALLER_FORMAT, true); + marshallerObj.setProperty(CHAR_ESCAPE_HANDLER, new PastisCustomCharacterEscapeHandler()); + + ByteArrayOutputStream os = new ByteArrayOutputStream(); + Writer writer = new OutputStreamWriter(os, "UTF-8"); + marshallerObj.marshal(rngTree, writer); + String response = new String (os.toByteArray(), "UTF-8"); + writer.close(); + + String status = !response.isEmpty() ? "Json marshalled successfully" : "Failed to marshall json object"; + LOGGER.info(status); + + return response; + } + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisSAX2Handler.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisSAX2Handler.java new file mode 100644 index 0000000000000000000000000000000000000000..27e07c21c626bdbdbd2cb968f7c74747cdb7cad3 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisSAX2Handler.java @@ -0,0 +1,151 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.util; + +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import fr.gouv.vitamui.pastis.common.dto.ElementRNG; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +import java.util.Stack; + +public class PastisSAX2Handler extends DefaultHandler{ + + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(PastisSAX2Handler.class); + + boolean isValue; + + private boolean isInDocumentationTag; + + public ElementRNG elementRNGRoot; + + Stack stackRNG = new Stack(); + + private StringBuilder documentationContent; + + + /** + BEGIN OF OVERRIDE OF SAX 5 METHODS : startElement, endElement, startDocument, endDocument and characters + * This method is called everytime the parser gets an open tag + * Identifies which tag has being opened at time by assiging a new flag + */ + public void startElement(String nameSpace, String localName, String qName, Attributes attr) throws SAXException { + + //cette variable contient le nom du nœud qui a créé l'événement + // If node not a grammar tag or start tag + if(!("grammar".equals(localName) || "start".equals(localName))){ + + // If node is ArchiveTransfer + if(null !=attr.getValue("name") && attr.getValue("name").equals("ArchiveTransfer")){ + return ; + } + //If node has documentation + if("value".equals(localName) || "documentation".equals(localName)) { + this.isValue = true; + } + // Create a new rng tag element and add it to the stack + ElementRNG elementRNG = new ElementRNG(); + elementRNG.setName(attr.getValue("name")); + elementRNG.setType(localName); + elementRNG.setDataType(attr.getValue("type")); + if(!stackRNG.empty()) { + ElementRNG e = stackRNG.lastElement(); + elementRNG.setParent(e); + e.getChildren().add(elementRNG); + } + stackRNG.push(elementRNG); + + + + } + + documentationContent = new StringBuilder(); + if (qName.equalsIgnoreCase("xsd:documentation")) { + isInDocumentationTag = true; + } + + } + + /** + * Actions à réaliser lors de la détection de la fin d'un élément. + */ + public void endElement(String nameSpace, String localName, String qName) throws SAXException { + + if (qName.equalsIgnoreCase("xsd:documentation")) { + isInDocumentationTag = false; + + } + if(!stackRNG.empty()) { + ElementRNG e = stackRNG.pop(); + } + } + + /** + * Actions à réaliser au début du document. + */ + public void startDocument() { + elementRNGRoot = new ElementRNG(); + elementRNGRoot.setName("ArchiveTransfer"); + elementRNGRoot.setType("element"); + stackRNG.push(elementRNGRoot); + } + + /** + * Actions à réaliser lors de la fin du document XML. + */ + public void endDocument() { + } + + /** + * Actions to perform when tag content is reached (Data between '< />' ) + */ + @Override + public void characters(char[] caracteres, int start, int length) throws SAXException { + if (isInDocumentationTag) { + documentationContent.append(new String(caracteres, start, length)); + stackRNG.lastElement().setValue(documentationContent.toString()); + } + if(isValue) { + String valueContent = new String(caracteres, start, length); + stackRNG.lastElement().setValue(valueContent); + this.isValue = false; + } + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PropertiesUtils.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PropertiesUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..4f5b53ebea9f3d20d325b615b8753dca8b0b9ed3 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PropertiesUtils.java @@ -0,0 +1,118 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.util; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.net.URISyntaxException; +import java.net.URL; + +public final class PropertiesUtils { + + private static final String FILE_NOT_FOUND_IN_RESOURCES = "File not found in Resources: "; + + private PropertiesUtils() { + // Empty + } + + /** + * Get the File representation from the local path to the Resources directory + * + * @param resourcesFile properties file from resources directory + * @return the associated File + * @throws FileNotFoundException if the resource file not found + */ + public static File getResourceFile(String resourcesFile) throws FileNotFoundException { + if (resourcesFile == null) { + throw new FileNotFoundException(FILE_NOT_FOUND_IN_RESOURCES + resourcesFile); + } + URL url; + try { + url = PropertiesUtils.class.getClassLoader().getResource(resourcesFile); + } catch (final SecurityException e) { + throw new FileNotFoundException(FILE_NOT_FOUND_IN_RESOURCES + resourcesFile); + } + if (url == null) { + url = Thread.currentThread().getContextClassLoader().getResource(resourcesFile); + } + if (url == null) { + throw new FileNotFoundException(FILE_NOT_FOUND_IN_RESOURCES + resourcesFile); + } + File file; + try { + file = new File(url.toURI()); + } catch (final URISyntaxException e) { + file = new File(url.getFile().replaceAll("%20", " ")); + } + if (file.exists()) { + return file; + } + throw new FileNotFoundException(FILE_NOT_FOUND_IN_RESOURCES + resourcesFile); + } + + /** + * Get the InputStream representation from the Resources directory + * + * @param resourcesFile properties file from resources directory + * @return the associated File + * @throws FileNotFoundException if the resource file not found + */ + public static InputStream getResourceAsStream(String resourcesFile) throws FileNotFoundException { + if (resourcesFile == null) { + throw new FileNotFoundException(FILE_NOT_FOUND_IN_RESOURCES); + } + InputStream stream = null; + try { + stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourcesFile); + } catch (final SecurityException e) { + + } + if (stream == null) { + try { + stream = PropertiesUtils.class.getClassLoader().getResourceAsStream(resourcesFile); + } catch (final SecurityException e) { + + } + } + if (stream == null) { + throw new FileNotFoundException(FILE_NOT_FOUND_IN_RESOURCES + resourcesFile); + } + return stream; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/RNGConstants.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/RNGConstants.java new file mode 100644 index 0000000000000000000000000000000000000000..bb2d2fad228b9b09f287b8688310ef68d6e21700 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/RNGConstants.java @@ -0,0 +1,401 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.util; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author rachid Sala + */ +public class RNGConstants { + + public static final Map typeElement = new HashMap<>() { + public static final long serialVersionUID = 1L; + { + put("Simple", "element"); + put("Complex", "element"); + put("Attribute", "attribute"); + } + }; + + public static enum DataType + { + string("string"), + dateTime("dateTime"), + date("date"), + ID("ID"), + id("id"), + anyURI("anyURI"), + token("token"), + tokenType("tokenType"), + base64Binary("base64Binary"), + positiveInteger("positiveInteger"), + booleanType("boolean"), + decimal("decimal"), + intType("int"), + language("language"), + NCName("NCName"), + undefined("undefined"); + + private String label; + + private DataType(final String value) { + setLabel(value); + } + public String getLabel() { + return label; + } + public void setLabel(final String label) { + this.label = label; + } + } + + public static enum MetadaDataType + { + element ("element"), + attribute("attribute"), + data("data"), + except("except"), + nsName("nsName"), + value("value"), + text("text"), + ID("ID"); + private String label; + + private MetadaDataType(final String value) { + setLabel(value); + } + public String getLabel() { + return label; + } + public void setLabel(final String label) { + this.label = label; + } + } + + public static final Map CardinalityMap = new HashMap() { + public static final long serialVersionUID = 1L; + { + put("optional", "0-1"); + put("zeroOrMore", "0-N"); + put("obligatoire", "1"); + put("oneOrMore", "1-N"); + }}; + + public static enum Cardinality + { + optional("0-1"), + zeroOrMore("0-N"), + obligatoire("1"), + oneOrMore("1-N"); + private String label; + + private Cardinality(final String value) { + setLabel(value); + } + public String getLabel() { + return label; + } + public void setLabel(final String label) { + this.label = label; + } + } + + public static final Map GroupOrChoiceMap = new HashMap() { + public static final long serialVersionUID = 1L; + { + put("group","group"); + put("choice","choice"); + }}; + + public static enum GroupOrChoice + { + group("group"), + choice("choice"); + private String label; + + private GroupOrChoice(final String value) { + setLabel(value); + } + public String getLabel() { + return label; + } + public void setLabel(final String label) { + this.label = label; + } + } + + + public static boolean isElement (String type) { + for(MetadaDataType typeElement : MetadaDataType.values()){ + if (typeElement.toString().equals(type)) { + return true; + } + } + return false; + } + + public static boolean isCardinality (String type) { + for(Cardinality typeElement : Cardinality.values()){ + if (typeElement.toString().equals(type)) { + return true; + } + } + return false; + } + + public static boolean hasGroupOrChoice(String type) { + for(GroupOrChoice typeElement : GroupOrChoice.values()){ + if (typeElement.toString().equals(type)) { + return true; + } + } + return false; + } + + public static boolean isDataType (String type) { + for(DataType typeElement : DataType.values()){ + if (typeElement.toString().equals(type)) { + return true; + } + } + return false; + } + + public static boolean isValueOrData (String type) { + + if (null != type && (MetadaDataType.data.toString().equals(type) + || MetadaDataType.nsName.toString().equals(type) + || MetadaDataType.value.toString().equals(type))){ + return true; + } + return false; + } + + public static final Map TypesMap = new HashMap() { + public static final long serialVersionUID = 1L; + { + put("CodeListVersions", DataType.token); + put("Comment", DataType.string); + put("Date", DataType.token); + put("MessageIdentifier", DataType.token); + put("ArchivalAgreement", DataType.token); + put("ReplyCodeListVersion", DataType.token); + put("MessageDigestAlgorithmCodeListVersion", DataType.token); + put("MimeTypeCodeListVersion", DataType.token); + put("EncodingCodeListVersion", DataType.token); + put("FileFormatCodeListVersion", DataType.token); + put("CompressionAlgorithmCodeListVersion", DataType.token); + put("DataObjectVersionCodeListVersion", DataType.token); + put("StorageRuleCodeListVersion", DataType.token); + put("AppraisalRuleCodeListVersion", DataType.token); + put("AccessRuleCodeListVersion", DataType.token); + put("DisseminationRuleCodeListVersion", DataType.token); + put("ReuseRuleCodeListVersion", DataType.token); + put("ClassificationRuleCodeListVersion", DataType.token); + put("AcquisitionInformationCodeListVersion", DataType.token); + put("AuthorizationReasonCodeListVersion", DataType.token); + put("RelationshipCodeListVersion", DataType.token); + put("OtherCodeListAbstract", DataType.token); + put("DataObjectSystemId", DataType.token); + put("DataObjectGroupSystemId", DataType.token); + put("Relationship", DataType.token); + put("DataObjectGroupReferenceId", DataType.token); + put("DataObjectGroupId", DataType.token); + put("DataObjectVersion", DataType.token); + put("Attachment", DataType.base64Binary); + put("Uri", DataType.anyURI); + put("MessageDigest", DataType.base64Binary); + put("Size", DataType.positiveInteger); + put("Compressed", DataType.booleanType); + put("FormatLitteral", DataType.string); + put("MimeType", DataType.token); + put("FormatId", DataType.token); + put("Encoding", DataType.token); + put("Filename", DataType.string); + put("CreatingApplicationName", DataType.string); + put("CreatingApplicationVersion", DataType.string); + put("DateCreatedByApplication", DataType.token); + put("CreatingOs", DataType.string); + put("CreatingOsVersion", DataType.string); + put("LastModified", DataType.token); + put("PhysicalId", DataType.token); + put("Width", DataType.decimal); + put("Height", DataType.decimal); + put("Depth", DataType.decimal); + put("Shape", DataType.string); + put("Diameter", DataType.decimal); + put("Length", DataType.decimal); + put("Thickness", DataType.decimal); + put("Weight", DataType.decimal); + put("NumberOfPage", DataType.intType); + put("EventIdentifier", DataType.token); + put("EventTypeCode", DataType.token); + put("EventType", DataType.token); + put("EventDateTime", DataType.token); + put("EventDetail", DataType.string); + put("Outcome", DataType.token); + put("OutcomeDetail", DataType.token); + put("OutcomeDetailMessage", DataType.token); + put("EventDetailData", DataType.token); + put("DataObjectReferenceId", DataType.token); + put("ArchiveUnitRefId", DataType.token); + put("ArchiveUnitProfile", DataType.token); + put("Rule", DataType.token); + put("StartDate", DataType.token); + put("PreventInheritance", DataType.booleanType); + put("RefNonRuleId", DataType.token); + put("FinalAction", DataType.token); + put("ClassificationAudience", DataType.token); + put("ClassificationLevel", DataType.token); + put("ClassificationOwner", DataType.token); + put("ClassificationReassessingDate", DataType.token); + put("NeedReassessingAuthorization", DataType.booleanType); + put("NeedAuthorization", DataType.booleanType); + put("DescriptionLevel", DataType.token); + put("Title", DataType.string); + put("FilePlanPosition", DataType.token); + put("SystemId", DataType.token); + put("OriginatingSystemId", DataType.token); + put("ArchivalAgencyArchiveUnitIdentifier", DataType.token); + put("OriginatingAgencyArchiveUnitIdentifier", DataType.token); + put("TransferringAgencyArchiveUnitIdentifier", DataType.token); + put("Description", DataType.string); + put("CustodialHistoryItem", DataType.string); + put("Type", DataType.string); + put("DocumentType", DataType.string); + put("language", DataType.language); + put("DescriptionLanguage", DataType.language); + put("Status", DataType.token); + put("Version", DataType.string); + put("Tag", DataType.token); + put("KeywordContent", DataType.string); + put("KeywordReference", DataType.token); + put("KeywordType", DataType.token); + put("Spatial", DataType.string); + put("Temporal", DataType.string); + put("Juridictional", DataType.string); + put("Identifier", DataType.string); + put("FirstName", DataType.string); + put("BirthName", DataType.string); + put("FullName", DataType.string); + put("GivenName", DataType.string); + put("Gender", DataType.string); + put("BirthDate", DataType.string); + put("Geogname", DataType.string); + put("Address", DataType.string); + put("PostalCode", DataType.string); + put("City", DataType.string); + put("Region", DataType.string); + put("Country", DataType.string); + put("DeathDate", DataType.token); + put("Nationality", DataType.string); + put("Corpname", DataType.string); + put("Function", DataType.string); + put("Activity", DataType.string); + put("Position", DataType.string); + put("Role", DataType.string); + put("Mandate", DataType.string); + put("Source", DataType.string); + put("ArchiveUnitRefId", DataType.NCName); + put("DataObjectReferenceId", DataType.token); + put("RepositoryArchiveUnitPID", DataType.token); + put("RepositoryObjectPID", DataType.token); + put("ExternalReference", DataType.token); + put("CreatedDate", DataType.token); + put("TransactedDate", DataType.token); + put("AcquiredDate", DataType.token); + put("SentDate", DataType.token); + put("ReceivedDate", DataType.token); + put("RegisteredDate", DataType.token); + put("EndDate", DataType.token); + put("Masterdata", DataType.token); + put("SigningTime", DataType.token); + put("ValidationTime", DataType.token); + put("SignedObjectId", DataType.token); + put("SignedObjectDigest", DataType.base64Binary); + put("GpsVersionID", DataType.string); + put("GpsAltitude", DataType.string); + put("GpsAltitudeRef", DataType.string); + put("GpsLatitude", DataType.string); + put("GpsLatitudeRef", DataType.string); + put("GpsLongitude", DataType.string); + put("GpsLongitudeRef", DataType.string); + put("GpsDateStamp", DataType.string); + put("ArchivalProfile", DataType.token); + put("ServiceLevel", DataType.token); + put("AcquisitionInformation", DataType.token); + put("LegalStatus", DataType.token); + put("OriginatingAgencyIdentifier", DataType.token); + put("SubmissionAgencyIdentifier", DataType.token); + put("RelatedTransferReference", DataType.token); + put("TransferRequestReplyIdentifier", DataType.token); + put("xml:id", DataType.ID); + put("ID", DataType.ID); + put("id", DataType.ID); + put("algorithm", DataType.token); + put("lang", DataType.language); + put("xml:lang", DataType.language); + put("href", DataType.anyURI); + put("listID", DataType.token); + put("listAgencyID", DataType.token); + put("listAgencyName", DataType.string); + put("listName", DataType.string); + put("listVersionID", DataType.token); + put("Name", DataType.string); + put("languageID", DataType.language); + put("listURI", DataType.anyURI); + put("listSchemeURI", DataType.anyURI); + put("schemeID", DataType.token); + put("schemeName", DataType.string); + put("schemeAgencyID", DataType.token); + put("schemeAgencyName", DataType.string); + put("schemeVersionID", DataType.token); + put("schemeDataURI", DataType.anyURI); + put("schemeURI", DataType.anyURI); + put("target", DataType.NCName); + put("type", DataType.token); + put("filename", DataType.string); + put("anyURI", DataType.anyURI); + put("unCompressedSize", DataType.positiveInteger); + put("unit", DataType.string); + put("when", DataType.token); + }}; + +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/RNGProfileValidator.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/RNGProfileValidator.java new file mode 100644 index 0000000000000000000000000000000000000000..e7f6530343f3352096db8697d415ab2293f3f5c5 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/RNGProfileValidator.java @@ -0,0 +1,97 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.util; + +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import org.xml.sax.SAXException; +import javax.xml.XMLConstants; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.XMLEvent; +import javax.xml.validation.SchemaFactory; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.util.Objects; + +public class RNGProfileValidator { + + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(RNGProfileValidator.class); + + public static final String RNG_FACTORY = "com.thaiopensource.relaxng.jaxp.XMLSyntaxSchemaFactory"; + public static final String RNG_PROPERTY_KEY = "javax.xml.validation.SchemaFactory:" + XMLConstants.RELAXNG_NS_URI; + + public boolean validateRNG(File file, String error) throws Exception { + try { + System.setProperty(RNG_PROPERTY_KEY, RNG_FACTORY); + SchemaFactory.newInstance(XMLConstants.RELAXNG_NS_URI).newSchema(file); + } catch (SAXException e) { + LOGGER.error("Malformed profile rng file", e); + error = "Malformed profile rng file : " + e.getMessage(); + return false; + } + + return checkTag(file, "rng", "grammar", error); + } + + private boolean checkTag(File file, String prefix, String element, String error) + throws FileNotFoundException, XMLStreamException { + + final XMLInputFactory xmlInputFactory = XMLInputFactoryUtils.newInstance(); + final XMLEventReader eventReader = xmlInputFactory.createXMLEventReader(new FileInputStream(file)); + while (eventReader.hasNext()) { + XMLEvent event = eventReader.nextEvent(); + if (event.isStartDocument()) { + continue; + } + + if (event.isStartElement()) { + String elementName = event.asStartElement().getName().getLocalPart(); + String elementPrefix = event.asStartElement().getName().getPrefix(); + + if (Objects.equals(element, elementName) || Objects.equals(prefix, elementPrefix)) { + error += "Profile file xsd have not the xsd:schema tag name."; + return true; + } + } + } + return false; + } +} diff --git a/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/XMLInputFactoryUtils.java b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/XMLInputFactoryUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..510389e909c6061ae4166e5409c05c220f39a9d4 --- /dev/null +++ b/api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/XMLInputFactoryUtils.java @@ -0,0 +1,51 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.common.util; + +import javax.xml.stream.XMLInputFactory; + +public class XMLInputFactoryUtils { + + public static XMLInputFactory newInstance() { + XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); + xmlInputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE); + xmlInputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); + xmlInputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE); + return xmlInputFactory; + } +} diff --git a/api/api-pastis/pastis-standalone/assembly.xml b/api/api-pastis/pastis-standalone/assembly.xml new file mode 100644 index 0000000000000000000000000000000000000000..48f7c425fe7aee41205e96f453a59e0856e9c61b --- /dev/null +++ b/api/api-pastis/pastis-standalone/assembly.xml @@ -0,0 +1,27 @@ + + package + + zip + + false + + + ${project.build.directory}/ + / + + *.exe + win32/** + + + + ${project.basedir}/src/main/resources/standalone/ + / + + PASTIS-APP.* + readme.txt + + + + diff --git a/api/api-pastis/pastis-standalone/build-standalone.sh b/api/api-pastis/pastis-standalone/build-standalone.sh new file mode 100644 index 0000000000000000000000000000000000000000..4de3605cb582e1e769bf9ed4ce6b709e393b2682 --- /dev/null +++ b/api/api-pastis/pastis-standalone/build-standalone.sh @@ -0,0 +1,6 @@ +cd ../../../ui/ +mvn clean install -DskipTests --projects ui-frontend,ui-frontend-common -Pstandalone +cd ../commons/ +mvn clean install -DskipTests +cd ../api/ +mvn clean install -DskipTests -Pstandalone diff --git a/api/api-pastis/pastis-standalone/pom.xml b/api/api-pastis/pastis-standalone/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..f0701f5468203a23590c89ab29e24c65128d8b87 --- /dev/null +++ b/api/api-pastis/pastis-standalone/pom.xml @@ -0,0 +1,326 @@ + + + + api-pastis + fr.gouv.vitamui + 5.0-SNAPSHOT + + 4.0.0 + + pastis-standalone + Pastis Standalone Version + + + 11 + 11 + 11 + / + pastis + false + src/main/java + ui + false + false + false + false + false + + + + + + fr.gouv.vitam + common-public + + + org.projectlombok + lombok + compile + + + fr.gouv.vitamui + pastis + 5.0-SNAPSHOT + + + fr.gouv.vitamui + pastis-client + + + + fr.gouv.vitamui.commons + commons-rest + + + fr.gouv.vitamui.commons + commons-vitam + + + fr.gouv.vitamui + security-client + + + fr.gouv.vitamui + iam-internal-client + + + fr.gouv.vitamui + iam-security + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-configuration-processor + + + org.springframework.cloud + spring-cloud-starter-consul-discovery + + + org.apache.httpcomponents + httpcore + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-test + + + fr.gouv.vitamui + iam-commons + + + fr.gouv.vitamui + iam-external-client + + + fr.gouv.vitamui.commons + commons-test + + + + + org.skyscreamer + jsonassert + ${jsonassert.version} + compile + + + com.sun.xml.bind + jaxb-impl + 2.3.1 + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-devtools + + + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.junit.vintage + junit-vintage-engine + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + build-info + + build-info + + + + + repackage + + + + + true + false + fr.gouv.vitamui.pastis.standalone.ApiPastisStandaloneApplication + + --spring.profiles.active=dev + + + + + + + + + standalone + + + fr.gouv.vitamui + ui-frontend + provided + pom + ${project.version} + + + + + + target/www/ + static/ + + + src/main/resources + + + + + src/test/resources + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + build-info + + build-info + + + + spring-boot-repackage + + repackage + + + + + true + true + fr.gouv.vitamui.pastis.standalone.ApiPastisStandaloneApplication + -Xmx512m + + --spring.profiles.active=dev + + + + + com.github.eirslett + frontend-maven-plugin + + + com.akathist.maven.plugins.launch4j + launch4j-maven-plugin + 1.7.21 + + + build-pastis-standalone-executable-windows + package + + launch4j + + + console + ${project.build.directory}/${project.build.finalName}.${project.packaging} + ${project.build.directory}/${project.build.finalName}.exe + + ./win32/java + true + 64 + + + + + + + + maven-resources-plugin + + + copy-resources-jre + + package + + copy-resources + + + ${basedir}/target/win32/java + + + ${java.home} + + + + + + + + + maven-assembly-plugin + + + assembly + package + single + + + assembly.xml + + + + + + + + + + + diff --git a/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/ApiPastisStandaloneApplication.java b/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/ApiPastisStandaloneApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..111ea7b8abf3e27cd36103ea36d4cd7973fa38f6 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/ApiPastisStandaloneApplication.java @@ -0,0 +1,58 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.standalone; + +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 ApiPastisStandaloneApplication extends SpringBootServletInitializer{ + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(ApiPastisStandaloneApplication.class); + } + + public static void main(String[] args) { + SpringApplication.run(ApiPastisStandaloneApplication.class, args); + } + +} diff --git a/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/config/PastisConfiguration.java b/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/config/PastisConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..3ed44f6dbf23a1dc7b98d244e3bb579bb4132e88 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/config/PastisConfiguration.java @@ -0,0 +1,102 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ +package fr.gouv.vitamui.pastis.standalone.config; + +import fr.gouv.vitamui.pastis.common.service.JsonFromPUA; +import fr.gouv.vitamui.pastis.common.service.PuaFromJSON; +import fr.gouv.vitamui.pastis.common.service.PuaPastisValidator; +import fr.gouv.vitamui.pastis.server.service.PastisService; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.ResourceLoader; +import org.springframework.http.HttpStatus; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.Collections; + +@Configuration +public class PastisConfiguration { + + private ResourceLoader resourceLoader; + + @Value("${cors.allowed-origins}") + private String origins; + + @Bean + public WebMvcConfigurer corsConfigurer() { + return new WebMvcConfigurer () { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins(origins.split(",")) + .allowCredentials(true); + } + }; + } + + @Bean + public ErrorViewResolver customErrorViewResolver() { + final ModelAndView redirectToIndexHtml = new ModelAndView("forward:/index.html", Collections.emptyMap(), HttpStatus.OK); + return (request, status, model) -> status == HttpStatus.NOT_FOUND ? redirectToIndexHtml : null; + } + + @Bean + public JsonFromPUA jsonFromPUA() { + return new JsonFromPUA(); + } + + @Bean + public PuaFromJSON puaFromJSON() { + return new PuaFromJSON(); + } + + @Bean + public PastisService pastisService() { + return new PastisService(this.resourceLoader); + } + + @Bean + public PuaPastisValidator puaPastisValidator() { + return new PuaPastisValidator(); + } + +} diff --git a/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/controller/PastisController.java b/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/controller/PastisController.java new file mode 100644 index 0000000000000000000000000000000000000000..c6715615f1e5351bd77a30ddc9855ecf99362b17 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/java/fr/gouv/vitamui/pastis/standalone/controller/PastisController.java @@ -0,0 +1,181 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.standalone.controller; + +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.dto.profiles.Notice; +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.server.service.PastisService; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.ServerVariable; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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.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.RestController; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.List; + + +@OpenAPIDefinition(tags = { @Tag(name = "pastis") }, + info = @Info(title = "Pastis Rest Api", description = ""), + servers = { @Server(url = "localhost" , + variables = { @ServerVariable(name = "scheme", allowableValues ={"https", "http"}, defaultValue = "http"), + @ServerVariable(name = "port", description = "Api port", defaultValue = "8096")}) }) +@RestController +class PastisController { + + private static final Logger LOGGER = LoggerFactory.getLogger(PastisController.class); + + private static final String APPLICATION_JSON_UTF8 = "application/json; charset=utf-8"; + + private final PastisService profileService; + + @Autowired + public PastisController(final PastisService profileService) { + this.profileService = profileService; + } + + @Operation(summary = "Retrieve RNG representation of the JSON structure", + description = "Retrieve RNG representation of the JSON structure of archive profile", + tags = {"pastis"}) + @RequestMapping(value = RestApi.PASTIS_DOWNLOAD_PA, method = RequestMethod.POST, consumes = APPLICATION_JSON_UTF8, produces = MediaType.APPLICATION_XML_VALUE) + ResponseEntity getArchiveProfile(@RequestBody final ElementProperties json) throws IOException { + String pa = profileService.getArchiveProfile(json); + if ( pa != null) { + return ResponseEntity.ok(pa); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @Operation(summary = "Retrieve JSON representation of archive unit profile", + description = "Retrieve JSON representation of archive unit profile", + tags = {"pastis"}) + @RequestMapping(value = RestApi.PASTIS_DOWNLOAD_PUA, method = RequestMethod.POST, consumes = APPLICATION_JSON_UTF8, produces = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity getArchiveUnitProfile(@RequestBody final ProfileNotice json) throws IOException { + String pua = profileService.getArchiveUnitProfile(json); + if ( pua != null) { + return ResponseEntity.ok(pua); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + + } + + @Operation(summary = "Retrieve JSON representation of the RNG structure", + description = "Retrieve JSON representation of the RNG structure", + tags = {"pastis"}) + @RequestMapping (value = RestApi.PASTIS_CREATE_PROFILE, method = RequestMethod.GET) + ResponseEntity createProfile(@RequestParam(name = "type") String profileType) throws URISyntaxException, IOException { + ProfileResponse profileResponse = profileService.createProfile(profileType); + if ( profileResponse != null) { + return ResponseEntity.ok(profileResponse); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @RequestMapping (value = RestApi.PASTIS_GET_PROFILE_FILE, method = RequestMethod.GET) + ResponseEntity getFile(@RequestParam(name = "name") String filename) { + Resource resource = profileService.getFile(filename); + if (resource != null) { + return ResponseEntity.ok(resource); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @Operation(summary = "Transform profile JSON representation from Notice", + description = "Transform profile JSON representation from Notice", + tags = {"pastis"}) + @RequestMapping (value = RestApi.PASTIS_TRANSFORM_PROFILE, method = RequestMethod.POST) + ResponseEntity loadProfile(@RequestBody final Notice notice) + throws IOException { + ProfileResponse profileResponse = profileService.loadProfile(notice); + if ( profileResponse!= null) { + return ResponseEntity.ok(profileResponse); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @Operation(summary = "Upload profile PA or PUA", + description = "Upload profile PA or PUA", + tags = {"pastis"}) + @RequestMapping (value = RestApi.PASTIS_UPLOAD_PROFILE, method = RequestMethod.POST, + consumes = "multipart/form-data", produces = "application/json") + ResponseEntity loadProfileFromFile(@RequestParam MultipartFile file) { + ProfileResponse profileResponse = profileService.loadProfileFromFile(file); + if (profileResponse != null) { + return ResponseEntity.ok(profileResponse); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @Operation(summary = "Retrieve all profiles PA and PUA", + description = "Retrieve all profiles PA and PUA", + tags = {"pastis"}) + @RequestMapping (value = RestApi.PASTIS_GET_ALL_PROFILES, method = RequestMethod.GET) + ResponseEntity> getFiles() throws IOException { + List notices = profileService.getFiles(); + if (notices != null) { + return ResponseEntity.ok(notices); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + +} diff --git a/api/api-pastis/pastis-standalone/src/main/resources/application-dev.yml b/api/api-pastis/pastis-standalone/src/main/resources/application-dev.yml new file mode 100644 index 0000000000000000000000000000000000000000..427a9b897115817519a3ba38a9b13608452e6822 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/application-dev.yml @@ -0,0 +1,29 @@ +#Spring +spring.servlet.multipart: + max-file-size: 10MB + max-request-size: 11MB + enabled: true + +#Spring docs swagger +springdoc: + api-docs.path: /api-docs + swagger-ui: + path: /open-api.html + model-and-view-allowed: false + + +# Pastis Rest APi +rng.base.file: rng/Profil_seda_pastis_mvp.rng +rng.base.directory: rng/ +json.base.file: rng/ProfileJson.json +pua.definitions.file: pua_validation/ProfileJson.json +json.template.file: rng/AUP_default_PASTIS.json + +#PORT +server.port: 8096 +server-identity: + identityName: vitamui-dev + identityRole: pastis-standalone + identityServerId: 1 +#CORS +cors.allowed-origins: https://dev.vitamui.com:4251,https://localhost diff --git a/api/api-pastis/pastis-standalone/src/main/resources/application.yml b/api/api-pastis/pastis-standalone/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..6e067300a252e1c8975ddc8650daa87175ec9dc2 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/application.yml @@ -0,0 +1,33 @@ +# 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} + api: + name: API Pastis + description: This API is used to manage Vitam's profile + version: v1 + mvc: + favicon: + enabled: false + jackson: + serialization: + write-dates-as-timestamps: false +pua: + definitions: + file: pua_validation/ProfileJson.json + +management: + endpoints: + jmx: + domain: ${server-identity.identityRole} + unique-names: true + web.exposure.include: info,health,prometheus + endpoint: + health: + show-details: always + prometheus: + enabled: true +cors.allowed-origins: https://dev.vitamui.com:4251,https://localhost + diff --git a/api/api-pastis/pastis-standalone/src/main/resources/standalone/PASTIS-APP.url b/api/api-pastis/pastis-standalone/src/main/resources/standalone/PASTIS-APP.url new file mode 100644 index 0000000000000000000000000000000000000000..75ff50467b1c0eae476b0a0c9bafc0c8461ba8aa --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/standalone/PASTIS-APP.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=http://localhost:8096/ diff --git a/api/api-pastis/pastis-standalone/src/main/resources/standalone/angular.json b/api/api-pastis/pastis-standalone/src/main/resources/standalone/angular.json new file mode 100644 index 0000000000000000000000000000000000000000..c932dbdfa47500a6f128b5b1697430b487b8f683 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/standalone/angular.json @@ -0,0 +1,181 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "vitamui-library": { + "projectType": "library", + "schematics": { + "@schematics/angular:component": { + "prefix": "vitamui", + "styleext": "scss" + }, + "@schematics/angular:directive": { + "prefix": "vitamui" + } + }, + "root": "projects/vitamui-library", + "sourceRoot": "projects/vitamui-library/src", + "prefix": "vitamui", + "architect": { + "build": { + "builder": "@angular-devkit/build-ng-packagr:build", + "options": { + "tsConfig": "projects/vitamui-library/tsconfig.lib.json", + "project": "projects/vitamui-library/ng-package.json" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "projects/vitamui-library/src/test.ts", + "tsConfig": "projects/vitamui-library/tsconfig.spec.json", + "karmaConfig": "projects/vitamui-library/karma.conf.js" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "projects/vitamui-library/tsconfig.lib.json", + "projects/vitamui-library/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "pastis": { + "root": "projects/pastis/", + "sourceRoot": "projects/pastis/src", + "projectType": "application", + "architect": { + "build": { + "builder": "@angular-builders/custom-webpack:browser", + "options": { + "customWebpackConfig": { + "path": "./extra-webpack.config.js" + }, + "outputPath": "../ui-pastis/src/main/resources/public", + "index": "projects/pastis/src/index.html", + "main": "projects/pastis/src/main.ts", + "polyfills": "projects/pastis/src/polyfills.ts", + "tsConfig": "projects/pastis/tsconfig.app.json", + "rebaseRootRelativeCssUrls": true, + "assets": [ + "projects/pastis/src/assets", + "projects/pastis/src/favicon.ico", + { + "glob": "**/*", + "input": "node_modules/ui-frontend-common/assets", + "output": "/assets" + } + ], + "styles": [ + "projects/pastis/src/sass/styles.scss", + "projects/pastis/src/assets/css/_colors.scss" + ], + "stylePreprocessorOptions": { + "includePaths": [ + "projects/commons/src/sass" + ] + }, + "scripts": [] + }, + "configurations": { + "standalone": { + "fileReplacements": [ + { + "replace": "projects/pastis/src/environments/environment.ts", + "with": "projects/pastis/src/environments/environment.standalone.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "17mb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-builders/custom-webpack:dev-server", + "options": { + "browserTarget": "pastis:build", + "host": "dev.vitamui.com", + "port": 4251 + }, + "configurations": { + "production": { + "browserTarget": "pastis:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "pastis:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "projects/pastis/src/test.ts", + "polyfills": "projects/pastis/src/polyfills.ts", + "tsConfig": "projects/pastis/tsconfig.spec.json", + "karmaConfig": "projects/pastis/karma.conf.js", + "assets": [ + "projects/pastis/src/favicon.ico", + "projects/pastis/src/assets" + ], + "styles": [ + "projects/pastis/src/styles.scss" + ], + "scripts": [] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "projects/pastis/tsconfig.app.json", + "projects/pastis/tsconfig.spec.json", + "projects/pastis/e2e/tsconfig.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + }, + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "projects/pastis/e2e/protractor.conf.js", + "devServerTarget": "pastis:serve" + }, + "configurations": { + "production": { + "devServerTarget": "pastis:serve:production" + } + } + } + } + } + }, + "defaultProject": "pastis", + "cli": { + "analytics": false + } +} diff --git a/api/api-pastis/pastis-standalone/src/main/resources/standalone/app.configuration.interface.ts b/api/api-pastis/pastis-standalone/src/main/resources/standalone/app.configuration.interface.ts new file mode 100644 index 0000000000000000000000000000000000000000..8206b197ab453de3ebcafb6166802f05fd41893f --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/standalone/app.configuration.interface.ts @@ -0,0 +1,41 @@ +/* + * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020) + * and the signatories of the "VITAM - Accord du Contributeur" agreement. + * + * contact@programmevitam.fr + * + * 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. + * + * 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". + * + * 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-C license and that you accept its terms. + */ +export interface AppConfiguration { + + THEME_COLORS: any; + +} diff --git a/api/api-pastis/pastis-standalone/src/main/resources/standalone/package.json b/api/api-pastis/pastis-standalone/src/main/resources/standalone/package.json new file mode 100644 index 0000000000000000000000000000000000000000..cf2a3eec37976323fd1ddd5b8e47760ad85021b8 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/standalone/package.json @@ -0,0 +1,173 @@ +{ + "name": "vitamui-ui", + "version": "5.4.0-SNAPSHOT", + "license": "MIT", + "pki": { + "path": "../../dev-deployment/environments/certs/server/hosts/localhost", + "asset": "reverse" + }, + "scripts": { + "ng": "ng", + "ng-high-memory": "node --max_old_space_size=4000 ./node_modules/@angular/cli/bin/ng", + "start": "ng serve --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:en": "ng serve --proxy-config proxy.conf.json --configuration=en --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:demo": "ng serve demo --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:portal": "ng serve portal --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:starter-kit": "ng serve --proxy-config proxy.conf.json starter-kit --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:starter-kit-mocked-server": "ng serve --port 5000 --proxy-config proxy-mock.conf.json starter-kit", + "json-server": "json-server --watch projects/starter-kit/mock-api/_db.js --config projects/starter-kit/mock-api/config.json --routes projects/starter-kit/mock-api/routes.json ", + "mock-starter-kit": "concurrently 'npm run json-server' 'npm run start:starter-kit-mocked-server'", + "start:identity": "ng serve identity --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:pastis": "ng serve pastis --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:referential": "ng serve referential --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:ingest": "ng serve ingest --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "start:archive-search": "ng serve archive-search --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt", + "build": "ng build --configuration=standalone --i18n-locale fr --build-optimizer=false --optimization=false", + "postinstall": "ngcc", + "build:prod": "export NODE_OPTIONS=--max_old_space_size=4096; ng build --prod --output-path ../../../target/www", + "build:dev": "ng build --prod --i18n-locale fr --build-optimizer=false --optimization=false", + "build:fr": "ng build --prod --i18n-locale fr --output-path ../../../target/www/fr", + "build:en": "ng build --prod --i18n-file src/locale/messages.en.xlf --i18n-format xlf --i18n-locale en --output-path ../../../target/www/en", + "build:all": "npm run build:fr && npm run build:en", + "build:demo": "ng build demo --prod --i18n-locale fr", + "build:portal": "export NODE_OPTIONS=--max_old_space_size=4096; ng build portal --prod", + "build:identity": "export NODE_OPTIONS=--max_old_space_size=4096; ng build identity --prod --output-path ../../../target/www/fr", + "build:ingest": "export NODE_OPTIONS=--max_old_space_size=4096; ng build ingest --prod --i18n-locale fr", + "build:archive-search": "export NODE_OPTIONS=--max_old_space_size=4096; ng build archive-search --prod --i18n-locale fr", + "build:referential": "export NODE_OPTIONS=--max_old_space_size=4096; ng build referential --prod --i18n-locale fr", + "build:pastis": "export NODE_OPTIONS=--max_old_space_size=4096; ng build pastis --prod --i18n-locale fr", + "analyze-portal": "ng build portal --stats-json --prod ; webpack-bundle-analyzer dist/portal/stats-es2015.json", + "analyze-identity": "ng build identity --stats-json --prod --i18n-locale fr ; webpack-bundle-analyzer dist/identity/stats-es2015.json", + "analyze-referential": "ng build referential --stats-json --prod --i18n-locale fr ; webpack-bundle-analyzer dist/referential/stats-es2015.json", + "analyze-ingest": "ng build ingest --stats-json --prod --i18n-locale fr ; webpack-bundle-analyzer dist/ingest/stats-es2015.json", + "analyze-archive-search": "ng build archive-search --stats-json --prod --i18n-locale fr ; webpack-bundle-analyzer dist/archive-search/stats-es2015.json", + "test": "ng test --watch=false", + "test:demo": "ng test demo --watch=false", + "test:portal": "ng test portal --watch=false", + "test:identity": "ng test identity --watch=false", + "test:ingest": "ng test ingest --watch=false", + "test:referential": "ng test referential --watch=false", + "test:archive-search": "ng test archive-search --watch=false", + "test:vitamui-library": "ng test vitamui-library --watch=false", + "test:conf-ci": "ng test --watch=false --karma-config=karma.conf.ci.js", + "test:sonar": "ng test --code-coverage --watch=false", + "lint": "ng lint --format=stylish", + "lint:demo": "ng lint demo --format=stylish", + "lint:identity": "ng lint identity --format=stylish", + "lint:ingest": "ng lint ingest --format=stylish", + "lint:portal": "ng lint portal --format=stylish", + "lint:archive-search": "ng lint archive-search --format=stylish", + "lint:referential": "ng lint referential --format=stylish", + "lint:vitamui-library": "ng lint vitamui-library --format=stylish", + "e2e": "ng e2e", + "i18n-extract": "ng xi18n --outputPath=locale --i18n-locale=fr", + "i18n-merge": "xliffmerge --profile xliffmerge.json fr en", + "i18n:identity": "ng xi18n identity --outputPath=src/locale --i18n-locale=fr && xliffmerge --profile projects/identity/xliffmerge.json fr en", + "i18n:ingest": "ng xi18n ingest --outputPath=src/locale --i18n-locale=fr && xliffmerge --profile projects/ingest/xliffmerge.json fr en", + "i18n:archive-search": "ng xi18n archive-search --outputPath=src/locale --i18n-locale=fr && xliffmerge --profile projects/archive-search/xliffmerge.json fr en", + "i18n:referential": "ng xi18n referential --outputPath=src/locale --i18n-locale=fr && xliffmerge --profile projects/referential/xliffmerge.json fr en", + "check:demo": "npm run lint:demo && npm run build:demo", + "check:portal": "npm run lint:portal && npm run test:portal && npm run build:portal", + "check:identity": "npm run lint:identity && npm run test:identity && npm run build:identity", + "extract-translations": "ngx-translate-extract --input ./projects/portal/src --output ./projects/portal/src/assets/i18n/*.json --sort --format namespaced-json --key-as-default-value", + "check:referential": "npm run lint:referential && npm run test:referential && npm run build:referential", + "check:archive-search": "npm run lint:archive-search && npm run test:archive-search && npm run build:archive-search", + "copy-scss:vitamui-library": "cp-cli ./projects/vitamui-library/src/sass ./dist/sass", + "build:vitamui-library": "ng build vitamui-library", + "watch:vitamui-library": "ng build vitamui-library --watch" + }, + "private": true, + "dependencies": { + "@angular/animations": "10.1.3", + "@angular/cdk": "^10.1.3", + "@angular/common": "10.1.3", + "@angular/compiler": "10.1.3", + "@angular/core": "10.1.3", + "@angular/forms": "10.1.3", + "@angular/localize": "^10.1.6", + "@angular/material": "^10.1.3", + "@angular/platform-browser": "10.1.3", + "@angular/platform-browser-dynamic": "10.1.3", + "@angular/pwa": "^0.803.29", + "@angular/router": "10.1.3", + "@angular/service-worker": "10.1.3", + "@babel/compat-data": "^7.8.0", + "@ngx-translate/core": "^12.1.2", + "@ngx-translate/http-loader": "^6.0.0", + "@types/d3": "^3.5.43", + "@types/uuid": "^7.0.0", + "angular-svg-icon": "^11.2.0", + "autoprefixer": "^9.7.5", + "bootstrap": "^4.5.0", + "bufferutil": "^4.0.1", + "classlist.js": "^1.1.20150312", + "core-js": "^2.6.11", + "d3": "^3.5.17", + "d3-svg-legend": "^1.13.0", + "flag-icon-css": "^3.5.0", + "generate-schema": "^2.6.0", + "hammerjs": "^2.0.8", + "jquery": "^3.5.1", + "lodash": "^4.17.15", + "material-design-icons": "^3.0.1", + "ng2-date-picker": "^8.0.0", + "ng2-file-upload": "^1.4.0", + "ng2-nvd3": "^2.0.0", + "ngx-color-picker": "^9.0.0", + "ngx-filesize": "^2.0.2", + "ngx-quicklink": "^0.2.1", + "ngx-toastr": "^11.3.3", + "ngx-translate-multi-http-loader": "^3.0.0", + "ngx-ui-loader": "^10.0.0", + "popper.js": "^1.16.1", + "remove": "^0.1.5", + "rxjs": "^6.5.5", + "serialize-javascript": "^5.0.1", + "tslib": "^2.0.3", + "ui-frontend-common": "file:../ui-frontend-common/ui-frontend-common-2.1.30.tgz", + "underscore": "^1.13.1", + "utf-8-validate": "^5.0.2", + "uuid": "^7.0.2", + "web-animations-js": "^2.3.2", + "zone.js": "~0.10.3" + }, + "devDependencies": { + "@angular-builders/custom-webpack": "^8.4.1", + "@angular-devkit/build-angular": "^0.1001.3", + "@angular-devkit/build-ng-packagr": "^0.1001.3", + "@angular/cli": "^10.1.3", + "@angular/compiler-cli": "10.1.3", + "@angular/language-service": "10.1.3", + "@angular/localize": "^10.2.3", + "@biesbjerg/ngx-translate-extract": "^7.0.2", + "@types/jasmine": "~3.3.0", + "@types/jasminewd2": "^2.0.8", + "@types/lodash": "^4.14.156", + "@types/node": "~8.9.1", + "@types/underscore": "^1.11.2", + "codelyzer": "^5.2.2", + "concurrently": "^5.3.0", + "cp-cli": "^2.0.0", + "jasmine-core": "^3.7.0", + "jasmine-marbles": "^0.4.1", + "jasmine-spec-reporter": "~4.2.1", + "json-server": "^0.16.3", + "karma": "^5.0.9", + "karma-chrome-launcher": "^2.2.0", + "karma-coverage-istanbul-reporter": "~2.1.1", + "karma-jasmine": "^2.0.1", + "karma-jasmine-html-reporter": "^1.5.4", + "moment-locales-webpack-plugin": "^1.2.0", + "ng-packagr": "^10.1.2", + "ngx-i18nsupport": "^0.17.1", + "ngx-markdown": "8.2.2", + "node-sass": "^4.14.1", + "protractor": "^7.0.0", + "puppeteer": "^1.2.0", + "ts-node": "~7.0.1", + "tsickle": "^0.39.1", + "tslint": "~5.11.0", + "typescript": "~4.0.5", + "webpack-bundle-analyzer": "^3.8.0" + } +} diff --git a/api/api-pastis/pastis-standalone/src/main/resources/standalone/readme.txt b/api/api-pastis/pastis-standalone/src/main/resources/standalone/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..1106b25f06a3c01178b675f8a6605d68c87b14af --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/standalone/readme.txt @@ -0,0 +1,4 @@ +PASTIS - Profil d’Archivage Simple pour le Traitement de l’Information en Seda + +1- Launch pastis.exe +2- Open http://localhost:8096 in your navigator or open "PASTIS APP" diff --git a/api/api-pastis/pastis-standalone/src/main/resources/standalone/startup.service.ts b/api/api-pastis/pastis-standalone/src/main/resources/standalone/startup.service.ts new file mode 100644 index 0000000000000000000000000000000000000000..34e8bdd01daf344abf6f02dec92a0f1597d467c7 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/standalone/startup.service.ts @@ -0,0 +1,221 @@ +/* + * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020) + * and the signatories of the "VITAM - Accord du Contributeur" agreement. + * + * contact@programmevitam.fr + * + * 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. + * + * 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". + * + * 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-C license and that you accept its terms. + */ +import { Inject, Injectable } from '@angular/core'; +import { Observable, Subject } from 'rxjs'; +import { tap } from 'rxjs/operators'; +import { ApplicationService } from './application.service'; + +import { ApplicationApiService } from './api/application-api.service'; +import { SecurityApiService } from './api/security-api.service'; +import { ApplicationId } from './application-id.enum'; +import { AuthService } from './auth.service'; +import { WINDOW_LOCATION } from './injection-tokens'; +import { Logger } from './logger/logger'; +import { AppConfiguration, AttachmentType, AuthUser, Color } from './models'; +import {ThemeService} from './theme.service'; + +const WARNING_DURATION = 2000; +const CUSTOMER_TECHNICAL_REFERENT_KEY = 'technical-referent-email'; +const CUSTOMER_WEBSITE_URL_KEY = 'website-url'; + +@Injectable({ + providedIn: 'root' +}) +export class StartupService { + + private configurationData: AppConfiguration; + + userRefresh = new Subject(); + + CURRENT_APP_ID: ApplicationId = ApplicationId.PORTAL_APP; + + private CURRENT_TENANT_IDENTIFIER: string; + + + constructor( + private logger: Logger, + private authService: AuthService, + private securityApi: SecurityApiService, + private themeService: ThemeService, + @Inject(WINDOW_LOCATION) private location: any + ) { } + + load(): any { + this.configurationData = null; + + let appConf: AppConfiguration = { + THEME_COLORS: { + "vitamui-background" : "#F5F7FC", + "vitamui-header-footer" : "#ffffff", + "vitamui-primary" : "#702382", + "vitamui-secondary" : "#2563A9", + "vitamui-tertiary" : "#C22A40" + } + }; + this.configurationData = appConf; + this.themeService.init(this.configurationData, this.configurationData.THEME_COLORS); + return appConf; + } + + setTenantIdentifier(tenantIdentifier?: string) { + this.CURRENT_TENANT_IDENTIFIER = tenantIdentifier; + } + + getTenantIdentifier() { + let tenantIdentifier = this.CURRENT_TENANT_IDENTIFIER; + if (!tenantIdentifier && this.authService.user) { + tenantIdentifier = this.authService.user.proofTenantIdentifier; + } + + return tenantIdentifier; + } + + /** + * No catchError should be set here, the security api must be called and verified before anything else. + */ + refreshUser(): Observable { + return this.securityApi.getAuthenticated().pipe( + tap((data) => { + this.authService.user = data; + this.userRefresh.next(data); + }) + ); + } + + configurationLoaded(): boolean { + return null; + } + + printConfiguration(): void { + if (this.configurationLoaded()) { + this.logger.log(this, 'startup data exists.', this.configurationData); + } else { + this.logger.log(this, 'startup data does not exists'); + } + } + + getLogo(): string { + return null; + } + + getAppLogoURL(): string { + let trustedAppLogoUrl = null; + const base64Logo = this.getLogo(); + + if (base64Logo) { + trustedAppLogoUrl = base64Logo; + } + + return trustedAppLogoUrl; + } + + getCustomerLogoURL(): string { + let trustedInlineLogoUrl = null; + + if (this.authService.user) { + const currentUser = this.authService.user; + if (currentUser.basicCustomer) { + trustedInlineLogoUrl = currentUser.basicCustomer.graphicIdentity.portalDataBase64; + } + } + + return trustedInlineLogoUrl; + } + + getPortalUrl(): string { + return null; + } + + getLoginUrl(): string { + return null; + } + + getLogoutUrl(): string { + + return null; + } + + getCasUrl(): string { + + return null; + } + + getSearchUrl(): string { + return null; + } + + getConfigStringValue(key: string): string { + + return null; + } + + getConfigNumberValue(key: string): number { + return +this.getConfigStringValue(key); + } + + /** + * Navigate to given url or to the portal otherwise. + * @param url URL to be redirected to. + */ + redirect(url?: string) { + setTimeout(() => this.location.href = url ? url : this.getPortalUrl(), WARNING_DURATION); + } + + getPlatformName(): string { + + return null; + } + + public getCustomer(): string { + return null; + } + + public getCustomerTechnicalReferentEmail(): string { + const customer = this.getCustomer(); + if (customer) { + return customer[CUSTOMER_TECHNICAL_REFERENT_KEY]; + } + } + + public getCustomerWebsiteUrl(): string { + const customer = this.getCustomer(); + if (customer) { + return customer[CUSTOMER_WEBSITE_URL_KEY]; + } + } + +} diff --git a/api/api-pastis/pastis-standalone/src/main/resources/standalone/theme.service.ts b/api/api-pastis/pastis-standalone/src/main/resources/standalone/theme.service.ts new file mode 100644 index 0000000000000000000000000000000000000000..a20638ae4705072d1794c72a8595d7f0b06e9619 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/main/resources/standalone/theme.service.ts @@ -0,0 +1,192 @@ +import { Injectable } from '@angular/core'; +import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; +import { AppConfiguration } from '.'; +import { AuthUser, ThemeDataType } from './models'; +import { Color } from './models/customer/theme/color.interface'; +import { convertLighten, getColorFromMaps, hexToRgb, hexToRgbString, ThemeColorType } from './utils'; + +export interface Theme { + colors: {[colorId: string]: string}; +} + +@Injectable({ + providedIn: 'root' +}) +export class ThemeService { + + public get defaultTheme(): Theme { + return this._defaultTheme; + } + + public set defaultTheme(theme: Theme) { this._defaultTheme = theme; } + + constructor( + private domSanitizer: DomSanitizer, + ) { } + + private baseColors: {[colorId in ThemeColorType]?: string} = { + [ThemeColorType.VITAMUI_PRIMARY]: 'Couleur principale', + [ThemeColorType.VITAMUI_SECONDARY]: 'Couleur secondaire', + [ThemeColorType.VITAMUI_TERTIARY]: 'Couleur tertiaire', + [ThemeColorType.VITAMUI_HEADER_FOOTER]: 'Couleur header/footer', + [ThemeColorType.VITAMUI_BACKGROUND]: 'Couleur background' + }; + + + // tslint:disable-next-line: variable-name + private _defaultTheme: Theme = { + colors: {} + }; + + // Default theme + defaultMap: {[colordId in ThemeColorType]: string} = { + [ThemeColorType.VITAMUI_PRIMARY]: '#604379', + [ThemeColorType.VITAMUI_GREY]: '#9E9E9E', + [ThemeColorType.VITAMUI_SECONDARY]: '#65B2E4', + [ThemeColorType.VITAMUI_TERTIARY]: '#E7304D', + [ThemeColorType.VITAMUI_HEADER_FOOTER]: '#604379', + [ThemeColorType.VITAMUI_BACKGROUND]: '#F5F7FC', + /* DEPRECATED colors : Use color chart with declinations var(--vitamui-primary-XXX), + var(--vitamui-secondary-XXX) and var(--vitamui-grey-XXX) */ + [ThemeColorType.VITAMUI_PRIMARY_LIGHT]: '', + [ThemeColorType.VITAMUI_PRIMARY_LIGHT_20]: '', + [ThemeColorType.VITAMUI_PRIMARY_DARK]: '', + [ThemeColorType.VITAMUI_SECONDARY_LIGHT]: '', + [ThemeColorType.VITAMUI_SECONDARY_LIGHT_8]: '', + [ThemeColorType.VITAMUI_SECONDARY_DARK_5]: '', + }; + + // Theme for current app configuration + applicationColorMap: {[colorId: string]: string}; + + // tslint:disable-next-line: variable-name + private _backgroundChoice: Color[] = [ + {class: 'Foncé', value: '#0F0D2D'}, + {class: 'Blanc', value: '#FFFFFF'}, + {class: 'Clair', value: '#F5F5F5'}, + {class: 'Bleu clair', value: '#F5F7FC'}, + ]; + + public get backgroundChoice(): Color[] { return this._backgroundChoice; } + + public getBaseColors(): {[colorId in ThemeColorType]?: string} { + return this.baseColors; + } + + public getVariationColorsNames(baseName: string): string[] { + return Object.keys(this.defaultMap).filter((colorName) => colorName.startsWith(baseName)); + } + + public init(conf: AppConfiguration, customerColorMap: {[colorId: string]: string}): void { + this.applicationColorMap = conf.THEME_COLORS; + + this.overrideTheme(customerColorMap); + if (conf) { + this.defaultTheme = { + colors: conf.THEME_COLORS, + }; + + // init default background + const defaultBackground = this.backgroundChoice + .find((color: Color) => color.value === conf.THEME_COLORS[ThemeColorType.VITAMUI_BACKGROUND]); + if (defaultBackground) { + defaultBackground.isDefault = true; + } + } + } + + public overloadLocalTheme(colors: {[colorId: string]: string}, selectorToOver: string): void { + const selector: HTMLElement = document.querySelector(selectorToOver); + for (const key in colors) { + if (colors.hasOwnProperty(key) && selector != null) { + selector.style.setProperty('--' + key, colors[key]); + } + } + } + + public getData(authUser: AuthUser, type: string): string | SafeResourceUrl { + return null; + } + + private calculateFontColor(color: string): string { + const rgbColor = hexToRgb(color); + if ((rgbColor.r * 0.299 + rgbColor.g * 0.587 + rgbColor.b * 0.114) > 186) { + return '#000000'; + } else { + return '#ffffff'; + } + } + + private add10Declinations(key: string, colors: {}, customerColors: {[colorId: string]: string}): void { + // tslint:disable-next-line: variable-name + const map = {...this.defaultMap, ...this.applicationColorMap, ...customerColors}; + const rgbValue = hexToRgb(map[key]); + // consider hs-L from color key as 500 + + if (key === ThemeColorType.VITAMUI_GREY) { + colors[key + '-900'] = '#212121'; + colors[key + '-800'] = '#424242'; + colors[key + '-700'] = '#616161'; + colors[key + '-600'] = '#757575'; + colors[key + '-400'] = '#BDBDBD'; + colors[key + '-300'] = '#E0E0E0'; + colors[key + '-200'] = '#EEEEEE'; + colors[key + '-100'] = '#F5F5F5'; + colors[key + '-50'] = '#FAFAFA'; + } else { + colors[key + '-900'] = convertLighten(rgbValue, -32); + colors[key + '-800'] = convertLighten(rgbValue, -24); + colors[key + '-700'] = convertLighten(rgbValue, -16); + colors[key + '-600'] = convertLighten(rgbValue, -8); + // The color declination 500 is the base version (we use var(--vitamui-primary) instead of var(--vitamui-primary-500)) + colors[key + '-400'] = convertLighten(rgbValue, 8); + colors[key + '-300'] = convertLighten(rgbValue, 16); + colors[key + '-200'] = convertLighten(rgbValue, 24); + colors[key + '-100'] = convertLighten(rgbValue, 32); + colors[key + '-50'] = convertLighten(rgbValue, 40); + } + + colors[key + '-900-font'] = this.calculateFontColor(colors[key + '-900']); + colors[key + '-800-font'] = this.calculateFontColor(colors[key + '-800']); + colors[key + '-700-font'] = this.calculateFontColor(colors[key + '-700']); + colors[key + '-600-font'] = this.calculateFontColor(colors[key + '-600']); + colors[key + '-font'] = this.calculateFontColor(map[key]); // primary/secondary/tertiary + colors[key + '-400-font'] = this.calculateFontColor(colors[key + '-400']); + colors[key + '-300-font'] = this.calculateFontColor(colors[key + '-300']); + colors[key + '-200-font'] = this.calculateFontColor(colors[key + '-200']); + colors[key + '-100-font'] = this.calculateFontColor(colors[key + '-100']); + colors[key + '-50-font'] = this.calculateFontColor(colors[key + '-50']); + } + + /** + * Gives complete color theme from current app config and any given customization. + * Setting base colors (primary, secondary) will return updated variations (primary-light etc..) + * @param customerColors Entries to override + */ + public getThemeColors(customerColors: {[colorId: string]: string} = null): {[colorId: string]: string} { + const colors = {}; + for (const key in this.defaultMap) { + if (this.defaultMap.hasOwnProperty(key)) { + if (([ThemeColorType.VITAMUI_PRIMARY, ThemeColorType.VITAMUI_SECONDARY, ThemeColorType.VITAMUI_GREY] as string[]).includes(key)) { + this.add10Declinations(key, colors, customerColors); + } else if (key === ThemeColorType.VITAMUI_HEADER_FOOTER) { + const map = {...this.defaultMap, ...this.applicationColorMap, ...customerColors}; + colors[key + '-font'] = this.calculateFontColor(map[key]); + } + colors[key] = getColorFromMaps(key, this.defaultMap, this.applicationColorMap, customerColors); + } + } + return colors; + } + + public overrideTheme(customerThemeMap, selector= 'body'): void { + const element: HTMLElement = document.querySelector(selector); + const themeColors = this.getThemeColors(customerThemeMap); + for (const key in themeColors) { + if (themeColors.hasOwnProperty(key)) { + element.style.setProperty('--' + key, themeColors[key]); + element.style.setProperty('--' + key + '-rgb', hexToRgbString(themeColors[key])); + } + } + } +} diff --git a/api/api-pastis/pastis-standalone/src/test/java/fr/gouv/vitamui/pastis/standalone/ProfileControllerTest.java b/api/api-pastis/pastis-standalone/src/test/java/fr/gouv/vitamui/pastis/standalone/ProfileControllerTest.java new file mode 100644 index 0000000000000000000000000000000000000000..7441dda2ce5b53ec58025bfbacd5af9c298c49ff --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/test/java/fr/gouv/vitamui/pastis/standalone/ProfileControllerTest.java @@ -0,0 +1,97 @@ +/* +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 +profiles based on the french SEDA standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.standalone; + +import com.fasterxml.jackson.databind.ObjectMapper; +import fr.gouv.vitamui.pastis.common.dto.profiles.Notice; +import fr.gouv.vitamui.pastis.common.rest.RestApi; +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.RequestBuilder; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RunWith(SpringRunner.class) +@AutoConfigureMockMvc +@SpringBootTest +public class ProfileControllerTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(ProfileControllerTest.class); + + @Autowired + private MockMvc mockMvc; + + private MockHttpServletResponse mockHttpServletResponse; + + @Test + public void getProfiles() throws Exception { + Map headers = new HashMap<>(); + headers.put("X-Tenant-Id","1"); + RequestBuilder requestBuilder = MockMvcRequestBuilders.get(RestApi.PASTIS_GET_ALL_PROFILES).header("X-Tenant-Id","1"); + mockHttpServletResponse = mockMvc.perform(requestBuilder).andReturn().getResponse(); + String resBody = mockHttpServletResponse.getContentAsString(); + LOGGER.info("response = {}", resBody); + Assertions.assertEquals(200, mockHttpServletResponse.getStatus()); + } + + @Test + public void getFile() throws Exception { + RequestBuilder requestBuilder = MockMvcRequestBuilders.get(RestApi.PASTIS_GET_PROFILE_FILE).param("name", "PA_UPPA_versio").header("X-Tenant-Id","1"); + mockHttpServletResponse = mockMvc.perform(requestBuilder).andReturn().getResponse(); + String resBody = mockHttpServletResponse.getContentAsString(); + LOGGER.info("response = {}", resBody); + Assertions.assertEquals(200, mockHttpServletResponse.getStatus()); + } + +} diff --git a/api/api-pastis/pastis-standalone/src/test/resources/application.properties b/api/api-pastis/pastis-standalone/src/test/resources/application.properties new file mode 100644 index 0000000000000000000000000000000000000000..0bfabaa03bc716b0c5d52ad60e2453d4b85efaa5 --- /dev/null +++ b/api/api-pastis/pastis-standalone/src/test/resources/application.properties @@ -0,0 +1,16 @@ +#Pastis rest api +rng.base.file=rng/Profil_seda_pastis_mvp.rng +rng.base.directory=rng/ +json.base.file=rng/ProfileJson.json +json.template.file=rng/AUP_default_PASTIS.json +pua.definitions.file=pua_validation/ProfileJson.json +server-identity.identityName=vitamui-dev +server-identity.identityRole=pastis-standalone +server-identity.identityServerId=1 +# Jaeger +opentracing.jaeger.enabled=true +opentracing.jaeger.logSpans=true +opentracing.jaeger.expandExceptionLogs=true +opentracing.jaeger.udp-sender.host=localhost +opentracing.jaeger.udp-sender.port=6831 + diff --git a/api/api-pastis/pastis/generated_test.xml b/api/api-pastis/pastis/generated_test.xml new file mode 100644 index 0000000000000000000000000000000000000000..d5b8587e93ea22e7a0350edac16427759e1d8409 --- /dev/null +++ b/api/api-pastis/pastis/generated_test.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BinaryMaster par défaut + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/api-pastis/pastis/pom.xml b/api/api-pastis/pastis/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..911059f4f99fd637802446006bc1073b9b89d11c --- /dev/null +++ b/api/api-pastis/pastis/pom.xml @@ -0,0 +1,435 @@ + + + + api-pastis + fr.gouv.vitamui + 5.0-SNAPSHOT + + 4.0.0 + + pastis + jar + VITAMUI Pastis API Server + + + false + api-external + false + + + + + + + fr.gouv.vitamui + pastis-commons + 5.0-SNAPSHOT + + + fr.gouv.vitamui + pastis-client + 5.0-SNAPSHOT + + + fr.gouv.vitamui.commons + commons-api + + + fr.gouv.vitamui.commons + commons-rest + + + fr.gouv.vitamui.commons + commons-vitam + + + fr.gouv.vitamui + security-client + + + fr.gouv.vitamui + iam-internal-client + + + fr.gouv.vitamui + iam-security + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-configuration-processor + + + org.springframework.cloud + spring-cloud-starter-consul-discovery + + + org.apache.httpcomponents + httpcore + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-tomcat + + + org.springframework.boot + spring-boot-devtools + + + + + io.micrometer + micrometer-registry-prometheus + + + + + org.projectlombok + lombok + provided + + + org.apache.commons + commons-lang3 + + + javax.ws.rs + javax.ws.rs-api + + + xml-apis + xml-apis + + + commons-fileupload + commons-fileupload + + + org.synchronoss.cloud + nio-multipart-parser + + + org.apache.commons + commons-text + + + org.apache.commons + commons-collections4 + + + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + + io.opentracing.contrib + opentracing-spring-jaeger-web-starter + + + + + + org.springframework.boot + spring-boot-starter-test + test + + + fr.gouv.vitamui + iam-external-client + test + + + fr.gouv.vitamui.commons + commons-test + test-jar + test + + + org.springframework.security + spring-security-test + test + + + fr.gouv.vitamui + iam-commons + test + test-jar + + + org.junit.vintage + junit-vintage-engine + test + + + + + javax.xml.bind + jaxb-api + 2.3.1 + + + + com.sun.xml.bind + jaxb-impl + 2.3.1 + + + + com.sun.istack + istack-commons-runtime + 4.0.0-M2 + + + + + + org.json + json + 20180813 + + + + javax.xml.parsers + jaxp-api + 1.4.5 + + + + com.fasterxml + jackson-xml-databind + 0.6.2 + + + + com.thaiopensource + jing + 20091111 + + + xml-apis + xml-apis + + + net.sf.saxon + saxon + + + xerces + xercesImpl + + + + + + com.thaiopensource + trang + 20091111 + + + xml-apis + xml-apis + + + net.sf.saxon + saxon + + + xerces + xercesImpl + + + + + + org.opengis.cite.xerces + xercesImpl-xsd11 + 2.12-beta-r1667115 + + + + xml-resolver + xml-resolver + 1.2 + + + org.skyscreamer + jsonassert + compile + + + com.google.code.gson + gson + + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + build-info + + build-info + + + + + repackage + + + + + true + false + fr.gouv.vitamui.pastis.server.ApiPastisServerApplication + + --spring.profiles.active=dev + + + + + + + + + + standalone + + + + + org.springframework.boot + spring-boot-maven-plugin + + + fr.gouv.vitamui + pastis-client + 5.0-SNAPSHOT + + + * + * + + + + + fr.gouv.vitamui.commons + commons-api + 5.0-SNAPSHOT + + + * + * + + + + + fr.gouv.vitamui.commons + commons-rest + 5.0-SNAPSHOT + + + * + * + + + + + fr.gouv.vitamui.commons + commons-vitam + 5.0-SNAPSHOT + + + * + * + + + + + fr.gouv.vitamui + security-client + 5.0-SNAPSHOT + + + * + * + + + + + fr.gouv.vitamui + iam-internal-client + 5.0-SNAPSHOT + + + * + * + + + + + + + build-info + + build-info + + + + + repackage + + + + + true + false + fr.gouv.vitamui.pastis.server.ApiPastisServerApplication + + --spring.profiles.active=test + + + + + + + + + + diff --git a/api/api-pastis/pastis/run.sh b/api/api-pastis/pastis/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..431dbef90f342b46be187d0c04d13e86f3eea417 --- /dev/null +++ b/api/api-pastis/pastis/run.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +#retrieve version +version="$(grep -oP '(?<=>).*?(?=)' pom.xml | grep -v 'version' | grep -oP 'SNAPSHOT')" + +java -jar target/pastis-5.0-SNAPSHOT.jar -Xms128m -Xmx512m --spring.profiles.active=dev diff --git a/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/ApiPastisServerApplication.java b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/ApiPastisServerApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..556891207146794f4fd4445e85210c93b420fb06 --- /dev/null +++ b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/ApiPastisServerApplication.java @@ -0,0 +1,74 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.server; + +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.core.env.Environment; + +@SpringBootApplication +@EnableDiscoveryClient +public class ApiPastisServerApplication implements CommandLineRunner { + + private static final VitamUILogger LOGGER = + VitamUILoggerFactory.getInstance(ApiPastisServerApplication.class); + @Autowired + private Environment env; + + public static void main(final String[] args) { + final SpringApplication app = new SpringApplicationBuilder(ApiPastisServerApplication.class) + .build(); + app.run(args); + } + + @Override + public void run(final String... args) throws Exception { + + LOGGER.info("VITAMUI SpringBoot Application started:"); + LOGGER.info("spring.application.name: " + env.getProperty("spring.application.name")); + LOGGER.info("-------------------------------"); + LOGGER.info("\n"); + } +} diff --git a/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/config/ApiPastisApplicationProperties.java b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/config/ApiPastisApplicationProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..8caefe3e98e3778b83a983ecb707da9ec9ec5879 --- /dev/null +++ b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/config/ApiPastisApplicationProperties.java @@ -0,0 +1,63 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.server.config; + + +import fr.gouv.vitamui.commons.rest.client.configuration.RestClientConfiguration; +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * Properties specific to API Archive Application. + *

+ * Properties are configured in the application.yml file. + */ +@Getter +@Setter +@Component +@ConfigurationProperties(prefix = "pastis-external", ignoreUnknownFields = false) +public class ApiPastisApplicationProperties { + + private RestClientConfiguration iamInternalClient; + + private RestClientConfiguration securityClient; + +} diff --git a/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/config/ApiPastisServerConfig.java b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/config/ApiPastisServerConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..308be5115cbe48e7579a2095e92a06a670379ad6 --- /dev/null +++ b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/config/ApiPastisServerConfig.java @@ -0,0 +1,139 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.server.config; + +import fr.gouv.vitamui.commons.api.application.AbstractContextConfiguration; +import fr.gouv.vitamui.commons.rest.RestExceptionHandler; +import fr.gouv.vitamui.commons.rest.configuration.SwaggerConfiguration; +import fr.gouv.vitamui.iam.internal.client.IamInternalRestClientFactory; +import fr.gouv.vitamui.iam.internal.client.UserInternalRestClient; +import fr.gouv.vitamui.iam.security.provider.ExternalApiAuthenticationProvider; +import fr.gouv.vitamui.iam.security.service.ExternalAuthentificationService; +import fr.gouv.vitamui.iam.security.service.ExternalSecurityService; +import fr.gouv.vitamui.pastis.common.service.JsonFromPUA; +import fr.gouv.vitamui.pastis.common.service.PuaFromJSON; +import fr.gouv.vitamui.pastis.common.service.PuaPastisValidator; +import fr.gouv.vitamui.security.client.ContextRestClient; +import fr.gouv.vitamui.security.client.SecurityRestClientFactory; +import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; + +import java.util.Arrays; + +@Configuration +@Import({RestExceptionHandler.class, SwaggerConfiguration.class, HttpMessageConvertersAutoConfiguration.class}) +public class ApiPastisServerConfig extends AbstractContextConfiguration { + + @Bean + public SecurityRestClientFactory securityRestClientFactory( + final ApiPastisApplicationProperties apiArchiveExternalApplicationProperties, + final RestTemplateBuilder restTemplateBuilder) { + return new SecurityRestClientFactory(apiArchiveExternalApplicationProperties.getSecurityClient(), + restTemplateBuilder); + } + + @Bean + public ContextRestClient contextCrudRestClient(final SecurityRestClientFactory securityRestClientFactory) { + + return securityRestClientFactory.getContextRestClient(); + } + + @Bean + public ExternalApiAuthenticationProvider apiAuthenticationProvider( + final ExternalAuthentificationService externalAuthentificationService) { + return new ExternalApiAuthenticationProvider(externalAuthentificationService); + } + + @Bean + public ExternalSecurityService externalSecurityService() { + return new ExternalSecurityService(); + } + + @Bean + public ExternalAuthentificationService externalAuthentificationService(final ContextRestClient contextRestClient, + final UserInternalRestClient userInternalRestClient) { + return new ExternalAuthentificationService(contextRestClient, userInternalRestClient); + } + + @Bean + public IamInternalRestClientFactory iamInternalRestClientFactory( + final ApiPastisApplicationProperties apiArchiveExternalApplicationProperties, + final RestTemplateBuilder restTemplateBuilder) { + return new IamInternalRestClientFactory(apiArchiveExternalApplicationProperties.getIamInternalClient(), + restTemplateBuilder); + + } + + @Bean + public UserInternalRestClient userInternalRestClient( + final IamInternalRestClientFactory iamInternalRestClientFactory) { + return iamInternalRestClientFactory.getUserInternalRestClient(); + } + + @Bean + public MappingJackson2HttpMessageConverter customizedJacksonMessageConverter() { + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + converter.setSupportedMediaTypes( + Arrays.asList( + MediaType.APPLICATION_JSON, + new MediaType("application", "*+json"), + MediaType.APPLICATION_OCTET_STREAM)); + return converter; + } + + @Bean + public JsonFromPUA jsonFromPUA() { + return new JsonFromPUA(); + } + + @Bean + public PuaFromJSON puaFromJSON() { + return new PuaFromJSON(); + } + + @Bean + public PuaPastisValidator puaPastisValidator() { + return new PuaPastisValidator(); + } +} diff --git a/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/rest/PastisController.java b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/rest/PastisController.java new file mode 100644 index 0000000000000000000000000000000000000000..2b485d1d955f4792ce21fc8a1adf8d7a172c34e5 --- /dev/null +++ b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/rest/PastisController.java @@ -0,0 +1,158 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.server.rest; + +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.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.dto.profiles.Notice; +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.server.service.PastisService; +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.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.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.net.URISyntaxException; + +@Api(tags = "pastis") +@RequestMapping(RestApi.PASTIS) +@RestController +@ResponseBody +class PastisController { + + private static final String APPLICATION_JSON_UTF8 = "application/json; charset=utf-8"; + private static final VitamUILogger LOGGER = + VitamUILoggerFactory.getInstance(PastisController.class); + + @Autowired + private PastisService profileService; + + @ApiOperation(value = "Download Pa Profile rng file") + @Secured(ServicesData.ROLE_GET_PROFILES) + @RequestMapping(value = RestApi.PASTIS_DOWNLOAD_PA, method = RequestMethod.POST, consumes = APPLICATION_JSON_UTF8, produces = MediaType.APPLICATION_XML_VALUE) + ResponseEntity getArchiveProfile(@RequestBody final ElementProperties json) throws IOException { + String archiveProfile = profileService.getArchiveProfile(json); + if (archiveProfile != null) { + return ResponseEntity.ok(archiveProfile); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @ApiOperation(value = "Download Pua Profile json file") + @Secured(ServicesData.ROLE_GET_ARCHIVE_PROFILES) + @RequestMapping(value = RestApi.PASTIS_DOWNLOAD_PUA, method = RequestMethod.POST, consumes = APPLICATION_JSON_UTF8, produces = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity getArchiveUnitProfile(@RequestBody final ProfileNotice json) throws IOException { + String archiveUnitProfile = profileService.getArchiveUnitProfile(json); + if (archiveUnitProfile != null) { + return ResponseEntity.ok(archiveUnitProfile); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + + } + + @ApiOperation(value = "Retrieve json representation from PUA notice") + @Secured({ServicesData.ROLE_UPDATE_ARCHIVE_PROFILES, ServicesData.ROLE_UPDATE_PROFILES}) + @RequestMapping(value = RestApi.PASTIS_TRANSFORM_PROFILE, method = RequestMethod.POST) + ResponseEntity loadProfile(@RequestBody final Notice notice) + throws IOException { + ProfileResponse profileResponse = profileService.loadProfile(notice); + if (profileResponse != null) { + return ResponseEntity.ok(profileResponse); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @ApiOperation(value = "Retrieve json representation from input file") + @Secured({ServicesData.ROLE_CREATE_ARCHIVE_PROFILES, ServicesData.ROLE_CREATE_PROFILES}) + @RequestMapping(value = RestApi.PASTIS_UPLOAD_PROFILE, method = RequestMethod.POST, + consumes = "multipart/form-data", produces = "application/json") + ResponseEntity loadProfileFromFile(@RequestParam MultipartFile file) { + ProfileResponse profileResponse = profileService.loadProfileFromFile(file); + if (profileResponse != null) { + return ResponseEntity.ok(profileResponse); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @ApiOperation(value = "Retrieve json representation from PA file") + @Secured({ServicesData.ROLE_UPDATE_ARCHIVE_PROFILES, ServicesData.ROLE_UPDATE_PROFILES}) + @RequestMapping(value = RestApi.PASTIS_TRANSFORM_PROFILE_PA, method = RequestMethod.POST, + consumes = "multipart/form-data", produces = "application/json") + ResponseEntity loadPA(@RequestParam MultipartFile file) throws IOException { + ElementProperties elementProperties = profileService.loadProfilePA(file); + if (elementProperties != null) { + return ResponseEntity.ok(elementProperties); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + @ApiOperation(value = "Get template profile by type") + @Secured({ServicesData.ROLE_CREATE_ARCHIVE_PROFILES, ServicesData.ROLE_CREATE_PROFILES}) + @RequestMapping(value = RestApi.PASTIS_CREATE_PROFILE, method = RequestMethod.GET) + ResponseEntity createProfile(@RequestParam(name = "type") String profileType) + throws URISyntaxException, IOException { + ProfileResponse profileResponse = profileService.createProfile(profileType); + if (profileResponse != null) { + return ResponseEntity.ok(profileResponse); + } else { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + +} diff --git a/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/security/WebSecurityConfig.java b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/security/WebSecurityConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..72f5a8d862e63a16556d2947910cfe276e7ad6aa --- /dev/null +++ b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/security/WebSecurityConfig.java @@ -0,0 +1,62 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + +package fr.gouv.vitamui.pastis.server.security; + +import fr.gouv.vitamui.commons.rest.RestExceptionHandler; +import fr.gouv.vitamui.iam.security.config.ExternalApiWebSecurityConfig; +import fr.gouv.vitamui.iam.security.provider.ExternalApiAuthenticationProvider; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; + +/** + * The security configuration. + */ +@EnableWebSecurity +@Configuration +@EnableGlobalMethodSecurity(securedEnabled = true, proxyTargetClass = true) +public class WebSecurityConfig extends ExternalApiWebSecurityConfig { + + public WebSecurityConfig(final ExternalApiAuthenticationProvider apiAuthenticationProvider, + final RestExceptionHandler restExceptionHandler, final Environment env) { + super(apiAuthenticationProvider, restExceptionHandler, env); + } + +} diff --git a/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/service/PastisService.java b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/service/PastisService.java new file mode 100644 index 0000000000000000000000000000000000000000..c5d4cfe34379aa8ad4ca37abc87efcef3938947f --- /dev/null +++ b/api/api-pastis/pastis/src/main/java/fr/gouv/vitamui/pastis/server/service/PastisService.java @@ -0,0 +1,372 @@ +/* +Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2021) + +[dad@cines.fr] + +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 standard +(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, +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". + +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-C license and that you accept its terms. +*/ + + +package fr.gouv.vitamui.pastis.server.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import fr.gouv.vitamui.commons.api.logger.VitamUILogger; +import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory; +import fr.gouv.vitamui.pastis.common.dto.ElementProperties; +import fr.gouv.vitamui.pastis.common.dto.jaxb.AnnotationXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.AnyNameXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.AttributeXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.BaliseXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.ChoiceXml; +import fr.gouv.vitamui.pastis.common.dto.jaxb.DataXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.DocumentationXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.ElementXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.ExceptXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.GrammarXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.NsNameXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.OneOrMoreXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.OptionalXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.StartXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.ValueXML; +import fr.gouv.vitamui.pastis.common.dto.jaxb.ZeroOrMoreXML; +import fr.gouv.vitamui.pastis.common.dto.profiles.Notice; +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.dto.profiles.ProfileType; +import fr.gouv.vitamui.pastis.common.service.JsonFromPUA; +import fr.gouv.vitamui.pastis.common.service.PuaFromJSON; +import fr.gouv.vitamui.pastis.common.service.PuaPastisValidator; +import fr.gouv.vitamui.pastis.common.util.NoticeUtils; +import fr.gouv.vitamui.pastis.common.util.PastisCustomCharacterEscapeHandler; +import fr.gouv.vitamui.pastis.common.util.PastisGetXmlJsonTree; +import fr.gouv.vitamui.pastis.common.util.PastisSAX2Handler; +import lombok.Getter; +import lombok.Setter; +import org.json.JSONObject; +import org.json.JSONTokener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; +import org.springframework.core.io.support.ResourcePatternUtils; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +@Getter +@Setter +@Service +public class PastisService { + + private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(PastisService.class); + + private static final String APPLICATION_JSON_UTF8 = "application/json; charset=utf-8"; + private final ResourceLoader resourceLoader; + @Value("${rng.base.file}") + private String rngFile; + @Value("${json.template.file}") + private String jsonFile; + @Value("${rng.base.directory}") + private String rngLocation; + @Autowired + private PuaPastisValidator puaPastisValidator; + + @Autowired + private JsonFromPUA jsonFromPUA; + + @Autowired + private PuaFromJSON puaFromJSON; + private List pastisProfiles = new ArrayList<>(); + private List notices = new ArrayList<>(); + @Autowired + public PastisService(ResourceLoader resourceLoader) { + this.resourceLoader = resourceLoader; + } + + public String getArchiveProfile(final ElementProperties json) throws IOException { + + // Recover a statically generated BaliseXML by buildBaliseXMLTree + json.initTree(json); + BaliseXML.buildBaliseXMLTree(json, 0, null); + // Add Recip struct to xml balises tree + BaliseXML.addRecipTags(); + BaliseXML eparentRng = BaliseXML.baliseXMLStatic; + String response = null; + Writer writer = null; + try { + JAXBContext contextObj = JAXBContext.newInstance(AttributeXML.class, ElementXML.class, DataXML.class, + ValueXML.class, OptionalXML.class, OneOrMoreXML.class, + ZeroOrMoreXML.class, AnnotationXML.class, DocumentationXML.class, + StartXML.class, GrammarXML.class, ChoiceXml.class, AnyNameXML.class, ExceptXML.class, NsNameXML.class); + Marshaller marshallerObj = contextObj.createMarshaller(); + marshallerObj.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + marshallerObj.setProperty("com.sun.xml.bind.marshaller.CharacterEscapeHandler", + new PastisCustomCharacterEscapeHandler()); + + ByteArrayOutputStream os = new ByteArrayOutputStream(); + writer = new OutputStreamWriter(os, "UTF-8"); + + marshallerObj.marshal(eparentRng, writer); + response = new String(os.toByteArray(), "UTF-8"); + + } catch (IOException e1) { + e1.printStackTrace(); + } catch (JAXBException e1) { + e1.printStackTrace(); + } finally { + writer.close(); + } + + LOGGER.info("RNG profile generated successfully"); + return response; + } + + public String getArchiveUnitProfile(final ProfileNotice json) throws IOException { + + Notice notice = new Notice(); + if (json.getNotice() != null) { + notice = json.getNotice(); + + } else { + notice.setId("12133411121213"); + } + + String controlSchema = puaFromJSON.getControlSchemaFromElementProperties(json.getElementProperties()); + notice.setControlSchema(controlSchema); + + ObjectMapper objectMapper = new ObjectMapper(); + String noticeAsString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(notice); + + return noticeAsString; + + } + + public Resource getFile(String filename) { + return new ClassPathResource(rngLocation + filename + ".rng"); + } + + public ProfileResponse createProfile(String type) throws URISyntaxException, IOException { + Resource resource; + ProfileType profileType; + if (type.equals(ProfileType.PA.toString())) { + profileType = ProfileType.PA; + resource = new ClassPathResource(rngFile); + } else if (type.equals(ProfileType.PUA.toString())) { + profileType = ProfileType.PUA; + resource = new ClassPathResource(jsonFile); + } else { + return null; + } + return createProfileByType(resource, profileType); + } + + public ProfileResponse loadProfile(Notice notice) throws IOException { + PastisSAX2Handler handler = new PastisSAX2Handler(); + PastisGetXmlJsonTree getJson = new PastisGetXmlJsonTree(); + ProfileResponse profileResponse = new ProfileResponse(); + + try { + profileResponse.setId(notice.getId()); + profileResponse.setType(NoticeUtils.getFileType(notice)); + profileResponse.setName(notice.getIdentifier()); + String s = notice.serialiseString(); + JSONObject profileJson = new JSONObject(s); + + if (NoticeUtils.getFileType(notice).equals(ProfileType.PA)) { + InputStream inputStream = getClass().getClassLoader().getResourceAsStream(rngLocation + + notice.getPath()); + InputSource inputSource = new InputSource(inputStream); + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + xmlReader.setContentHandler(handler); + xmlReader.parse(inputSource); + profileResponse.setProfile(getJson.getJsonParsedTree(handler.elementRNGRoot)); + LOGGER.info("Starting editing Archive Profile with id : {}", notice.getId()); + } else if (NoticeUtils.getFileType(notice).equals(ProfileType.PUA)) { + puaPastisValidator.validatePUA(profileJson); + profileResponse.setProfile(jsonFromPUA.getProfileFromPUA(profileJson)); + } + profileResponse.setNotice(NoticeUtils.getNoticeFromPUA(profileJson)); + } catch (SAXException | IOException e) { + LOGGER.error("Failed to load profile with id : {}", notice.getId()); + return null; + } catch (AssertionError ae) { + LOGGER.error("Failed to load pua with id {} and error message {}", notice.getId(), ae.getMessage()); + return null; + } + + return profileResponse; + } + + public ElementProperties loadProfilePA(MultipartFile file) throws IOException { + PastisSAX2Handler handler = new PastisSAX2Handler(); + PastisGetXmlJsonTree getJson = new PastisGetXmlJsonTree(); + ElementProperties elementProperties; + + try { + InputStream fileInputStream = file.getInputStream(); + InputSource inputSource = new InputSource(file.getInputStream()); + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + xmlReader.setContentHandler(handler); + xmlReader.parse(inputSource); + elementProperties = getJson.getJsonParsedTree(handler.elementRNGRoot); + } catch (SAXException | IOException e) { + LOGGER.error(e.getMessage()); + return null; + } + return elementProperties; + } + + public ProfileResponse createProfileByType(Resource resource, ProfileType profileType) throws IOException { + PastisSAX2Handler handler = new PastisSAX2Handler(); + PastisGetXmlJsonTree getJson = new PastisGetXmlJsonTree(); + ProfileResponse profileResponse = new ProfileResponse(); + + try { + profileResponse.setType(profileType); + profileResponse.setName(resource.getFilename()); + + InputStream fileInputStream = resource.getInputStream(); + InputSource inputSource = new InputSource(resource.getInputStream()); + + if (profileType.equals(ProfileType.PA)) { + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + xmlReader.setContentHandler(handler); + xmlReader.parse(inputSource); + profileResponse.setProfile(getJson.getJsonParsedTree(handler.elementRNGRoot)); + LOGGER.info("Starting editing Archive Profile from file : {}", resource.getFilename()); + + } else { + JSONTokener tokener = new JSONTokener(new InputStreamReader(fileInputStream)); + JSONObject profileJson = new JSONObject(tokener); + puaPastisValidator.validatePUA(profileJson); + profileResponse.setProfile(jsonFromPUA.getProfileFromPUA(profileJson)); + profileResponse.setNotice(NoticeUtils.getNoticeFromPUA(profileJson)); + LOGGER.info("Starting editing Archive Unit Profile with name : {}", resource.getFilename()); + } + + } catch (SAXException | IOException e) { + LOGGER.error("Failed to load profile '{}' : " + e.getMessage(), resource.getFilename()); + return null; + } catch (AssertionError ae) { + LOGGER.error("Failed to load pua : {}", ae.getMessage()); + return null; + } + + profileResponse.setId(String.valueOf((Math.abs(new Random().nextLong()) / 1000))); + + return profileResponse; + } + + public ProfileResponse loadProfileFromFile(MultipartFile file) { + + PastisSAX2Handler handler = new PastisSAX2Handler(); + PastisGetXmlJsonTree getJson = new PastisGetXmlJsonTree(); + ProfileResponse profileResponse = new ProfileResponse(); + + try { + String fileExtension = file.getOriginalFilename().split("\\.")[1]; + String profileName = file.getOriginalFilename().split("\\.(?=[^\\.]+$)")[0]; + profileResponse.setType(fileExtension.equals("rng") ? ProfileType.PA : ProfileType.PUA); + profileResponse.setName(profileName); + + InputStream fileInputStream = file.getInputStream(); + InputSource inputSource = new InputSource(file.getInputStream()); + + if (profileResponse.getType().equals(ProfileType.PA)) { + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + xmlReader.setContentHandler(handler); + xmlReader.parse(inputSource); + profileResponse.setProfile(getJson.getJsonParsedTree(handler.elementRNGRoot)); + LOGGER.info("Starting editing Archive Profile from file : {}", file.getOriginalFilename()); + + } else { + JSONTokener tokener = new JSONTokener(new InputStreamReader(fileInputStream)); + JSONObject profileJson = new JSONObject(tokener); + puaPastisValidator.validatePUA(profileJson); + profileResponse.setProfile(jsonFromPUA.getProfileFromPUA(profileJson)); + profileResponse.setNotice(NoticeUtils.getNoticeFromPUA(profileJson)); + LOGGER.info("Starting editing Archive Unit Profile with name : {}", file.getOriginalFilename()); + } + + } catch (SAXException | IOException e) { + LOGGER.error("Failed to load profile '{}' : " + e.getMessage(), file.getOriginalFilename()); + return null; + } catch (AssertionError ae) { + LOGGER.error("Failed to load pua : {}", ae.getMessage()); + return null; + } + + profileResponse.setId(String.valueOf((Math.abs(new Random().nextLong()) / 1000))); + + return profileResponse; + } + + public List getFiles() throws IOException { + Resource[] resources = ResourcePatternUtils + .getResourcePatternResolver(resourceLoader) + .getResources("classpath*:" + rngLocation + "*.*"); + + try { + if (notices.isEmpty()) { + for (Resource r : resources) { + notices.add(new Notice(r)); + } + } + return notices; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + +} + diff --git a/api/api-pastis/pastis/src/main/resources/application-dev.yml b/api/api-pastis/pastis/src/main/resources/application-dev.yml new file mode 100644 index 0000000000000000000000000000000000000000..3bb08a9dc85b401d4f445df0c2615ee2c31bbcce --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/application-dev.yml @@ -0,0 +1,84 @@ +debug: false +# Pastis Rest APi +rng: + base: + file: rng/Profil_seda_pastis_mvp.rng + directory: rng/ +json: + base: + file: rng/ProfileJson.json + template: + file: rng/AUP_default_PASTIS.json +pua: + definitions: + file: pua_validation/ProfileJson.json + +spring: + config: + use-legacy-processing: true + profiles: + active: dev, swagger + + cloud: + consul: #disabled for dev + enabled: false + discovery: + enabled: false + register: false + +multipart: + enabled: true + +spring.servlet.multipart.max-file-size: -1 +spring.servlet.multipart.max-request-size: -1 + +server-identity: + identityName: vitamui-dev + identityRole: pastis-external + identityServerId: 1 + +server: + host: + port: 8015 + ssl: + key-store: src/main/resources/dev/keystore_pastis-external.jks + key-store-password: e2zS1Za6se9vYky0uoATKDfuXDp0j6r4PBWDn4ZHQvX5cKfX + key-password: e2zS1Za6se9vYky0uoATKDfuXDp0j6r4PBWDn4ZHQvX5cKfX + trust-store: src/main/resources/dev/truststore_server.jks + trust-store-password: changeme + client-auth: need + enabled-protocols: TLSv1.1,TLSv1.2,TLSv1.3 + ciphers: ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384 + +management: + server: + address: localhost + port: 8189 + ssl: + enabled: false +pastis-external: + security-client: + server-host: localhost + server-port: 8084 + secure: false + iam-internal-client: + server-host: localhost + server-port: 7083 + secure: false + +# Jaeger +opentracing: + jaeger: + enabled: true + logSpans: true + expandExceptionLogs: true + udp-sender: + host: localhost + port: 6831 + +logging: + level: + fr.gouv.vitamui: DEBUG + fr.gouv.vitamui.iam.security: DEBUG + #level.org.springframework.web.filter.CommonsRequestLoggingFilter: DEBUG +cors.allowed-origins: https://dev.vitamui.com:4251,https://localhost diff --git a/api/api-pastis/pastis/src/main/resources/application-standalone.yml b/api/api-pastis/pastis/src/main/resources/application-standalone.yml new file mode 100644 index 0000000000000000000000000000000000000000..37773f7078d6ea403c58c382c6aaf17606d232e1 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/application-standalone.yml @@ -0,0 +1,35 @@ +debug: false +# Pastis Rest APi +rng: + base: + file: rng/Profil_seda_pastis_mvp.rng +json: + base: + file: rng/ProfileJson.json +pua: + definitions: + file: pua_validation/ProfileJson.json +spring: + config: + use-legacy-processing: true + profiles: + active: dev, swagger + servlet: + multipart: + max-file-size: -1 + max-request-size: -1 + enabled: true + +server: + host: localhost + port: 8080 + scheme: http +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: http://localhost:80 + +multipart: + enabled: true + diff --git a/api/api-pastis/pastis/src/main/resources/application-test.yml b/api/api-pastis/pastis/src/main/resources/application-test.yml new file mode 100644 index 0000000000000000000000000000000000000000..26898d32d31d446bd38c3200e8c5557c4c73e10e --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/application-test.yml @@ -0,0 +1,71 @@ +debug: false +# Pastis Rest APi +rng: + base: + file: rng/Profil_seda_pastis_mvp.rng +json: + base: + file: rng/ProfileJson.json +pua: + definitions: + file: pua_validation/ProfileJson.json + +spring: + config: + use-legacy-processing: true + profiles: + active: dev, swagger + + cloud: + consul: #disabled for dev + enabled: false + discovery: + enabled: false + register: false + +multipart: + enabled: true + +spring.servlet.multipart.max-file-size: -1 +spring.servlet.multipart.max-request-size: -1 + +server-identity: + identityName: vitamui-dev + identityRole: pastis-external + identityServerId: 1 + +server: + host: + port: 8099 +management: + server: + address: localhost + port: 8189 + ssl: + enabled: false +pastis-external: + security-client: + server-host: localhost + server-port: 8084 + secure: false + iam-internal-client: + server-host: localhost + server-port: 7083 + secure: false + +# Jaeger +opentracing: + jaeger: + enabled: true + logSpans: true + expandExceptionLogs: true + udp-sender: + host: localhost + port: 6831 + +logging: + level: + fr.gouv.vitamui: DEBUG + fr.gouv.vitamui.iam.security: DEBUG + #level.org.springframework.web.filter.CommonsRequestLoggingFilter: DEBUG +cors.allowed-origins: https://dev.vitamui.com:4251,https://localhost diff --git a/api/api-pastis/pastis/src/main/resources/application.yml b/api/api-pastis/pastis/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..337020ce3ebe845a3dc53c6411c46bcee7b60e0b --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/application.yml @@ -0,0 +1,34 @@ +# 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} + api: + name: API Pastis + description: This API is used to manage Vitam's profile + version: v1 + mvc: + favicon: + enabled: false + jackson: + serialization: + write-dates-as-timestamps: false + +management: + endpoints: + jmx: + domain: ${server-identity.identityRole} + unique-names: true + web.exposure.include: info,health,prometheus + endpoint: + health: + show-details: always + prometheus: + enabled: true + +swagger: + layer: api-external + file-path: file:../../../tools/swagger/docs/api-external/pastis-external/swagger.json +cors.allowed-origins: https://dev.vitamui.com:4251,https://localhost + diff --git a/api/api-pastis/pastis/src/main/resources/dev/keystore_pastis-external.jks b/api/api-pastis/pastis/src/main/resources/dev/keystore_pastis-external.jks new file mode 100644 index 0000000000000000000000000000000000000000..3716aae6f797449f22ef2918da87062a25b2094d Binary files /dev/null and b/api/api-pastis/pastis/src/main/resources/dev/keystore_pastis-external.jks differ diff --git a/api/api-pastis/pastis/src/main/resources/dev/truststore_server.jks b/api/api-pastis/pastis/src/main/resources/dev/truststore_server.jks new file mode 100644 index 0000000000000000000000000000000000000000..5ac432f91a4ad2846943f18d4bc42fccfbc26104 Binary files /dev/null and b/api/api-pastis/pastis/src/main/resources/dev/truststore_server.jks differ diff --git a/api/api-pastis/pastis/src/main/resources/pua_validation/archiveUnitSeda.json b/api/api-pastis/pastis/src/main/resources/pua_validation/archiveUnitSeda.json new file mode 100644 index 0000000000000000000000000000000000000000..81e57fb6d236a1db4d75b0923f8a36003d64f6fb --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/pua_validation/archiveUnitSeda.json @@ -0,0 +1,7391 @@ +{ + "Name": "ArchiveUnit", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "yes", + "Enumeration": [ + ], + "Definition": "Correspond à la notion de composant en ISAD(G). ArchiveUnit permet à la fois de gérer la hiérarchie intellectuelle, tout en contenant les métadonnées de description et de gestion propres à chaque niveau de description archivistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de l'unité d'archives utilisé par exemple dans le cas de multiples héritages, pour savoir quel noeud contient une erreur.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ArchiveUnitRefId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Permet de faire une référence à d'autres ArchiveUnit dans la même transaction.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ArchiveUnitProfile", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à une partie d'un profil d\u2019archivage applicable à un ArchiveUnit en particulier. Permet par exemple de faire référence à une typologie documentaire dans un profil d'archivage.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "schemeID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeAgencyID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeAgencyName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeVersionID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeDataURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Management", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "yes", + "Enumeration": [ + ], + "Definition": "Métadonnées de gestion applicables à l\u2019ArchiveUnit concernée et à ses héritiers.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "StorageRule", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Gestion de la durée d\u2019utilité courante.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Rule", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à la règle de durée d'utilité courante.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "StartDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de départ de calcul de la règle d'utilité courante.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PreventInheritance", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "boolean", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + "false", + "true" + ], + "Definition": "Indique si les règles de gestion héritées des ArchiveUnit parents doivent être ignorées pour l\u2019ArchiveUnit concerné.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RefNonRuleId", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "FinalAction", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + "RestrictAccess", + "Transfer", + "Copy" + ], + "Definition": "Action à mettre en œuvre au terme de la durée de gestion.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "AppraisalRule", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Gestion de la durée d\u2019utilité administrative.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Rule", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à la règle de durée d'utilité administrative.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "StartDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de départ de calcul de la règle d'utilité administrative.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PreventInheritance", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "boolean", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + "false", + "true" + ], + "Definition": "Indique si les règles de gestion héritées des ArchiveUnit parents doivent être ignorées pour l\u2019ArchiveUnit concerné.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RefNonRuleId", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "FinalAction", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + "Keep", + "Destroy" + ], + "Definition": "Action à mettre en œuvre au terme de la durée de gestion.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "AccessRule", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Gestion de la communicabilité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Rule", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à la règle de communicabilité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "StartDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de départ de calcul de la règle de communicabilité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PreventInheritance", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "boolean", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + "false", + "true" + ], + "Definition": "Indique si les règles de gestion héritées des ArchiveUnit parents doivent être ignorées pour l\u2019ArchiveUnit concerné.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RefNonRuleId", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "DisseminationRule", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Gestion de la diffusion.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Rule", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à la règle de diffusion.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "StartDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de départ de calcul de la règle de diffusion.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PreventInheritance", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "boolean", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + "false", + "true" + ], + "Definition": "Indique si les règles de gestion héritées des ArchiveUnit parents doivent être ignorées pour l\u2019ArchiveUnit concerné.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RefNonRuleId", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "ReuseRule", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Gestion de la réutilisation.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Rule", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à la règle de réutilisation.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "StartDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de départ de calcul de la règle de réutilisation.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PreventInheritance", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "boolean", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + "false", + "true" + ], + "Definition": "Indique si les règles de gestion héritées des ArchiveUnit parents doivent être ignorées pour l\u2019ArchiveUnit concerné.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RefNonRuleId", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "ClassificationRule", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Gestion de la classification.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Rule", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à la règle de classification.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "StartDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de départ de calcul de la règle de classification.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ClassificationAudience", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Permet de gérer les questions de diffusion restreinte, de spécial France et de Confidentiel Industrie.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PreventInheritance", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "boolean", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + "false", + "true" + ], + "Definition": "Indique si les règles de gestion héritées des ArchiveUnit parents doivent être ignorées pour l\u2019ArchiveUnit concerné.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RefNonRuleId", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "ClassificationLevel", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence au niveau de classification.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ClassificationOwner", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Propriétaire de la classification. Service émetteur au sens de l\u2019IGI 1300.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ClassificationReassessingDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de réévaluation de la classification.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "NeedReassessingAuthorization", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "boolean", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + "true", + "false" + ], + "Definition": "Indique si une autorisation humaine est nécessaire pour réévaluer la classification.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "LogBook", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Gestion des traces.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Event", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "yes", + "Enumeration": [ + ], + "Definition": "", + "Collection": "Arborescence", + "Children": [ + { + "Name": "EventIdentifier", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de l'événement. Références : premis.eventIdentifier", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventTypeCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Code du type d'événement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventType", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Type d'événement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventDateTime", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date et heure de l'événement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventDetail", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Détail sur l'événement.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Outcome", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Résultat du traitement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "OutcomeDetail", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Détail sur le résultat du traitement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "OutcomeDetailMessage", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Message détaillé sur le résultat du traitement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventDetailData", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Message technique détaillant l'erreur.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "NeedAuthorization", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "boolean", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + "true", + "false" + ], + "Definition": "Indique si une autorisation humaine est nécessaire pour vérifier ou valider les opérations de gestion des ArchiveUnit.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Content", + "Element": "Complex", + "Cardinality": "1", + "Type": "null", + "Choice": "no", + "Extensible": "yes", + "Enumeration": [ + ], + "Definition": "Métadonnées de description associées à un ArchiveUnit.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "DescriptionLevel", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + "Fonds", + "Subfonds", + "Class", + "Collection", + "Series", + "Subseries", + "RecordGrp", + "SubGrp", + "File", + "Item", + "OtherLevel" + ], + "Definition": "Niveau de description au sens de la norme ISAD (G). Indique si l\u2019ArchiveUnit correspond à un fonds, à un sous-fonds, à une classe, à une série organique, à une sous-série organique, à un dossier, à un sous-dossier ou à une pièce. Référence : seda.DescriptionLevel", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Title", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé de l'ArchiveUnit. Références : DC.Title ead.unittitle", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": null, + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "FilePlanPosition", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Position de l\u2019ArchiveUnit dans le plan de classement du service producteur. Références : seda.FilePlanPosition", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "SystemId", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant attribué aux objets. Il est attribué par le SAE et correspond à un identifiant interne. Références : ARMS", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "OriginatingSystemId", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant système attribué à l\u2019ArchiveUnit par l\u2019application du service producteur.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ArchivalAgencyArchiveUnitIdentifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant métier attribué à l'ArchiveUnit par le service d'archives. Peut être comparé à une cote.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "OriginatingAgencyArchiveUnitIdentifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant métier attribué à l\u2019ArchiveUnit par le service producteur.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "TransferringAgencyArchiveUnitIdentifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant attribué à l'ArchiveUnit par le service versant.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Description", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Description détaillée de l\u2019ArchiveUnit. Correspond à la présentation du contenu au sens de la norme ISAD(G). Références : DC:Documentation", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "CustodialHistory", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Énumère les changements successifs de propriété, de responsabilité et de conservation des ArchiveUnit avant leur entrée dans le lieu de conservation. On peut notamment y indiquer comment s'est effectué le passage de l'application d'origine au fichier archivable. Correspond à l'historique de la conservation en ISAD(G). Références : seda.CustodialHistory", + "Collection": "Arborescence", + "Children": [ + { + "Name": "CustodialHistoryItem", + "Element": "Simple", + "Cardinality": "1-N", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Description d'une période ou d'un événement précis dans l'historique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "when", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "CustodialHistoryFile", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un fichier de journalisation externe.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectGroupReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un groupe d'objets-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Type", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Type d\u2019information au sens de l\u2019OAIS (information de représentation, information de pérennisation, etc.). Références : seda.DocumentType", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DocumentType", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Type de document au sens diplomatique du terme (ex. compte-rendu de réunion, note, correspondance, etc.). Ne pas confondre avec Type.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Language", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Langue du contenu des objets-données. Références : seda.Language", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DescriptionLanguage", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Langue utilisée pour les informations de représentation et de pérennisation. Références : seda.DescriptionLanguage", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Status", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Etat de l'objet-données (par rapport avec son cycle de vie). Permet par exemple d'indiquer si la signature du fichier a été vérifiée avant le transfert aux archives. Références : seda.Status", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Version", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Permet d'indiquer quelle est la version du document.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Tag", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Mots-clés ou liste de mots-clés génériques. En ce qui concerne l'indexation, on pourra utiliser Tag ou Keyword en fonction de ce que l'on souhaite décrire.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Keyword", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Mots-clef avec contexte inspiré du SEDA 1.0. En ce qui concerne l'indexation, on pourra utiliser Tag ou Keyword en fonction de ce que l'on souhaite décrire. Références : seda.Keyword", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "KeywordContent", + "Element": "Simple", + "Cardinality": "1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Valeur du mot-clé. A utiliser avec Keyword.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "KeywordReference", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant du mot clé dans un référentiel donné. Par exemple, pour un lieu, il pourrait s'agir de son code officiel géographique selon l'INSEE.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "schemeID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeAgencyID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeAgencyName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeVersionID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeDataURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "KeywordType", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + "corpname", + "famname", + "geogname", + "name", + "occupation", + "persname", + "subject", + "genreform", + "function" + ], + "Definition": "Type de mot clé.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "listVersionID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Coverage", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Couverture spatiale, temporelle ou juridictionnelle de l\u2019ArchiveUnit. Références : DC.Coverage", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Spatial", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Couverture spatiale ou couverture géographique. Références: AGKRMS.spatialCoverage", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Temporal", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Couverture temporelle. Références: AGKRMS.temporalCoverage", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Juridictional", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Juridiction administrative ou ressort administratif. Références: AGKRMS.juridictionalCoverage", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "OriginatingAgency", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Service producteur. Personne physique ou morale, publique ou privée, qui a produit, reçu et conservé des archives dans l'exercice de son activité, Dictionnaire de terminologie archivistique, direction des archives de France, 2002. Références : seda.OriginatingAgency", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de l'organisation.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "schemeID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeAgencyID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeAgencyName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeVersionID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeDataURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "OrganizationDescriptiveMetadata", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "yes", + "Enumeration": [ + ], + "Definition": "Métadonnées de description de l'organisation.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xlink:href", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "xml:id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "SubmissionAgency", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Service versant responsable du transfert des données. Références : seda.SubmissionAgency", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de l'organisation.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "schemeID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeAgencyID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeAgencyName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeVersionID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeDataURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "schemeURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "OrganizationDescriptiveMetadata", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "yes", + "Enumeration": [ + ], + "Definition": "Métadonnées de description de l'organisation.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xlink:href", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "xml:id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "AuthorizedAgent", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Titulaire des droits de propriété intellectuelle.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "FirstName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Prénom d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom de naissance d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "FullName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom complet d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GivenName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'usage d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Gender", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Sexe de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DeathDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DeathPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Nationality", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nationalité d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Corpname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'une entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la personne (par exemple, le numéro matricule) ou de l'entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Function", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Activity", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Position", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé du poste de travail occupé par la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Role", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application. Références : moreq.role", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Mandate", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Définit la propriété intellectuelle et artistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Writer", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Rédacteur de l\u2019ArchiveUnit. Références : interpares.Writer", + "Collection": "Arborescence", + "Children": [ + { + "Name": "FirstName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Prénom d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom de naissance d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "FullName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom complet d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GivenName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'usage d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Gender", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Sexe de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DeathDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DeathPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Nationality", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nationalité d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Corpname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'une entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la personne (par exemple, le numéro matricule) ou de l'entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Function", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Activity", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Position", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé du poste de travail occupé par la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Role", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application. Références : moreq.role", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Mandate", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Définit la propriété intellectuelle et artistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Addressee", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Destinataire pour action. Utilisé pour indiquer le nom du destinatire par exemple dans un courrier électronique. Références : ARMS.Addressee, Interpares.Addressee", + "Collection": "Arborescence", + "Children": [ + { + "Name": "FirstName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Prénom d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom de naissance d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "FullName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom complet d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GivenName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'usage d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Gender", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Sexe de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DeathDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DeathPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Nationality", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nationalité d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Corpname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'une entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la personne (par exemple, le numéro matricule) ou de l'entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Function", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Activity", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Position", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé du poste de travail occupé par la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Role", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application. Références : moreq.role", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Mandate", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Définit la propriété intellectuelle et artistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Recipient", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Destinataire pour information. Utilisé pour indiquer le nom du destinatire en copie, pour information, par exemple dans un courrier électronique. Références : Interpares.Recipient", + "Collection": "Arborescence", + "Children": [ + { + "Name": "FirstName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Prénom d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom de naissance d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "FullName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom complet d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GivenName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'usage d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Gender", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Sexe de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DeathDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DeathPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Nationality", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nationalité d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Corpname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'une entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la personne (par exemple, le numéro matricule) ou de l'entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Function", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Activity", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Position", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé du poste de travail occupé par la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Role", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application. Références : moreq.role", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Mandate", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Définit la propriété intellectuelle et artistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Transmitter", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Emetteur du message.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "FirstName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Prénom d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom de naissance d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "FullName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom complet d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GivenName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'usage d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Gender", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Sexe de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DeathDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DeathPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Nationality", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nationalité d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Corpname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'une entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la personne (par exemple, le numéro matricule) ou de l'entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Function", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Activity", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Position", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé du poste de travail occupé par la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Role", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application. Références : moreq.role", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Mandate", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Définit la propriété intellectuelle et artistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Sender", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Expéditeur du message.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "FirstName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Prénom d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom de naissance d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "FullName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom complet d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GivenName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'usage d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Gender", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Sexe de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DeathDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DeathPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Nationality", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nationalité d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Corpname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'une entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la personne (par exemple, le numéro matricule) ou de l'entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Function", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Activity", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Position", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé du poste de travail occupé par la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Role", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application. Références : moreq.role", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Mandate", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Définit la propriété intellectuelle et artistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Source", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En cas de substitution numérique, permet de faire référence au papier.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RelatedObjectReference", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet faisant ou ne faisant pas partie du présent paquet d'information.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "IsVersionOf", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Est une partie de. Cette relation permet d'indique qu'un objet est une partie d'un autre.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "ArchiveUnitRefId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "NCName", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit interne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReference", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données ou à un groupe d'objets-données interne(s).", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectGroupReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un groupe d'objets-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "RepositoryArchiveUnitPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit déjà conservé dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RepositoryObjectPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un un objet-données ou à un groupe d'objets-données déjà conservé(s) dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ExternalReference", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence externe.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Replaces", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Remplace. Cette relation permet d'indiquer les objets remplacés par le niveau courant de description. DC.Relation.replaces", + "Collection": "Arborescence", + "Children": [ + { + "Name": "ArchiveUnitRefId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "NCName", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit interne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReference", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données ou à un groupe d'objets-données interne(s).", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectGroupReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un groupe d'objets-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "RepositoryArchiveUnitPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit déjà conservé dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RepositoryObjectPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un un objet-données ou à un groupe d'objets-données déjà conservé(s) dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ExternalReference", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence externe.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Requires", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Requiert. Cette relation permet d'indiquer les objets nécessaire à la compréhension du niveau courant de description. Références : DC.Relation.requires", + "Collection": "Arborescence", + "Children": [ + { + "Name": "ArchiveUnitRefId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "NCName", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit interne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReference", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données ou à un groupe d'objets-données interne(s).", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectGroupReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un groupe d'objets-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "RepositoryArchiveUnitPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit déjà conservé dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RepositoryObjectPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un un objet-données ou à un groupe d'objets-données déjà conservé(s) dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ExternalReference", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence externe.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "IsPartOf", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Est une partie de. Cette relation permet d'indique qu'un objet est une partie d'un autre. Références : DC.Relation.isPartOf", + "Collection": "Arborescence", + "Children": [ + { + "Name": "ArchiveUnitRefId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "NCName", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit interne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReference", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données ou à un groupe d'objets-données interne(s).", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectGroupReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un groupe d'objets-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "RepositoryArchiveUnitPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit déjà conservé dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RepositoryObjectPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un un objet-données ou à un groupe d'objets-données déjà conservé(s) dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ExternalReference", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence externe.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "References", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence. Cette relation permet d'indiquer qu'un objet en référence un autre. DC.Relation.references", + "Collection": "Arborescence", + "Children": [ + { + "Name": "ArchiveUnitRefId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "NCName", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit interne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReference", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données ou à un groupe d'objets-données interne(s).", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectGroupReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un groupe d'objets-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "RepositoryArchiveUnitPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un ArchiveUnit déjà conservé dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RepositoryObjectPID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un un objet-données ou à un groupe d'objets-données déjà conservé(s) dans un système d'archivage.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ExternalReference", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence externe.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "CreatedDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de création. Références : ARKMS.DateCreated", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "TransactedDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de la transaction. Références : ARKMS.DateTransacted", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "AcquiredDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de numérisation. Références : ARKMS.DateAcquired", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "SentDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date d'envoi.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ReceivedDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de réception.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "RegisteredDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date d'enregistrement. Références : ARMS.DateDeclared", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "StartDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date d'ouverture / date de début. Références : AGKRMS.StartDate", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EndDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de fermeture / Date de fin. Références : AGKRMS.EndDate", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Event", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "", + "Collection": "Arborescence", + "Children": [ + { + "Name": "EventIdentifier", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de l'événement. Références : premis.eventIdentifier", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventTypeCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Code du type d'événement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventType", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Type d'événement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventDateTime", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date et heure de l'événement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventDetail", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Détail sur l'événement.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Outcome", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Résultat du traitement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "OutcomeDetail", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Détail sur le résultat du traitement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "OutcomeDetailMessage", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Message détaillé sur le résultat du traitement.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "EventDetailData", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Message technique détaillant l'erreur.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Signature", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Contient toutes les informations relatives à la signature.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Signer", + "Element": "Complex", + "Cardinality": "1-N", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Signataire(s) de la transaction ou de l'objet. Références : premis.signer", + "Collection": "Arborescence", + "Children": [ + { + "Name": "FirstName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Prénom d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom de naissance d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "FullName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom complet d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GivenName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'usage d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Gender", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Sexe de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DeathDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DeathPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Nationality", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nationalité d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Corpname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'une entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la personne (par exemple, le numéro matricule) ou de l'entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "SigningTime", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de signature.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Function", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Activity", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Position", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé du poste de travail occupé par la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Role", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application. Références : moreq.role", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Mandate", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Définit la propriété intellectuelle et artistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Validator", + "Element": "Complex", + "Cardinality": "1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Validateur de la signature.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "FirstName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Prénom d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom de naissance d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "FullName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom complet d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GivenName", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'usage d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Gender", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Sexe de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "BirthPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de naissance de la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "DeathDate", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DeathPlace", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Lieu de décès d'une personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "Geogname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique. Références : ead.geogname", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Address", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse. Références : ead.address", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "PostalCode", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "City", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Region", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Country", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Nationality", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nationalité d'une personne.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Corpname", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Nom d'une entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Identifier", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la personne (par exemple, le numéro matricule) ou de l'entité.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "ValidationTime", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Date de la validation de la signature.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "Function", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Activity", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Position", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Intitulé du poste de travail occupé par la personne.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Role", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application. Références : moreq.role", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "Mandate", + "Element": "Simple", + "Cardinality": "0-N", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Définit la propriété intellectuelle et artistique.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "xml:lang", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "Masterdata", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référentiel des personnes et des organisations au moment de la vérification de la signature et de sa validation.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "listID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "listAgencyID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "listAgencyName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "listName", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "listVersionID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "name", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "languageID", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "language", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "listURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "listSchemeURI", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "anyURI", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + }, + { + "Name": "ReferencedObject", + "Element": "Complex", + "Cardinality": "1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à l'objet signé.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "SignedObjectId", + "Element": "Simple", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de l'objet-données signé.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "SignedObjectDigest", + "Element": "Simple", + "Cardinality": "1", + "Type": "base64Binary", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Empreinte obligatoire jusqu'au processus de versement pour assurer la portabilité de la valeur probante. Le SAE peut ne pas la conserver si l'on considère que l'identifiant de l'objet correspondant suffit. Ce procédé permet de résister au temps lorsque les informations binaires du paquet seront converties au gré des opérations de préservation de la lisibilité des formats. Au cours de ces opérations, l'identifiant ne changera pas, contrairement au format dufichier et donc à son empreinte.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "algorithm", + "Element": "Attribute", + "Cardinality": "1", + "Type": "token", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + } + ] + }, + { + "Name": "Gps", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Coordonnées gps complétées ou vérifiées par un utilisateur. Fait référence à des coordonnées traitées par un utilisateur et non à des coordonnées captées.", + "Collection": "Arborescence", + "Children": [ + { + "Name": "GpsVersionID", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Identifiant de la version du GPS.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GpsAltitude", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Indique l'altitude basée sur la référence dans GPSAltitudeRef. L'altitude est exprimée en mètres.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GpsAltitudeRef", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Indique l'altitude utilisée comme altitude de référence. Si l'altitude est au dessus du niveau de la mer, la valeur 0 est normalement donnée. Si l'altitude est au-dessous du niveau de la mer, la veleur 1 est normalement donnée.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GpsLatitude", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "La latitude peut être exprimée de deux manières différentes : 1)degrés, décimaux ou 2)degrés, minutes et secondes. 1)Si la latitude est exprimée en degrés, décimaux, le format type est dd, dd. Par ex: 45.3130339. 2)Si la latitude est exprimée en degrés, minutes et secondes, le format type est dd, mm, ss. Par ex: 45 18 46.922.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GpsLatitudeRef", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Indique si la latitude est nord ou sud. La valeur 'N' indique la latitude nord, et 'S' indique la latitude sud.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GpsLongitude", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "La longitude peut être exprimée de deux manières différentes : 1)degrés, décimaux ou 2)degrés, minutes et secondes. 1)Si la longitude est exprimée en degrés, décimaux, le format type est dd, dd. Par ex: 5.392285833333334. 2)Si la longitude est exprimée en degrés, minutes et secondes, le format type est dd, mm, ss. Par ex: 5 23 32.229.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GpsLongitudeRef", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Indique si la longitude est est ou ouest. La valeur 'E' indique la longitude est, et 'W' indique la longitude Ouest.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "GpsDateStamp", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "string", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Heure et Date de la position GPS.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] + }, + { + "Name": "ArchiveUnit", + "Element": "Complex", + "Cardinality": "0-N", + "Type": "null", + "Choice": "yes", + "Extensible": "yes", + "Enumeration": [ + ], + "Definition": "Gestion de la récursivité. Une ArchiveUnit peut être contenu dans une autre ArchiveUnit.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReference", + "Element": "Complex", + "Cardinality": "0-1", + "Type": "null", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données ou à un groupe d'objets-données interne(s).", + "Collection": "Arborescence", + "Children": [ + { + "Name": "id", + "Element": "Attribute", + "Cardinality": "0-1", + "Type": "ID", + "Choice": "no", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "null", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un objet-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + }, + { + "Name": "DataObjectGroupReferenceId", + "Element": "Simple", + "Cardinality": "0-1", + "Type": "token", + "Choice": "yes", + "Extensible": "no", + "Enumeration": [ + ], + "Definition": "Référence à un groupe d'objets-données listé dans les métadonnées de transport.", + "Collection": "Arborescence", + "Children": [ + ] + } + ] + } + ] +} diff --git a/api/api-pastis/pastis/src/main/resources/pua_validation/pua_defitions.json b/api/api-pastis/pastis/src/main/resources/pua_validation/pua_defitions.json new file mode 100644 index 0000000000000000000000000000000000000000..82f6a2bb148d5791d97d6391e8353ce3dd36ee4d --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/pua_validation/pua_defitions.json @@ -0,0 +1,10 @@ +"definitions": { +"pattern-simple-date": { +"type": "string", +"pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}" +}, +"pattern-date": { +"type": "string", +"pattern": "^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$" +} +} diff --git a/api/api-pastis/pastis/src/main/resources/pua_validation/valid_pa.json b/api/api-pastis/pastis/src/main/resources/pua_validation/valid_pa.json new file mode 100644 index 0000000000000000000000000000000000000000..a83102e176e2bed590122835bc67d231bde4b646 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/pua_validation/valid_pa.json @@ -0,0 +1,15 @@ +{ + "id": "aegaaaaabafbmai5aa2d2alwatqvahqaaaaq", + "identifier": "AUP-000007", + "name": "AUP default PASTIS", + "description": "Import d'un AUP default pour PASTIS", + "status": "ACTIVE", + "creationDate": "2000-09-01T00:00:00.000", + "lastUpdate": "2020-11-26T14:08:20.987", + "activationDate": "2016-12-10T00:00:00.000", + "deactivationDate": "2016-12-10T00:00:00.000", + "tenant": 8, + "version": 1, + "format": "RNG", + "path": "ProfilCouzCouz.rng" +} diff --git a/api/api-pastis/pastis/src/main/resources/pua_validation/valid_pua.json b/api/api-pastis/pastis/src/main/resources/pua_validation/valid_pua.json new file mode 100644 index 0000000000000000000000000000000000000000..b90e9b9e1c85ac1b8113f8a3a501c6f9ac831749 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/pua_validation/valid_pua.json @@ -0,0 +1,16 @@ +{ + "id": "aegaaaaabafbmai5aa2d2alwatqvahqaaaaq", + "identifier": "AUP-000007", + "name": "AUP default PASTIS", + "description": "Import d'un AUP default pour PASTIS", + "status": "ACTIVE", + "creationDate": "2000-09-01T00:00:00.000", + "lastUpdate": "2020-11-26T14:08:20.987", + "activationDate": "2016-12-10T00:00:00.000", + "deactivationDate": "2016-12-10T00:00:00.000", + "controlSchema": "{\"$schema\":\"http://json-schema.org/draft-04/schema\",\"type\":\"object\",\"additionalProperties\":false,\"definitions\":{\"pattern-simple-date\":{\"type\":\"string\",\"pattern\":\"[0-9]{4}-[0-9]{2}-[0-9]{2}\"},\"pattern-date\":{\"type\":\"string\",\"pattern\":\"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"}},\"properties\":{}}", + "tenant": 8, + "version": 1, + "fields": [ + ] +} diff --git a/api/api-pastis/pastis/src/main/resources/rng/AUP_default_PASTIS.json b/api/api-pastis/pastis/src/main/resources/rng/AUP_default_PASTIS.json new file mode 100644 index 0000000000000000000000000000000000000000..564ae47199fc65e9cd017c701cb08a4c10192480 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/AUP_default_PASTIS.json @@ -0,0 +1,19 @@ +{ + "id": "aegaaaaabafbmai5aa2d2alwatqvahqaaaaq", + "identifier": "AUP-000007", + "name": "AUP default PASTIS", + "description": "Import d'un AUP default pour PASTIS", + "status": "ACTIVE", + "creationDate": "2000-09-01T00:00:00.000", + "lastUpdate": "2020-11-26T14:08:20.987", + "activationDate": "2016-12-10T00:00:00.000", + "deactivationDate": "2016-12-10T00:00:00.000", + "controlSchema": "{\"$schema\":\"http://json-schema.org/draft-04/schema\",\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"#management\":{}},\"required\":[\"ArchiveUnitProfile\",\"DescriptionLevel\",\"Title_\"],\"definitions\":{\"pattern-simple-date\":{\"type\":\"string\",\"pattern\":\"[0-9]{4}-[0-9]{2}-[0-9]{2}\"},\"pattern-date\":{\"type\":\"string\",\"pattern\":\"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"}},\"properties\":{\"ArchiveUnitProfile\":{\"type\":\"string\",\"description\":\"Identifiant du PUA : cardinalité 1\"},\"DescriptionLevel\":{\"type\":\"string\",\"description\":\"Niveau de description : cardinalité 1\"},\"Title_\":{\"type\":\"object\",\"description\":\"Titre de la ressource : cardinalité 1-N\"}}}", + "tenant": 8, + "version": 1, + "fields": [ + "ArchiveUnitProfile", + "DescriptionLevel", + "Title" + ] +} diff --git a/api/api-pastis/pastis/src/main/resources/rng/AUP_default_PASTIS_test.json b/api/api-pastis/pastis/src/main/resources/rng/AUP_default_PASTIS_test.json new file mode 100644 index 0000000000000000000000000000000000000000..8f3e6366e557ebaf688e719fd117a31396b8dac5 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/AUP_default_PASTIS_test.json @@ -0,0 +1,19 @@ +{ + "id": "", + "tenant": 0, + "version": 0, + "activationDate": "2015-12-10T00:00:00.000", + "controlSchema": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"patternProperties\": {\n\t \"#management\":{} \n\t },\n \"required\": [\n \"ArchiveUnitProfile\",\"DescriptionLevel\",\"Title_\"\n ],\n \"definitions\": {\n \"pattern-simple-date\": {\n \"type\": \"string\",\n \"pattern\": \"[0-9]{4}-[0-9]{2}-[0-9]{2}\"\n },\n \"pattern-date\": {\n \"type\": \"string\",\n \"pattern\": \"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"\n }\n },\n \"properties\": {\n \"ArchiveUnitProfile\": {\n \"type\": \"string\",\n \"description\": \"Identifiant du PUA : cardinalité 1\"\n },\n \"DescriptionLevel\": {\n \"type\": \"string\",\n \"description\": \"Niveau de description : cardinalité 1\"\n },\n \"Title\": {\n \"type\": \"object\",\n \"description\": \"Titre de la ressource Create : cardinalité 1-N\"\n }\n }\n}", + "creationDate": "2003-10-01T00:00:00.000", + "deactivationDate": "2017-12-10T00:00:00.000", + "description": "Create PUA Test KDE 1", + "fields": [ + "ArchiveUnitProfile", + "DescriptionLevel", + "Title" + ], + "identifier": "AUP_Test_Pastis_KDE_Created_1", + "lastUpdate": "2021-11-08T13:57:18.927", + "name": "Create PUA Test KDE Name 1", + "status": "ACTIVE" +} diff --git a/api/api-pastis/pastis/src/main/resources/rng/AUP_test_long.json b/api/api-pastis/pastis/src/main/resources/rng/AUP_test_long.json new file mode 100644 index 0000000000000000000000000000000000000000..e27a4804d697a6cb15462278fafdd2e5bffb224e --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/AUP_test_long.json @@ -0,0 +1,19 @@ +{ + "id": "aegaaaaabafbmai5aa2d2alwatqvahqaaaaq", + "identifier": "AUP-000007", + "name": "AUP default PASTIS", + "description": "Import d'un AUP default pour PASTIS", + "status": "ACTIVE", + "creationDate": "2000-09-01T00:00:00.000", + "lastUpdate": "2020-11-26T14:08:20.987", + "activationDate": "2016-12-10T00:00:00.000", + "deactivationDate": "2016-12-10T00:00:00.000", + "controlSchema": "{\"$schema\":\"http://json-schema.org/draft-04/schema\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"ArchiveUnitProfile\",\"DescriptionLevel\",\"Title_\",\"OriginatingAgency\",\"StartDate\",\"EndDate\"],\"definitions\":{\"pattern-simple-date\":{\"type\":\"string\",\"pattern\":\"[0-9]{4}-[0-9]{2}-[0-9]{2}\"},\"pattern-date\":{\"type\":\"string\",\"pattern\":\"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"}},\"properties\":{\"ArchiveUnitProfile\":{\"type\":\"string\",\"description\":\"Identifiant du PUA : cardinalité 1\"},\"#management\":{\"properties\":{\"AppraisalRule\":{\"type\":\"object\",\"description\":\"DUA : cardinalité 1\",\"additionalProperties\":false,\"required\":[\"FinalAction\"],\"properties\":{\"Rules\":{\"items\":{\"properties\":{\"Rule\":{\"type\":\"string\",\"description\":\"Règle issue du référentiel des règles de gestion : cardinalité 1\"},\"StartDate\":{\"type\":\"string\",\"description\":\"Date de début du calcul : cardinalité 1\"}},\"required\":[\"Rule\",\"StartDate\"]}},\"FinalAction\":{\"type\":\"string\",\"description\":\"Sort final : cardinalité 1\"}}},\"AccessRule\":{\"type\":\"object\",\"description\":\"Communicabilité : cardinalité 0-1\",\"additionalProperties\":false,\"properties\":{\"Rules\":{\"items\":{\"properties\":{\"Rule\":{\"type\":\"string\",\"description\":\"Règle issue du référentiel des règles de gestion : cardinalité 1\"},\"StartDate\":{\"type\":\"string\",\"description\":\"Date de début du calcul : cardinalité 1\"}},\"required\":[\"Rule\",\"StartDate\"]}}}}},\"required\":[\"AppraisalRule\"]},\"DescriptionLevel\":{\"type\":\"string\",\"description\":\"Niveau de description : cardinalité 1\",\"enum\":[\"Fonds\",\"Subfonds\",\"Class\",\"Collection\",\"Series\",\"Subseries\",\"RecordGrp\",\"SubGrp\",\"File\",\"Item\",\"OtherLevel\"]},\"Title_\":{\"type\":\"object\",\"description\":\"Titre de la ressource : cardinalité 1-N\"},\"OriginatingSystemId\":{\"type\":\"array\",\"description\":\"Identifiant de la ressource par le SP : cardinalité 0-1\",\"minItems\":0,\"maxItems\":1},\"Description_\":{\"type\":\"object\",\"description\":\"Description : cardinalité 0-n\"},\"Tag\":{\"type\":\"array\",\"description\":\"Tag : cardinalité 0-N\"},\"OriginatingAgency\":{\"type\":\"object\",\"description\":\"Service producteur : cardinalité 1\",\"additionalProperties\":false,\"required\":[\"Identifier\"],\"properties\":{\"Identifier\":{\"type\":\"string\",\"description\":\"Identifiant du SP : cardinalité 1\"}}},\"Writer\":{\"description\":\"Rédacteur de la ressource : cardinalité 0-1\",\"type\":\"array\",\"minItems\":0,\"maxItems\":1,\"additionalProperties\":false,\"required\":[\"FullName\"],\"properties\":{\"FullName\":{\"type\":\"string\",\"description\":\"Nom complet : cardinalité 1\"},\"Function\":{\"type\":\"array\",\"description\":\"Fonction : cardinalité 0-N\"}}},\"CreatedDate\":{\"type\":\"string\",\"description\":\"Date de création : cardinalité 0-1\"},\"StartDate\":{\"type\":\"string\",\"description\":\"Date de début : cardinalité 1\"},\"EndDate\":{\"type\":\"string\",\"description\":\"Date de fin : cardinalité 1\"}}}", + "tenant": 8, + "version": 1, + "fields": [ + "ArchiveUnitProfile", + "DescriptionLevel", + "Title" + ] +} diff --git a/api/api-pastis/pastis/src/main/resources/rng/AUP_with_management.json b/api/api-pastis/pastis/src/main/resources/rng/AUP_with_management.json new file mode 100644 index 0000000000000000000000000000000000000000..cb989efa549e8f5cdc99a8d6cf019619b62a9bc9 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/AUP_with_management.json @@ -0,0 +1,19 @@ +{ + "id": "aegaaaaabafbmai5aa2d2alwatqvahqaaaaq", + "identifier": "AUP-000007", + "name": "AUP default PASTIS", + "description": "Import d'un AUP default pour PASTIS", + "status": "ACTIVE", + "creationDate": "2000-09-01T00:00:00.000", + "lastUpdate": "2020-11-26T14:08:20.987", + "activationDate": "2016-12-10T00:00:00.000", + "deactivationDate": "2016-12-10T00:00:00.000", + "controlSchema": "{\"$schema\":\"http://json-schema.org/draft-04/schema\",\"type\":\"object\",\"additionalProperties\":false,\"definitions\":{\"pattern-simple-date\":{\"type\":\"string\",\"pattern\":\"[0-9]{4}-[0-9]{2}-[0-9]{2}\"},\"pattern-date\":{\"type\":\"string\",\"pattern\":\"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"}},\"properties\":{\"ArchiveUnitProfile\":{\"type\":\"string\",\"description\":\"DescriptionLevel : cardinalité 0-1 / valeur au choix\"},\"#management\":{\"properties\":{\"AppraisalRule\":{\"type\":\"object\",\"description\":\"Appraisal : cardinalité 0-1 / contient obligatoirement Rule et FinalAction\",\"additionalProperties\":false,\"properties\":{\"Rules\":{\"items\":{\"properties\":{\"Rule\":{\"description\":\"Rule : cardinalité 1\",\"type\":\"string\"},\"StartDate\":{\"description\":\"StartDate : cardinalité 0-1 / valeur date libre\",\"type\":\"string\"}},\"required\":[\"StartDate\"]}},\"FinalAction\":{\"description\":\"FinalAction : cardinalité 1-1 / valeur au choix\",\"type\":\"string\"}}}}},\"DescriptionLevel\":{\"type\":\"string\",\"description\":\"DescriptionLevel : cardinalité 0-1\",\"enum\":[\"Fonds\",\"Subfonds\",\"Class\",\"Collection\",\"Series\",\"Subseries\",\"RecordGrp\",\"SubGrp\",\"File\",\"Item\",\"OtherLevel\"]},\"Title_\":{\"type\":\"object\",\"description\":\"Title : cardinalité 0-N / valeur au choix\"},\"FilePlanPosition\":{\"description\":\"FilePlanPosition : cardinalité 0-N / valeur au choix\",\"type\":\"array\"},\"Tag\":{\"description\":\"Tag : cardinalité 0-N / valeur au choix\",\"type\":\"array\"},\"Keyword\":{\"description\":\"Keyword : cardinalité 0-N / valeur au choix\",\"type\":\"array\",\"minItems\":0,\"maxItems\":1,\"additionalProperties\":false,\"properties\":{\"KeywordContent\":{\"type\":\"string\",\"description\":\"Identifier : cardinalité 1 / valeur au choix\"}}},\"OriginatingAgency\":{\"description\":\"OriginatingAgency : cardinalité 0-1 / valeur au choix\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"Identifier\":{\"description\":\"Identifier : cardinalité 1-1 / valeur au choix\",\"type\":\"string\"}}}}}", + "tenant": 8, + "version": 1, + "fields": [ + "ArchiveUnitProfile", + "DescriptionLevel", + "Title" + ] +} diff --git a/api/api-pastis/pastis/src/main/resources/rng/AUP_without_management.json b/api/api-pastis/pastis/src/main/resources/rng/AUP_without_management.json new file mode 100644 index 0000000000000000000000000000000000000000..01fef2f41ed8b5b88c400cddbd491eac7f013f50 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/AUP_without_management.json @@ -0,0 +1,19 @@ +{ + "id": "aegaaaaabafbmai5aa2d2alwatqvahqaaaaq", + "identifier": "AUP-000007", + "name": "AUP default PASTIS", + "description": "Import d'un AUP default pour PASTIS", + "status": "ACTIVE", + "creationDate": "2000-09-01T00:00:00.000", + "lastUpdate": "2020-11-26T14:08:20.987", + "activationDate": "2016-12-10T00:00:00.000", + "deactivationDate": "2016-12-10T00:00:00.000", + "controlSchema": "{\"$schema\":\"http://json-schema.org/draft-04/schema\",\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"#management\":{}},\"definitions\":{\"pattern-simple-date\":{\"type\":\"string\",\"pattern\":\"[0-9]{4}-[0-9]{2}-[0-9]{2}\"},\"pattern-date\":{\"type\":\"string\",\"pattern\":\"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"}},\"properties\":{\"ArchiveUnitProfile\":{\"type\":\"string\",\"description\":\"DescriptionLevel : cardinalité 0-1 / valeur au choix\"},\"DescriptionLevel\":{\"type\":\"string\",\"description\":\"DescriptionLevel : cardinalité 0-1\",\"enum\":[\"Fonds\",\"Subfonds\",\"Class\",\"Collection\",\"Series\",\"Subseries\",\"RecordGrp\",\"SubGrp\",\"File\",\"Item\",\"OtherLevel\"]},\"Title_\":{\"type\":\"object\",\"description\":\"Title : cardinalité 0-N / valeur au choix\"},\"FilePlanPosition\":{\"description\":\"FilePlanPosition : cardinalité 0-N / valeur au choix\",\"type\":\"array\"},\"Tag\":{\"description\":\"Tag : cardinalité 0-N / valeur au choix\",\"type\":\"array\"},\"Keyword\":{\"description\":\"Keyword : cardinalité 0-N / valeur au choix\",\"type\":\"array\",\"minItems\":0,\"maxItems\":1,\"additionalProperties\":false,\"properties\":{\"KeywordContent\":{\"type\":\"string\",\"description\":\"Identifier : cardinalité 1 / valeur au choix\"}}},\"OriginatingAgency\":{\"description\":\"OriginatingAgency : cardinalité 0-1 / valeur au choix\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"Identifier\":{\"description\":\"Identifier : cardinalité 1-1 / valeur au choix\",\"type\":\"string\"}}}}}", + "tenant": 8, + "version": 1, + "fields": [ + "ArchiveUnitProfile", + "DescriptionLevel", + "Title" + ] +} diff --git a/api/api-pastis/pastis/src/main/resources/rng/PA_UPPA_versio.rng b/api/api-pastis/pastis/src/main/resources/rng/PA_UPPA_versio.rng new file mode 100644 index 0000000000000000000000000000000000000000..e22a40d0359c37867e5fba90b16862f39aacaf81 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/PA_UPPA_versio.rng @@ -0,0 +1,834 @@ + + + + + + + + + + + + IN-UPPA-0 + + + + + + + + + + + + + + + BinaryMaster par défaut + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Séance du conseil d'administration + + + + + + + File + + + + + fra + + + + + ID-SI-prod + + + + + + + + + + + + + + + + + + fra + + + Organe délibérant + + + Conseil d'administration + + + + Date de tenue du CA + + + + + + Date de tenue du CA + + + + + + Date de tenue du CA + + + + + + + + Procurations + + + + + + + Item + + + + + fra + + + + + ID-SI-prod + + + + + Procuration + + + + + + + + + + + + Convocation-OJ + + + + + + + Item + + + + fra + + Convocation-OJ + + + + ID-SI-prod + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Feuille d'émargement-élus + + + + + + + Item + + + + fra + + Feuille émargement-élus + + + + ID-SI-prod + + + + + + + + + + + + + Feuille d'émargement-membres consultatifs + + + + + + + Item + + + + fra + + Feuille émargement-consultatifs + + + + ID-SI-prod + + + + + + + + + + + + + + Enregistrement audio + + + + + + + + + + DUA 15 ans + + APP-00015 + + + + + + Destroy + + + + + ACC-00020 + + + + + + + + + + Item + + + + fra + + Enregistrement audio + + + + ID-SI-prod + + + + + + + + + + + + + + Relevé de conclusions + + + + + + + Item + + + + fra + + Relevé de conclusions + + + + ID-SI-prod + + + + + + + + + + + + + Accusé de réception du rectorat + + + + + + + Item + + + + fra + + Accusé de réception du rectorat + + + + ID-SI-prod + + + + + + + + + + + + + + Point OJ + + + + + + + File + + + + Intitulé du point à l'OJ + + + + fra + + + + Point OJ + + + + Point n° + + + + + + + Mot-clés ordre du jour + + + + + + + + + PV CA antérieur + + + + + + + Item + + + + + fra + + + + + ID-SI-prod + + + + + + "Voté" ou "Non voté" + + + + + PV + + + + + + + + + + + + + Extrait + + + + + + + File + + + + + fra + + + + Extrait de délibération + + + + + Extrait + + + + + + + Item + + + + + fra + + + + + ID-SI-prod + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pièces annexes + + + + + + + Item + + + + + fra + + + + + ID-SI-prod + + + + + Pièce annexe + + + + + + + + + + + + + + + Pièces annexes + + + + + + + Item + + + + + fra + + + + + ID-SI-prod + + + + + Pièce annexe + + + + + + + + + + + + + Convention ou Accord international + + + + + + + + APP-00015 + + + + + + Destroy + + + + + + File + + + + + fra + + + + + ACI + + + + + Convention + + + + + + + + + + + Convention ou ACI + + + + + + + Item + + + + + fra + + + + + ID-SI-prod + + + + + + + + + + + + + + Pièces annexes + + + + + + + Item + + + + + fra + + + + + ID-SI-prod + + + + + Pièce annexe + + + + + + + + + + + + + + + + + + + + + 19640251500270 + + + 19640251500270 + + + + + DUA 15 ans + + APP-00015 + + + + + + Keep + + + + + + Librement communicable + + ACC-00001 + + + + + + + + + + 19341594000017 + + + + + 19640251500270 + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/rng/ProfilCouzCouz.rng b/api/api-pastis/pastis/src/main/resources/rng/ProfilCouzCouz.rng new file mode 100644 index 0000000000000000000000000000000000000000..c6bd8fc46425b26c545b1c107444fa86921178b0 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/ProfilCouzCouz.rng @@ -0,0 +1,148 @@ + + + + + + + + + + + + IN-UPPA-0 + + + + + + + + + + + + + + + BinaryMaster par défaut + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Séance du conseil d'administration + + + + + + + + + + + File + + + + + + + fra + + + + + + + + + + + + 19640251500270 + + + 19640251500270 + + + + + DUA 15 ans + + APP-00015 + + + + + + Keep + + + + + + Librement communicable + + ACC-00001 + + + + + + + + + + 19341594000017 + + + + + 19640251500270 + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/rng/Profil_seda_pastis_mvp.rng b/api/api-pastis/pastis/src/main/resources/rng/Profil_seda_pastis_mvp.rng new file mode 100644 index 0000000000000000000000000000000000000000..aeb8a1ee433e630ba92a3788bec4d538a606eac7 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/Profil_seda_pastis_mvp.rng @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BinaryMaster par défaut + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/rng/Profil_seda_pastis_mvp34.rng b/api/api-pastis/pastis/src/main/resources/rng/Profil_seda_pastis_mvp34.rng new file mode 100644 index 0000000000000000000000000000000000000000..aeb8a1ee433e630ba92a3788bec4d538a606eac7 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/rng/Profil_seda_pastis_mvp34.rng @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BinaryMaster par défaut + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/xsd/full.xsd b/api/api-pastis/pastis/src/main/resources/xsd/full.xsd new file mode 100644 index 0000000000000000000000000000000000000000..25093a9d1fda920e888b056c16bb7e9d55022f16 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/xsd/full.xsd @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/xsd/full_last.xsd b/api/api-pastis/pastis/src/main/resources/xsd/full_last.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5f4c2b04316f5079be29f5184b3bd150ff91bd27 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/xsd/full_last.xsd @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/xsd/full_test.xsd b/api/api-pastis/pastis/src/main/resources/xsd/full_test.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1a21bafd0c69af5ef48b2a30cfeb2f0aec11d8ad --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/xsd/full_test.xsd @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/xsd/relaxng2.xsd b/api/api-pastis/pastis/src/main/resources/xsd/relaxng2.xsd new file mode 100644 index 0000000000000000000000000000000000000000..fd7ccec3f114f23eb5b1bc0b37b33fb8380eccf6 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/xsd/relaxng2.xsd @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/xsd/rng_cines.xsd b/api/api-pastis/pastis/src/main/resources/xsd/rng_cines.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2f84b106d4f6e55b65f43afa2def83e9a6a39c12 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/xsd/rng_cines.xsd @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/api-pastis/pastis/src/main/resources/xsd/vitam.xsd b/api/api-pastis/pastis/src/main/resources/xsd/vitam.xsd new file mode 100644 index 0000000000000000000000000000000000000000..dbd0638caead6e5e6e237ba79d56988b1109e4c6 --- /dev/null +++ b/api/api-pastis/pastis/src/main/resources/xsd/vitam.xsd @@ -0,0 +1,1589 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +