Re: Wicket 1.5 migration questions

2012-09-13 Thread Alec Swan
Martin, I tried and came back :) Could you clarify how you suggest response.renderCSSReference to pass parameters which are then retrieved in ResourceReference#getName() On Wed, Sep 12, 2012 at 4:26 PM, Alec Swan alecs...@gmail.com wrote: Maybe you could simply use

Re: Wicket 1.5 migration questions

2012-09-13 Thread Martin Grigorov
in YourComponent.java: PageParameters params = new PageParameters(); params.set(0, css); params.set(1, styles.css); url = urlFor(new MountedResourceReference(), params); response.renderCSSReference(url) in MyApp#init(): mountResource(global, new MountedResourceReference()); in

Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
@wicket.apache.org Subject: Re: Wicket 1.5 migration questions I take it by global you mean http://myServer:###/myWebApp/global? Yes. If so, why don't you just add the folder to the root of your war? Good point, I could do that, but I'd rather keep my current folder structure. So, does it mean

Re: Wicket 1.5 migration questions

2012-09-12 Thread Martin Grigorov
~ Thank you, Paul Bors -Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Tuesday, September 11, 2012 11:42 AM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions I take it by global you mean http://myServer:###/myWebApp/global? Yes. If so

RE: Wicket 1.5 migration questions

2012-09-12 Thread Paul Bors
:04 AM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions Hi Alec, See my previous response. Try it and then come back. On Wed, Sep 12, 2012 at 5:43 PM, Alec Swan alecs...@gmail.com wrote: Paul, I looked at IResource and ResourceReference classes but still can't figure out

Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
Wicket-er. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, September 12, 2012 11:04 AM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions Hi Alec, See my previous response. Try it and then come back. On Wed, Sep 12, 2012

RE: Wicket 1.5 migration questions

2012-09-12 Thread Paul Bors
you, Paul Bors PS: Wicket itself is full of examples, the power of open source :) -Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Wednesday, September 12, 2012 2:00 PM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions I tried Martin's

Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
PackageResourceReference IS-A ResourceReference and neither has a no-arg constructor. My point exactly. That's why I can't just do mountResource(/global, new MyRR()) as Martin suggested. To see examples of how to implement your own PackageResourceReference take a look at its children such as

Re: Wicket 1.5 migration questions

2012-09-12 Thread Christoph Leiter
On 12.09.2012 21:38, Alec Swan wrote: PackageResourceReference IS-A ResourceReference and neither has a no-arg constructor. My point exactly. That's why I can't just do mountResource(/global, new MyRR()) as Martin suggested. My quick try: public class MyPackageResourceReference extends

Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
Thanks, Christoph. I tested your implementation and was able to pull global/css/styles.css from the browser. However, the following code threw an exception: response.renderCSSReference(new MyPackageResourceReference(MyResources.class, css/styles.css), screen); I also tried:

Re: Wicket 1.5 migration questions

2012-09-12 Thread Christoph Leiter
On 12.09.2012 22:50, Alec Swan wrote: I tested your implementation and was able to pull global/css/styles.css from the browser. However, the following code threw an exception: response.renderCSSReference(new MyPackageResourceReference(MyResources.class, css/styles.css), screen); Maybe you

Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
Maybe you could simply use response.renderCSSReference(getRequest().getContextPath() + /global/css/styles.css); or is there a problem with it? That didn't fix request.getUrl().toString() returning an empty string when called from ResourceReference.getExtension()

RE: Wicket 1.5 migration questions

2012-09-11 Thread Paul Bors
you, Paul Bors -Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Monday, September 10, 2012 7:43 PM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions Any update on this? How can I mount CSS and JS resources under /global/ without having to do

Re: Wicket 1.5 migration questions

2012-09-11 Thread Alec Swan
I take it by global you mean http://myServer:###/myWebApp/global? Yes. If so, why don't you just add the folder to the root of your war? Good point, I could do that, but I'd rather keep my current folder structure. So, does it mean that putClassAlias functionality is gone in 1.5? Thanks,

RE: Wicket 1.5 migration questions

2012-09-11 Thread Paul Bors
an existing one :) http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/resource/IRes ource.html ~ Thank you, Paul Bors -Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Tuesday, September 11, 2012 11:42 AM To: users@wicket.apache.org Subject: Re: Wicket 1.5

Re: Wicket 1.5 migration questions

2012-09-10 Thread Alec Swan
Any update on this? How can I mount CSS and JS resources under /global/ without having to do a mountResource() for every such file? Thanks, Alec On Thu, Sep 6, 2012 at 12:07 PM, Alec Swan alecs...@gmail.com wrote: But I want JavaScript files to be compresses by JavaScriptResourceReference and

Re: Wicket 1.5 migration questions

2012-09-06 Thread Alec Swan
In 1.4 I had the following classes in com.myco.app.res package: GlobalJavascriptResourceReference extends JavaScriptResourceReference GlobalCompressedResourceReference extends PackageResourceReference GlobalResourceScope And Application had the following code:

Re: Wicket 1.5 migration questions

2012-09-06 Thread Martin Grigorov
extend PackageResourceReference and override its #getName() to read the name from the request path/parameters mountResource(/global, new MyPRR()) On Thu, Sep 6, 2012 at 7:57 PM, Alec Swan alecs...@gmail.com wrote: In 1.4 I had the following classes in com.myco.app.res package:

Re: Wicket 1.5 migration questions

2012-09-06 Thread Alec Swan
But I want JavaScript files to be compresses by JavaScriptResourceReference and CSS be served as PackageResourceReference. How do I mount them both under /global URL suffix? On Thu, Sep 6, 2012 at 12:02 PM, Martin Grigorov mgrigo...@apache.org wrote: extend PackageResourceReference and override

Re: Wicket 1.5 migration questions

2012-09-04 Thread Thomas Götz
Take a look at the migration guide, this will answer some (if not all) of your questions: https://cwiki.apache.org/WICKET/migration-to-wicket-15.html -Tom On 04.09.2012, at 02:36, Alec Swan alecs...@gmail.com wrote: Hello, I finally decided to bite the bullet and migrate to Wicket 1.5.

Re: Wicket 1.5 migration questions

2012-09-04 Thread Alec Swan
I used that migration guide during the migration but none of the questions in my original post were answered there. Alec On Tue, Sep 4, 2012 at 12:44 AM, Thomas Götz t...@decoded.de wrote: Take a look at the migration guide, this will answer some (if not all) of your questions:

Re: Wicket 1.5 migration questions

2012-09-04 Thread Thomas Götz
Please see my inline comments. Cheers, -Tom On 04.09.2012, at 02:36, Alec Swan alecs...@gmail.com wrote: * How to implement HybridUrlCodingStrategy in 1.5? Please have a look at http://wicketinaction.com/2011/07/wicket-1-5-mounting-pages/ * I saw a ticket related to putClassAlias,

Re: Wicket 1.5 migration questions

2012-09-04 Thread Alec Swan
Thanks, Tom. I saw the link explaining how to migrate SharedResources#putClassAlias(GlobalResourceScope.class, global) before but was found it confusing because global and images aliases 1.4 version were replaced with imgres in 1.5 example. All I need to do is use global in place of

Re: Wicket 1.5 migration questions

2012-09-04 Thread Thomas Götz
I didn't get your usecase exactly yet, but maybe this will help you: http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ Cheers, -Tom On 04.09.2012, at 17:33, Alec Swan alecs...@gmail.com wrote: I saw the link explaining how to migrate

Re: Wicket 1.5 migration questions

2012-09-04 Thread Alec Swan
Tom, I have com.myco.app.res.GlobalResourceScope.class and events.js in the same package. So, putClassAlias(GlobalResourceScope.class, global) in 1.4 would allow me to access http://../app/global/events.js in the browser. It seems like in 1.5 this is similar to mountPackage(String, Class?

Re: Wicket 1.5 migration questions

2012-09-04 Thread Alec Swan
Well, mountPackage did not work for me either. Basically, what I want to do is access ALL resources in com.myco.app.res package with global URL prefix. For example, access a JavaScript file as global/events.js instead of ../wicket/resource/com.myco.app.res.GlobalResourceScope/events.js URL. In

RE: Wicket 1.5 migration questions

2012-09-04 Thread Paul Bors
-Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Tuesday, September 04, 2012 5:18 PM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions Well, mountPackage did not work for me either. Basically, what I want to do is access ALL resources

Re: Wicket 1.5 migration questions

2012-09-04 Thread Martin Grigorov
On Tue, Sep 4, 2012 at 11:17 PM, Alec Swan alecs...@gmail.com wrote: Well, mountPackage did not work for me either. Basically, what I want to do is access ALL resources in com.myco.app.res package with global URL prefix. For example, access a JavaScript file as global/events.js instead of