private String name(Ancestor ancestor) { return ancestor==null ? null : ancestor.getDefaultNameText(); }
private String _getPublisherName(Ancestors ancestors, String publisherLevelId){ Ancestor publisher = ancestors.getAncestorAtLevel(publisherLevelId); if(publisher != null) return publisher.getDefaultNameText(); else return ""; }
private String evaluate(Ancestor ancestor, HierarchyLevelLabelSource levelLabels) { switch (property) { case LEVEL_NAME: return levelLabels.getLabelForLevel(levelId); case ELEMENT_NAME: return ancestor.getDefaultNameText(); } return ""; }
@Override public void process(final SElement sel, final Ancestor ref) { if (sel.getPublishDate() == null) { final String n = ref.getDefaultNameText(); if (n.matches("[0-9]{4}")) { final int i = Integer.parseInt(n); final Calendar c = new GregorianCalendar(i, 1, 1); sel.setPublishDate(new SDate(c.getTime(), Precision.YEAR)); } else { log.warn( "Year does not match required regexp. Cannot use it to generate publication date (year name='{}', element id='{}')", n, ref.getExtid()); } } } }
private void processJournalAncestors(final DocMetadata metadata, final List<Ancestor> ancestors) { if (ancestors == null || ancestors.isEmpty()) { return; } metadata.setType(Type.ARTICLE); for (final Ancestor ancestor : ancestors) { final String levelExtId = ancestor.getLevelExtid(); final String name = ancestor.getDefaultNameText(); if (YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL.equals(levelExtId)) { metadata.setJournal(name); } if (YaddaIdConstants.ID_LEVEL_JOURNAL_NUMBER.equals(levelExtId)) { metadata.setNumber(name); } if (YaddaIdConstants.ID_LEVEL_JOURNAL_PUBLISHER.equals(levelExtId)) { metadata.setPublisher(name); } if (YaddaIdConstants.ID_LEVEL_JOURNAL_SERIES.equals(levelExtId)) { metadata.setSeries(name); } if (YaddaIdConstants.ID_LEVEL_JOURNAL_VOLUME.equals(levelExtId)) { metadata.setVolume(name); } if (YaddaIdConstants.ID_LEVEL_JOURNAL_YEAR.equals(levelExtId)) { metadata.setYear(name); } } }
@Override public void process(final SElement sel, final Ancestor ref) { final SJournalDescendantInfo jdi = new SJournalDescendantInfo(); jdi.setJournalName(ref.getDefaultNameText()); jdi.addJournalOtherNames(ref.getAdditionalNames()); jdi.setJournalExtId(ref.getExtid()); sel.addInfo(jdi); sel.addAncestorName(ref.getDefaultNameText()); final Map<String, String> ids = ref.getAdditionalIdentifiers(); if (ids != null) { sel.addIssn(ids.get(YaddaIdConstants.IDENTIFIER_CLASS_ISSN)); sel.addIssn(ids.get(YaddaIdConstants.IDENTIFIER_CLASS_EISSN)); } } }
@Override public void process(final SElement sel, final Ancestor ref) { if (sel.getLevels() != null && sel.getLevels().contains(YaddaIdConstants.ID_LEVEL_JOURNAL_PUBLISHER)) { final SBookInfo bookInfo = new SBookInfo(); bookInfo.setPublisherName(ref.getDefaultNameText()); bookInfo.setPublisherExtId(ref.getExtid()); sel.addInfo(bookInfo); sel.addAncestorName(bookInfo.getPublisherName()); } } }
@Override public void process(final SElement sel, final Ancestor ref) { if (sel.getLevels() != null && sel.getLevels().contains(YaddaIdConstants.ID_LEVEL_BOOK_BOOK)) { final SBookInfo bookInfo = new SBookInfo(); bookInfo.setPublisherName(ref.getDefaultNameText()); bookInfo.setPublisherExtId(ref.getExtid()); sel.addInfo(bookInfo); sel.addAncestorName(bookInfo.getPublisherName()); } } }
@Override public void process(final SElement sel, final Ancestor ref) { if (sel.getLevels() != null && sel.getLevels().contains(YaddaIdConstants.ID_LEVEL_SCIENTIFIC_WORK)) { final SScientificEntityInfo seInfo = new SScientificEntityInfo(); seInfo.setEntityExtId(ref.getExtid()); seInfo.setEntityName(ref.getDefaultNameText()); sel.addInfo(seInfo); sel.addAncestorName(seInfo.getEntityName()); } } }
@Override public void process(final SElement sel, final Ancestor ref) { if (sel.getLevels() != null && sel.getLevels().contains(YaddaIdConstants.ID_LEVEL_SCIENTIFIC_WORK)) { final SScientificInstitutionInfo siInfo = new SScientificInstitutionInfo(); siInfo.setInstitutionExtId(ref.getExtid()); siInfo.setInstitutionName(ref.getDefaultNameText()); sel.addInfo(siInfo); sel.addAncestorName(siInfo.getInstitutionName()); } } }
throw new PolindexException(ErrorCode.ANCESTORS_HINT_WITHOUT_YEAR); IntRange yearRange = yearExtractor.extractYearRange( year.getDefaultNameText() ); if (yearRange == null) { throw new PolindexException(ErrorCode.INVALID_YEAR, journal.getDefaultNameText()); result.setJournalTitle( journal.getDefaultNameText() ); result.setJournalIssn( issn(journal) ); result.setJournalEissn( eissn(journal) ); String yearName = year.getDefaultNameText(); result.setYear( yearName, yearExtractor.extractYearRangeAsString(yearName) );
.equals(ancestor.getLevelExtid())) { addValue(IndexFields.F_JOURNAL_NAME, ancestor.getDefaultNameText(), values); addValue(IndexFields.F_SIM_HIERARCHY_DUMP_NAME_PREFIX + ancestor.getLevelExtid(), ancestor.getDefaultNameText(), values);
@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 String extid = ancestor.getExtid(); final String levelExtid = ancestor.getLevelExtid(); final String name = ancestor.getDefaultNameText();
if (journal != null) { result.setJournal(new BasicElementInfo(journal.getExtid(), journal.getDefaultNameText())); JournalIssue issue = new JournalIssue(); if (year != null) { issue.getYear().setName(year.getDefaultNameText()); issue.getYear().setId(year.getExtid()); issue.getVolume().setName(volume.getDefaultNameText()); issue.getVolume().setId(volume.getExtid()); issue.getNumber().setName(number.getDefaultNameText()); issue.getNumber().setId(number.getExtid());
if (journal != null) { result.setJournal(new BasicElementInfo(journal.getExtid(), journal.getDefaultNameText())); JournalIssue issue = new JournalIssue(); if (year != null) { issue.getYear().setName(year.getDefaultNameText()); issue.getYear().setId(year.getExtid()); issue.getVolume().setName(volume.getDefaultNameText()); issue.getVolume().setId(volume.getExtid()); issue.getNumber().setName(number.getDefaultNameText()); issue.getNumber().setId(number.getExtid());