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

ImageProvider should handle documents based on mimetypes, based on configuration

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Neutral
    • None
    • 5.2
    • image provider
    • None

    Description

      DefaultImageProvider.resolveIconClassName() returns which IconFont CssClass is appropriate for the document based on MimeType. The decision is made based on a chain of regexp comparisons on the mime type, but this set of checks should be configurable via configuration.

      Related, getThumbnailResource() checks the mimetype of the doc to see if its an image, if so it generates a thumbnail image, otherwise it calls the method mentioned above to get a class name.

      The above two methods should be integrated and generalized such that any type of processing can be taken on a document (probably based on mime type (not extension)) in a configurable way, to return an ExternalResource (image) or IconFontResource (cssclass).

      For example, a configuration node could hold an ordered list of "MimeHandlers" which would consist of a RegExp phrase, the name of one of the default handlers (image, pdf, video, icon font), optionally a class name for a document image generator, optionally an IconFont Css class.

      A concept paper should be written for this topic before implementing.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD