/** * 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; } }
@Override protected Chunk doProcessChunk(Chunk data, Map<String, Serializable> context, IProcessListener processListener, ProcessingStats stats) throws Exception { List<Element> elementList = new ArrayList<Element>(); List<Ancestors> ancestorsList = new ArrayList<Ancestors>(); for (CatalogElement item : data.getItems()) { if (item == null || item.getElement() == null) continue; Ancestors ancestors = new Ancestors(); for (Entry<String, List<Ancestor>> hierarchyData : item.getRelations().entrySet()) ancestors.setAncestorsOfHierarchy(hierarchyData.getKey(), hierarchyData.getValue()); elementList.add(item.getElement()); ancestorsList.add(ancestors); } if (! elementList.isEmpty()) metadataImporter.importDesklightMetadata(elementList, ancestorsList); return data; }
@Override protected Chunk doProcessChunk(Chunk data, Map<String, Serializable> context, IProcessListener processListener, ProcessingStats stats) throws Exception { List<Element> elementList = new ArrayList<Element>(); List<Ancestors> ancestorsList = new ArrayList<Ancestors>(); for (CatalogElement item : data.getItems()) { if (item == null || item.getElement() == null) continue; Ancestors ancestors = new Ancestors(); for (Entry<String, List<Ancestor>> hierarchyData : item.getRelations().entrySet()) ancestors.setAncestorsOfHierarchy(hierarchyData.getKey(), hierarchyData.getValue()); elementList.add(item.getElement()); ancestorsList.add(ancestors); } if (! elementList.isEmpty()) metadataImporter.matchDesklightMetadata(elementList, ancestorsList); return data; }
if (ce != null && ce.getRelations() != null) { List<Ancestor> ancestors = ce.getRelations().get(hierarchyExtId); if (ancestors != null && ancestors.size() > 0) { for (Ancestor currentAncestor : ancestors) {
@Override protected void processElement(Element<CatalogElement> element) throws Exception { Ancestors ancestors = new Ancestors(); for (Entry<String, List<Ancestor>> hierarchyData : element.getData().getRelations().entrySet()) { ancestors.setAncestorsOfHierarchy(hierarchyData.getKey(), hierarchyData.getValue()); } metadataImporter.matchDesklightMetadata(element.getData().getElement(), ancestors); }
@Override protected void processElement(Element<CatalogElement> element) throws Exception { if (element.getData() == null || element.getData().getElement() == null) { //TODO log me return; } Ancestors ancestors = new Ancestors(); for (Entry<String, List<Ancestor>> hierarchyData : element.getData().getRelations().entrySet()) { ancestors.setAncestorsOfHierarchy(hierarchyData.getKey(), hierarchyData.getValue()); } metadataImporter.importDesklightMetadata(element.getData().getElement(), ancestors); }
for (List<Ancestor> entry : ce.getRelations().values()) { if (entry.size() > 1) { Ancestor parent = entry.get(1);
if (ce.getRelations() != null) { for (List<Ancestor> ancestorLists : ce.getRelations().values()) { for (Ancestor ancestor : ancestorLists) { if (YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL
if (ce.getRelations() != null) { for (final List<Ancestor> ancestorLists : ce.getRelations().values()) { for (final Ancestor ancestor : ancestorLists) {
for (final String hierarchyId : ce.getRelations().keySet()) { final Serializable[] ser=ElementView.asTuple(ce, hierarchyId, levelsToSkip, licenseMapper, contributorUtil); elementViewBath.addOrUpdate(Condition.eq(ElementView.FIELD_EXTID, ce.getExtId()), ser);