Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2014-08-20 Thread Dirk Forchel
Thank you Martin. Lovely.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4667115.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2014-08-20 Thread Martin Grigorov
Hi,

With the following modifications it works:

in HomePage.html:

static resource from Web Container
 
ContextRelativeResource with SharedResourceReference
 
PlaceholderImageResourceReference
 

in HomePage.java:

add(new Image("dotclear1", new SharedResourceReference("dotclear")));
 add(new Image("dotclear2", new PlaceholderImageResourceReference()));

the generated paths look like:
http://localhost:8080/en_US/images/dotclear1-ver-138389572.png
note the locale as first segment in the path! with your code this is
missing and thus the 404s


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


On Wed, Aug 20, 2014 at 10:58 AM, Dirk Forchel 
wrote:

> Hi Ernesto,
> after a couple of weeks (months) I still haven't found a solution. Any
> idea?
> Thanks for your helping hand.
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4667100.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2014-08-20 Thread Dirk Forchel
Hi Ernesto,
after a couple of weeks (months) I still haven't found a solution. Any idea?
Thanks for your helping hand.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4667100.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-11 Thread Ernesto Reinaldo Barreiro
Did not have time to look at it. I will try today.


On Tue, Nov 12, 2013 at 7:44 AM, Dirk Forchel wrote:

> Did anybody try to run my attached quickstart application and can explain
> why
> the additional LocaleMapper changes the path?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662335.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-11 Thread Dirk Forchel
Did anybody try to run my attached quickstart application and can explain why
the additional LocaleMapper changes the path?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662335.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-08 Thread Dirk Forchel
No, actually not. We've got a complete layout for our web applications from
an external design company and they use this CSS+static image resource thing
quite often. And, as I have mentioned before, we have two Wicket web
applications running in the same container. One of them on the root context
and one of them on e.g. "/foo". If I start the application server (Tomcat)
and request the home page of the second application (e.g.
"/foo/uk/en/home.html") the first application is initialized too, just to
render the static placeholder image from the web container. I was wondering
why and started to do some investigation. If I would disable the first web
application (remove the servlet from web.xml), all works fine and even the
static image resource from the web container is delivered.
By the way ... I've finished to prepare a quickstart (see uploaded
quickstart.zip file). At the first glance all images were rendered. I've
added an additional mapper (the LocalMapper from the Wicket examples) to
simulate our Country/Language mapping solution and ... oh wonder ... the
second and third images are not rendered!

quickstart.zip
  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662232.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-08 Thread Ernesto Reinaldo Barreiro
may I ask what is the use case for this 1x1 PNG? Is it something that
cannot be handled via CSS + static image on resources?


On Fri, Nov 8, 2013 at 8:49 AM, Dirk Forchel wrote:

> Okay. I know, but their is no need for an additional parameter. I want to
> generate always the same image (a 1x1px PNG with a transparent background).
> So I don't see the need for a parameter.
> But I try to prepare a quickstart.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662225.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-07 Thread Dirk Forchel
Okay. I know, but their is no need for an additional parameter. I want to
generate always the same image (a 1x1px PNG with a transparent background).
So I don't see the need for a parameter.
But I try to prepare a quickstart.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662225.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-07 Thread Ernesto Reinaldo Barreiro
If you mount a global resource then you can pass a parameter to it and use
that parameter to generate dynamic image. If you create a quickstart I
could try to look at it and help (if I can).


On Fri, Nov 8, 2013 at 8:18 AM, Dirk Forchel wrote:

> Yes, I know this article and based on this one I wrote the
> PlaceholderImageResourceReference class. And it works as expected. I mean I
> can add this resource reference to each component I want.
>
> Panel:
>
> add( new Image("placeholderImg", new PlaceholderImageResourceReference() )
> );
>
> Markup:
>
>
> But this is not the point. I thought I can add a kind of "global" resource
> with a mount path like:
> mountResource("/images/dotclear.png", new
> PlaceholderImageResourceReference() );
>
> Where each src-attribute of an img-tag with the src path like
> "images/dotclear.png" is replaced with the image automatically. But it is
> not. We have about 10 to 20 Panels with almost the same "placeholder"
> image.
>
> But if I add the servlet context path (the application runs with this
> servlet context path) to the src-attribute, the image is added!? I don't
> understand why?
>
> This is a bit strange to me.
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662221.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-07 Thread Dirk Forchel
Yes, I know this article and based on this one I wrote the
PlaceholderImageResourceReference class. And it works as expected. I mean I
can add this resource reference to each component I want.

Panel:

add( new Image("placeholderImg", new PlaceholderImageResourceReference() )
);

Markup:


But this is not the point. I thought I can add a kind of "global" resource
with a mount path like:
mountResource("/images/dotclear.png", new
PlaceholderImageResourceReference() );

Where each src-attribute of an img-tag with the src path like
"images/dotclear.png" is replaced with the image automatically. But it is
not. We have about 10 to 20 Panels with almost the same "placeholder" image.

But if I add the servlet context path (the application runs with this
servlet context path) to the src-attribute, the image is added!? I don't
understand why?

This is a bit strange to me.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662221.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-07 Thread Ernesto Reinaldo Barreiro
Did you read this?

http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/




On Fri, Nov 8, 2013 at 6:56 AM, Dirk Forchel wrote:

> No comment? No idea? Probably another solution?
> Thanks
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662219.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-07 Thread Dirk Forchel
No comment? No idea? Probably another solution?
Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662219.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-07 Thread Dirk Forchel
And finally I've added two Image components to the Panel (this works as
expected).

In my Panel.class:

add( new Image("img1", new SharedResourceReference("dotclear") ) );
add( new Image("img2", new PlaceholderImageResourceReference()  ) );

HTML:

Rendered URLs:

In addition we use the placeholder image quite often in different panels to
replace it with different css rules like this (only an example):

.bt_right {
background: url(../images/sprite.png) -200px -30px;
width: 10px;
height:32px;
margin:4px 0 0 0;
}

So even if I could add an appropriate Image component to each panel using
the placeholder image this would blow up the code where it should not. I
hope I could make it clear.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662196.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org