source: trunk/greenstone3-extensions/gs3build/src/org/greenstone/gsdl3/gs3build/metadata/METSDocument.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.8 KB
Line 
1package org.greenstone.gsdl3.gs3build.metadata;
2
3/**
4 * A METS document representation - the METS objects are represented
5 * by hand-coded classes rather than JAXB products due to the fact
6 * that we want wrappers to provide higher-level abstractions than
7 * the basic METS XML mark-up.
8 */
9
10import java.util.Map;
11import java.util.HashMap;
12
13import java.io.File;
14import java.net.URL;
15
16public class METSDocument
17{
18 // TODO: add use of 'ID'
19 String objectID;
20 String label;
21 String type;
22 // TODO: add use of 'PROFILE';
23
24 METSHeader header;
25 METSDescriptiveSet descriptiveSet;
26 METSAdmin admin;
27 METSFileSet fileSet;
28
29 public METSDocument(String identifier)
30 {
31 this.objectID = identifier; // In Greenstone land, this should be a unique identifier within
32 // the current collection
33 this.type = "document"; // Types in METS are just strings - we currently use
34 // 'Document' as a standard representation.
35 // Individual options should be defined in a published
36 // METS Profile - in Greenstone we currently 'cheat'
37 // and bodge the system
38 this.header = new METSHeader();
39 this.descriptiveSet = new METSDescriptiveSet();
40 this.fileSet = new METSFileSet();
41 }
42
43 /**
44 * Set the document identifier for this document
45 *
46 * @param <code>String</code> the identifier
47 */
48 public void setDocId(String id)
49 { this.objectID = id;
50 }
51
52 public String getDocId()
53 { return this.objectID;
54 }
55
56 public METSHeader getHeader()
57 { return this.header;
58 }
59
60 public void setHeader(METSHeader header)
61 { this.header = header;
62 }
63
64 public void addFile(METSFile file)
65 { this.fileSet.addFile(file);
66 }
67
68 public void addFile(URL url)
69 { this.fileSet.addFile(url);
70 }
71
72 public void addFile(METSFile file, String toGroup)
73 { this.fileSet.addFile(file, toGroup);
74 }
75}
Note: See TracBrowser for help on using the repository browser.