Description
The media display type introduced in #12786 reads the media type from another attribute (mediaTypeAttribute), but only recognises MIME strings (image/png, application/pdf) or the literal display type names (image, video, panorama, ...).
Datasets often use their own vocabulary for that column: IMG, VID, PAN, 360, or numeric codes. Those values are not recognised, so the attribute falls back to file extension detection. That is not enough, because a panorama is a .jpg and cannot be told apart from a plain image.
Proposal
Add an instance level alias configuration in localConfig.json:
{
"featureInfoMediaTypeAliases": {
"panorama": ["PAN", "PANO", "360"],
"image": ["IMG", "FOTO"],
"video": ["VID"]
}
}
This new configuration will allow to have aliases to resolve correctly the media type in a project. These are the changes we will need to introduce:
- One
featureInfoMediaTypeAliases in localConfig.json global for the whole application.
- Implementation and support needs to be introduced in the resolveAttributeDisplayType function (access the configuration with
ConfigUtils.getConfigProp).
- Value normalized with
String(value).trim().toLowerCase() to support also numeric value.
- Configuration keys must validated against
DISPLAY_TYPES so a typo can't invent a renderer.
- Documentation
What kind of improvement you want to add? (check one with "x", remove the others)
Other useful information
Description
The
mediadisplay type introduced in #12786 reads the media type from another attribute (mediaTypeAttribute), but only recognises MIME strings (image/png,application/pdf) or the literal display type names (image,video,panorama, ...).Datasets often use their own vocabulary for that column:
IMG,VID,PAN,360, or numeric codes. Those values are not recognised, so the attribute falls back to file extension detection. That is not enough, because a panorama is a.jpgand cannot be told apart from a plain image.Proposal
Add an instance level alias configuration in
localConfig.json:This new configuration will allow to have aliases to resolve correctly the media type in a project. These are the changes we will need to introduce:
featureInfoMediaTypeAliasesin localConfig.json global for the whole application.ConfigUtils.getConfigProp).String(value).trim().toLowerCase()to support also numeric value.DISPLAY_TYPESso a typo can't invent a renderer.What kind of improvement you want to add? (check one with "x", remove the others)
Other useful information