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
|
import java.util.Set;
|
14
|
|
15
|
import org.apache.log4j.Logger;
|
16
|
|
17
|
import eu.etaxonomy.cdm.common.URI;
|
18
|
import eu.etaxonomy.cdm.io.stream.terms.TermUri;
|
19
|
import eu.etaxonomy.cdm.model.agent.AgentBase;
|
20
|
import eu.etaxonomy.cdm.model.common.TimePeriod;
|
21
|
import eu.etaxonomy.cdm.model.location.Point;
|
22
|
import eu.etaxonomy.cdm.model.media.Rights;
|
23
|
|
24
|
/**
|
25
|
* @author a.mueller
|
26
|
* @since 20.04.2011
|
27
|
*/
|
28
|
public class DwcaImageRecord extends DwcaRecordBase{
|
29
|
|
30
|
@SuppressWarnings("unused")
|
31
|
private static final Logger logger = Logger.getLogger(DwcaImageRecord.class);
|
32
|
|
33
|
private URI identifier;
|
34
|
private String title;
|
35
|
private String description;
|
36
|
|
37
|
//TODO ??
|
38
|
private String spatial;
|
39
|
private Point coordinates;
|
40
|
private String format;
|
41
|
private Set<Rights> license;
|
42
|
private TimePeriod created;
|
43
|
private AgentBase<?> creator;
|
44
|
private AgentBase<?> contributor;
|
45
|
private AgentBase<?> publisher;
|
46
|
private String audience;
|
47
|
|
48
|
public DwcaImageRecord(DwcaMetaDataRecord metaDataRecord, DwcaTaxExportConfigurator config){
|
49
|
super(metaDataRecord, config);
|
50
|
}
|
51
|
|
52
|
@Override
|
53
|
protected void registerKnownFields(){
|
54
|
try {
|
55
|
addKnownField("identifier", "http://purl.org/dc/terms/identifier");
|
56
|
addKnownField("title", "http://purl.org/dc/terms/title");
|
57
|
addKnownField("description", "http://purl.org/dc/terms/description");
|
58
|
addKnownField("spatial", "http://purl.org/dc/terms/spatial");
|
59
|
addKnownField("latitude", "http://www.w3.org/2003/01/geo/wgs84_pos#latitude");
|
60
|
addKnownField("longitude", "http://www.w3.org/2003/01/geo/wgs84_pos#longitude");
|
61
|
addKnownField("license", "http://purl.org/dc/terms/license");
|
62
|
addKnownField("format", "http://purl.org/dc/terms/format");
|
63
|
addKnownField("created", "http://purl.org/dc/terms/created");
|
64
|
addKnownField("creator", "http://purl.org/dc/terms/creator");
|
65
|
addKnownField("publisher", "http://purl.org/dc/terms/publisher");
|
66
|
addKnownField("contributor", "http://purl.org/dc/terms/contributor");
|
67
|
addKnownField("audience", "http://purl.org/dc/terms/audience");
|
68
|
|
69
|
} catch (URISyntaxException e) {
|
70
|
throw new RuntimeException(e);
|
71
|
}
|
72
|
}
|
73
|
|
74
|
// @Override
|
75
|
// public List<String> getHeaderList() {
|
76
|
// String[] result = new String[]{"coreid",
|
77
|
// "identifier",
|
78
|
// "title",
|
79
|
// "description",
|
80
|
// "spatial",
|
81
|
// "latitude",
|
82
|
// "longitude",
|
83
|
// "format",
|
84
|
// "license",
|
85
|
// "created",
|
86
|
// "creator",
|
87
|
// "contributor",
|
88
|
// "publisher",
|
89
|
// "audience"};
|
90
|
// return Arrays.asList(result);
|
91
|
// }
|
92
|
|
93
|
@Override
|
94
|
protected void doWrite(DwcaTaxExportState state, PrintWriter writer) {
|
95
|
|
96
|
printId(getUuid(), writer, IS_FIRST, "coreid");
|
97
|
print(identifier, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
|
98
|
print(title, writer, IS_NOT_FIRST, TermUri.DC_TITLE);
|
99
|
print(description, writer, IS_NOT_FIRST, TermUri.DC_DESCRIPTION);
|
100
|
print(spatial, writer, IS_NOT_FIRST, TermUri.DC_SPATIAL);
|
101
|
print(coordinates, writer, IS_NOT_FIRST, TermUri.GEO_WGS84_LATITUDE, TermUri.GEO_WGS84_LONGITUDE);
|
102
|
print(license, writer, IS_NOT_FIRST, TermUri.DC_LICENSE);
|
103
|
print(getTimePeriod(created), writer, IS_NOT_FIRST, TermUri.DC_CREATED);
|
104
|
print(creator, writer, IS_NOT_FIRST, TermUri.DC_CREATOR);
|
105
|
print(contributor, writer, IS_NOT_FIRST, TermUri.DC_CONTRIBUTOR);
|
106
|
print(publisher, writer, IS_NOT_FIRST, TermUri.DC_PUBLISHER);
|
107
|
print(audience, writer, IS_NOT_FIRST, TermUri.DC_AUDIENCE);
|
108
|
|
109
|
writer.println();
|
110
|
}
|
111
|
|
112
|
public URI getIdentifier() {
|
113
|
return identifier;
|
114
|
}
|
115
|
public void setIdentifier(URI identifier) {
|
116
|
this.identifier = identifier;
|
117
|
}
|
118
|
|
119
|
public String getTitle() {
|
120
|
return title;
|
121
|
}
|
122
|
public void setTitle(String title) {
|
123
|
this.title = title;
|
124
|
}
|
125
|
|
126
|
public String getDescription() {
|
127
|
return description;
|
128
|
}
|
129
|
public void setDescription(String description) {
|
130
|
this.description = description;
|
131
|
}
|
132
|
|
133
|
public String getSpatial() {
|
134
|
return spatial;
|
135
|
}
|
136
|
public void setSpatial(String spatial) {
|
137
|
this.spatial = spatial;
|
138
|
}
|
139
|
|
140
|
public Point getCoordinates() {
|
141
|
return coordinates;
|
142
|
}
|
143
|
public void setCoordinates(Point coordinates) {
|
144
|
this.coordinates = coordinates;
|
145
|
}
|
146
|
|
147
|
public String getFormat() {
|
148
|
return format;
|
149
|
}
|
150
|
public void setFormat(String format) {
|
151
|
this.format = format;
|
152
|
}
|
153
|
|
154
|
public Set<Rights> getLicense() {
|
155
|
return license;
|
156
|
}
|
157
|
public void setLicense(Set<Rights> set) {
|
158
|
this.license = set;
|
159
|
}
|
160
|
|
161
|
public TimePeriod getCreated() {
|
162
|
return created;
|
163
|
}
|
164
|
public void setCreated(TimePeriod created) {
|
165
|
this.created = created;
|
166
|
}
|
167
|
|
168
|
public AgentBase<?> getCreator() {
|
169
|
return creator;
|
170
|
}
|
171
|
public void setCreator(AgentBase<?> creator) {
|
172
|
this.creator = creator;
|
173
|
}
|
174
|
|
175
|
public AgentBase<?> getContributor() {
|
176
|
return contributor;
|
177
|
}
|
178
|
public void setContributor(AgentBase<?> contributor) {
|
179
|
this.contributor = contributor;
|
180
|
}
|
181
|
|
182
|
public AgentBase<?> getPublisher() {
|
183
|
return publisher;
|
184
|
}
|
185
|
public void setPublisher(AgentBase<?> publisher) {
|
186
|
this.publisher = publisher;
|
187
|
}
|
188
|
|
189
|
public String getAudience() {
|
190
|
return audience;
|
191
|
}
|
192
|
public void setAudience(String audience) {
|
193
|
this.audience = audience;
|
194
|
}
|
195
|
}
|