1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.impl;
18 import java.util.Collection;
19 import java.util.Locale;
20
21 import org.apache.jetspeed.om.common.DublinCore;
22 import org.apache.jetspeed.om.common.GenericMetadata;
23
24 /***
25 * DublinCoreImpl
26 * <br/>
27 * Implementation that allows retrieving information according to the
28 * Dublin Core specification
29 * (<a href="http://www.dublincore.org">http://www.dublincore.org</a>)
30 *
31 * @author <a href="mailto:jford@apache.org">Jeremy Ford</a>
32 * @version $Id: DublinCoreImpl.java 517719 2007-03-13 15:05:48Z ate $
33 *
34 */
35 public class DublinCoreImpl implements DublinCore
36 {
37 public static final String TITLE = "title";
38 public static final String CONTRIBUTOR = "contributor";
39 public static final String COVERAGE = "coverage";
40 public static final String CREATOR = "creator";
41 public static final String DESCRIPTION = "description";
42 public static final String FORMAT = "format";
43 public static final String IDENTIFIER = "identifier";
44 public static final String LANGUAGE = "language";
45 public static final String PUBLISHER = "publisher";
46 public static final String RELATION = "relation";
47 public static final String RIGHT = "right";
48 public static final String SOURCE = "source";
49 public static final String SUBJECT = "subject";
50 public static final String TYPE = "type";
51
52 GenericMetadata metadata = null;
53
54 /***
55 * @param md
56 */
57 public DublinCoreImpl(GenericMetadata md) {
58
59 this.metadata = md;
60 }
61
62 /***
63 * @return Returns the titles
64 */
65 public Collection getTitles()
66 {
67 return metadata.getFields(TITLE);
68 }
69
70 /***
71 * @param titles The titles to set
72 */
73 public void setTitles(Collection titles)
74 {
75 metadata.setFields(TITLE, titles);
76 }
77
78 /***
79 * @return Returns the contributors.
80 */
81 public Collection getContributors() {
82 return metadata.getFields(CONTRIBUTOR);
83 }
84
85 /***
86 * @param contributors The contributors to set.
87 */
88 public void setContributors(Collection contributors) {
89 metadata.setFields(CONTRIBUTOR, contributors);
90 }
91
92 /***
93 * @return Returns the coverages.
94 */
95 public Collection getCoverages() {
96 return metadata.getFields(COVERAGE);
97 }
98
99 /***
100 * @param coverages The coverages to set.
101 */
102 public void setCoverages(Collection coverages) {
103 metadata.setFields(COVERAGE, coverages);
104 }
105
106 /***
107 * @return Returns the creators.
108 */
109 public Collection getCreators() {
110 return metadata.getFields(CREATOR);
111 }
112
113 /***
114 * @param creators The creators to set.
115 */
116 public void setCreators(Collection creators) {
117 metadata.setFields(CREATOR, creators);
118 }
119
120 /***
121 * @return Returns the descriptions.
122 */
123 public Collection getDescriptions() {
124 return metadata.getFields(DESCRIPTION);
125 }
126
127 /***
128 * @param descriptions The descriptions to set.
129 */
130 public void setDescriptions(Collection descriptions) {
131 metadata.setFields(DESCRIPTION, descriptions);
132 }
133
134 /***
135 * @return Returns the formats.
136 */
137 public Collection getFormats() {
138 return metadata.getFields(FORMAT);
139 }
140
141 /***
142 * @param formats The formats to set.
143 */
144 public void setFormats(Collection formats) {
145 metadata.setFields(FORMAT, formats);
146 }
147
148 /***
149 * @return Returns the identifiers.
150 */
151 public Collection getIdentifiers() {
152 return metadata.getFields(IDENTIFIER);
153 }
154
155 /***
156 * @param identifiers The identifiers to set.
157 */
158 public void setIdentifiers(Collection identifiers) {
159 metadata.setFields(IDENTIFIER, identifiers);
160 }
161
162 /***
163 * @return Returns the languages.
164 */
165 public Collection getLanguages() {
166 return metadata.getFields(LANGUAGE);
167 }
168
169 /***
170 * @param languages The languages to set.
171 */
172 public void setLanguages(Collection languages) {
173 metadata.setFields(LANGUAGE, languages);
174 }
175
176 /***
177 * @return Returns the publishers.
178 */
179 public Collection getPublishers() {
180 return metadata.getFields(PUBLISHER);
181 }
182
183 /***
184 * @param publishers The publishers to set.
185 */
186 public void setPublishers(Collection publishers) {
187 metadata.setFields(PUBLISHER, publishers);
188 }
189
190 /***
191 * @return Returns the relations.
192 */
193 public Collection getRelations() {
194 return metadata.getFields(RELATION);
195 }
196
197 /***
198 * @param relations The relations to set.
199 */
200 public void setRelations(Collection relations) {
201 metadata.setFields(RELATION, relations);
202 }
203
204 /***
205 * @return Returns the rights.
206 */
207 public Collection getRights() {
208 return metadata.getFields(RIGHT);
209 }
210
211 /***
212 * @param rights The rights to set.
213 */
214 public void setRights(Collection rights) {
215 metadata.setFields(RIGHT, rights);
216 }
217
218 /***
219 * @return Returns the sources.
220 */
221 public Collection getSources() {
222 return metadata.getFields(SOURCE);
223 }
224
225 /***
226 * @param sources The sources to set.
227 */
228 public void setSources(Collection sources) {
229 metadata.setFields(SOURCE, sources);
230 }
231
232 /***
233 * @return Returns the subjects.
234 */
235 public Collection getSubjects() {
236 return metadata.getFields(SUBJECT);
237 }
238
239 /***
240 * @param subjects The subjects to set.
241 */
242 public void setSubjects(Collection subjects) {
243 metadata.setFields(SUBJECT, subjects);
244 }
245
246 /***
247 * @return Returns the types.
248 */
249 public Collection getTypes() {
250 return metadata.getFields(TYPE);
251 }
252
253 /***
254 * @param types The types to set.
255 */
256 public void setTypes(Collection types) {
257 metadata.setFields(TYPE, types);
258 }
259
260
261
262
263 public void addContributor(Locale locale, String contributor) {
264 metadata.addField(locale, CONTRIBUTOR, contributor);
265 }
266
267
268
269
270 public void addCoverage(Locale locale, String coverage) {
271 metadata.addField(locale, COVERAGE, coverage);
272 }
273
274
275
276
277 public void addCreator(Locale locale, String creator) {
278 metadata.addField(locale, CREATOR, creator);
279 }
280
281
282
283
284 public void addDescription(Locale locale, String description) {
285 metadata.addField(locale, DESCRIPTION, description);
286 }
287
288
289
290
291 public void addFormat(Locale locale, String format) {
292 metadata.addField(locale, FORMAT, format);
293 }
294
295
296
297
298 public void addIdentifier(Locale locale, String identifier) {
299 metadata.addField(locale, IDENTIFIER, identifier);
300 }
301
302
303
304
305 public void addLanguage(Locale locale, String language) {
306 metadata.addField(locale, LANGUAGE, language);
307 }
308
309
310
311
312 public void addPublisher(Locale locale, String publisher) {
313 metadata.addField(locale, PUBLISHER, publisher);
314 }
315
316
317
318
319 public void addRelation(Locale locale, String relation) {
320 metadata.addField(locale, RELATION, relation);
321 }
322
323
324
325
326 public void addRight(Locale locale, String right) {
327 metadata.addField(locale, RIGHT, right);
328 }
329
330
331
332
333 public void addSource(Locale locale, String source) {
334 metadata.addField(locale, SOURCE, source);
335 }
336
337
338
339
340 public void addSubject(Locale locale, String subject) {
341 metadata.addField(locale, SUBJECT, subject);
342
343 }
344
345
346
347
348 public void addTitle(Locale locale, String title) {
349 metadata.addField(locale, TITLE, title);
350 }
351
352
353
354
355 public void addType(Locale locale, String type) {
356 metadata.addField(locale, TYPE, type);
357 }
358 }