Cues for tools namespace prefix in JSON response
twagoo opened this issue · 3 comments
twagoo commented
This is needed to resolve clarin-eric/component-registry-front-end#154
Response from server for this test component (front end uses JSON rendering in request/response):
{"@isProfile":"false","@CMDVersion":"1.2","@CMDOriginalVersion":"1.1","Header":{"ID":"clarin.eu:cr1:c_1345561703642","Name":"Location","Description":"CMDI metadata","Status":"production"},"Component":{"@name":"Location","@CardinalityMin":"1","@CardinalityMax":"1","Element":[{"@name":"Continent","@ConceptLink":"http://hdl.handle.net/11459/CCR_C-2531_e0427265-2fc4-d23e-0a7c-a21981ec3734","@CardinalityMin":"1","@CardinalityMax":"1","@inclusive-or":"grp","@DisplayPriority":"1","ValueScheme":{"Vocabulary":{"enumeration":{"item":[{"@ConceptLink":"http://hdl.handle.net/11459/CCR_C-2591_f769d93b-c007-d2c9-aff2-99e9177e5764","@AppInfo":"","$":"Unknown"},{"@ConceptLink":"http://hdl.handle.net/11459/CCR_C-2592_6bf81885-106a-fbf0-40e0-9f0233fbd88c","@AppInfo":"","$":"Unspecified"},{"@ConceptLink":"","@AppInfo":"","$":"Africa"},{"@ConceptLink":"","@AppInfo":"","$":"Asia"},{"@ConceptLink":"","@AppInfo":"","$":"Europe"},{"@ConceptLink":"","@AppInfo":"","$":"Australia"},{"@ConceptLink":"","@AppInfo":"","$":"Oceania"},{"@ConceptLink":"","@AppInfo":"","$":"North-America"},{"@ConceptLink":"","@AppInfo":"","$":"Middle-America"},{"@ConceptLink":"","@AppInfo":"","$":"South-America"}]}}}},{"@name":"Country","@ConceptLink":"http://hdl.handle.net/11459/CCR_C-2532_d004b0a6-fd1d-3ca3-abf1-1e6aeb3e37b2","@ValueScheme":"string","@CardinalityMin":"1","@CardinalityMax":"1","@Multilingual":"false","@inclusive-or":"grp","@DisplayPriority":"1"},{"@name":"Region","@ConceptLink":"http://hdl.handle.net/11459/CCR_C-2533_fa6e1812-e29b-3cf6-e15a-50aa34b9be68","@ValueScheme":"string","@CardinalityMin":"0","@CardinalityMax":"unbounded","@Multilingual":"false","@inclusive-or":"grp","@DisplayPriority":"1"},{"@name":"Address","@ConceptLink":"http://hdl.handle.net/11459/CCR_C-2528_1eaf4da1-64cc-71fc-1622-bb5bfd6e52c9","@ValueScheme":"string","@CardinalityMin":"0","@CardinalityMax":"1","@Multilingual":"false","@inclusive-or":"grp","@DisplayPriority":"1"}]}}
Namespace is omitted by backend! (e.g. "@inclusive-or":"grp"
)
Since there is no fixed schema constraining the element names, we need to know the namespace.
Note that DisplayPriority in the same namespace is handled correctly (with a special mapping??)
twagoo commented
Looks like we might be able to use a solution similar to the example at https://www.intertech.com/jaxb-tutorial-customized-namespace-prefixes-example-using-namespaceprefixmapper/
twagoo commented
Some helpful documentation in https://eclipse-ee4j.github.io/jersey.github.io/documentation/1.19.1/user-guide.html