Project

General

Profile

1
package eu.dnetlib.data.mdstore.plugins.objects;
2

    
3
import java.util.LinkedHashSet;
4
import java.util.Set;
5
import java.util.TreeSet;
6

    
7
import javax.xml.bind.annotation.XmlAccessType;
8
import javax.xml.bind.annotation.XmlAccessorType;
9
import javax.xml.bind.annotation.XmlElement;
10
import javax.xml.bind.annotation.XmlElementWrapper;
11
import javax.xml.bind.annotation.XmlRootElement;
12

    
13
@XmlRootElement(name = "record")
14
@XmlAccessorType(XmlAccessType.FIELD)
15
public class MdRecord {
16

    
17
	@XmlElement(name = "identifier")
18
	private String id;
19

    
20
	@XmlElement(name = "title")
21
	private String title;
22

    
23
	@XmlElementWrapper(name = "creators")
24
	@XmlElement(name = "creator")
25
	private Set<String> creators = new LinkedHashSet<>();
26

    
27
	@XmlElement(name = "publisher")
28
	private String publisher;
29

    
30
	@XmlElementWrapper(name = "subjects")
31
	@XmlElement(name = "subject")
32
	private Set<String> subjects = new LinkedHashSet<>();
33

    
34
	@XmlElementWrapper(name = "contributors")
35
	@XmlElement(name = "contributor")
36
	private Set<String> contributors = new LinkedHashSet<>();
37

    
38
	@XmlElement(name = "date")
39
	private int date;
40

    
41
	@XmlElement(name = "language")
42
	private String language;
43

    
44
	@XmlElement(name = "type")
45
	private String type;
46

    
47
	@XmlElementWrapper(name = "urls")
48
	@XmlElement(name = "url")
49
	private Set<MyURL> urls = new TreeSet<>((u1, u2) -> {
50
		final String r1 = u1.getRights();
51
		final String r2 = u2.getRights();
52
		final int n1 = r1.equalsIgnoreCase("Open Access") ? 0 : r1.equalsIgnoreCase("Unknown") ? 2 : 1;
53
		final int n2 = r2.equalsIgnoreCase("Open Access") ? 0 : r2.equalsIgnoreCase("Unknown") ? 2 : 1;
54
		final int res = Integer.compare(n1, n2);
55
		if (res == 0) {
56
			final String url1 = u1.getUrl().replaceAll("https://", "http://").toLowerCase();
57
			final String url2 = u2.getUrl().replaceAll("https://", "http://").toLowerCase();
58
			return url1.compareTo(url2);
59
		} else {
60
			return res;
61
		}
62
	});
63

    
64
	@XmlElementWrapper(name = "dois")
65
	@XmlElement(name = "doi")
66
	private Set<String> dois = new LinkedHashSet<>();
67

    
68
	@XmlElement(name = "bestRights")
69
	private String bestRights;
70

    
71
	@XmlElement(name = "abstract")
72
	private String descriptionAbstract;
73

    
74
	@XmlElement(name = "source")
75
	private String source;
76

    
77
	@XmlElementWrapper(name = "projects")
78
	@XmlElement(name = "project")
79
	private Set<Project> projects = new TreeSet<>((p1, p2) -> p1.getName().compareTo(p2.getName()));
80

    
81
	@XmlElementWrapper(name = "cnrPersons")
82
	@XmlElement(name = "cnrPerson")
83
	private Set<CnrPerson> cnrPersons = new TreeSet<>((p1, p2) -> p1.getName().compareTo(p2.getName()));
84

    
85
	@XmlElementWrapper(name = "datasets")
86
	@XmlElement(name = "dataset")
87
	private Set<Dataset> datasets = new TreeSet<>((d1, d2) -> d1.getTitle().compareTo(d2.getTitle()));
88

    
89
	@XmlElementWrapper(name = "citations")
90
	@XmlElement(name = "citation")
91
	private Set<String> citations = new LinkedHashSet<>();
92

    
93
	@XmlElementWrapper(name = "collections")
94
	@XmlElement(name = "inCollection")
95
	private Set<CnrCollection> inCollections = new LinkedHashSet<>();
96

    
97
	public String getId() {
98
		return id;
99
	}
100

    
101
	public void setId(final String id) {
102
		this.id = id;
103
	}
104

    
105
	public String getTitle() {
106
		return title;
107
	}
108

    
109
	public void setTitle(final String title) {
110
		this.title = title;
111
	}
112

    
113
	public Set<String> getCreators() {
114
		return creators;
115
	}
116

    
117
	public void setCreators(final Set<String> creators) {
118
		this.creators = creators;
119
	}
120

    
121
	public String getPublisher() {
122
		return publisher;
123
	}
124

    
125
	public void setPublisher(final String publisher) {
126
		this.publisher = publisher;
127
	}
128

    
129
	public Set<String> getSubjects() {
130
		return subjects;
131
	}
132

    
133
	public void setSubjects(final Set<String> subjects) {
134
		this.subjects = subjects;
135
	}
136

    
137
	public Set<String> getContributors() {
138
		return contributors;
139
	}
140

    
141
	public void setContributors(final Set<String> contributors) {
142
		this.contributors = contributors;
143
	}
144

    
145
	public int getDate() {
146
		return date;
147
	}
148

    
149
	public void setDate(final int date) {
150
		this.date = date;
151
	}
152

    
153
	public String getLanguage() {
154
		return language;
155
	}
156

    
157
	public void setLanguage(final String language) {
158
		this.language = language;
159
	}
160

    
161
	public String getType() {
162
		return type;
163
	}
164

    
165
	public void setType(final String type) {
166
		this.type = type;
167
	}
168

    
169
	public Set<MyURL> getUrls() {
170
		return urls;
171
	}
172

    
173
	public void setUrls(final Set<MyURL> urls) {
174
		this.urls = urls;
175
	}
176

    
177
	public Set<String> getDois() {
178
		return dois;
179
	}
180

    
181
	public void setDois(final Set<String> dois) {
182
		this.dois = dois;
183
	}
184

    
185
	public String getBestRights() {
186
		return bestRights;
187
	}
188

    
189
	public void setBestRights(final String bestRights) {
190
		this.bestRights = bestRights;
191
	}
192

    
193
	public String getDescriptionAbstract() {
194
		return descriptionAbstract;
195
	}
196

    
197
	public void setDescriptionAbstract(final String descriptionAbstract) {
198
		this.descriptionAbstract = descriptionAbstract;
199
	}
200

    
201
	public String getSource() {
202
		return source;
203
	}
204

    
205
	public void setSource(final String source) {
206
		this.source = source;
207
	}
208

    
209
	public Set<Project> getProjects() {
210
		return projects;
211
	}
212

    
213
	public void setProjects(final Set<Project> projects) {
214
		this.projects = projects;
215
	}
216

    
217
	public Set<CnrPerson> getCnrPersons() {
218
		return cnrPersons;
219
	}
220

    
221
	public void setCnrPersons(final Set<CnrPerson> cnrPersons) {
222
		this.cnrPersons = cnrPersons;
223
	}
224

    
225
	public void setCnrPerson(final Set<CnrPerson> cnrPersons) {
226
		this.cnrPersons = cnrPersons;
227
	}
228

    
229
	public Set<Dataset> getDatasets() {
230
		return datasets;
231
	}
232

    
233
	public void setDatasets(final Set<Dataset> datasets) {
234
		this.datasets = datasets;
235
	}
236

    
237
	public Set<String> getCitations() {
238
		return citations;
239
	}
240

    
241
	public void setCitations(final Set<String> citations) {
242
		this.citations = citations;
243
	}
244

    
245
	public Set<CnrCollection> getInCollections() {
246
		return inCollections;
247
	}
248

    
249
	public void setInCollections(final Set<CnrCollection> inCollections) {
250
		this.inCollections = inCollections;
251
	}
252

    
253
}
(5-5/8)