Project

General

Profile

Download (5.37 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
import org.joda.time.DateTime;
18

    
19
import eu.etaxonomy.cdm.io.stream.terms.TermUri;
20
import eu.etaxonomy.cdm.model.agent.AgentBase;
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
 */
29
public class DwcaImageRecord extends DwcaRecordBase{
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 DateTime created;
43
	private AgentBase<?> creator;
44
	private AgentBase<?> contributor;
45
	private AgentBase<?> publisher;
46
	private String audience;
47

    
48

    
49
	public DwcaImageRecord(DwcaMetaDataRecord metaDataRecord, DwcaTaxExportConfigurator config){
50
		super(metaDataRecord, config);
51
	}
52

    
53

    
54
	@Override
55
    protected void registerKnownFields(){
56
		try {
57
			addKnownField("identifier", "http://purl.org/dc/terms/identifier");
58
			addKnownField("title", "http://purl.org/dc/terms/title");
59
			addKnownField("description", "http://purl.org/dc/terms/description");
60
			addKnownField("spatial", "http://purl.org/dc/terms/spatial");
61
			addKnownField("latitude", "http://www.w3.org/2003/01/geo/wgs84_pos#latitude");
62
			addKnownField("longitude", "http://www.w3.org/2003/01/geo/wgs84_pos#longitude");
63
			addKnownField("license", "http://purl.org/dc/terms/license");
64
			addKnownField("format", "http://purl.org/dc/terms/format");
65
			addKnownField("created", "http://purl.org/dc/terms/created");
66
			addKnownField("creator", "http://purl.org/dc/terms/creator");
67
			addKnownField("publisher", "http://purl.org/dc/terms/publisher");
68
			addKnownField("contributor", "http://purl.org/dc/terms/contributor");
69
			addKnownField("audience", "http://purl.org/dc/terms/audience");
70

    
71
		} catch (URISyntaxException e) {
72
			throw new RuntimeException(e);
73
		}
74
	}
75

    
76
//	@Override
77
//	public List<String> getHeaderList() {
78
//		String[] result = new String[]{"coreid",
79
//				"identifier",
80
//				"title",
81
//				"description",
82
//				"spatial",
83
//				"latitude",
84
//				"longitude",
85
//				"format",
86
//				"license",
87
//				"created",
88
//				"creator",
89
//				"contributor",
90
//				"publisher",
91
//				"audience"};
92
//		return Arrays.asList(result);
93
//	}
94

    
95
    @Override
96
    protected void doWrite(DwcaTaxExportState state, PrintWriter writer) {
97

    
98
		printId(getUuid(), writer, IS_FIRST, "coreid");
99
		print(identifier, writer, IS_NOT_FIRST, TermUri.DC_IDENTIFIER);
100
		print(title, writer, IS_NOT_FIRST, TermUri.DC_TITLE);
101
		print(description, writer, IS_NOT_FIRST, TermUri.DC_DESCRIPTION);
102
		print(spatial, writer, IS_NOT_FIRST, TermUri.DC_SPATIAL);
103
		print(coordinates, writer, IS_NOT_FIRST, TermUri.GEO_WGS84_LATITUDE, TermUri.GEO_WGS84_LONGITUDE);
104
		print(license, writer, IS_NOT_FIRST, TermUri.DC_LICENSE);
105
		print(getDate(created), writer, IS_NOT_FIRST, TermUri.DC_CREATED);
106
		print(creator, writer, IS_NOT_FIRST, TermUri.DC_CREATOR);
107
		print(contributor, writer, IS_NOT_FIRST, TermUri.DC_CONTRIBUTOR);
108
		print(publisher, writer, IS_NOT_FIRST, TermUri.DC_PUBLISHER);
109
		print(audience, writer, IS_NOT_FIRST, TermUri.DC_AUDIENCE);
110

    
111
		writer.println();
112
	}
113

    
114
	public URI getIdentifier() {
115
		return identifier;
116
	}
117

    
118
	public void setIdentifier(URI identifier) {
119
		this.identifier = identifier;
120
	}
121

    
122
	public String getTitle() {
123
		return title;
124
	}
125

    
126
	public void setTitle(String title) {
127
		this.title = title;
128
	}
129

    
130
	public String getDescription() {
131
		return description;
132
	}
133

    
134
	public void setDescription(String description) {
135
		this.description = description;
136
	}
137

    
138
	public String getSpatial() {
139
		return spatial;
140
	}
141

    
142
	public void setSpatial(String spatial) {
143
		this.spatial = spatial;
144
	}
145

    
146
	public Point getCoordinates() {
147
		return coordinates;
148
	}
149

    
150
	public void setCoordinates(Point coordinates) {
151
		this.coordinates = coordinates;
152
	}
153

    
154
	public String getFormat() {
155
		return format;
156
	}
157

    
158
	public void setFormat(String format) {
159
		this.format = format;
160
	}
161

    
162
	public Set<Rights> getLicense() {
163
		return license;
164
	}
165

    
166
	public void setLicense(Set<Rights> set) {
167
		this.license = set;
168
	}
169

    
170
	public DateTime getCreated() {
171
		return created;
172
	}
173

    
174
	public void setCreated(DateTime created) {
175
		this.created = created;
176
	}
177

    
178
	public AgentBase<?> getCreator() {
179
		return creator;
180
	}
181

    
182
	public void setCreator(AgentBase<?> creator) {
183
		this.creator = creator;
184
	}
185

    
186
	public AgentBase<?> getContributor() {
187
		return contributor;
188
	}
189

    
190
	public void setContributor(AgentBase<?> contributor) {
191
		this.contributor = contributor;
192
	}
193

    
194
	public AgentBase<?> getPublisher() {
195
		return publisher;
196
	}
197

    
198
	public void setPublisher(AgentBase<?> publisher) {
199
		this.publisher = publisher;
200
	}
201

    
202
	public String getAudience() {
203
		return audience;
204
	}
205

    
206
	public void setAudience(String audience) {
207
		this.audience = audience;
208
	}
209

    
210

    
211

    
212
}
(11-11/33)