Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2868

Harvesting OAI-PMH using "until" param with a midnight timestamp (T00:00:00Z) returns items last modified on that date


    • Type: Bug
    • Status: Volunteer Needed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.4, 6.0
    • Fix Version/s: None
    • Component/s: OAI-PMH
    • Labels:
    • Attachments:
    • Comments:
    • Documentation Status:
      Not Required


      This issue is a side-effect to the fix in DS-2542.

      Unfortunately the fix to that ticket required us to check for midnight timestamps (T00:00:00Z) in the "until" param, and automatically convert them to the end of the day (T23:59:59Z). This allowed for queries like this to work properly:

      Unfortunately, the side effect of this fix was that explicitly specifying a midnight timestamp (T00:00:00Z) in the "until" param ONLY no longer works properly.

      For example, this query will WRONGLY return all items which were last modified on "2015-04-07": http://demo.dspace.org/oai/request?verb=ListRecords&metadataPrefix=oai_dc&until=2015-04-07T00:00:00Z

      The cause:

      It seems XOAI itself is flawed in that it immediately converts any passed in dates (via until or from params) into "java.util.Date". Unfortunately, once they are "java.util.Date" objects, there is no way to tell the difference between a date with no timestamp (e.g. 2015-04-07) and one with a midnight timestamp (e.g. 2015-04-07T00:00:00Z), as those two Date objects are considered equivalent in Java. See for example: http://stackoverflow.com/a/9334481/3750035

      For more on the flawed manner in which XOAI parses date inputs, see these areas of the XOAI codebase:

      Unfortunately, the only way to resolve this issue in XOAI 3.x would be to refactor the codebase to no longer use "java.util.Date" to store these dates/times.

      Alternatively, we may wish to investigate whether upgrading to use XOAI 4.x may be a better option (as the issue may be solved or more easily solved in that codebase). See also DS-2595


          Issue Links



              • Assignee:
                tdonohue Tim Donohue
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: