public static Ancestor year(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR); }
private Ancestor year(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR); }
public static Ancestor journal(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL); }
private Ancestor volume(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME); }
private Ancestor journal(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL); }
private Ancestor issue(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE); }
private String _getAncestorId(Ancestors ancestors, String levelId){ Ancestor ancestor = ancestors.getAncestorAtLevel(levelId); if(ancestor==null) return ""; else return ancestor.getExtid(); }
@Override public String evaluate(Ancestors ancestors, HierarchyLevelLabelSource levelLabels) { Ancestor ancestor = ancestors.getAncestorAtLevel(levelId); return ancestor==null ? "" : evaluate(ancestor, levelLabels); }
private String _getPublisherName(Ancestors ancestors, String publisherLevelId){ Ancestor publisher = ancestors.getAncestorAtLevel(publisherLevelId); if(publisher != null) return publisher.getDefaultNameText(); else return ""; }
private String journalTitle(ElementAncestors<YElement> yElemAncest) { final Ancestors ancestors = yElemAncest.getAncestors(); final Ancestor journal = ancestors.getAncestorAtLevel(YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL); return journal != null ? yElemToCitationDataCnv.prepareYNameText(journal.getDefaultName()) : ""; }
private void addJournalTitleAndIds(CitationCommonData citationData, CSLItemDataBuilder builder, Ancestors ancestors) { Ancestor journal = ancestors.getAncestorAtLevel(YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL); if(journal != null) { builder.containerTitle(textFromYName(journal.getDefaultName())); addIds(citationData, builder, journal); } }
private void addVolumeAndNumber(CSLItemDataBuilder builder, Ancestors ancestors) { Ancestor journalVolume = ancestors.getAncestorAtLevel(YaddaIdConstants.ID_LEVEL_JOURNAL_VOLUME); String volume = ""; if(journalVolume != null) { volume = textFromYName(journalVolume.getDefaultName()); } Ancestor journalNumber = ancestors.getAncestorAtLevel(YaddaIdConstants.ID_LEVEL_JOURNAL_NUMBER); String number = ""; if(journalNumber != null) { number = textFromYName(journalNumber.getDefaultName()); } IssueUtils.VolumeNumber volumeNumber = IssueUtils.parseVolumeIfNumberEmpty(volume, number); builder.volume(volumeNumber.volume); builder.issue(volumeNumber.number); }
private void addDateFromJournalYearAncest(ElementAncestors<YElement> elemAncest, CSLDateBuilder dateBuilder) { Ancestors ancestors = elemAncest.getAncestors(); Ancestor journalYear = ancestors.getAncestorAtLevel(YaddaIdConstants.ID_LEVEL_JOURNAL_YEAR); if (journalYear != null) { dateBuilder.raw(textFromYName(journalYear.getDefaultName())); } }
private ElementAncestors<YElement> setJournalIdsInOrigSequence(ElementAncestors<YElement> yElemAncest) throws ModelDataSourceException { Ancestor journal = yElemAncest.getAncestors().getAncestorAtLevel(YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL); if (journal != null) { YElement journalYElem= dataSourcesFactory.getYCatalogDataSource().getElementById(journal.getExtid()); // Keep ids original order, it decides on citation styling @see YElemToCSLItemConverter LinkedHashMap<String, String> idsSorted = new LinkedHashMap<>(); for (YId yId : journalYElem.getIds()) { idsSorted.put(yId.getScheme(), yId.getValue()); } journal.setAdditionalIdentifiers(idsSorted); } return yElemAncest; }
@Override public AncestorsViewObject getParentJournalForIssue(String issueReferenceId) { AncestorsViewObject result = new AncestorsViewObject(); try { final ElementAncestors<YElement> elementWithAncestors = elementRepository.getElementWithAncestors(issueReferenceId); final Ancestors ancestors = elementWithAncestors.getAncestors(); final Ancestor journal = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_JOURNAL); if (journal != null) { result.setJournal(new BasicElementInfo(journal.getExtid(), journal.getDefaultNameText())); } } catch (RepositoryException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } return result; }
final ElementAncestors<YElement> elementWithAncestors = elementRepository.getElementWithAncestors(articleId); final Ancestors ancestors = elementWithAncestors.getAncestors(); final Ancestor journal = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_JOURNAL); if (journal != null) { final Ancestor year = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_YEAR); final Ancestor volume = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_VOLUME); final Ancestor number = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_ISSUE); if (year != null || volume != null || number != null) {
final ElementAncestors<YElement> elementWithAncestors = elementRepository.getElementWithAncestors(parentIssueReferenceId); final Ancestors ancestors = elementWithAncestors.getAncestors(); final Ancestor journal = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_JOURNAL); if (journal != null) { final Ancestor year = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_YEAR); final Ancestor volume = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_VOLUME); final Ancestor number = ancestors.getAncestorAtLevel(HierarchyWithLevelIds .EXT_LEVEL_JOURNAL_ISSUE); if (year != null || volume != null || number != null) {