private String _getPublisherName(Ancestors ancestors, String publisherLevelId){ Ancestor publisher = ancestors.getAncestorAtLevel(publisherLevelId); if(publisher != null) return publisher.getDefaultNameText(); else return ""; }
private String _getAncestorId(Ancestors ancestors, String levelId){ Ancestor ancestor = ancestors.getAncestorAtLevel(levelId); if(ancestor==null) return ""; else return ancestor.getExtid(); }
public static Ancestor journal(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL); }
private ElementTitlePart findTitlePart(Ancestors ancestors) { for (String hierarchyId : ancestors.getHierarchies()) { Ancestor ancestor = ancestors.getCurrentInHierarchy(hierarchyId); ElementTitlePart titlePart = levelToTitlePartMap.get(ancestor.getLevelExtid()); if (titlePart!=null) { return titlePart; } } return null; }
private String name(Ancestor ancestor) { return ancestor==null ? null : ancestor.getDefaultNameText(); }
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()) : ""; }
/** * FIXME: stolen from ElementView, could issn be cached in CatalogElement? * <p> * Searches for issn number in identifiers of element ancestors from the journal hierarchy. * * @param ce the CatalogElement to find issn for * @return issn, null if not found */ private String getIssn(final CatalogElement ce) { for (final Ancestor ancestor : ce.getRelations(YaddaIdConstants.ID_HIERARACHY_JOURNAL)) { if (ancestor.getAdditionalIdentifiers().get(YaddaIdConstants.IDENTIFIER_CLASS_ISSN) != null) { return ancestor.getAdditionalIdentifiers().get(YaddaIdConstants.IDENTIFIER_CLASS_ISSN); } } return null; } }
private void fillPublishingProcessRelatedFields(SElement sElement, CatalogElement catalogElement) { sElement.setState(catalogElement.getState()); sElement.setLastEditor(catalogElement.getEditedBy()); sElement.setRejectedEditor(catalogElement.getReturnedTo()); }
@Override protected Chunk doProcessChunk(Chunk data, Map<String, Serializable> context, IProcessListener processListener, ProcessingStats stats) throws Exception { for (CatalogElement element : data.getItems()) { String extId = element.getExtId(); metadataImporter.cleanMetadata(extId); } return data; }
private void fillRemoteContent(final CatalogElement ce, final SElement sElement) { final Ancestors ancestors = ce.getAncestors(); final boolean hasRemoteContent = sElement.hasRemoteContent() || ancestors != null && ancestors.hasRemoteContent(); sElement.setRemoteContent(hasRemoteContent); }
@Override protected Chunk doProcessChunk(final Chunk data, final Map<String, Serializable> context, final IProcessListener processListener, final ProcessingStats stats) throws Exception { storageFacade.batch(data.getCustomStorageOperations(), IStorage.EXECUTION_MODE.TRANSACTIONAL); return data; }
private Ancestor volume(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME); }
private String evaluate(Ancestor ancestor, HierarchyLevelLabelSource levelLabels) { switch (property) { case LEVEL_NAME: return levelLabels.getLabelForLevel(levelId); case ELEMENT_NAME: return ancestor.getDefaultNameText(); } return ""; }
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 Ancestor journal(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL); }
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 Ancestor issue(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE); }
private Ancestor year(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR); }
public static Ancestor year(Ancestors ancestors) { return ancestors.getAncestorAtLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR); }
@Override public String evaluate(Ancestors ancestors, HierarchyLevelLabelSource levelLabels) { Ancestor ancestor = ancestors.getAncestorAtLevel(levelId); return ancestor==null ? "" : evaluate(ancestor, levelLabels); }