Revision 52044
Added by Claudio Atzori almost 6 years ago
SimpleRecordParser.java | ||
---|---|---|
11 | 11 |
import org.apache.commons.logging.LogFactory; |
12 | 12 |
import org.xml.sax.InputSource; |
13 | 13 |
|
14 |
import static eu.dnetlib.data.mdstore.modular.MDStoreConstants.*; |
|
15 |
|
|
14 | 16 |
/** |
15 | 17 |
* Terrible implementation of a record parser. |
16 | 18 |
* |
... | ... | |
25 | 27 |
@Override |
26 | 28 |
public Map<String, String> parseRecord(String record) { |
27 | 29 |
Map<String, String> props = new HashMap<String, String>(); |
28 |
props.put("timestamp", String.valueOf(getTimestamp()));
|
|
30 |
props.put(TIMESTAMP, String.valueOf(getTimestamp()));
|
|
29 | 31 |
|
30 | 32 |
try { |
31 | 33 |
// DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); |
... | ... | |
34 | 36 |
// Document doc = builder.parse(new InputSource(new StringReader(record))); |
35 | 37 |
InputSource doc = new InputSource(new StringReader(record)); |
36 | 38 |
|
37 |
props.put("id", xpath.evaluate("//*[local-name()='objIdentifier']", doc));
|
|
39 |
props.put(ID, xpath.evaluate("//*[local-name()='objIdentifier']", doc));
|
|
38 | 40 |
props.put("originalId", xpath.evaluate("//*[local-name()='efgEntity']/*/*[local-name()='identifier']", doc)); |
39 | 41 |
|
40 | 42 |
// String date = xpath.evaluate("//*[local-name()='dateOfCollection'][1]", doc); |
Also available in: Unified diff
long, not string!