[MAGNOLIA-6576] MIMEMapping needs rewrite Created: 02/Mar/16  Updated: 21/Sep/22

Status: Open
Project: Magnolia
Component/s: None
Affects Version/s: 5.4.5
Fix Version/s: None

Type: Task Priority: Low
Reporter: Espen Jervidalo Assignee: Unassigned
Resolution: Unresolved Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MAGNOLIA-6807 Core incorrectly bootstraps dam-app's... Closed
relates to MAGNOLIA-1858 Review MIMEMapping and make it a prop... Closed
relation
is related to MGNLDAM-902 AssetPreviewProvider throws exception... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: System config restrictions and externalisation - Phase 2
Story Points: 5
Team: DeveloperX

 Description   

UPD re: SaaS cloud

  • Externalise MIME type configuration mappings out of JCR config, use property-based configuration sources to facilitate mappings.
  • consider personas that should have access to such configuration (consider Magnolia admins as the only ones initially).

Original description

Once the cached mime-types list is propagated from JCR it's impossible to reset it without hacks. This is in production not such a big issue, but it leaks in unit-tests. There are several classes which don't run isolated and are implicitly depending on other unit-tests to set up the JCR nodes underneath /server/MIMEMapping and load them using #init().

Apart from that:

  • it's not using node2bean mechanism, instead it's directly accessing JCR. It should be aligned to other observed managers in server-config.
  • It's not a util-class, it should not be static.


 Comments   
Comment by Jan Haderka [ 11/Mar/16 ]

Another thing for the rewrite - often same different mime mappings point to same extension. Currently Magnolia doesn't allow for 1:n relation between extension and mime type . That should be addressed by any eventual refactoring as well.

Comment by Jan Haderka [ 08/Dec/16 ]

Hey this is bull*. info.magnolia.cms.beans.config.MIMEMapping is deprecated with comment * @deprecated since 5.4.6. This class will be replaced (see MAGNOLIA-6576). but this issue is not resolved leaving user with having to use deprecated class without replacement. Whole point of deprecation is to give people time to cleanup their code and move to newer API before the old one is removed, but with this class such move is not possible leaving just annoyance behind from having to use deprecated code.

Comment by Richard Unger [ 25/Jan/17 ]

+1 to Jan's comment

Also, could you please make the mapping queryable in both directions? Eg, given a mime-type, load the icon or extension(s) for this mimeType?

Thanks!

Generated at Mon Feb 12 04:15:49 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.