Changeset 5944 for trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/doctypes/DocumentInterface.java
- Timestamp:
- 2003-11-24T14:26:35+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/doctypes/DocumentInterface.java
r5800 r5944 3 3 import java.util.List; 4 4 import java.util.Map; 5 6 import java.net.URL; 5 7 6 8 import org.greenstone.gsdl3.gs3build.metadata.*; … … 10 12 public interface DocumentInterface 11 13 { 12 /** 13 * Get the immediate document type of the document. The type may be derived/inherited 14 * from other DocumentInterface types, but that cannot be checked here. 15 * 16 * @return <code>String</code> the document type as a string 17 */ 18 public String getDocumentType(); 14 /** 15 * Get the immediate document type of the document. The type may be derived/inherited 16 * from other DocumentInterface types, but that cannot be checked here. 17 * 18 * @return <code>String</code> the document type as a string 19 */ 20 public String getDocumentType(); 21 22 /** 23 * Check if this document is of a particular type, or is derived from a particular 24 * type - i.e. inheritance is considered as well as the immediate type. 25 * 26 * @param <code>String</code> the type to check against. 27 * @return <code>boolean</code> if the document matches the given type. 28 */ 29 public boolean isDocumentType(String documentType); 30 31 public void setID(DocumentID id); 32 public DocumentID getID(); 19 33 20 /** 21 * Check if this document is of a particular type, or is derived from a particular 22 * type - i.e. inheritance is considered as well as the immediate type. 23 * 24 * @param <code>String</code> the type to check against. 25 * @return <code>boolean</code> if the document matches the given type. 26 */ 27 public boolean isDocumentType(String documentType); 34 /** 35 * Get the METS type of the document. 36 * 37 * @return <code>String</code> the document type as a string 38 */ 39 public String getMETSType(); 40 41 public void setHeader(METSHeader header); 42 public METSHeader getHeader(); 28 43 29 public void setID(DocumentID id); 30 public DocumentID getID(); 44 /** 45 * Whether the document is indexed or not. 46 * 47 * @return <code>boolean</code> <code>true</code> by default. 48 */ 49 public boolean isIndexed(); 31 50 32 /** 33 * Get the METS type of the document. 34 * 35 * @return <code>String</code> the document type as a string 36 */ 37 public String getMETSType(); 51 /** 52 * The plain text of the document. 53 * 54 * @return <code>String</code> This value may be <code>null</code> 55 * for documents which have no textual component - e.g. 56 * an image file 57 */ 58 public String getDocumentText(); 59 60 /** 61 * The metadata for the document, encoded as a map. 62 * 63 * The returned Map may have the following properties: 64 * 1) It may be <code>null</code> - e.g. for plain text documents 65 * 2) Any value in the map may be a <code>List</code> object containing 66 * more than one possible value - e.g. they key 'Author' may associated 67 * with a List of several people. 68 * 3) Any value in the map may itself be a <code>Map</code> where the 69 * encoding scheme permits groupings of hierarchical metadata items. 70 * 4) Where the namespace for a metadata item is known, its key will 71 * include the namespace. Hence Dublin Core 'Author' would be encoded 72 * as "dc.Author" as the key. 73 * 74 * @return <code>METSDescriptive</code> the metadata of the document 75 */ 76 public METSDescriptiveSet getDocumentMetadata(); 77 78 /** 79 * The metadata for a particular given upon the document, encoded as a <code>List</code> 80 * 81 * @param <code>String</code> the namespace of the metadata 82 * @param <code>String</code> the label of the values to obtain 83 * 84 * @return <code>List</code> the metadata values 85 */ 86 public List getDocumentMetadataItem(String namespace, String label); 87 88 /** 89 * The metadata for the document, encoded as a map. 90 * 91 * @param <code>String</code> the namespace and label of the metadata, separated 92 * by a colon. If no namespace is given, it is 93 * defaulted 94 * 95 * @return <code>List</code> the metadata values 96 */ 97 public List getDocumentMetadataItem(String namespaceLabel); 98 99 /** 100 * Facilitate the decoration of a document with external or extracted 101 * metadata. This is a "cheap" form which doesn't have a separate 102 * namespace element. Either the data is to be stored in the "open" 103 * Greenstone metadata namespace, or the namespace is encoded within 104 * the label. 105 * 106 * @param <code>String</code> label of the metadata, with a '.' to deliminate 107 * sub-component structures. The label may commence 108 * with a namespace followed by a colon. 109 * <p>e.g. "dc:title" for Dublin Core Title.</p> 110 * @param <code>String</code> value of the metadata 111 */ 112 public void addDocumentMetadata(String label, String value); 113 114 /** 115 * Facilitate the decoration of a document with external or extracted 116 * metadata. 117 * 118 * @param <code>String</code> namespace of the metadata 119 * @param <code>String</code> label of the metadata, with a '.' to deliminate 120 * sub-component structures 121 * @param <code>String</code> value of the metadata 122 */ 123 public void addDocumentMetadata(String namespace, String label, String value); 38 124 39 public void setHeader(METSHeader header); 40 public METSHeader getHeader(); 125 126 /** 127 * Post metadata to a file in this document - the appropriate changes 128 * should be made... 129 * 130 * @param <code>URL</code> the location of the file... 131 * @param <code>String</code> the namespace of the metadata 132 * @param <code>String</code> label of the metadata, with a '.' to deliminate 133 * sub-component structures 134 * @param <code>String</code> value of the metadata 135 */ 136 public void postFileMetadata(URL fileLocation, String namespace, String label, String value); 41 137 42 /** 43 * Whether the document is indexed or not. 44 * 45 * @return <code>boolean</code> <code>true</code> by default. 46 */ 47 public boolean isIndexed(); 138 /** 139 * The constituent files for the document: each should be wrapped up 140 * as a URL 141 * 142 * @return <code>METSFileSet</code> the files which constitute the document 143 */ 144 public METSFileSet getDocumentFiles(); 48 145 49 /** 50 * The plain text of the document. 51 * 52 * @return <code>String</code> This value may be <code>null</code> 53 * for documents which have no textual component - e.g. 54 * an image file 55 */ 56 public String getDocumentText(); 57 58 /** 59 * The metadata for the document, encoded as a map. 60 * 61 * The returned Map may have the following properties: 62 * 1) It may be <code>null</code> - e.g. for plain text documents 63 * 2) Any value in the map may be a <code>List</code> object containing 64 * more than one possible value - e.g. they key 'Author' may associated 65 * with a List of several people. 66 * 3) Any value in the map may itself be a <code>Map</code> where the 67 * encoding scheme permits groupings of hierarchical metadata items. 68 * 4) Where the namespace for a metadata item is known, its key will 69 * include the namespace. Hence Dublin Core 'Author' would be encoded 70 * as "dc.Author" as the key. 71 * 72 * @return <code>METSDescriptive</code> the metadata of the document 73 */ 74 public METSDescriptiveSet getDocumentMetadata(); 146 /** 147 * Set the constituent files for the document. 148 */ 149 public void setDocumentFiles(METSFileSet fileSet); 75 150 76 /** 77 * The metadata for the document, encoded as a map. 78 * 79 * @param <code>String</code> the namespace of the metadata 80 * @param <code>String</code> the label of the values to obtain 81 * 82 * @return <code>List</code> the metadata values 83 */ 84 public List getDocumentMetadataItem(String namespace, String label); 151 /** 152 * Obtain the structural information on the document 153 * 154 * @return <code>METSStructureSet</code> the structural information on the 155 * document. 156 */ 157 public METSStructureSet getDocumentStructure(); 158 159 /** 160 * Indicate whether the document can be stored in a native form in 161 * a METS wrapper 162 * 163 * @return <code>boolean</code> <code>true</code> if the document 164 * is just to be wrapped in a METS shell. 165 */ 166 public boolean isMETSCompatible(); 167 168 /** 169 * Write the document into a METS wrapper - for many document types, 170 * this will not actually be done by the document itself, but rather 171 * by the default writer 172 */ 173 public DocumentWriter getMETSWriter(); 174 175 /** 176 * Get the writer to send the document to an SQL database 177 */ 178 public DocumentSQLWriter getSQLWriter(); 85 179 86 /** 87 * The metadata for the document, encoded as a map. 88 * 89 * @param <code>String</code> the namespace and label of the metadata, separated 90 * by a colon. If no namespace is given, it is 91 * defaulted 92 * 93 * @return <code>List</code> the metadata values 94 */ 95 public List getDocumentMetadataItem(String namespaceLabel); 180 /** 181 * Check if the document is changed or not 182 */ 183 public boolean isModified(); 96 184 97 /** 98 * Facilitate the decoration of a document with external or extracted 99 * metadata. This is a "cheap" form which doesn't have a separate 100 * namespace element. Either the data is to be stored in the "open" 101 * Greenstone metadata namespace, or the namespace is encoded within 102 * the label. 103 * 104 * @param <code>String</code> label of the metadata, with a '.' to deliminate 105 * sub-component structures. The label may commence 106 * with a namespace followed by a colon. 107 * <p>e.g. "dc:title" for Dublin Core Title.</p> 108 * @param <code>String</code> value of the metadata 109 */ 110 public void addDocumentMetadata(String label, String value); 111 112 /** 113 * Facilitate the decoration of a document with external or extracted 114 * metadata. 115 * 116 * @param <code>String</code> namespace of the metadata 117 * @param <code>String</code> label of the metadata, with a '.' to deliminate 118 * sub-component structures 119 * @param <code>String</code> value of the metadata 120 */ 121 public void addDocumentMetadata(String namespace, String label, String value); 122 123 /** 124 * The constituent files for the document: each should be wrapped up 125 * as a URL 126 * 127 * @return <code>METSFileSet</code> the files which constitute the document 128 */ 129 public METSFileSet getDocumentFiles(); 130 131 /** 132 * Obtain the structural information on the document 133 * 134 * @return <code>METSStructureSet</code> the structural information on the 135 * document. 136 */ 137 public METSStructureSet getDocumentStructure(); 138 139 /** 140 * Indicate whether the document can be stored in a native form in 141 * a METS wrapper 142 * 143 * @return <code>boolean</code> <code>true</code> if the document 144 * is just to be wrapped in a METS shell. 145 */ 146 public boolean isMETSCompatible(); 147 148 149 /** 150 * Write the document into a METS wrapper - for many document types, 151 * this will not actually be done by the document itself, but rather 152 * by the default writer 153 */ 154 public DocumentWriter getMETSWriter(); 155 156 public DocumentSQLWriter getSQLWriter(); 185 /** 186 * Set the document modified state 187 */ 188 public void setModified(boolean isModified); 157 189 }
Note:
See TracChangeset
for help on using the changeset viewer.