Search in sources :

Example 1 with ArticleItemInput

use of org.ambraproject.rhino.model.ingest.ArticleItemInput in project rhino by PLOS.

the class HibernatePersistenceServiceImpl method persistAssets.

@Override
public void persistAssets(ArticlePackage articlePackage, ArticleIngestion ingestion) {
    List<ArticleItem> items = articlePackage.getAllItems().stream().map((ArticleItemInput item) -> contentRepoPersistenceService.createItem(item, ingestion)).collect(Collectors.toList());
    for (ArticleItem item : items) {
        hibernateTemplate.save(item);
    }
    Collection<ArticleFile> files = contentRepoPersistenceService.persistAncillaryFiles(articlePackage, ingestion);
    for (ArticleFile file : files) {
        hibernateTemplate.save(file);
    }
    persistStrikingImage(ingestion, items, articlePackage.getManifest());
}
Also used : ArticleItem(org.ambraproject.rhino.model.ArticleItem) ArticleFile(org.ambraproject.rhino.model.ArticleFile) ArticleItemInput(org.ambraproject.rhino.model.ingest.ArticleItemInput)

Aggregations

ArticleFile (org.ambraproject.rhino.model.ArticleFile)1 ArticleItem (org.ambraproject.rhino.model.ArticleItem)1 ArticleItemInput (org.ambraproject.rhino.model.ingest.ArticleItemInput)1