Revision 49184
Added by Sandro La Bruzzo over 6 years ago
CrossRefParserJSON.java | ||
---|---|---|
11 | 11 |
import com.google.gson.JsonObject; |
12 | 12 |
import com.google.gson.JsonParser; |
13 | 13 |
import eu.dnetlib.dli.resolver.model.CompletionStatus; |
14 |
import eu.dnetlib.dli.resolver.model.ObjectProvenance; |
|
15 |
import eu.dnetlib.dli.resolver.model.ObjectType;
|
|
16 |
import eu.dnetlib.dli.resolver.model.ResolvedObject;
|
|
14 |
import eu.dnetlib.dli.resolver.model.DLIObjectProvenance;
|
|
15 |
import eu.dnetlib.dli.resolver.model.DLIResolvedObject;
|
|
16 |
import eu.dnetlib.pid.resolver.model.ObjectType;
|
|
17 | 17 |
import org.apache.commons.lang3.ArrayUtils; |
18 | 18 |
import org.apache.commons.lang3.StringUtils; |
19 | 19 |
import org.apache.commons.logging.Log; |
... | ... | |
30 | 30 |
private static final String CROSSREF_NS_PREFIX = "crossref____"; |
31 | 31 |
private static final Log log = LogFactory.getLog(CrossRefParserJSON.class); // NOPMD by marko on 11/24/08 5:02 PM |
32 | 32 |
|
33 |
public ResolvedObject parseRecord(final String record) {
|
|
33 |
public DLIResolvedObject parseRecord(final String record) {
|
|
34 | 34 |
|
35 | 35 |
log.debug("Start to parsing " + record); |
36 | 36 |
|
... | ... | |
41 | 41 |
return null; |
42 | 42 |
} |
43 | 43 |
JsonObject message = mainObj.getAsJsonObject("message"); |
44 |
ResolvedObject currentObject = new ResolvedObject();
|
|
44 |
DLIResolvedObject currentObject = new DLIResolvedObject();
|
|
45 | 45 |
|
46 | 46 |
if (message.get("DOI") != null) { |
47 | 47 |
final String doi = message.get("DOI").getAsString(); |
... | ... | |
76 | 76 |
} |
77 | 77 |
currentObject.setAuthors(authorList); |
78 | 78 |
} |
79 |
ObjectProvenance provenance = new ObjectProvenance();
|
|
80 |
AbstractPIDResolver.setDatasourceProvenance(provenance, CROSSREF_NS_PREFIX);
|
|
79 |
final DLIObjectProvenance provenance = new DLIObjectProvenance();
|
|
80 |
DLIPIDResolver.setDatasourceProvenance(provenance, CROSSREF_NS_PREFIX);
|
|
81 | 81 |
if (message.get("publisher") != null && !message.get("publisher").isJsonNull()) { |
82 | 82 |
provenance.setPublisher(message.get("publisher").getAsString()); |
83 | 83 |
} |
... | ... | |
100 | 100 |
* @param fullCitations |
101 | 101 |
* @param result |
102 | 102 |
*/ |
103 |
private void parseFullCitation(final String fullCitations, final ResolvedObject result) {
|
|
104 |
if (StringUtils.isEmpty(fullCitations))
|
|
103 |
private void parseFullCitation(final String fullCitations, final DLIResolvedObject result) {
|
|
104 |
if (StringUtils.isEmpty(fullCitations))
|
|
105 | 105 |
return; |
106 | 106 |
|
107 | 107 |
String beforeTitles[] = fullCitations.split("'"); |
Also available in: Unified diff
Refactored Pid resolver