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; }
if (ancestors != null && ancestors.size() > 0) { for (Ancestor currentAncestor : ancestors) { if (currentAncestor.getLevelExtid().equals(levelExtId)) { return currentAncestor.getExtid();
log.debug("got valid policy: " + result.getId() + " from ancestor: " + currentAncestor.getExtid() + " of level: " + currentAncestor.getLevelExtid()); if (log.isDebugEnabled()) { log.debug("no ACL part for ancestor: " + currentAncestor.getExtid() + " of level: " + currentAncestor.getLevelExtid() + ", checking next level if available...");
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); } } }
if (log.isDebugEnabled()) { log.debug("found ACL part for ancestor: " + currentAncestor.getExtid() + " of level: " + currentAncestor.getLevelExtid() + ", ACL content: " + aclPart.getData()); if (log.isDebugEnabled()) { log.debug("no ACL part for ancestor: " + currentAncestor.getExtid() + " of level: " + currentAncestor.getLevelExtid() + ", checking next level if available...");
private boolean hasRelatedPublisher(CatalogElement catalogElement) throws YaddaException { final Element element = catalogElement.getElement(); final ElementLevel journalHierarchyLevel = element.getElementLevel(YaddaIdConstants.ID_HIERARACHY_JOURNAL); if (journalHierarchyLevel!=null && YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL.equals(journalHierarchyLevel.getLevelExtId())) { final Ancestors ancestors = catalogElement.getAncestors(); if (ancestors != null) { final Ancestor parentInHierarchy = ancestors.getParentInHierarchy(YaddaIdConstants.ID_HIERARACHY_JOURNAL); if (parentInHierarchy != null) { final String parentLevel = parentInHierarchy.getLevelExtid(); if (YaddaIdConstants.ID_LEVEL_JOURNAL_PUBLISHER.equals(parentLevel)) { return true; } } } } for (Contributor contributor : element.getContributors()) { if (ContributorConstants.ROLE_PUBLISHER.equals(contributor.getRole())) { return true; } } return false; }
String id = ancestor.getExtid(); YElement element = loadElementFromYaddaCatalog(id); if (ancestor.getLevelExtid().equals("bwmeta1.level.hierarchy_Journal_Year")) { year = element.getOneName().getText(); } else if (ancestor.getLevelExtid().equals("bwmeta1.level.hierarchy_Journal_Volume")) { volume = element.getOneName().getText(); } else if (ancestor.getLevelExtid().equals("bwmeta1.level.hierarchy_Journal_Number")) { issue = element.getOneName().getText(); } else if (ancestor.getLevelExtid().equals("bwmeta1.level.hierarchy_Journal_Journal")) { journal = element.getOneName().getText();
for (Ancestor currentAnc : journalAncestors) { if (RepositoryStringConstants.HIERARCHY_JOURNAL_NUMBER.equals( currentAnc.getLevelExtid())) {
/** * Retrieves publication date from ancestors or null when not found. * @param ce * @return */ protected Date getPublicationDateFromAncestors(CatalogElement ce) { if (ce!=null && ce.getAncestors()!=null) { List<Ancestor> anc = ce.getAncestors().getAncestorsOfHierarchy(ID_HIERARACHY_JOURNAL); if (anc!=null) { for (Ancestor currentAnc : anc) { if (currentAnc.getPublishedDate()!=null) { try { return currentAnc.getPublishedDate().getDate(); } catch (ParseException e) { log.error("unable to retrieve publication date from ancestor " + currentAnc.getExtid() + " of level " + currentAnc.getLevelExtid() + " of element " + ce.getExtId(), e); } } } } } // fallback return null; }
for (Ancestor currentAnc : journalAncestors) { if (RepositoryStringConstants.HIERARCHY_JOURNAL_JOURNAL.equals( currentAnc.getLevelExtid())) {
for (Ancestor ancestor : ancestorLists) { if (YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL .equals(ancestor.getLevelExtid())) { addValue(IndexFields.F_JOURNAL_NAME, ancestor.getDefaultNameText(), values); + ancestor.getLevelExtid(), ancestor.getExtid(), values); addValue(IndexFields.F_SIM_HIERARCHY_DUMP_NAME_PREFIX + ancestor.getLevelExtid(), ancestor.getDefaultNameText(), values);
final String levelExtid = ancestor.getLevelExtid(); final String name = ancestor.getDefaultNameText();
final List<Ancestor> list = ancestors.getAncestorsOfHierarchy(YaddaIdConstants.ID_HIERARACHY_JOURNAL); if (list != null && !list.isEmpty() && YaddaIdConstants.ID_LEVEL_JOURNAL_ARTICLE.equals(list.iterator().next().getLevelExtid())) { processJournalAncestors(metadata, list);
final List<Ancestor> list = ancestors.getAncestorsOfHierarchy(YaddaIdConstants.ID_HIERARACHY_JOURNAL); if (list != null && !list.isEmpty() && YaddaIdConstants.ID_LEVEL_JOURNAL_ARTICLE.equals(list.iterator().next().getLevelExtid())) { processJournalAncestors(metadata, list);
final List<Ancestor> list = ancestors.getAncestorsOfHierarchy(YaddaIdConstants.ID_HIERARACHY_JOURNAL); if (list != null && !list.isEmpty() && YaddaIdConstants.ID_LEVEL_JOURNAL_ARTICLE.equals(list.iterator().next().getLevelExtid())) { processJournalAncestors(metadata, list);
final List<AncestorPlugin> ancestorPlugins = getAncestorPlugins(ancestor.getLevelExtid()); if (ancestorPlugins.isEmpty()) { log.debug("No plugin for ancestor in level '" + ancestor.getLevelExtid() + "'");