Uploaded image for project: 'Z39.50'
  1. Z39.50
  2. ZF-57

Allow post-processing substitutions to interpolate field values

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • TBD
    • Resolution: Done
    • None
    • 2.5.0
    • None
    • Thor

    Description

      At present, the Z39.50 server's configuration can include a postProcessing section with rules like:

      { "op": "regsub", "pattern": "[123]", "replacement": "smallnum", "flags": "g" }
      

      We want to expand this facility such that the replacement string can contain sequences of the form

      ${name}
      

      and these will be replaced by present contents of the field of subfield specified by name, e.g. 100 or 952$b.

      This will yield a powerful and general facility allowing installations with complex requirements to generate exactly the detail they need. For example, we can implement fallbacks, as in this case where if 952$2 has no value it's replaced by the value in 952$b. (This could be used for situations like reporting the item-level copy-number if that's present, but falling back to the holdings-level copy-number if not.)

      "952$2": [
        { "op": "regsub", "pattern": "^$", "replacement": "${952$b}" }
      ]
      

      Or we could build a location string in $z from fragments in $1, $2 and $2:

      "952$z": [
        { "op": "regsub", "pattern": ".*", "replacement": "${952$1}/${952$2}/${952$3}" }
      ]
      

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                mike Mike Taylor
                mike Mike Taylor
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases