Ignore:
Timestamp:
2017-08-23T18:58:38+12:00 (7 years ago)
Author:
ak19
Message:

Dr Bainbridge thought about it and decided that the correct solution is that, since a collection will always have an oai-inf db from now on, the earliest datestamp of a collection should not fall back to either buildconfig's earliestdatestamp field or else buildconfig's lastmodified. However, the latter are used as the publishing date by the RSS service, and so still stored as Collection.java's earliestDatestamp. Now OAICollection has a new additional field, earliestOAIDatestamp which contains the earliest timestamp in oai-inf db. The OAIReceptionist now determines the earliestDatestamp of the entire OAIRepository solely based on the earliestOAIDatestamp values across all OAICollections, also with no fallbacks on Collections' earliestDatestamp or lastModified fields.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java

    r31913 r31915  
    10381038    for(int i=0; i<oai_coll_size; i++) {
    10391039    String collName = collection_name_list.get(i);
    1040     long coll_earliestDatestamp = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.EARLIEST_DATESTAMP)); // Taken from oai-inf db's OAI_EARLIEST_TIMESTAMP_OID entry, else falls back to earliest datestamp field in buildcfg
    1041       if (coll_earliestDatestamp == 0) {
    1042     // try last modified
    1043     coll_earliestDatestamp = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.LAST_MODIFIED));
    1044     //logger.info("@@@ Falling back to using collection " + collName + "'s lastmodified date as its earliest timestamp: " + coll_earliestDatestamp);
    1045       }
    1046       if (coll_earliestDatestamp > 0) {
    1047     earliestDatestamp = (earliestDatestamp > coll_earliestDatestamp)? coll_earliestDatestamp : earliestDatestamp;
    1048       }
    1049     }
     1040    long coll_earliestDatestamp = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.EARLIEST_OAI_DATESTAMP)); // Taken from oai-inf db's OAI_EARLIEST_TIMESTAMP_OID entry, -1 if not found
     1041
     1042    if (coll_earliestDatestamp > 0 && earliestDatestamp > coll_earliestDatestamp) {
     1043        earliestDatestamp = coll_earliestDatestamp;
     1044        //logger.info("@@@ Found earlier timestamp: " + earliestDatestamp + " ms");
     1045    }
     1046    }
     1047
     1048    // we're no longer trying fallbacks for earliestDatestamp (other than the extreme fallback of
     1049    // unix epoch time) because, going forward, all collections will have oai-inf db containing
     1050    // an entry for earliesttimestamp. And all OAICollections will moreover have them stored and
     1051    // will return them upon calling getEarliestOAIDatestamp().
     1052    /*   
     1053    if(earliestDatestamp == current_time) {
     1054    logger.info("Can't determine earliesttimestamp from oai-inf.db for any OAI collection. Trying timestamps in build config...");
     1055    for(int i=0; i<oai_coll_size; i++) {
     1056        String collName = collection_name_list.get(i);
     1057        long coll_earliestDatestamp = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.EARLIEST_DATESTAMP)); // Taken from the earliest datestamp field in buildcfg
     1058        if (coll_earliestDatestamp == 0) {
     1059        // try last modified
     1060        coll_earliestDatestamp = Long.parseLong(((Element)oai_coll.item(i)).getAttribute(OAIXML.LAST_MODIFIED));
     1061        //logger.info("@@@ Falling back to using collection " + collName + "'s lastmodified date as its earliest timestamp: " + coll_earliestDatestamp);
     1062        }
     1063        if (coll_earliestDatestamp > 0) {
     1064        earliestDatestamp = (earliestDatestamp > coll_earliestDatestamp)? coll_earliestDatestamp : earliestDatestamp;
     1065        }
     1066    }
     1067    }
     1068    */
     1069   
    10501070    if (earliestDatestamp == current_time) {
    10511071      logger.info("no collection had a real datestamp, using value from OAIConfig");
Note: See TracChangeset for help on using the changeset viewer.