Document Genesys MCPD
Create the "Genesys MCDP" descriptor list with a fixed uuid and document the codes used.
After implementing #230 (closed) we will use this descriptor list to display decoded values (e.g. SAMPSTAT
).
Mapping
The original MCPD descriptors have columnName
that is used in FoxPro databases, while Genesys API uses JSON with nested objects.
We need to be able to link JSON paths with individual descriptors (e.g. orgCty.iso3
→ ORIGCTY
descriptor) unless we want to redefine all descriptors just because we use different "database names". (And that would be silly).
Genesys Anno introduced a concept of column definitions that link to a descriptor, but also specify whether multiple values are supported (arrays) and other constraints.
As we get JSON from Genesys API, all that is required is to be able to map each JSON path to the correct descriptor.
Implementation
We need an ordered list of descriptors associated with the JSON path that allows us to understand the preferred order of Genesys passport data for display and at the same time maps it to JSON paths where those values are found:
[
{"descriptor": "uu-uu-id", "jsonPath": "inst.code", "multiple": false},
{"descriptor": "uu-uu-id", "jsonPath": "orgCty.iso3", "multiple": false},
{"descriptor": "uu-uu-id", "jsonPath": "acceNumb", "multiple": false, "orderBy": "a.numb" },
{"descriptor": "uu-uu-id", "jsonPath": "storage", "multiple": true},
...
]
The implementation is specific to the Genesys Catalog, but it may be useful to others as it describes the implementation of the Genesys MCPD.
How?
- We don't want to further complicate the data model, add a simple "jsonMapping" Lob string that contains the definition.
- We parse JSON into objects
JSON.parse()
- For editing we need a simple textarea where this data is pasted in and stored with the Descriptor list.
In #230 (closed) we use this mapping to:
- Display the list of "Columns to display"
- Order by (special field in the mapping-JSON)
- Field display (special fields): typography, span, link templates
- Displaying decoded values from vocabularies and coded descriptors
https://catalog.demo.genesys-pgr.org/descriptorlists/dc1d4e81-a6dd-4f03-b682-53a3a1383988