Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public void incTouchedInDataObjectPackageId(String inDataObjectPackageId) {
* not touched
*/
public Integer getTouchedInDataObjectPackageId(String inDataObjectPackageId) {
return touchedInDataObjectPackageIdMap.get(inDataObjectPackageId);
return touchedInDataObjectPackageIdMap.getOrDefault(inDataObjectPackageId,0);
Copy link
Contributor

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)

}

/**
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert les changements de formatage

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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;
}

Expand All @@ -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);
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -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);
Expand All @@ -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 {
Expand All @@ -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);
Expand Down Expand Up @@ -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();
}
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
}

/*
Expand Down
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();
}


}
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();
}

}
Loading