use of org.nextprot.api.core.domain.publication.PublicationCategory in project nextprot-api by calipho-sib.
the class EntryPublicationViewServiceImpl method buildEntryPublicationView.
@Override
public List<EntryPublicationView> buildEntryPublicationView(String entryAccession, PublicationCategory publicationCategory) {
EntryPublications entryPublications = entryPublicationService.findEntryPublications(entryAccession);
List<EntryPublicationView> list = new ArrayList<>();
Map<Long, EntryPublication> entryPublicationMap = entryPublications.getEntryPublicationList(publicationCategory).stream().collect(Collectors.toMap(EntryPublication::getPubId, Function.identity(), (entryPublication, entryPublication2) -> entryPublication));
List<Publication> publications = publicationService.findPublicationsByEntryName(entryPublications.getEntryAccession());
for (Publication publication : publications) {
if (entryPublicationMap.containsKey(publication.getPublicationId())) {
EntryPublicationView view = new EntryPublicationView();
EntryPublication entryPublication = entryPublicationMap.get(publication.getPublicationId());
view.setCitedInViews(entryPublication.getCitedInViews());
view.setDirectLinks(entryPublication.getDirectLinks());
view.setPublication(publication);
list.add(view);
}
}
return list;
}
Aggregations