Changeset 24007 for main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java
- Timestamp:
- 2011-05-09T14:37:04+12:00 (13 years ago)
- Location:
- main/branches/64_bit_Greenstone/greenstone3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/branches/64_bit_Greenstone/greenstone3
- Property svn:mergeinfo changed
-
main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java
r22974 r24007 253 253 254 254 ArrayList keys = new ArrayList(info.getKeys()); 255 String lastmodified = "";256 if(keys.contains(OAIXML. LASTMODIFIED)) {257 lastmodified = info.getInfo(OAIXML.LASTMODIFIED);258 }259 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));255 String oailastmodified = ""; 256 if(keys.contains(OAIXML.OAI_LASTMODIFIED)) { 257 oailastmodified = info.getInfo(OAIXML.OAI_LASTMODIFIED); 258 oailastmodified = OAIXML.getTime(Long.parseLong(oailastmodified)*1000); // java wants dates in milliseconds 259 } 260 260 261 261 Element get_record = OAIXML.createElement(OAIXML.GET_RECORD); 262 262 Element record = OAIXML.createElement(OAIXML.RECORD); 263 263 //compose the header element 264 record.appendChild(createHeaderElement(oid, lastmodified));264 record.appendChild(createHeaderElement(oid, oailastmodified)); 265 265 //compose the metadata element 266 266 record.appendChild(createMetadataElement(prefix, info, metadata_format)); … … 332 332 } 333 333 ArrayList keys = new ArrayList(info.getKeys()); 334 String lastmodified = "";335 if(keys.contains(OAIXML. LASTMODIFIED)) {336 lastmodified = info.getInfo(OAIXML.LASTMODIFIED);337 } 338 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));334 String oailastmodified = ""; 335 if(keys.contains(OAIXML.OAI_LASTMODIFIED)) { 336 oailastmodified = info.getInfo(OAIXML.OAI_LASTMODIFIED); 337 oailastmodified = OAIXML.getTime(Long.parseLong(oailastmodified)*1000); // java wants dates in milliseconds 338 } 339 339 340 Date this_date = OAIXML.getDate( lastmodified);340 Date this_date = OAIXML.getDate(oailastmodified); 341 341 if (from_date != null) { 342 342 if(this_date.before(from_date)) { … … 350 350 } 351 351 //compose the header element and append it 352 list_identifiers.appendChild(createHeaderElement(oid, lastmodified));352 list_identifiers.appendChild(createHeaderElement(oid, oailastmodified)); 353 353 }//end of for(int i=0; i<oid_list.size(); i++) of doing thru each record 354 354 … … 418 418 } 419 419 ArrayList keys = new ArrayList(info.getKeys()); 420 String lastmodified = "";421 if(keys.contains(OAIXML. LASTMODIFIED)) {422 lastmodified = info.getInfo(OAIXML.LASTMODIFIED);423 } 424 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));420 String oailastmodified = ""; 421 if(keys.contains(OAIXML.OAI_LASTMODIFIED)) { 422 oailastmodified = info.getInfo(OAIXML.OAI_LASTMODIFIED); 423 oailastmodified = OAIXML.getTime(Long.parseLong(oailastmodified)*1000); // java wants dates in milliseconds 424 } 425 425 426 Date this_date = OAIXML.getDate( lastmodified);426 Date this_date = OAIXML.getDate(oailastmodified); 427 427 if (from_date != null) { 428 428 if(this_date.before(from_date)) { … … 439 439 list_records.appendChild(record); 440 440 //compose the header element 441 record.appendChild(createHeaderElement(oid, lastmodified));441 record.appendChild(createHeaderElement(oid, oailastmodified)); 442 442 //compose the metadata element 443 443 record.appendChild(createMetadataElement(prefix, info, metadata_format)); … … 501 501 /** create a header element used when processing requests like ListRecords/GetRecord/ListIdentifiers 502 502 */ 503 private Element createHeaderElement(String oid, String lastmodified) {503 private Element createHeaderElement(String oid, String oailastmodified) { 504 504 Element header = OAIXML.createElement(OAIXML.HEADER); 505 505 Element identifier = OAIXML.createElement(OAIXML.IDENTIFIER); … … 510 510 header.appendChild(set_spec); 511 511 Element datestamp = OAIXML.createElement(OAIXML.DATESTAMP); 512 GSXML.setNodeText(datestamp, lastmodified);512 GSXML.setNodeText(datestamp, oailastmodified); 513 513 header.appendChild(datestamp); 514 514 return header; … … 656 656 <contains>".1;".2;".3;".4;".5;".6;".7;".8;".9 657 657 <docnum>349 658 <oailastmodified>1303283795 659 <lastmodifieddate>20110412 660 <oailastmodifieddate>20110420 658 661 ---------------------------------------------------------------------- 659 662 */
Note:
See TracChangeset
for help on using the changeset viewer.