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.io.dwca.TermUri;
|
18
|
import eu.etaxonomy.cdm.model.agent.AgentBase;
|
19
|
import eu.etaxonomy.cdm.model.common.Language;
|
20
|
import eu.etaxonomy.cdm.model.description.Feature;
|
21
|
import eu.etaxonomy.cdm.model.media.Rights;
|
22
|
|
23
|
/**
|
24
|
* @author a.mueller
|
25
|
* @date 20.04.2011
|
26
|
*
|
27
|
*/
|
28
|
public class DwcaDescriptionRecord extends DwcaRecordBase {
|
29
|
@SuppressWarnings("unused")
|
30
|
private static final Logger logger = Logger.getLogger(DwcaDescriptionRecord.class);
|
31
|
|
32
|
private String description;
|
33
|
private Feature type;
|
34
|
private String source;
|
35
|
private Language language;
|
36
|
private AgentBase<?> creator;
|
37
|
private AgentBase<?> contributor;
|
38
|
private String audience;
|
39
|
private Set<Rights> license;
|
40
|
private AgentBase<?> rightsHolder;
|
41
|
|
42
|
|
43
|
public DwcaDescriptionRecord(DwcaMetaDataRecord metaDataRecord, DwcaTaxExportConfigurator config){
|
44
|
super(metaDataRecord, config);
|
45
|
}
|
46
|
|
47
|
/* (non-Javadoc)
|
48
|
* @see eu.etaxonomy.cdm.io.dwca.out.DwcaRecordBase#registerKnownFields()
|
49
|
*/
|
50
|
protected void registerKnownFields(){
|
51
|
try {
|
52
|
addKnownField("description", "http://purl.org/dc/terms/description");
|
53
|
addKnownField("type", "http://purl.org/dc/terms/type");
|
54
|
addKnownField("source", "http://purl.org/dc/terms/source");
|
55
|
addKnownField("language", "http://purl.org/dc/terms/language");
|
56
|
addKnownField("creator", "http://purl.org/dc/terms/creator");
|
57
|
addKnownField("contributor", "http://purl.org/dc/terms/contributor");
|
58
|
addKnownField("audience", "http://purl.org/dc/terms/audience");
|
59
|
addKnownField("license", "http://purl.org/dc/terms/license");
|
60
|
addKnownField("rightsHolder", "http://purl.org/dc/terms/rightsHolder");
|
61
|
|
62
|
} catch (URISyntaxException e) {
|
63
|
throw new RuntimeException(e);
|
64
|
}
|
65
|
}
|
66
|
|
67
|
// @Override
|
68
|
// public List<String> getHeaderList() {
|
69
|
// String[] result = new String[]{
|
70
|
// "coreid",
|
71
|
// "description",
|
72
|
// "type",
|
73
|
// "source",
|
74
|
// "language",
|
75
|
// "creator",
|
76
|
// "contributor",
|
77
|
// "audience",
|
78
|
// "license",
|
79
|
// "rightsHolder"};
|
80
|
// return Arrays.asList(result);
|
81
|
// }
|
82
|
|
83
|
public void write(PrintWriter writer) {
|
84
|
printId(getUuid(), writer, IS_FIRST, "coreid");
|
85
|
print(description, writer, IS_NOT_FIRST, TermUri.DC_DESCRIPTION);
|
86
|
print(getFeature(type), writer, IS_NOT_FIRST, TermUri.DC_TYPE);
|
87
|
print(source, writer, IS_NOT_FIRST, TermUri.DC_SOURCE);
|
88
|
print(language, writer, IS_NOT_FIRST, TermUri.DC_LANGUAGE);
|
89
|
print(creator, writer, IS_NOT_FIRST, TermUri.DC_CREATOR);
|
90
|
print(contributor, writer, IS_NOT_FIRST, TermUri.DC_CONTRIBUTOR);
|
91
|
print(audience, writer, IS_NOT_FIRST, TermUri.DC_AUDIENCE);
|
92
|
print(license, writer, IS_NOT_FIRST, TermUri.DC_LICENSE);
|
93
|
print(rightsHolder, writer, IS_NOT_FIRST, TermUri.DC_RIGHTS_HOLDER);
|
94
|
writer.print(config.getLinesTerminatedBy());
|
95
|
}
|
96
|
|
97
|
public String getSource() {
|
98
|
return source;
|
99
|
}
|
100
|
public void setSource(String source) {
|
101
|
this.source = source;
|
102
|
}
|
103
|
|
104
|
public String getDescription() {
|
105
|
return description;
|
106
|
}
|
107
|
|
108
|
|
109
|
public void setDescription(String description) {
|
110
|
this.description = description;
|
111
|
}
|
112
|
|
113
|
|
114
|
public Feature getType() {
|
115
|
return type;
|
116
|
}
|
117
|
|
118
|
|
119
|
public void setType(Feature type) {
|
120
|
this.type = type;
|
121
|
}
|
122
|
|
123
|
|
124
|
public Language getLanguage() {
|
125
|
return language;
|
126
|
}
|
127
|
|
128
|
|
129
|
public void setLanguage(Language language) {
|
130
|
this.language = language;
|
131
|
}
|
132
|
|
133
|
|
134
|
public AgentBase<?> getCreator() {
|
135
|
return creator;
|
136
|
}
|
137
|
|
138
|
|
139
|
public void setCreator(AgentBase<?> creator) {
|
140
|
this.creator = creator;
|
141
|
}
|
142
|
|
143
|
|
144
|
public AgentBase<?> getContributor() {
|
145
|
return contributor;
|
146
|
}
|
147
|
|
148
|
|
149
|
public void setContributor(AgentBase<?> contributor) {
|
150
|
this.contributor = contributor;
|
151
|
}
|
152
|
|
153
|
|
154
|
public String getAudience() {
|
155
|
return audience;
|
156
|
}
|
157
|
|
158
|
|
159
|
public void setAudience(String audience) {
|
160
|
this.audience = audience;
|
161
|
}
|
162
|
|
163
|
|
164
|
public Set<Rights> getLicense() {
|
165
|
return license;
|
166
|
}
|
167
|
|
168
|
|
169
|
public void setLicense(Set<Rights> license) {
|
170
|
this.license = license;
|
171
|
}
|
172
|
|
173
|
|
174
|
public AgentBase<?> getRightsHolder() {
|
175
|
return rightsHolder;
|
176
|
}
|
177
|
|
178
|
|
179
|
public void setRightsHolder(AgentBase<?> rightsHolder) {
|
180
|
this.rightsHolder = rightsHolder;
|
181
|
}
|
182
|
|
183
|
|
184
|
|
185
|
}
|