use of de.undercouch.citeproc.csl.CSLItemData in project ORCID-Source by ORCID.
the class WorkToCiteprocTranslatorTest method testBibtexWorkTranslationHyperAuthorNoAbrev.
@Test
public void testBibtexWorkTranslationHyperAuthorNoAbrev() {
Work w = makeWork(bibtexHyper);
WorkToCiteprocTranslator t = new WorkToCiteprocTranslator();
CSLItemData d = t.toCiteproc(w, null, false);
Assert.assertEquals(d.getAuthor().length, 2932);
}
use of de.undercouch.citeproc.csl.CSLItemData in project ORCID-Source by ORCID.
the class PublicV2ApiServiceDelegatorImpl method viewWorkCitation.
@Override
public Response viewWorkCitation(String orcid, Long putCode) {
Work w = (Work) this.viewWork(orcid, putCode).getEntity();
ProfileEntity entity = profileEntityManagerReadOnly.findByOrcid(orcid);
String creditName = null;
RecordNameEntity recordNameEntity = entity.getRecordNameEntity();
if (recordNameEntity != null) {
if (!recordNameEntity.getVisibility().isMoreRestrictiveThan(Visibility.PUBLIC)) {
creditName = recordNameEntity.getCreditName();
if (StringUtils.isBlank(creditName)) {
creditName = recordNameEntity.getGivenNames();
String familyName = recordNameEntity.getFamilyName();
if (StringUtils.isNotBlank(familyName)) {
creditName += " " + familyName;
}
}
}
}
WorkToCiteprocTranslator tran = new WorkToCiteprocTranslator();
CSLItemData item = tran.toCiteproc(w, creditName, true);
return Response.ok(item).build();
}
Aggregations