use of org.ambraproject.rhino.view.article.CategoryAssignmentView in project rhino by PLOS.
the class ArticleCrudServiceImpl method serveCategories.
/**
* {@inheritDoc}
*
* @param articleId
*/
@Override
public ServiceResponse<Collection<CategoryAssignmentView>> serveCategories(final ArticleIdentifier articleId) throws IOException {
Article article = readArticle(articleId);
Collection<ArticleCategoryAssignment> categoryAssignments = taxonomyService.getAssignmentsForArticle(article);
Collection<CategoryAssignmentView> views = categoryAssignments.stream().map(CategoryAssignmentView::new).collect(Collectors.toList());
return ServiceResponse.serveView(views);
}
Aggregations