Project

General

Profile

Download (6.18 KB) Statistics
| Branch: | Tag: | Revision:
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.dwca.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.TimePeriod;
23
import eu.etaxonomy.cdm.model.media.Rights;
24

    
25
/**
26
 * @author a.mueller
27
 * @date 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 TimePeriod 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
    public void write(DwcaTaxExportState state, PrintWriter writer) {
102
        if(writer == null){
103
            writeCsv(state);
104
            return;
105
        }
106
		printId(getUuid(), writer, IS_FIRST, "coreid");
107
		print(isbnIssn, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
108
		print(uri, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
109
		print(doi, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
110
		print(lsid, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
111
		print(bibliographicCitation, writer, IS_NOT_FIRST, TermUri.DC_BIBLIOGRAPHIC_CITATION);
112
		print(title, writer, IS_NOT_FIRST, TermUri.DC_TITLE);
113
		print(creator, writer, IS_NOT_FIRST, TermUri.DC_CREATOR);
114
		//TODO
115
		print(getTimePeriod(date), writer, IS_NOT_FIRST, TermUri.DC_DATE);
116
		print(source, writer, IS_NOT_FIRST, TermUri.DC_SOURCE);
117
		print(description, writer, IS_NOT_FIRST, TermUri.DC_DESCRIPTION);
118
		print(subject, writer, IS_NOT_FIRST, TermUri.DC_SUBJECT);
119
		print(language, writer, IS_NOT_FIRST, TermUri.DC_LANGUAGE);
120
		print(rights, writer, IS_NOT_FIRST, TermUri.DC_RIGHTS);
121
		print(taxonRemarks, writer, IS_NOT_FIRST, TermUri.DWC_TAXON_REMARKS);
122
		print(type, writer, IS_NOT_FIRST, TermUri.DC_TYPE);
123
		writer.println();
124
	}
125

    
126
	public String getSource() {
127
		return source;
128
	}
129
	public void setSource(String source) {
130
		this.source = source;
131
	}
132

    
133
	public String getIsbnIssn() {
134
		return isbnIssn;
135
	}
136

    
137
	public void setIsbnIssn(String isbnIssn) {
138
		this.isbnIssn = isbnIssn;
139
	}
140

    
141
	public URI getUri() {
142
		return uri;
143
	}
144

    
145
	public void setUri(URI uri) {
146
		this.uri = uri;
147
	}
148

    
149
	public String getDoi() {
150
		return doi;
151
	}
152

    
153
	public void setDoi(String doi) {
154
		this.doi = doi;
155
	}
156

    
157
	public LSID getLsid() {
158
		return lsid;
159
	}
160

    
161
	public void setLsid(LSID lsid) {
162
		this.lsid = lsid;
163
	}
164

    
165
	public void setISBN_ISSN(String isbnIssn) {
166
		this.isbnIssn = isbnIssn;
167
	}
168

    
169

    
170
	public String getBibliographicCitation() {
171
		return bibliographicCitation;
172
	}
173

    
174

    
175
	public void setBibliographicCitation(String bibliographicCitation) {
176
		this.bibliographicCitation = bibliographicCitation;
177
	}
178

    
179

    
180
	public String getTitle() {
181
		return title;
182
	}
183

    
184

    
185
	public void setTitle(String title) {
186
		this.title = title;
187
	}
188

    
189

    
190
	public AgentBase<?> getCreator() {
191
		return creator;
192
	}
193

    
194

    
195
	public void setCreator(AgentBase<?> creator) {
196
		this.creator = creator;
197
	}
198

    
199

    
200
	public TimePeriod getDate() {
201
		return date;
202
	}
203

    
204

    
205
	public void setDate(TimePeriod date) {
206
		this.date = date;
207
	}
208

    
209

    
210
	public String getDescription() {
211
		return description;
212
	}
213

    
214

    
215
	public void setDescription(String description) {
216
		this.description = description;
217
	}
218

    
219

    
220
	public String getSubject() {
221
		return subject;
222
	}
223

    
224

    
225
	public void setSubject(String subject) {
226
		this.subject = subject;
227
	}
228

    
229

    
230
	public Language getLanguage() {
231
		return language;
232
	}
233

    
234

    
235
	public void setLanguage(Language language) {
236
		this.language = language;
237
	}
238

    
239

    
240
	public Set<Rights> getRights() {
241
		return rights;
242
	}
243

    
244

    
245
	public void setRights(Set<Rights> rights) {
246
		this.rights = rights;
247
	}
248

    
249

    
250
	public String getTaxonRemarks() {
251
		return taxonRemarks;
252
	}
253

    
254

    
255
	public void setTaxonRemarks(String taxonRemarks) {
256
		this.taxonRemarks = taxonRemarks;
257
	}
258

    
259

    
260
	public String getType() {
261
		return type;
262
	}
263

    
264

    
265
	public void setType(String type) {
266
		this.type = type;
267
	}
268

    
269

    
270
}
(16-16/33)