[MGNLRES-105] Resource can't have same name different extension Created: 14/Aug/13  Updated: 29/Mar/22  Resolved: 04/Dec/13

Status: Closed
Project: Magnolia Resources Module
Component/s: None
Affects Version/s: 1.5, 2.0
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Ricardo Ulate Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tested on Windows 7, Running on Eclipse


Attachments: Text File ResourceExtensionDispatcherRenderer.java     XML File config.modules.resources.renderers.extensionDispatcher.xml     XML File config.modules.resources.templates.extensionDispatcher.xml    
Issue Links:
relation
is related to MAGNOLIA-5696 Resources on first level are not serv... 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)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Team: Nucleus

 Description   

One can't have several files with the same name but different extension. This is common when for font files with extensions: ttf, woff, svg, eot

The work around is to change the filename.



 Comments   
Comment by Tobias Mattsson [ 04/Dec/13 ]

This is by design. The extension is not part of the node name. The design allows for serving a resource in any number of supported formats by transforming it on the fly.

Comment by Ricardo Ulate [ 09/Dec/13 ]

"The design allows for serving a resource in any number of supported formats by transforming it on the fly."

Does this also apply to font files?, because as mentioned on the ticket, the problem we're having is related with handling several font files (to better support different browsers), where it makes sense they are named the same just with a different extension.

Comment by Magnolia International [ 06/Mar/14 ]

Hi,

I suggest the following approach instead: Usage of a dedicated Resources renderer which returns the binary corresponding to the requested extensions. Basically the idea is to have a node called for instance myImage. It has its own type called extension dispatcher.

Below this node, there are several nodes, one for each extension:

myImage [Extension Dispatcher]
|-- jpg [Binary/jpg]
|-- png [Binary/png]

The renderer will look at the extension (on the URI) and returns the corresponding sub node.

I have attached the patch to the issue.
Thanks,
Nicolas

Comment by Roman Kovařík [ 06/Mar/14 ]

Hi Nicolas,
please create new ticket in the Resources module, this old ticket won't be reopened.

Regards
Roman

Comment by Roman Kovařík [ 17/Mar/14 ]

Hello Nicolas,
it should be possible to use extension as part of a node name directly:

  • myImage.jpg
  • myImage.png

Hope that helps.
Roman

Generated at Mon Feb 12 06:47:27 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.