You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Felix Gonschorek <fe...@netzgut.net> on 2013/05/03 13:25:57 UTC

Re: Failing to load asset / stylesheet with @Import annotation in subclassed component / TAP5-2083 (Tapestry 5.4-SNAPSHOT)

hi guys,

had a closer look at this since our upgrade to 5.4 is blocked by this issue.

It looks like the line 148 in AssetSourceImpl causes this behaviour
(tapestry-5.4-alpha3):


<code>
String metaRoot = "META-INF/assets/" +
toPathPrefix(resources.getComponentModel().getLibraryName());
</code>


the method call "toPathPrefix(libraryName)" resolves the path relative to
the component model, which in turn does not take into consideration, that
the component may be subclassed.

I tried to find a intermediate solution with "javaScriptSupport(asset)" in
the parent class, but this does'nt work either.

Some of my subclassed components are not in the same library, so that
should also be checked when searching for a solution. i would contribute a
solution on my own, but i can't think of a possible solution that is easy
to implement - i think that someone with more insight into the new tapestry
internals has to take care here.

In the current state it's defineately not possible to subclass components
which reside in different packages or libraries.

if you have any idea how to solve this properly i would try to implement it
and contribute a patch with test case etc.

thanks!


On Fri, Mar 8, 2013 at 4:22 PM, Felix Gonschorek <fe...@netzgut.net> wrote:

> Hi guys,
>
> we are upgrading our system to tapestry5.4 (snapshot).
>
> importing a stylesheet with the "@Import" annotation fails, when
> subclassing a component which is in a different folder: tapestry tries to
> load the asset in the folder of the subclassed component instead of the
> folder, where the class resides where the "@Import" annotation is put on.
>
> https://issues.apache.org/jira/browse/TAP5-2083
>
> this was working in 5.3.4-rc-5 (which we still are on because this version
> has hibernate 4 support by accident ;-) )
>
> thanks!
>
> felix
>