Revision f1a25720
Added by Katja Luther over 6 years ago
- ID f1a25720755daa96e8838a617a660dfced7b9f31
- Parent 23e50194
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/oaipmh/IdentifyView.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.io.IOException; |
4 | 4 |
import java.io.StringReader; |
5 |
import java.time.ZonedDateTime; |
|
5 | 6 |
import java.util.Map; |
6 | 7 |
|
7 | 8 |
import javax.xml.parsers.DocumentBuilder; |
8 | 9 |
import javax.xml.parsers.DocumentBuilderFactory; |
9 | 10 |
import javax.xml.parsers.ParserConfigurationException; |
10 | 11 |
|
11 |
import org.joda.time.DateTime; |
|
12 | 12 |
import org.w3c.dom.Document; |
13 | 13 |
import org.w3c.dom.Element; |
14 | 14 |
import org.xml.sax.InputSource; |
15 | 15 |
import org.xml.sax.SAXException; |
16 | 16 |
|
17 |
|
|
18 | 17 |
import eu.etaxonomy.cdm.remote.dto.oaipmh.DeletedRecord; |
19 | 18 |
import eu.etaxonomy.cdm.remote.dto.oaipmh.Description; |
20 | 19 |
import eu.etaxonomy.cdm.remote.dto.oaipmh.Granularity; |
... | ... | |
35 | 34 |
identify.setProtocolVersion((String)model.get("protocolVersion")); |
36 | 35 |
identify.setDeletedRecord((DeletedRecord) model.get("deletedRecord")); |
37 | 36 |
identify.setGranularity((Granularity) model.get("granularity")); |
38 |
identify.setEarliestDatestamp((DateTime) model.get("earliestDatestamp")); |
|
37 |
identify.setEarliestDatestamp((ZonedDateTime) model.get("earliestDatestamp"));
|
|
39 | 38 |
identify.getAdminEmail().add((String) model.get("adminEmail")); |
40 | 39 |
if(model.get("description") != null){ |
41 | 40 |
Description description = new Description(); |
... | ... | |
47 | 46 |
try { |
48 | 47 |
documentBuilder = documentBuilderFactory.newDocumentBuilder(); |
49 | 48 |
document = documentBuilder.parse(inputSource); |
50 |
Element domElem = (Element)document.getDocumentElement();
|
|
49 |
Element domElem = document.getDocumentElement(); |
|
51 | 50 |
|
52 | 51 |
description.setAny(domElem); |
53 | 52 |
} catch (ParserConfigurationException e) { |
... | ... | |
60 | 59 |
// TODO Auto-generated catch block |
61 | 60 |
e.printStackTrace(); |
62 | 61 |
} |
63 |
|
|
62 |
|
|
64 | 63 |
identify.getDescription().add(description); |
65 | 64 |
} |
66 |
|
|
65 |
|
|
67 | 66 |
oaiPmh.setIdentify(identify); |
68 | 67 |
} |
69 | 68 |
} |
Also available in: Unified diff
first implementation for change from joda time to java8 time