1
|
/**
|
2
|
* Copyright (C) 2009 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.io.dwca.out;
|
10
|
|
11
|
import java.io.PrintWriter;
|
12
|
import java.net.URI;
|
13
|
import java.net.URISyntaxException;
|
14
|
import java.util.Set;
|
15
|
|
16
|
import org.apache.log4j.Logger;
|
17
|
|
18
|
import eu.etaxonomy.cdm.io.stream.terms.TermUri;
|
19
|
import eu.etaxonomy.cdm.model.agent.AgentBase;
|
20
|
import eu.etaxonomy.cdm.model.common.LSID;
|
21
|
import eu.etaxonomy.cdm.model.common.Language;
|
22
|
import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
|
23
|
import eu.etaxonomy.cdm.model.media.Rights;
|
24
|
|
25
|
/**
|
26
|
* @author a.mueller
|
27
|
* @since 20.04.2011
|
28
|
*
|
29
|
*/
|
30
|
public class DwcaReferenceRecord extends DwcaRecordBase{
|
31
|
@SuppressWarnings("unused")
|
32
|
private static final Logger logger = Logger.getLogger(DwcaReferenceRecord.class);
|
33
|
|
34
|
private String isbnIssn;
|
35
|
private URI uri;
|
36
|
private String doi;
|
37
|
private LSID lsid;
|
38
|
|
39
|
|
40
|
private String bibliographicCitation;
|
41
|
private String title;
|
42
|
private AgentBase<?> creator;
|
43
|
private VerbatimTimePeriod date;
|
44
|
private String source;
|
45
|
private String description;
|
46
|
private String subject;
|
47
|
private Language language;
|
48
|
private Set<Rights> rights;
|
49
|
private String taxonRemarks;
|
50
|
private String type;
|
51
|
|
52
|
|
53
|
public DwcaReferenceRecord(DwcaMetaDataRecord metaDataRecord, DwcaTaxExportConfigurator config){
|
54
|
super(metaDataRecord, config);
|
55
|
}
|
56
|
|
57
|
@Override
|
58
|
protected void registerKnownFields(){
|
59
|
try {
|
60
|
addKnownField("identifier", "http://purl.org/dc/terms/identifier");
|
61
|
addKnownField("bibliographicCitation", "http://purl.org/dc/terms/bibliographicCitation");
|
62
|
addKnownField("title", "http://purl.org/dc/terms/title");
|
63
|
addKnownField("creator", "http://purl.org/dc/terms/creator");
|
64
|
addKnownField("date", "http://purl.org/dc/terms/date");
|
65
|
addKnownField("source", "http://purl.org/dc/terms/source");
|
66
|
addKnownField("subject", "http://purl.org/dc/terms/subject");
|
67
|
addKnownField("description", "http://purl.org/dc/terms/description");
|
68
|
addKnownField("language", "http://purl.org/dc/terms/language");
|
69
|
addKnownField("rights", "http://purl.org/dc/terms/rights");
|
70
|
addKnownField("taxonRemarks", "http://rs.tdwg.org/dwc/terms/taxonRemarks");
|
71
|
addKnownField("type", "http://purl.org/dc/terms/type");
|
72
|
|
73
|
|
74
|
} catch (URISyntaxException e) {
|
75
|
throw new RuntimeException(e);
|
76
|
}
|
77
|
}
|
78
|
|
79
|
// @Override
|
80
|
// public List<String> getHeaderList() {
|
81
|
// String[] result = new String[]{"coreid",
|
82
|
// "identifier",
|
83
|
// "identifier",
|
84
|
// "identifier",
|
85
|
// "identifier",
|
86
|
// "bibliographicCitation",
|
87
|
// "title",
|
88
|
// "creator",
|
89
|
// "date",
|
90
|
// "source",
|
91
|
// "description",
|
92
|
// "subject",
|
93
|
// "language",
|
94
|
// "rights",
|
95
|
// "taxonRemarks",
|
96
|
// "type"};
|
97
|
// return Arrays.asList(result);
|
98
|
// }
|
99
|
|
100
|
@Override
|
101
|
protected void doWrite(DwcaTaxExportState state, PrintWriter writer) {
|
102
|
|
103
|
printId(getUuid(), writer, IS_FIRST, "coreid");
|
104
|
print(isbnIssn, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
|
105
|
print(uri, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
|
106
|
print(doi, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
|
107
|
print(lsid, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
|
108
|
print(bibliographicCitation, writer, IS_NOT_FIRST, TermUri.DC_BIBLIOGRAPHIC_CITATION);
|
109
|
print(title, writer, IS_NOT_FIRST, TermUri.DC_TITLE);
|
110
|
print(creator, writer, IS_NOT_FIRST, TermUri.DC_CREATOR);
|
111
|
//TODO
|
112
|
print(getTimePeriod(date), writer, IS_NOT_FIRST, TermUri.DC_DATE);
|
113
|
print(source, writer, IS_NOT_FIRST, TermUri.DC_SOURCE);
|
114
|
print(description, writer, IS_NOT_FIRST, TermUri.DC_DESCRIPTION);
|
115
|
print(subject, writer, IS_NOT_FIRST, TermUri.DC_SUBJECT);
|
116
|
print(language, writer, IS_NOT_FIRST, TermUri.DC_LANGUAGE);
|
117
|
print(rights, writer, IS_NOT_FIRST, TermUri.DC_RIGHTS);
|
118
|
print(taxonRemarks, writer, IS_NOT_FIRST, TermUri.DWC_TAXON_REMARKS);
|
119
|
print(type, writer, IS_NOT_FIRST, TermUri.DC_TYPE);
|
120
|
writer.println();
|
121
|
}
|
122
|
|
123
|
public String getSource() {
|
124
|
return source;
|
125
|
}
|
126
|
public void setSource(String source) {
|
127
|
this.source = source;
|
128
|
}
|
129
|
|
130
|
public String getIsbnIssn() {
|
131
|
return isbnIssn;
|
132
|
}
|
133
|
|
134
|
public void setIsbnIssn(String isbnIssn) {
|
135
|
this.isbnIssn = isbnIssn;
|
136
|
}
|
137
|
|
138
|
public URI getUri() {
|
139
|
return uri;
|
140
|
}
|
141
|
|
142
|
public void setUri(URI uri) {
|
143
|
this.uri = uri;
|
144
|
}
|
145
|
|
146
|
public String getDoi() {
|
147
|
return doi;
|
148
|
}
|
149
|
|
150
|
public void setDoi(String doi) {
|
151
|
this.doi = doi;
|
152
|
}
|
153
|
|
154
|
public LSID getLsid() {
|
155
|
return lsid;
|
156
|
}
|
157
|
|
158
|
public void setLsid(LSID lsid) {
|
159
|
this.lsid = lsid;
|
160
|
}
|
161
|
|
162
|
public void setISBN_ISSN(String isbnIssn) {
|
163
|
this.isbnIssn = isbnIssn;
|
164
|
}
|
165
|
|
166
|
|
167
|
public String getBibliographicCitation() {
|
168
|
return bibliographicCitation;
|
169
|
}
|
170
|
|
171
|
|
172
|
public void setBibliographicCitation(String bibliographicCitation) {
|
173
|
this.bibliographicCitation = bibliographicCitation;
|
174
|
}
|
175
|
|
176
|
|
177
|
public String getTitle() {
|
178
|
return title;
|
179
|
}
|
180
|
|
181
|
|
182
|
public void setTitle(String title) {
|
183
|
this.title = title;
|
184
|
}
|
185
|
|
186
|
|
187
|
public AgentBase<?> getCreator() {
|
188
|
return creator;
|
189
|
}
|
190
|
|
191
|
|
192
|
public void setCreator(AgentBase<?> creator) {
|
193
|
this.creator = creator;
|
194
|
}
|
195
|
|
196
|
|
197
|
public VerbatimTimePeriod getDate() {
|
198
|
return date;
|
199
|
}
|
200
|
|
201
|
|
202
|
public void setDate(VerbatimTimePeriod date) {
|
203
|
this.date = date;
|
204
|
}
|
205
|
|
206
|
|
207
|
public String getDescription() {
|
208
|
return description;
|
209
|
}
|
210
|
|
211
|
|
212
|
public void setDescription(String description) {
|
213
|
this.description = description;
|
214
|
}
|
215
|
|
216
|
|
217
|
public String getSubject() {
|
218
|
return subject;
|
219
|
}
|
220
|
|
221
|
|
222
|
public void setSubject(String subject) {
|
223
|
this.subject = subject;
|
224
|
}
|
225
|
|
226
|
|
227
|
public Language getLanguage() {
|
228
|
return language;
|
229
|
}
|
230
|
|
231
|
|
232
|
public void setLanguage(Language language) {
|
233
|
this.language = language;
|
234
|
}
|
235
|
|
236
|
|
237
|
public Set<Rights> getRights() {
|
238
|
return rights;
|
239
|
}
|
240
|
|
241
|
|
242
|
public void setRights(Set<Rights> rights) {
|
243
|
this.rights = rights;
|
244
|
}
|
245
|
|
246
|
|
247
|
public String getTaxonRemarks() {
|
248
|
return taxonRemarks;
|
249
|
}
|
250
|
|
251
|
|
252
|
public void setTaxonRemarks(String taxonRemarks) {
|
253
|
this.taxonRemarks = taxonRemarks;
|
254
|
}
|
255
|
|
256
|
|
257
|
public String getType() {
|
258
|
return type;
|
259
|
}
|
260
|
|
261
|
|
262
|
public void setType(String type) {
|
263
|
this.type = type;
|
264
|
}
|
265
|
|
266
|
|
267
|
}
|