Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-831

Consolidate code for determining media type, format type, icon for a media binary

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 5.0
    • None
    • None

      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

        Acceptance criteria

              Unassigned Unassigned
              czimmermann Christopher Zimmermann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD