private String getId(YAncestor ancestor, String scheme) { for (String eissn : ancestor.getIds(scheme)) { return eissn; } return null; }
private String extracjIssnsFromArticle(List<YElement> yelements) { //System.out.println("[extracjIssnsFromArticle]"); List<YElement> articles = YElementsParsingToolbox.filterYElementsOfStructureLevel(yelements, YConstants.EXT_LEVEL_JOURNAL_ARTICLE); if (articles.size() == 0) { return null; } if (articles.size() > 1) { log.error("More than one articles found in package of yelements!"); } YElement article = articles.get(0); YStructure struct = article.getStructure(YConstants.EXT_HIERARCHY_JOURNAL); if (struct == null) { return null; } YAncestor ancest = struct.getAncestor(YConstants.EXT_LEVEL_JOURNAL_JOURNAL); if (ancest == null) { return null; } String issnsStr = extractIssnsStr(ancest.getIds()); return issnsStr; }
public static void copyDataToAncestor(YElement ele, YAncestor anc) { anc.getNames().addAll(ele.getNames()); anc.getIds().addAll(ele.getIds()); anc.getDates().addAll(ele.getDates()); anc.setIdentity(ele.getId()); }
protected YStructure buildStructureFromParent(YElement parent, String hierarchy, String currentLevel) { YStructure structure = new YStructure(hierarchy); YCurrent current = new YCurrent(currentLevel); structure.setCurrent(current); if (parent != null) { YStructure parentStructure = parent.getStructure(hierarchy); structure.getAncestors().addAll(parentStructure.getAncestors()); YAncestor ancestor = new YAncestor(parentStructure.getCurrent().getLevel(), parent.getId()); ancestor.getNames().addAll(parent.getNames()); ancestor.getIds().addAll(parent.getIds()); structure.addAncestor(ancestor); } return structure; }
protected void fillIdentifiers(HtmlMetaHeaders metadata, YElement yElement) { YStructure yStructure = yElement.getStructure(YaddaIdConstants.ID_HIERARACHY_JOURNAL); if (yStructure != null) { YAncestor yAncestor = yStructure.getAncestor(YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL); if (yAncestor != null) { for (YId journalYId : yAncestor.getIds()) { if (YaddaIdConstants.IDENTIFIER_CLASS_ISSN.equals(journalYId.getScheme())) { metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_IDENTIFIER, "ISSN " + journalYId.getValue()); } } } } for (YId yId : yElement.getIds()) { if (IdSchemaIds.EXT_SCHEME_DOI.equals(yId.getScheme())) { metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_IDENTIFIER, "DOI " + yId.getValue()); } else if (IdSchemaIds.EXT_SCHEME_ISBN.equals(yId.getScheme())) { metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_IDENTIFIER, "ISBN " + yId.getValue()); } else { metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_IDENTIFIER, yId.getValue()); } } }