Content negotiation plugin (archetecture) #124
+1,077
−295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DO NOT MERGE - WIP
This is a PR-to-the-PR-to-the-PR for architectural issues.
Ok, I've got a really messy version of the content negotiation stuff up in a PR (to the PR, to the PR,...). The main purpose is to create and register the single-record formatters (i.e. dcat, etc...):
?f=jsonand?f=application/json.IContentNegotiationInitializablefrom any of the modules.IControllerResultFormatter. In this case theFormatterApiis queried and 4 classes are created - one for each of the 4 MimeTypes that the formatter produces (xml, json, xml+rdf, geojson). TheseIControllerResultFormatterare profile-aware formatters that use toFormatterApito do the actual work.MessageConvertersin the normal spring content negotiation.As mentioned before, when a request for a single-record comes in:
OgcApiRecordsSingleRecordResponse, which is a very small object that contains the catalogId, recordId, and user-requested profiles.application/xml+rdrfor theOgcApiRecordsSingleRecordResponse(this is one of the profile-aware ones we registered).OgcApiRecordsSingleRecordResponseoff to our profile-awareFormatterApisetup forapplication/xml+rdrFormatterApi(knowing both mimetype and official profile name)WHEW
The main thing is that the content negotation system is pluggable - any app/module can supply a set of
IContentNegotiationInitializablethat will register everything in the content negotation system.Key things to look at
IContentNegotiationInitializableand calls#initialize()on them.?f=...) are setup and message writers (created by MessageWriterUtil) are registeredOgcApiRecordsSingleRecordResponsePR Title
Description
Type of Change
Select one:
Related Issue
Closes/updates # (optional):
Approach
How to Verify
Checklist