Changeset 14208 for greenstone3/trunk/src/java
- Timestamp:
- 2007-06-29T13:22:35+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/src/java/org/greenstone/gsdl3/collection/Collection.java
r13994 r14208 52 52 /** is this collection public or private */ 53 53 protected boolean is_public = true; 54 55 /** does this collection provide the OAI service */ 56 protected boolean has_oai = true; 57 /** time when this collection was built */ 58 protected long lastmodified = 0; 59 60 /** An element containing the serviceRackList element of buildConfig.xml, used to determine whether it contains 61 * the OAIPMH serviceRack 62 */ 63 protected Element service_rack_list = null; 64 54 65 protected XMLTransformer transformer = null; 55 66 /** same as setClusterName */ … … 93 104 Element service_list = (Element)GSXML.getChildByTagName(build_config_xml, GSXML.SERVICE_CLASS_ELEM+GSXML.LIST_MODIFIER); 94 105 configureServiceRack(service_list, coll_config_xml); 95 106 107 this.service_rack_list = service_list; 108 96 109 return true; 97 110 … … 104 117 public boolean isPublic() { 105 118 return is_public; 119 } 120 //used by the OAIReceptionist to find out the earliest datestamp amongst all oai collections in the repository 121 public long getLastmodified() { 122 return lastmodified; 123 } 124 /** whether the service_map in ServiceCluster.java contains the service 'OAIPMH' 125 * 11/06/2007 xiao 126 */ 127 public boolean hasOAI() { 128 if (service_rack_list == null) return false; 129 Element oai_service_rack = GSXML.getNamedElement(service_rack_list, GSXML.SERVICE_CLASS_ELEM, 130 OAIXML.NAME, OAIXML.OAIPMH); 131 if (oai_service_rack == null) { 132 logger.info("No oai for collection: " + this.cluster_name); 133 return false; 134 } 135 return true;//oai_service_rack == null; 106 136 } 107 137 /** … … 141 171 build_config_elem = build_config_doc.getDocumentElement(); 142 172 } 173 174 lastmodified = build_config_file.lastModified(); 175 143 176 return build_config_elem; 144 177 } … … 149 182 protected boolean findAndLoadInfo(Element coll_config_xml, 150 183 Element build_config_xml){ 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 } 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 184 185 // metadata 186 Element meta_list = (Element)GSXML.getChildByTagName(coll_config_xml, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 187 addMetadata(meta_list); 188 meta_list = (Element)GSXML.getChildByTagName(build_config_xml, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 189 addMetadata(meta_list); 190 191 meta_list = this.doc.createElement(GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER); 192 GSXML.addMetadata(this.doc, meta_list, "httpPath", this.site_http_address+"/collect/"+this.cluster_name); 193 addMetadata(meta_list); 194 195 // display stuff 196 Element display_list = (Element)GSXML.getChildByTagName(coll_config_xml, GSXML.DISPLAY_TEXT_ELEM+GSXML.LIST_MODIFIER); 197 if (display_list != null) { 198 resolveMacros(display_list); 199 addDisplayItems(display_list); 200 } 201 202 //check whether the html are tidy or not 203 Element import_list = (Element)GSXML.getChildByTagName(coll_config_xml, GSXML.IMPORT_ELEM); 204 if (import_list != null) { 205 Element plugin_list = (Element)GSXML.getChildByTagName(import_list, GSXML.PLUGIN_ELEM+GSXML.LIST_MODIFIER); 206 addPlugins(plugin_list); 207 if (plugin_list != null){ 208 Element plugin_elem = (Element)GSXML.getNamedElement(plugin_list, GSXML.PLUGIN_ELEM, GSXML.NAME_ATT, "HTMLPlug"); 209 if (plugin_elem != null) { 210 //get the option 211 Element option_elem = (Element)GSXML.getNamedElement(plugin_elem, GSXML.PARAM_OPTION_ELEM, GSXML.NAME_ATT, "-tidy_html"); 212 if (option_elem != null) { 213 useBook = true; 214 } 215 } 216 } 217 } 218 meta_list = this.doc.createElement(GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER); 219 if (useBook == true) 220 GSXML.addMetadata(this.doc, meta_list, "tidyoption", "tidy"); 221 else 222 GSXML.addMetadata(this.doc, meta_list, "tidyoption", "untidy"); 223 addMetadata(meta_list); 224 225 // check whether we are public or not 226 if (meta_list != null) { 227 Element meta_elem = (Element) GSXML.getNamedElement(metadata_list, GSXML.METADATA_ELEM, GSXML.NAME_ATT, "public"); 228 if (meta_elem != null) { 229 String value = GSXML.getValue(meta_elem).toLowerCase().trim(); 230 if (value.equals("false")) { 231 is_public = false; 232 } 233 } 234 } 235 return true; 203 236 204 237 }
Note:
See TracChangeset
for help on using the changeset viewer.