added id to BaseRecordInfo
This commit is contained in:
parent
da65728afe
commit
8ffdd9747d
|
@ -156,12 +156,16 @@ public class BaseAnalyzerJob {
|
||||||
|
|
||||||
final BaseRecordInfo info = new BaseRecordInfo();
|
final BaseRecordInfo info = new BaseRecordInfo();
|
||||||
|
|
||||||
|
info.setId(record.valueOf("//*[local-name() = 'header']/*[local-name() = 'identifier']").trim());
|
||||||
|
|
||||||
for (final Object o : record.selectNodes("//*|//@*")) {
|
for (final Object o : record.selectNodes("//*|//@*")) {
|
||||||
info.getPaths().add(((Node) o).getPath());
|
info.getPaths().add(((Node) o).getPath());
|
||||||
|
|
||||||
final String nodeName = ((Node) o).getName();
|
|
||||||
if (o instanceof Element) {
|
if (o instanceof Element) {
|
||||||
final Element n = (Element) o;
|
final Element n = (Element) o;
|
||||||
|
|
||||||
|
final String nodeName = n.getName();
|
||||||
|
|
||||||
if ("collection".equals(nodeName)) {
|
if ("collection".equals(nodeName)) {
|
||||||
final String collName = n.getText().trim();
|
final String collName = n.getText().trim();
|
||||||
if (StringUtils.isNotBlank(collName)) {
|
if (StringUtils.isNotBlank(collName)) {
|
||||||
|
|
|
@ -10,9 +10,19 @@ public class BaseRecordInfo implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8848232018350074593L;
|
private static final long serialVersionUID = -8848232018350074593L;
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private Map<String, Map<String, String>> collections = new HashMap<>();
|
||||||
private Set<String> paths = new LinkedHashSet<>();
|
private Set<String> paths = new LinkedHashSet<>();
|
||||||
private Set<String> types = new LinkedHashSet<>();
|
private Set<String> types = new LinkedHashSet<>();
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public Set<String> getPaths() {
|
public Set<String> getPaths() {
|
||||||
return this.paths;
|
return this.paths;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +47,4 @@ public class BaseRecordInfo implements Serializable {
|
||||||
this.collections = collections;
|
this.collections = collections;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Map<String, String>> collections = new HashMap<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,14 @@ import org.dom4j.Document;
|
||||||
import org.dom4j.DocumentHelper;
|
import org.dom4j.DocumentHelper;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
import org.dom4j.Node;
|
import org.dom4j.Node;
|
||||||
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import eu.dnetlib.dhp.common.aggregation.AggregatorReport;
|
import eu.dnetlib.dhp.common.aggregation.AggregatorReport;
|
||||||
|
|
||||||
|
@Disabled
|
||||||
public class BaseCollectorIteratorTest {
|
public class BaseCollectorIteratorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue