[MGNLUI-831] Consolidate code for determining media type, format type, icon for a media binary Created: 06/Mar/13  Updated: 10/Mar/21  Resolved: 10/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.0
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-213 ImageProvider should handle documents... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

There is code in multiple places for these activities. Some of the code should be consolidated into a utility class. Please analyze and discuss with architects.

Definitely unify:
DefaultImageProvider.resolveFileTypeFromMimeType()
FileItemWrapper.resolveFileTypeFromMimeType()

And:
DefaultImageProvider.isImage()
FileItemWrapper.isImage()

Also Consider:
FileItemWrapper.ResolveMediaTypeFromMimeType()

The difference is that FileType includes all of the files that we have icons for. Do we want to do this? Should it be a different name? IconfileType?

This is also handled in DAM with Voters and configuration. Would it make sense to move this functionality out of dam? so that it could be used for files in general? Maybe this implementation can replace the above functions.
DamModule.getMediaTypeForMimeType()

This is very much related to: http://jira.magnolia-cms.com/browse/MGNLUI-213



 Comments   
Comment by Christopher Zimmermann [ 06/Mar/13 ]

Closely related.

Generated at Mon Feb 12 08:40:44 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.