diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseAnalyzerJob.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseAnalyzerJob.java index 1ca9e8966..ee7283a99 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseAnalyzerJob.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseAnalyzerJob.java @@ -156,12 +156,16 @@ public class BaseAnalyzerJob { final BaseRecordInfo info = new BaseRecordInfo(); + info.setId(record.valueOf("//*[local-name() = 'header']/*[local-name() = 'identifier']").trim()); + for (final Object o : record.selectNodes("//*|//@*")) { info.getPaths().add(((Node) o).getPath()); - final String nodeName = ((Node) o).getName(); if (o instanceof Element) { final Element n = (Element) o; + + final String nodeName = n.getName(); + if ("collection".equals(nodeName)) { final String collName = n.getText().trim(); if (StringUtils.isNotBlank(collName)) { diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseRecordInfo.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseRecordInfo.java index 727958cf0..920e61230 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseRecordInfo.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/plugin/base/BaseRecordInfo.java @@ -10,9 +10,19 @@ public class BaseRecordInfo implements Serializable { private static final long serialVersionUID = -8848232018350074593L; + private String id; + private Map> collections = new HashMap<>(); private Set paths = new LinkedHashSet<>(); private Set types = new LinkedHashSet<>(); + public String getId() { + return this.id; + } + + public void setId(final String id) { + this.id = id; + } + public Set getPaths() { return this.paths; } @@ -37,6 +47,4 @@ public class BaseRecordInfo implements Serializable { this.collections = collections; } - private Map> collections = new HashMap<>(); - } diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/collection/plugin/base/BaseCollectorIteratorTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/collection/plugin/base/BaseCollectorIteratorTest.java index a677eefa2..d8893e8db 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/collection/plugin/base/BaseCollectorIteratorTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/collection/plugin/base/BaseCollectorIteratorTest.java @@ -16,12 +16,14 @@ import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.dom4j.Node; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import com.fasterxml.jackson.databind.ObjectMapper; import eu.dnetlib.dhp.common.aggregation.AggregatorReport; +@Disabled public class BaseCollectorIteratorTest { @Test