Skip to content

Commit

Permalink
story #11795 feat: add schemas api
Browse files Browse the repository at this point in the history
story #11600 feat(archive-unit-viewer): simple tags
story #11618 feat(archive-unit-viewer): nested tags
story #11642 feat(archive-unit-viewer): external metadata
  • Loading branch information
Regzox committed Nov 20, 2023
1 parent f3f0058 commit fb82eda
Show file tree
Hide file tree
Showing 99 changed files with 15,346 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ customer-init:
- ROLE_TRANSFER_REQUEST
- ROLE_GET_RULES
- ROLE_TRANSFER_ACKNOWLEDGMENT
- ROLE_GET_SCHEMAS

- name: Consultation
description: Profil pour la recherche et consultation des archives dans Vitam sans mises à jour des règles, sans export DIP et sans élimination
Expand All @@ -236,17 +237,17 @@ customer-init:
- ROLE_SEARCH_WITH_RULES
- ROLE_GET_ACCESS_CONTRACTS
- ROLE_GET_RULES
- ROLE_GET_SCHEMAS

- 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

- 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 sans mises à jour des règles de gestion, avec export DIP et sans élimination
Expand All @@ -261,6 +262,7 @@ customer-init:
- ROLE_GET_ACCESS_CONTRACTS
- ROLE_UPDATE_UNIT_DESC_METADATA
- ROLE_GET_RULES
- ROLE_GET_SCHEMAS

- name: Collecte
description: Collecte de données, Application de préparation de versements
Expand Down Expand Up @@ -300,7 +302,6 @@ customer-init:
- ROLE_IMPORT_ARCHIVE_PROFILES
- ROLE_DELETE_ARCHIVE_PROFILES


#- name: profileName
# description: desc
# level: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ public TenantDto getCurrentTenantDto() {
return getTenant(getTenantIdentifier());
}

public VitamContext getVitamContext() {
return buildVitamContext(getTenantIdentifier());
}

/**
* Build Vitam Context using tenantIdentifier.
* @param tenantId
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2022)
*
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/

package fr.gouv.vitamui.referential.common.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import fr.gouv.vitam.common.model.administration.OntologyOrigin;
import fr.gouv.vitam.common.model.administration.SchemaType;
import fr.gouv.vitamui.referential.common.model.Cardinality;
import fr.gouv.vitamui.referential.common.model.Collection;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
public class ExtendedOntologyCreateDto {
@JsonProperty("Tenant") private Integer tenant;
@JsonProperty("Version") private Integer version;
@JsonProperty("Depth") private Integer depth; // TODO: Useless, easy to compute
@JsonProperty("path") private String path;
@JsonProperty("DataType") private String dataType;
@JsonProperty("DataSize") private String dataSize; // TODO: Useless, don't know how to use this
@JsonProperty("Cardinality") private Cardinality cardinality;
@JsonProperty("Identifier") private String identifier;
@JsonProperty("ShortName") private String shortName;
@JsonProperty("Description") private String description;
@JsonProperty("CreationDate") private String creationDate;
@JsonProperty("LastUpdate") private String lastUpdate;
@JsonProperty("SedaField") private String sedaField;
@JsonProperty("ApiField") private String apiField;
@JsonProperty("Type") private SchemaType type;
@JsonProperty("Origin") private OntologyOrigin origin;
@JsonProperty("Collections") private List<Collection> collections;
@JsonProperty("SedaVersions") private List<String> sedaVersions;
@JsonProperty("RootPaths") private List<String> rootPaths;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2022)
*
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/

package fr.gouv.vitamui.referential.common.dto;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;


@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class ExtendedOntologyDto extends ExtendedOntologyCreateDto {
private String id;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2022)
*
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/

package fr.gouv.vitamui.referential.common.dto;

import java.util.ArrayList;

public class SchemaDto extends ArrayList<ExtendedOntologyDto> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2022)
*
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/

package fr.gouv.vitamui.referential.common.exception;

import org.springframework.web.bind.annotation.ResponseStatus;

import static org.springframework.http.HttpStatus.BAD_REQUEST;

@ResponseStatus(value = BAD_REQUEST)
public class NoCollectionException extends Exception {
public NoCollectionException() {
super("No collection provided");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2022)
*
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/

package fr.gouv.vitamui.referential.common.model;

import java.util.Arrays;
import java.util.Objects;

public enum Cardinality {
ZERO_OR_ONE("0-1"),
ZERO_OR_MORE("0-N"),
ONE_OR_ONE("1-1"),
ONE_OR_MORE("1-N");

private final String cardinality;

Cardinality(final String cardinality) {
this.cardinality = cardinality;
}

public String getValue() {
return cardinality;
}

public boolean isMandatory() {
return this.cardinality.contains("1");
}

public boolean isMultiple() {
return this.cardinality.contains("N");
}

public static Cardinality of(final String cardinality) {
return Arrays.stream(Cardinality.values()).filter(c -> Objects.equals(c.getValue(), cardinality)).findFirst()
.orElseThrow();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2022)
*
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "https://cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/

package fr.gouv.vitamui.referential.common.model;

import java.util.Arrays;
import java.util.Objects;

public enum Collection {
ARCHIVE_UNIT("archive-unit"),
OBJECT_GROUP("object-group");

private final String type;

Collection(final String type) {
this.type = type;
}

public String getValue() {
return type;
}

public static Collection of(final String collection) {
return Arrays.stream(Collection.values()).filter(c -> Objects.equals(c.getValue(), collection)).findFirst()
.orElseThrow();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,8 @@ public RuleExternalRestClient getRuleExternalRestClient() {
public LogbookManagementOperationExternalRestClient getLogbookManagementOperationExternalRestClient() {
return new LogbookManagementOperationExternalRestClient(getRestTemplate(), getBaseUrl());
}

public SchemaClient getSchemaClient() {
return new SchemaClient(getRestTemplate(), getBaseUrl());
}
}
Loading

0 comments on commit fb82eda

Please sign in to comment.