- Timestamp:
- 2011-04-20T21:02:12+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
r23901 r23938 68 68 /** time when this collection was built */ 69 69 protected long lastmodified = 0; 70 70 /** earliestDatestamp of this collection. Necessary for OAI */ 71 protected long earliestDatestamp = 0; 72 73 71 74 /** An element containing the serviceRackList element of buildConfig.xml, used to determine whether it contains 72 75 * the OAIPMH serviceRack … … 133 136 return is_public; 134 137 } 135 //used by the OAIReceptionist to find out the earliest datestamp amongst all oai collections in the repository 138 // Not used anymore by the OAIReceptionist to find out the earliest datestamp 139 // amongst all oai collections in the repository. May be useful generally. 136 140 public long getLastmodified() { 137 141 return lastmodified; 138 142 } 143 //used by the OAIReceptionist to find out the earliest datestamp amongst all oai collections in the repository 144 public long getEarliestDatestamp() { 145 return earliestDatestamp; 146 } 147 139 148 /** whether the service_map in ServiceCluster.java contains the service 'OAIPMH' 140 149 * 11/06/2007 xiao … … 179 188 build_config_elem = build_config_doc.getDocumentElement(); 180 189 } 181 190 182 191 lastmodified = build_config_file.lastModified(); 183 192 … … 264 273 } else { 265 274 has_oai = true; 275 276 // extract earliestDatestamp from the buildconfig.xml for OAI 277 Element metadata_list = (Element)GSXML.getChildByTagName(build_config_xml, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 278 279 if(metadata_list != null) { 280 NodeList children = metadata_list.getElementsByTagName(GSXML.METADATA_ELEM); 281 // can't do getChildNodes(), because whitespace, such as newlines, creates Text nodes 282 for (int i = 0; i < children.getLength(); i++) { 283 Element metadata = (Element)children.item(i); 284 if(metadata.getAttribute(GSXML.NAME_ATT).equals(OAIXML.EARLIEST_DATESTAMP)) { 285 String earliestDatestampStr = GSXML.getValue(metadata); 286 if(!earliestDatestampStr.equals("")) { 287 earliestDatestamp = Long.parseLong(earliestDatestampStr); 288 } 289 break; // found a metadata element with name=earliestDatestamp in buildconfig 290 } 291 } 292 } 293 294 // If at the end of this, there is no value for earliestDatestamp, print out a warning 295 logger.warn("No earliestDatestamp in buildConfig.xml for collection: " + this.cluster_name + ". Defaulting to 0."); 296 266 297 } 267 298 } else { // no list of services (no ServiceRackList), so no oai_service_rack either
Note:
See TracChangeset
for help on using the changeset viewer.