Project

General

Profile

1
package eu.dnetlib.data.claims.migration;
2

    
3
import com.google.gson.annotations.SerializedName;
4
import eu.dnetlib.data.claimsDemo.ClaimUtils;
5

    
6
import java.util.Date;
7

    
8
/**
9
 * Created by kiatrop on 20/11/2015.
10
 */
11
public class Result implements OpenaireEntity{
12
	
13
	@SerializedName("@id")
14
	private String id;
15
	
16
	@SerializedName("@type")
17
	private final String type = "oaf:result";
18
	
19
    private String title;
20
    private String externalUrl;
21
    private String openaireId;
22
    private String doi;
23
    private String orcidworkid;
24
    private String pmcid;
25
    //accessRights : set by user
26
    private String accessRights;
27
    //bestLicence : from search
28
    private String bestLicense;
29

    
30
    private String collectedFrom;
31
    private String xml;
32
    private String resultType;
33
    private boolean found=false;
34
    private String embargoEndDate;
35

    
36

    
37

    
38
    public String getDoi() {
39
		return doi;
40
	}
41

    
42
	public void setDoi(String doi) {
43
		this.doi = doi;
44
	}
45

    
46
	public String getTitle() {
47
        return title;
48
    }
49

    
50
    public void setTitle(String title) {
51
        this.title = title;
52
    }
53

    
54
    public String getExternal_url() {
55
        return externalUrl;
56
    }
57

    
58
    public void setExternal_url(String external_url) {
59
        this.externalUrl = external_url;
60
    }
61

    
62
    public String getOpenaireId() {
63
        return openaireId;
64
    }
65

    
66
    public void setOpenaireId(String openaire_id) {
67
        this.openaireId = openaire_id;
68
        this.id = "http://www.openaire.eu/results/" + openaire_id;
69
    }
70

    
71
    public String getAccessRights() {
72
        return accessRights;
73
    }
74

    
75
    public void setAccessRights(String accessRights) {
76
        this.accessRights = accessRights;
77
    }
78

    
79
    public String getBestLicense() {
80
        return bestLicense;
81
    }
82

    
83
    public void setBestLicense(String bestLicense) {
84
        this.bestLicense = bestLicense;
85
    }
86

    
87
    public String getCollectedFrom() {
88
        return collectedFrom;
89
    }
90

    
91
    public void setCollectedFrom(String collectedFrom) {
92
        if(!collectedFrom.contains("____::")) {
93
            if (collectedFrom.equals("Datacite")) {
94
                collectedFrom = ClaimUtils.COLLECTED_FROM_DATACITE;
95

    
96
            } else if (collectedFrom.equals("Crossref")) {
97
                collectedFrom = ClaimUtils.COLLECTED_FROM_CROSSREF;
98

    
99
            } else if (collectedFrom.equals("Orcid")) {
100
                collectedFrom = ClaimUtils.COLLECTED_FROM_ORCID;
101

    
102
            } else {
103
                collectedFrom = ClaimUtils.COLLECTED_FROM_OPENAIRE;
104
            }
105
        }
106
        this.collectedFrom = collectedFrom;
107
    }
108

    
109
    public String getXml() {
110
        return xml;
111
    }
112

    
113
    public void setXml(String xml) {
114
        this.xml = xml;
115
    }
116

    
117
    public String getResultType() {
118
        return resultType;
119
    }
120

    
121
    public void setResultType(String resultType) {
122
        this.resultType = resultType;
123
    }
124

    
125

    
126
    public String getId() {
127
		return id;
128
	}
129

    
130
	public void setId(String id) {
131
		this.id = id;
132
	}
133

    
134
    public boolean isFound() {
135
        return found;
136
    }
137

    
138
    public void setFound(boolean found) {
139
        this.found = found;
140
    }
141

    
142
    public String getPmcid() {
143
        return pmcid;
144
    }
145

    
146
    public void setPmcid(String pmcid) {
147
        this.pmcid = pmcid;
148
    }
149

    
150
    public String getOrcidworkid() {
151
        return orcidworkid;
152
    }
153

    
154
    public void setOrcidworkid(String orcidworkid) {
155
        this.orcidworkid = orcidworkid;
156
    }
157

    
158
    public String getEmbargoEndDate() {
159
        return embargoEndDate;
160
    }
161

    
162
    public void setEmbargoEndDate(String embargoEndDate) {
163
        this.embargoEndDate = embargoEndDate;
164
    }
165

    
166
    @Override
167
    public String toString() {
168
        return "\nResult{" +
169
                "title='" + title + '\'' +
170
                ",\n external_url='" + externalUrl + '\'' +
171
                ",\n openaire_id='" + openaireId + '\'' +
172
                ",\n doi='" + doi + '\'' +
173
                ",\n pmcid='" + pmcid + '\'' +
174
                ",\n orcidworkid='" + orcidworkid + '\'' +
175
                ",\n accessRights='" + accessRights + '\'' +
176
                ",\n embargoEndDate='" + embargoEndDate + '\'' +
177
                ",\n bestLicense='" + bestLicense + '\'' +
178
                ",\n collectedFrom='" + collectedFrom + '\'' +
179
                ",\n xml='" + xml.substring(0,60) + "...\'" +
180
                ",\n resultType='" + resultType + '\'' +
181
                '}';
182
    }
183
//method to ask from API of search to get the xml
184
    //then parse the fields
185
}
(9-9/10)