Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
    var discoverySuppress = nonNull(deletedRecordsSupport ? null : suppressedRecordsSupport);

source After that instances should be transformed to the corresponding XML format (marc21/dc).

metadataSource = SRS

OAI-PMH makes call to the SRS-storage (/source-storage/source-records?query=...) with using SRS-client which supports deletedRecordsSupport and suppressedRecordsSupport options. Both SRS and Inventory clients supports suppressedFromDiscovery and supportDeleted option. After that based on the value of withInventory. If it is true then OAI-PMH makes call to the inventory (/instance-storage/instances?query=...) to retrieve corresponding instances. If source record is not found but instances are presented then instances should be converted to marc21 or dc format and returned to the client. Otherwise, if instances and source records are presented, then they are combined and returned in XML representation (marc21 or dc).

If withInventory=false then the only records from SRS should be downloaded and transformed to the corresponding XML format marc21/dc.

draw.io Diagram
bordertrue
diagramNameGetRecords_Algorithm
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth561
revision5

ListRecords marc21_withholdings
As a header identifier, the instance id is used.
Returns the plain marc records from mod-source-record-storage with record type MARC that are enriched with inventory data (?) and converted to XML representation.

Marc21_withholdings business flow




The processing of marc21_withholdings request is divided into two processes - download instances ids and process records.

Download instance ids is a process that asks for instance ids that meet the filtering criteria from inventory storage and saves them to the local module database with a small set of the required metadata.
The filtering criteria are provided by the parameters specified within the initial request and oai-pmh settings like "deleted records support" and "suppressed records processing".



The initial request triggers the downloading instances ids, this is the process that is run in the background and populates the database(/inventory-hierarchy/updated-instance-ids). This process is run only one time for each separate harvest. Each harvest has its own request id that can be found in the request_metadata_lb table(you can find the request id of your harvest within the decoded resumption token). It has a row with request id related to harvest and state of the downloading instances ids process (whether it is in progress or already completed). 
The "process records" process is triggered by each request and it asks the database for the already downloaded instance ids cyclically. So, while not enough instances were downloaded it will ask the database each 500ms for the data until the downloaded instances process will populate the DB with the required amount of instances ids required for processing the batch of data.

Process records process is pretty simple and can be described in the next few steps:
1) Get instances ids from DB in size of "max records per response" setting value
2) Request marc records from mod-source-record-storage(SRS) by instance ids got from step 1.
    If SRS cannot send data for some reason the oai-pmh logic will ask it cyclically until data will be received or request attempts will expire(50 attempts in total)
3) Filter instances for which marc records weren't found (therefore instances with source FOLIO are omitted)
4) Request the holdings/items data from inventory(/inventory-hierarchy/items-and-holdings)
5) Populate SRS records with items/holdings data (852 and 956 fields)
6) Convert enriched marc records to XML representation
7) Send the response to a client

...