Commit 62b1ed59 authored by marceteau's avatar marceteau
Browse files

seda1To21 formatId recupere depuis le validateur au lieu du xml

parent a1a792db
......@@ -368,12 +368,12 @@ public class Seda1ToSeda21Converter extends AbstractArchiveConverter {
manifest.setArchivalAgreement(archivalAgreement);
// Profil d'archivage
ArchivesIDType archiveProfileId = currentArchive.getArchivalProfile();
// ArchivesIDType archiveProfileId = currentArchive.getArchivalProfile();
ManagementMetadataType managementMetadata = objectFactory.createManagementMetadataType();
IdentifierType archivalProfile = objectFactory.createIdentifierType();
archivalProfile.setValue(archiveProfileId.getValue());
managementMetadata.setArchivalProfile(archivalProfile);
// IdentifierType archivalProfile = objectFactory.createIdentifierType();
// archivalProfile.setValue(archiveProfileId.getValue());
// managementMetadata.setArchivalProfile(archivalProfile);
fr.gouv.culture.archivesdefrance.seda.v2.AppraisalRuleType appraisalRule = mapAppraisalRules(currentArchive.getAppraisalRule());
......@@ -1033,12 +1033,26 @@ public class Seda1ToSeda21Converter extends AbstractArchiveConverter {
formatIdentification.setMimeType(format.getTypeMimes().get(0));
if (!format.getEncoding().equals("NA"))
formatIdentification.setEncoding(format.getEncoding());
formatIdentification.setFormatId(document.getAttachment().getFormat());
if (format.getPronomIds().size() > 0)
formatIdentification.setFormatId(format.getPronomIds().get(0));
// formatIdentification.setFormatId(document.getAttachment().getFormat());
// if(document.getAttachment().getFilename().equalsIgnoreCase("Content/" + this.archiveType)) {
// formatIdentification.setFormatId(format.getPronomIds().get(0));
// }
if ((formatIdentification.getMimeType()!= null) || (formatIdentification.getEncoding() != null)
|| (formatIdentification.getFormatId() != null) || (formatIdentification.getFormatLitteral() != null)) {
binaryDataObject.setFormatIdentification(formatIdentification);
}
if (!format.getPronomIds().get(0).equalsIgnoreCase(document.getAttachment().getFormat())
&& !document.getAttachment().getFilename().equalsIgnoreCase("Content/" + this.archiveType)) {
String warnMsg = "Le format indiqué pour le document " + document.getAttachment().getFilename()
+ " : " + document.getAttachment().getFormat() + " ne correspond pas au format trouvé par le validateur"
+ format.getPronomIds().get(0);
System.out.println(warnMsg);
// logger.warn(warnMsg);
}
}
if (!isOnlyManifest() && formatVideoList.contains(format.getName())) {
JAXBElement<String> jaxbElementEncoding =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment