Skip to content

resumptionToken is exclusive

Jorge Lanza requested to merge jlanza/importing-oaipmh:master into master

There is an incompatibility with OAIPMH specification in file ImportingOaipmhVehicle.java (lines 100 to 119). The specification says that the resumptionToken query parameter is exclusive, which means that a request containing this parameter should not contain any other parameters (except the verb one). However, in the request and validation flow of the data obtained within the importing-oaipmh module, it is contemplated that the metadataPrefix parameter always exists, whether the resumptionToken parameter is present in the request or not, which violates the OAI-PMH protocol specification.

OAI-PMH specfication:

  • resumptionToken an exclusive argument with a value that is the flow control token returned by a previous ListRecords request that issued an incomplete list.
  • metadataPrefix a required argument (unless the exclusive argument resumptionToken is used) that specifies the metadataPrefix of the format that should be included in the metadata part of the returned records. (...)

Right now the code asks for the request url to be:
https://<ckan_host>/oai?verb=ListRecords&metadataPrefix=<metadataPrefix>&resumptionToken=<resumptionToken>

when according to the OAI-PMH specification it should be:
https://<ckan_host>/oai?verb=ListRecords&resumptionToken=<resumptionToken>

In this sense, we have updated the code to check whether the resumptionToken query parameter is present or not, and based on it (considering it is encoded in the most common way -application/x-www-form-urlencoded-), fill up the required variables for the rest of the code to work as before.

Besides we have found that in order to build the project, Maven 4 and Java 17 are required. So we have also updated the README file.

Merge request reports