Ignore:
Timestamp:
2011-05-09T14:37:04+12:00 (13 years ago)
Author:
sjm84
Message:

Updating this branch to match the latest Greenstone3 changes

Location:
main/branches/64_bit_Greenstone/greenstone3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/branches/64_bit_Greenstone/greenstone3

  • main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java

    r22974 r24007  
    253253
    254254    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    }
    260260
    261261    Element get_record = OAIXML.createElement(OAIXML.GET_RECORD);
    262262    Element record = OAIXML.createElement(OAIXML.RECORD);
    263263    //compose the header element
    264     record.appendChild(createHeaderElement(oid, lastmodified));     
     264    record.appendChild(createHeaderElement(oid, oailastmodified));     
    265265    //compose the metadata element
    266266    record.appendChild(createMetadataElement(prefix, info, metadata_format));
     
    332332      }
    333333      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      }
    339339     
    340       Date this_date = OAIXML.getDate(lastmodified);       
     340      Date this_date = OAIXML.getDate(oailastmodified);       
    341341      if (from_date != null) {
    342342        if(this_date.before(from_date)) {
     
    350350      }     
    351351      //compose the header element and append it
    352       list_identifiers.appendChild(createHeaderElement(oid, lastmodified));     
     352      list_identifiers.appendChild(createHeaderElement(oid, oailastmodified));     
    353353    }//end of for(int i=0; i<oid_list.size(); i++) of doing thru each record
    354354   
     
    418418      }
    419419      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      }
    425425     
    426       Date this_date = OAIXML.getDate(lastmodified);       
     426      Date this_date = OAIXML.getDate(oailastmodified);       
    427427      if (from_date != null) {
    428428        if(this_date.before(from_date)) {
     
    439439      list_records.appendChild(record);
    440440      //compose the header element
    441       record.appendChild(createHeaderElement(oid, lastmodified));     
     441      record.appendChild(createHeaderElement(oid, oailastmodified));     
    442442      //compose the metadata element
    443443      record.appendChild(createMetadataElement(prefix, info, metadata_format));
     
    501501  /** create a header element used when processing requests like ListRecords/GetRecord/ListIdentifiers
    502502   */
    503   private Element createHeaderElement(String oid, String lastmodified) {   
     503  private Element createHeaderElement(String oid, String oailastmodified) {   
    504504        Element header = OAIXML.createElement(OAIXML.HEADER);
    505505        Element identifier = OAIXML.createElement(OAIXML.IDENTIFIER);
     
    510510        header.appendChild(set_spec);
    511511        Element datestamp = OAIXML.createElement(OAIXML.DATESTAMP);
    512         GSXML.setNodeText(datestamp, lastmodified);
     512        GSXML.setNodeText(datestamp, oailastmodified);
    513513        header.appendChild(datestamp);
    514514        return header;
     
    656656<contains>".1;".2;".3;".4;".5;".6;".7;".8;".9
    657657<docnum>349
     658<oailastmodified>1303283795
     659<lastmodifieddate>20110412
     660<oailastmodifieddate>20110420
    658661----------------------------------------------------------------------
    659662     */
Note: See TracChangeset for help on using the changeset viewer.