source: trunk/greenstone3-extensions/gs3build/src/org/greenstone/gsdl3/gs3build/collection/CollectionMetadata.java@ 12188

Last change on this file since 12188 was 12188, checked in by kjdon, 18 years ago

Initial revision

  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1package org.greenstone.gsdl3.gs3build.collection;
2
3import java.io.PrintWriter;
4
5import java.util.List;
6
7import org.greenstone.gsdl3.gs3build.metadata.METSDescriptive;
8
9import org.greenstone.gsdl3.gs3build.doctypes.DocumentID;
10
11/**
12 * A class to consolidate the metadata assigned to the documents of a collection
13 * as per the extension to Greenstone 2 done by George Buchanan.
14 */
15
16public class CollectionMetadata
17{ METSDescriptive metadata;
18
19 public CollectionMetadata()
20 { this.metadata = new METSDescriptive("CM0", "collection");
21 }
22
23 /**
24 * Accrue the metadata assigned to a particular document
25 *
26 * @param <code>DocumentID</code> the document identifier
27 * @param <code>String</code> the namespace of the metadata
28 * @param <code>String</code> the field of metadata
29 * @param <code>String</code> the actual value assigned
30 */
31 public void addDocumentMetadata(DocumentID documentID, String namespace, String field, String value)
32 { // we don't presently use the document ID in this member function
33 this.metadata.addMetadata(namespace, field, value);
34 }
35
36 /**
37 * Set the metadata stored on a given metadata item - any other values are
38 * destroyed.
39 *
40 * @param <code>String</code> the namespace
41 * @param <code>String</code> the label of the metadata
42 * @param <code>String</code> the actual value assigned
43 */
44 public void setCollectionMetadata(String namespace, String label, String value)
45 { this.metadata.setMetadata(namespace, label, value);
46 }
47
48 /**
49 * Get the metadata stored on a given metadata item
50 *
51 * @param <code>String</code> the namespace
52 * @param <code>String</code> the label of the metadata
53 */
54 public List getCollectionMetadata(String namespace, String label)
55 { return this.metadata.getMetadata(namespace, label);
56 }
57
58 /**
59 * Write the collection metadata
60 *
61 * TODO: dummy function - complete
62 */
63 public boolean write(PrintWriter writer)
64 { return false;
65 }
66}
Note: See TracBrowser for help on using the repository browser.