use of org.ambraproject.rhino.model.ingest.IngestPackage in project rhino by PLOS.
the class IngestionService method createIngestPackage.
private IngestPackage createIngestPackage(Archive archive, Optional<String> bucketName) throws IOException {
ManifestXml manifestXml = getManifestXml(archive);
ImmutableSet<String> entryNames = archive.getEntryNames();
manifestXml.validateManifestCompleteness(entryNames);
String manuscriptEntry = getManuscriptEntry(entryNames, manifestXml);
Document document = getDocument(archive, manuscriptEntry);
ArticleXml parsedArticle = new ArticleXml(document);
ArticleCustomMetadata customMetadata = customMetadataExtractorFactory.parse(document).build();
ArticlePackage articlePackage = new ArticlePackageBuilder(resolveBucketName(bucketName), archive, parsedArticle, manifestXml).build();
articlePackage.validateAssetCompleteness(parsedArticle.findAllAssetNodes().getDois());
ArticleMetadata articleMetadata = parsedArticle.build();
return new IngestPackage(articlePackage, articleMetadata, customMetadata);
}
Aggregations