-
Notifications
You must be signed in to change notification settings - Fork 10
UPDATE sedalib: Saphir team adaptations to Sedalib to address missing elements #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert les changements de formatage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,7 +182,7 @@ public void setArchivalAgreement(String archivalAgreement) { | |
| * | ||
| * @param archiveUnitID the archive unit ID | ||
| * @return the archive unit | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the DataObjectPackage | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the DataObjectPackage | ||
| */ | ||
| public ArchiveUnit createRootArchiveUnit(String archiveUnitID) throws SEDALibException { | ||
| ArchiveUnit au; | ||
|
|
@@ -203,7 +203,7 @@ public ArchiveUnit createRootArchiveUnit(String archiveUnitID) throws SEDALibExc | |
| * @param title the title | ||
| * @param description the description | ||
| * @return the archive unit | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the SIP | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the SIP | ||
| */ | ||
| public ArchiveUnit createRootArchiveUnit(String archiveUnitID, String descriptionLevel, String title, | ||
| String description) throws SEDALibException { | ||
|
|
@@ -222,14 +222,40 @@ public ArchiveUnit createRootArchiveUnit(String archiveUnitID, String descriptio | |
| return au; | ||
| } | ||
|
|
||
| /** | ||
| * Creates a root archive unit in the SIP. | ||
| * Nouvelle signature de la méthode pour descriptionLevel et title uniquement | ||
| * et éviter la géneration de la balise <Description></Description> vide. | ||
|
Comment on lines
+226
to
+228
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Écrire le tout en anglais |
||
| * | ||
| * @param archiveUnitID the archive unit ID | ||
| * @param descriptionLevel the description level | ||
| * @param title the title | ||
| * @return the archive unit | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the SIP | ||
| */ | ||
| public ArchiveUnit createRootArchiveUnit(String archiveUnitID, String descriptionLevel, String title) throws SEDALibException { | ||
| ArchiveUnit au = createRootArchiveUnit(archiveUnitID); | ||
|
|
||
| Content c = new Content(); | ||
| try { | ||
| c.addNewMetadata("DescriptionLevel", descriptionLevel); | ||
| c.addNewMetadata("Title", title); | ||
| } catch (SEDALibException ignored) { | ||
| // ignored | ||
| } | ||
| au.setContent(c); | ||
|
|
||
| return au; | ||
| } | ||
|
|
||
| /** | ||
| * Creates a root archive unit in the SIP which is in fact an existing archive unit in the archiving system. | ||
| * This archive unit is defined by its uniq systemId. | ||
| * | ||
| * @param archiveUnitID the archive unit ID | ||
| * @param systemId the system id | ||
| * @return the archive unit | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the SIP | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the SIP | ||
| */ | ||
| public ArchiveUnit createSystemExistingRootArchiveUnit(String archiveUnitID, String systemId) | ||
| throws SEDALibException { | ||
|
|
@@ -255,7 +281,7 @@ public ArchiveUnit createSystemExistingRootArchiveUnit(String archiveUnitID, Str | |
| * @param descriptionLevel the description level | ||
| * @param title the title | ||
| * @return the archive unit | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the SIP | ||
| * @throws SEDALibException when the ArchiveUnit has a defined UniqId which is already in the SIP | ||
| */ | ||
| public ArchiveUnit createSystemExistingRootArchiveUnit(String archiveUnitID, String metadataName, | ||
| String metadataValue, String descriptionLevel, String title) throws SEDALibException { | ||
|
|
@@ -302,7 +328,7 @@ public ArchiveUnit addSubArchiveUnit(String archiveUnitID, String childArchiveUn | |
| * @param title the title | ||
| * @param description the description | ||
| * @return the archive unit | ||
| * @throws SEDALibException if no identified ArchiveUnit, or when there is already an ArchiveUnit with the same UniqID | ||
| * @throws SEDALibException if no identified ArchiveUnit, or when there is already an ArchiveUnit with the same UniqID | ||
| */ | ||
| public ArchiveUnit addNewSubArchiveUnit(String archiveUnitID, String childArchiveUnitID, String descriptionLevel, | ||
| String title, String description) throws SEDALibException { | ||
|
|
@@ -321,7 +347,7 @@ public ArchiveUnit addNewSubArchiveUnit(String archiveUnitID, String childArchiv | |
| au.setContent(c); | ||
| parentAU.addChildArchiveUnit(au); | ||
| doProgressLogWithoutInterruption(sedaLibProgressLogger, SEDALibProgressLogger.OBJECTS, | ||
| "sedalib: création d'une sous ArchiveUnit [" + childArchiveUnitID + "] de [" + archiveUnitID + "]",null); | ||
| "sedalib: création d'une sous ArchiveUnit [" + childArchiveUnitID + "] de [" + archiveUnitID + "]", null); | ||
| return au; | ||
| } | ||
|
|
||
|
|
@@ -330,7 +356,7 @@ public ArchiveUnit addNewSubArchiveUnit(String archiveUnitID, String childArchiv | |
| * | ||
| * @param archiveUnitID the archive unit ID | ||
| * @param fromArchiveUnitID the from archive unit ID | ||
| * @throws SEDALibException if no identified ArchiveUnit | ||
| * @throws SEDALibException if no identified ArchiveUnit | ||
| */ | ||
| public void addArchiveUnitSubTree(String archiveUnitID, String fromArchiveUnitID) throws SEDALibException { | ||
| ArchiveUnit parentAU = archiveTransfer.getDataObjectPackage().getArchiveUnitById(archiveUnitID); | ||
|
|
@@ -355,7 +381,7 @@ public void addArchiveUnitSubTree(String archiveUnitID, String fromArchiveUnitID | |
| * @param title the title | ||
| * @param description the description | ||
| * @return the archive unit | ||
| * @throws SEDALibException if no identified ArchiveUnit, file access problem , or when there is already an ArchiveUnit with the same UniqID | ||
| * @throws SEDALibException if no identified ArchiveUnit, file access problem , or when there is already an ArchiveUnit with the same UniqID | ||
| */ | ||
| public ArchiveUnit addFileSubArchiveUnit(String archiveUnitID, String onDiskPath, String childArchiveUnitID, | ||
| String descriptionLevel, String title, String description) throws SEDALibException { | ||
|
|
@@ -390,11 +416,11 @@ public ArchiveUnit addFileSubArchiveUnit(String archiveUnitID, String onDiskPath | |
| * @param archiveUnitID the archive unit ID | ||
| * @param onDiskPathString the on disk path string | ||
| * @param ignorePatterString the ignore patter string | ||
| * @throws SEDALibException if no identified ArchiveUnit | ||
| * @throws SEDALibException if no identified ArchiveUnit | ||
| */ | ||
| public void addDiskSubTree(String archiveUnitID, String onDiskPathString, String... ignorePatterString) | ||
| throws SEDALibException { | ||
| addDiskSubTree(archiveUnitID,onDiskPathString,false,null,ignorePatterString); | ||
| addDiskSubTree(archiveUnitID, onDiskPathString, false, null, ignorePatterString); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -411,18 +437,18 @@ public void addDiskSubTree(String archiveUnitID, String onDiskPathString, String | |
| * @param noLinkFlag the no link flag | ||
| * @param extractTitleFromFileNameFunction the extract title from file name function | ||
| * @param ignorePatterString the ignore patter string | ||
| * @throws SEDALibException if no identified ArchiveUnit | ||
| * @throws SEDALibException if no identified ArchiveUnit | ||
| */ | ||
| public void addDiskSubTree(String archiveUnitID, String onDiskPathString, boolean noLinkFlag, | ||
| Function<String,String> extractTitleFromFileNameFunction, | ||
| Function<String, String> extractTitleFromFileNameFunction, | ||
| String... ignorePatterString) | ||
| throws SEDALibException { | ||
|
|
||
| ArchiveUnit parentAU = archiveTransfer.getDataObjectPackage().getArchiveUnitById(archiveUnitID); | ||
| if (parentAU == null) | ||
| throw new SEDALibException("Pas d'ArchiveUnit avec l'identifiant [" + archiveUnitID + "]"); | ||
| DiskToDataObjectPackageImporter di = new DiskToDataObjectPackageImporter(onDiskPathString, noLinkFlag, | ||
| extractTitleFromFileNameFunction,sedaLibProgressLogger); | ||
| extractTitleFromFileNameFunction, sedaLibProgressLogger); | ||
|
|
||
| for (String ip : ignorePatterString) | ||
| di.addIgnorePattern(ip); | ||
|
|
@@ -443,7 +469,7 @@ public void addDiskSubTree(String archiveUnitID, String onDiskPathString, boolea | |
| * @param encoding the encoding | ||
| * @param separator the separator | ||
| * @param onDiskPathString the on disk path string | ||
| * @throws SEDALibException if no identified ArchiveUnit | ||
| * @throws SEDALibException if no identified ArchiveUnit | ||
| */ | ||
| public void addCSVMetadataSubTree(String archiveUnitID, String encoding, char separator, String onDiskPathString) | ||
| throws SEDALibException { | ||
|
|
@@ -468,7 +494,7 @@ public void addCSVMetadataSubTree(String archiveUnitID, String encoding, char se | |
| * @param archiveUnitID the ArchiveUnit id | ||
| * @param onDiskPathString the file path string | ||
| * @param usageVersion the usageVersion metadata in "usage_version" format | ||
| * @throws SEDALibException if no identified ArchiveUnit or file acces problem | ||
| * @throws SEDALibException if no identified ArchiveUnit or file acces problem | ||
| */ | ||
| public void addFileToArchiveUnit(String archiveUnitID, String onDiskPathString, String usageVersion) throws SEDALibException { | ||
| ArchiveUnit au = archiveTransfer.getDataObjectPackage().getArchiveUnitById(archiveUnitID); | ||
|
|
@@ -682,7 +708,7 @@ public void sedaSchemaValidate() throws SEDALibException { | |
| */ | ||
| public void sedaProfileValidate(String profileFileName) throws SEDALibException { | ||
| try { | ||
| archiveTransfer.sedaProfileValidate(profileFileName,sedaLibProgressLogger); | ||
| archiveTransfer.sedaProfileValidate(profileFileName, sedaLibProgressLogger); | ||
| } catch (InterruptedException e) { | ||
| Thread.currentThread().interrupt(); | ||
| } | ||
|
|
@@ -709,7 +735,7 @@ private void verifyContext() throws SEDALibException { | |
| /** | ||
| * Generate SIP. | ||
| * | ||
| * @throws SEDALibException the SEDA lib exception | ||
| * @throws SEDALibException the SEDA lib exception | ||
| */ | ||
| public void generateSIP() throws SEDALibException { | ||
| generateSIP(false, false); | ||
|
|
@@ -720,7 +746,7 @@ public void generateSIP() throws SEDALibException { | |
| * | ||
| * @param hierarchicalArchiveUnitsFlag the hierarchical archive units flag | ||
| * @param indentedFlag the indented flag | ||
| * @throws SEDALibException the SEDA lib exception | ||
| * @throws SEDALibException the SEDA lib exception | ||
| */ | ||
| public void generateSIP(boolean hierarchicalArchiveUnitsFlag, boolean indentedFlag) throws SEDALibException { | ||
| doProgressLogWithoutInterruption(sedaLibProgressLogger, SEDALibProgressLogger.GLOBAL, "sedalib: lancement de la génération du SIP", null); | ||
|
|
@@ -742,7 +768,7 @@ public void generateSIP(boolean hierarchicalArchiveUnitsFlag, boolean indentedFl | |
| Thread.currentThread().interrupt(); | ||
| } | ||
| doProgressLogWithoutInterruption(sedaLibProgressLogger, SEDALibProgressLogger.GLOBAL, "sedalib: fichier sauvegardé (" + SEDALibProgressLogger.readableFileSize(new File(sipPathString).length()) | ||
| + ")", null); | ||
| + ")", null); | ||
| } | ||
|
|
||
| /* | ||
|
|
||
91 changes: 91 additions & 0 deletions
91
sedalib/src/main/java/fr/gouv/vitam/tools/sedalib/metadata/content/ContentSaphir.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| /** | ||
| * Copyright French Prime minister Office/DINSIC/Vitam Program (2015-2019) | ||
| * <p> | ||
| * contact.vitam@programmevitam.fr | ||
| * <p> | ||
| * This software is developed as a validation helper tool, for constructing Submission Information Packages (archives | ||
| * sets) in the Vitam program whose purpose is to implement a digital archiving back-office system managing high | ||
| * volumetry securely and efficiently. | ||
| * <p> | ||
| * 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 archiveDeliveryRequestReply the following URL "http://www.cecill.info". | ||
| * <p> | ||
| * As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, | ||
| * users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the | ||
| * successive licensors have only limited liability. | ||
| * <p> | ||
| * In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or | ||
| * developing or reproducing the software by the user in light of its specific status of free software, that may mean | ||
| * that it is complicated to manipulate, and that also therefore means that it is reserved for developers and | ||
| * experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the | ||
| * software's suitability as regards their requirements in conditions enabling the security of their systems and/or data | ||
| * to be ensured and, more generally, to use and operate it in the same conditions as regards security. | ||
| * <p> | ||
| * The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you | ||
| * accept its terms. | ||
| */ | ||
| package fr.gouv.vitam.tools.sedalib.metadata.content; | ||
|
|
||
| import fr.gouv.vitam.tools.sedalib.metadata.namedtype.ComplexListMetadataKind; | ||
| import fr.gouv.vitam.tools.sedalib.metadata.namedtype.StringType; | ||
|
|
||
| /** | ||
| * The Class ContentSaphir. | ||
| * <p> | ||
| * Class for SEDA element Content. | ||
| * <p> | ||
| * A ArchiveUnit metadata. | ||
| * <p> | ||
| * Standard quote: "Métadonnées de description associées à un ArchiveUnit" | ||
| */ | ||
| public class ContentSaphir extends Content { | ||
|
|
||
|
|
||
| static { | ||
|
|
||
|
|
||
| metadataMap.put("CreatedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap.put("TransactedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap.put("AcquiredDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap.put("SentDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap.put("ReceivedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap.put("RegisteredDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap.put("StartDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap.put("EndDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| } | ||
|
|
||
|
|
||
| static { | ||
|
|
||
| metadataMap_v2.put("CreatedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v2.put("TransactedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v2.put("AcquiredDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v2.put("SentDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v2.put("ReceivedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v2.put("RegisteredDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v2.put("StartDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v2.put("EndDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| } | ||
|
|
||
| static { | ||
|
|
||
| metadataMap_v3.put("CreatedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v3.put("TransactedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v3.put("AcquiredDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v3.put("SentDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v3.put("ReceivedDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v3.put("RegisteredDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v3.put("StartDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| metadataMap_v3.put("EndDate", new ComplexListMetadataKind(StringType.class, false)); | ||
| } | ||
|
|
||
| /** | ||
| * Instantiates a new ContentSaphir. | ||
| */ | ||
| public ContentSaphir() { | ||
| super(); | ||
| } | ||
|
|
||
|
|
||
| } |
68 changes: 68 additions & 0 deletions
68
sedalib/src/main/java/fr/gouv/vitam/tools/sedalib/metadata/content/EventSaphir.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /** | ||
| * Copyright French Prime minister Office/DINSIC/Vitam Program (2015-2019) | ||
| * <p> | ||
| * contact.vitam@programmevitam.fr | ||
| * <p> | ||
| * This software is developed as a validation helper tool, for constructing Submission Information Packages (archives | ||
| * sets) in the Vitam program whose purpose is to implement a digital archiving back-office system managing high | ||
| * volumetry securely and efficiently. | ||
| * <p> | ||
| * 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 archiveDeliveryRequestReply the following URL "http://www.cecill.info". | ||
| * <p> | ||
| * As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, | ||
| * users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the | ||
| * successive licensors have only limited liability. | ||
| * <p> | ||
| * In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or | ||
| * developing or reproducing the software by the user in light of its specific status of free software, that may mean | ||
| * that it is complicated to manipulate, and that also therefore means that it is reserved for developers and | ||
| * experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the | ||
| * software's suitability as regards their requirements in conditions enabling the security of their systems and/or data | ||
| * to be ensured and, more generally, to use and operate it in the same conditions as regards security. | ||
| * <p> | ||
| * The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you | ||
| * accept its terms. | ||
| */ | ||
| package fr.gouv.vitam.tools.sedalib.metadata.content; | ||
|
|
||
| import fr.gouv.vitam.tools.sedalib.metadata.namedtype.ComplexListMetadataKind; | ||
| import fr.gouv.vitam.tools.sedalib.metadata.namedtype.StringType; | ||
|
|
||
| /** | ||
| * The Class EventSaphir. | ||
| * <p> | ||
| * Class for SEDA element Event. | ||
| * <p> | ||
| * An Event metadata. | ||
| * <p> | ||
| * Standard quote: "Informations décrivant un événement survenu au cours d’une | ||
| * procédure (ex. publication d’un marché, notification d’un marché, recueil | ||
| * d’un avis administratif, etc.)." | ||
| */ | ||
| public class EventSaphir extends Event { | ||
|
|
||
|
|
||
| static { | ||
|
|
||
|
|
||
| metadataMap_default.put("EventDateTime", new ComplexListMetadataKind(StringType.class, false)); | ||
|
|
||
| } | ||
|
|
||
|
|
||
| static { | ||
|
|
||
| metadataMap_v2.put("EventDateTime", new ComplexListMetadataKind(StringType.class, false)); | ||
|
|
||
| } | ||
|
|
||
| /** | ||
| * Instantiates a new EventSaphir. | ||
| */ | ||
| public EventSaphir() { | ||
| super(); | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatage inconsistant (manque un espace après la virgule)