[MAGNOLIA-6274] Resource API should provide a method to resolve the resource type Created: 29/Jun/15  Updated: 12/May/17  Resolved: 22/Dec/16

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

Type: Improvement Priority: Major
Reporter: Aleksandr Pchelintcev Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLRES-173 Create FileFormat column for the reso... Closed
is related to MGNLRES-200 Show image previews for image resources 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)
Date of First Response:
Epic Link: Registry & Resources API wishlist
Story Points: 3

 Description   

We need to add a method that'd return a Resource MIME-type string, smth like
Resource#getType()

One of the use case is a browser sub-app in the new Resources app - there we use a workaround via Tika for the time being, which is indeed ugly.



 Comments   
Comment by Mikaël Geljić [ 22/Dec/16 ]

This ticket belongs to a series of improvements to the 5.4 registry & resources APIs—which hasn't caught sufficient traction or rationale ever since 5.4 was released last year.

Do reopen should this become a topic again.

Comment by Joerg von Frantzius [ 12/May/17 ]

Hi,
we're using a custom Renderer for .hbs (Handlebars) templates. Unfortunately, these can neither be viewed nor edited in the Resources app, nor are hot-fixes possible for our templates.

https://git.magnolia-cms.com/projects/MODULES/repos/resources/browse/magnolia-resources-app/src/main/java/info/magnolia/resources/app/availability/IsNotBinaryFileRule.java#70 contains a hardcoded list of extensions that are supported for viewing and editing. This list should be configurable somewhere instead of being hardcoded.

Otherwise the resources app won't work for any templating language other than FTL. Currently probably even JSP isn't supported, as it is not in the hardcoded list.

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