bodleian / ora_data_model

Documentation and crosswalks relating to the ORA data model
1 stars 1 forks source link

Temporary crosswalk behaviour to support HTTP headers #54

Closed tomwrobel closed 4 years ago

tomwrobel commented 5 years ago

In order to support HTTP headers in the crosswalks, a change will need to be made to the crosswalk engine.

Due to time constraints, this feature will be hard-coded in the May release, and then made configurable in subsequent releases.

This will necessitate a change to the crosswalks post-May-release in order to effect and test these changes.

AndrewBennet commented 5 years ago

Just to confirm, the functionality I've developed looks as follows. A specially named "field-map" in the crosswalk file, with the name "http-headers", will - if present - be evaluated and the results of this will not be included in the output metadata, but instead will be included as HTTP header key-value string pairs in the POST call to http://ora4-prd-symp.bodleian.ox.ac.uk/sword/collections/default/works.

image

This will allow dynamic configuration of the HTTP headers, possibly based on data. E.g. the above produces the Hyrax-Work-Type header and the On-Behalf-Of header:

2019-03-27 17:55:39: HTTP request: POST http://ora4-prd-symp.bodleian.ox.ac.uk/sword/collections/default/works
2019-03-27 17:55:39: HTTP request headers: 
    Packaging   application/atom+xml;type=entry
    On-Behalf-Of    symplectic@elements.co.uk
    Hyrax-Work-Type Journal article
    In-Progress true
    User-Agent  symplectic-elements-at-lilliput
    Accept  application/xml
    Content-Type    application/xml; charset=utf-8
    Content-Disposition attachment; filename=metadata.xml

I'm not sure exactly how this will change in the release after the initial release, but I expect any required changes on the map file to be small. (Perhaps a reference to the field-map name will be required to be added somewhere).

tomwrobel commented 4 years ago

Now configurable