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.URISyntaxException;
|
13
|
|
14
|
import org.apache.log4j.Logger;
|
15
|
|
16
|
import eu.etaxonomy.cdm.io.dwca.TermUri;
|
17
|
import eu.etaxonomy.cdm.model.common.DefinedTerm;
|
18
|
import eu.etaxonomy.cdm.model.common.Language;
|
19
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
20
|
|
21
|
/**
|
22
|
* @author a.mueller
|
23
|
* @date 18.04.2011
|
24
|
*
|
25
|
*/
|
26
|
public class DwcaVernacularRecord extends DwcaRecordBase implements IDwcaAreaRecord{
|
27
|
@SuppressWarnings("unused")
|
28
|
private static final Logger logger = Logger.getLogger(DwcaVernacularRecord.class);
|
29
|
|
30
|
private String vernacularName;
|
31
|
private String source;
|
32
|
private Language language;
|
33
|
private String temporal;
|
34
|
private DwcaId locationId;
|
35
|
private String locality;
|
36
|
private String countryCode;
|
37
|
private DefinedTerm sex;
|
38
|
private DefinedTerm lifeStage;
|
39
|
private Boolean isPlural;
|
40
|
private Boolean isPreferredName;
|
41
|
private String organismPart;
|
42
|
private String taxonRemarks;
|
43
|
|
44
|
public DwcaVernacularRecord(DwcaMetaDataRecord metaDataRecord, DwcaTaxExportConfigurator config){
|
45
|
super(metaDataRecord, config);
|
46
|
locationId = new DwcaId(config);
|
47
|
}
|
48
|
|
49
|
/* (non-Javadoc)
|
50
|
* @see eu.etaxonomy.cdm.io.dwca.out.DwcaRecordBase#registerKnownFields()
|
51
|
*/
|
52
|
protected void registerKnownFields(){
|
53
|
try {
|
54
|
addKnownField("vernacularName", "http://rs.tdwg.org/dwc/terms/vernacularName");
|
55
|
addKnownField("source", "http://purl.org/dc/terms/source");
|
56
|
addKnownField("language", "http://purl.org/dc/terms/language");
|
57
|
addKnownField("temporal", "http://purl.org/dc/terms/temporal");
|
58
|
addKnownField("locationID", "http://rs.tdwg.org/dwc/terms/locationID");
|
59
|
addKnownField("countryCode", "http://rs.tdwg.org/dwc/terms/countryCode");
|
60
|
addKnownField("locality", "http://rs.tdwg.org/dwc/terms/locality");
|
61
|
addKnownField("sex", "http://rs.tdwg.org/dwc/terms/sex");
|
62
|
addKnownField("lifeStage", "http://rs.tdwg.org/dwc/terms/lifeStage");
|
63
|
addKnownField("isPlural", "http://rs.gbif.org/terms/1.0/isPlural");
|
64
|
addKnownField("organismPart", "http://rs.gbif.org/terms/1.0/organismPart");
|
65
|
addKnownField("taxonRemarks", "http://rs.tdwg.org/dwc/terms/taxonRemarks");
|
66
|
addKnownField("isPreferredName", "http://rs.gbif.org/terms/1.0/isPreferredName");
|
67
|
addKnownField("verbatimEventDate", "http://rs.tdwg.org/dwc/terms/verbatimEventDate");
|
68
|
addKnownField("verbatimLabel", "http://rs.gbif.org/terms/1.0/verbatimLabel");
|
69
|
addKnownField("verbatimLongitude", "http://rs.tdwg.org/dwc/terms/verbatimLongitude");
|
70
|
addKnownField("verbatimLatitude", "http://rs.tdwg.org/dwc/terms/verbatimLatitude");
|
71
|
} catch (URISyntaxException e) {
|
72
|
throw new RuntimeException(e);
|
73
|
}
|
74
|
}
|
75
|
|
76
|
|
77
|
// @Override
|
78
|
// public List<String> getHeaderList() {
|
79
|
// String[] result = new String[]{"coreid",
|
80
|
// "vernacularName",
|
81
|
// "source",
|
82
|
// "language",
|
83
|
// "temporal",
|
84
|
// "locationId",
|
85
|
// "locality",
|
86
|
// "countryCode",
|
87
|
// "sex",
|
88
|
// "lifeStage",
|
89
|
// "locality",
|
90
|
// "sex",
|
91
|
// "isPlural",
|
92
|
// "isPreferredName",
|
93
|
// "organismPart",
|
94
|
// "taxonRemarks"
|
95
|
// };
|
96
|
// return Arrays.asList(result);
|
97
|
// }
|
98
|
|
99
|
|
100
|
public void write(PrintWriter writer) {
|
101
|
printId(getUuid(), writer, IS_FIRST, "coreid");
|
102
|
|
103
|
print(vernacularName, writer, IS_NOT_FIRST, TermUri.DWC_VERNACULAR_NAME);
|
104
|
print(source, writer, IS_NOT_FIRST, TermUri.DC_SOURCE);
|
105
|
print(language, writer, IS_NOT_FIRST, TermUri.DC_LANGUAGE);
|
106
|
print(temporal, writer, IS_NOT_FIRST, TermUri.DC_TEMPORAL);
|
107
|
print(locationId, writer, IS_NOT_FIRST, TermUri.DWC_LOCATION_ID);
|
108
|
print(locality, writer, IS_NOT_FIRST, TermUri.DWC_LOCALITY);
|
109
|
print(countryCode, writer, IS_NOT_FIRST, TermUri.DWC_COUNTRY_CODE);
|
110
|
print(getSex(sex), writer, IS_NOT_FIRST, TermUri.DWC_SEX);
|
111
|
print(getLifeStage(lifeStage), writer, IS_NOT_FIRST, TermUri.DWC_LIFESTAGE);
|
112
|
print(isPlural, writer, IS_NOT_FIRST, TermUri.GBIF_IS_PLURAL);
|
113
|
print(isPreferredName, writer, IS_NOT_FIRST, TermUri.GBIF_IS_PREFERRED_NAME);
|
114
|
print(organismPart, writer, IS_NOT_FIRST, TermUri.GBIF_ORGANISM_PART);
|
115
|
print(taxonRemarks, writer, IS_NOT_FIRST, TermUri.DWC_TAXON_REMARKS);
|
116
|
writer.println();
|
117
|
}
|
118
|
|
119
|
|
120
|
|
121
|
public String getVernacularName() {
|
122
|
return vernacularName;
|
123
|
}
|
124
|
public void setVernacularName(String vernacularName) {
|
125
|
this.vernacularName = vernacularName;
|
126
|
}
|
127
|
public String getTaxonRemarks() {
|
128
|
return taxonRemarks;
|
129
|
}
|
130
|
public void setTaxonRemarks(String taxonRemarks) {
|
131
|
this.taxonRemarks = taxonRemarks;
|
132
|
}
|
133
|
public Language getLanguage() {
|
134
|
return language;
|
135
|
}
|
136
|
public void setLanguage(Language language) {
|
137
|
this.language = language;
|
138
|
}
|
139
|
public String getSource() {
|
140
|
return source;
|
141
|
}
|
142
|
public void setSource(String source) {
|
143
|
this.source = source;
|
144
|
}
|
145
|
|
146
|
public String getTemporal() {
|
147
|
return temporal;
|
148
|
}
|
149
|
|
150
|
|
151
|
public void setTemporal(String temporal) {
|
152
|
this.temporal = temporal;
|
153
|
}
|
154
|
|
155
|
|
156
|
public String getLocality() {
|
157
|
return locality;
|
158
|
}
|
159
|
|
160
|
|
161
|
public void setLocality(String locality) {
|
162
|
this.locality = locality;
|
163
|
}
|
164
|
|
165
|
|
166
|
public String getCountryCode() {
|
167
|
return countryCode;
|
168
|
}
|
169
|
|
170
|
|
171
|
public void setCountryCode(String countryCode) {
|
172
|
this.countryCode = countryCode;
|
173
|
}
|
174
|
|
175
|
|
176
|
public DefinedTerm getLifeStage() {
|
177
|
return lifeStage;
|
178
|
}
|
179
|
|
180
|
|
181
|
public void setLifeStage(DefinedTerm lifeStage) {
|
182
|
this.lifeStage = lifeStage;
|
183
|
}
|
184
|
|
185
|
|
186
|
public String getLocationId() {
|
187
|
return this.locationId.getId();
|
188
|
}
|
189
|
|
190
|
|
191
|
public void setLocationId(NamedArea locationId) {
|
192
|
this.locationId.setId(locationId);
|
193
|
}
|
194
|
|
195
|
public DefinedTerm getSex() {
|
196
|
return sex;
|
197
|
}
|
198
|
|
199
|
|
200
|
public void setSex(DefinedTerm sex) {
|
201
|
this.sex = sex;
|
202
|
}
|
203
|
|
204
|
|
205
|
public Boolean getIsPlural() {
|
206
|
return isPlural;
|
207
|
}
|
208
|
|
209
|
|
210
|
public void setIsPlural(Boolean isPlural) {
|
211
|
this.isPlural = isPlural;
|
212
|
}
|
213
|
|
214
|
|
215
|
public Boolean getIsPreferredName() {
|
216
|
return isPreferredName;
|
217
|
}
|
218
|
|
219
|
|
220
|
public void setIsPreferredName(Boolean isPreferredName) {
|
221
|
this.isPreferredName = isPreferredName;
|
222
|
}
|
223
|
|
224
|
|
225
|
public String getOrganismPart() {
|
226
|
return organismPart;
|
227
|
}
|
228
|
|
229
|
|
230
|
public void setOrganismPart(String organismPart) {
|
231
|
this.organismPart = organismPart;
|
232
|
}
|
233
|
|
234
|
|
235
|
|
236
|
|
237
|
}
|