Re: Avoid ListenerInvocationNotAllowedException on slow clients

2013-07-30 Thread Martin Grigorov
Hi,

You can use AjaxChannel.ACTIVE in the Ajax attributes. This will tell
Wicket JS to not send second Ajax call until the previous has finished.


On Wed, Jul 31, 2013 at 8:03 AM, René Hartwig <
rene.hart...@befine-solutions.com> wrote:

>  Hi there,
>
> I am using Wicket Version 6.9.1 on a Jetty 8 Server and have a Page
> opening up a modal dialog triggered by an AjaxSubmitLink.
> Now I recognized that on slow Clients a User is capable of clicking this
> link twice so that the server has already disabled the behavior, but the
> Client has not yet redrawn the page and the second click then causes a
> ListenerInvocationNotAllowedException.
> Do you have a suggestion for me how I can avoid, or at least improve this
> behavior?
>
>
> Thank you and best regards,
> René
>
> --
>
> René Hartwig
> Senior Developer
>
> *Befine Solutions AG - The Cryptshare Company*
> Bebelstraße 17
> 79108 Freiburg
> Germany
>
> Tel: +49 (0) 761 38913 0
> Fax: +49 (0) 761 38913 115
>
> E-Mail: *rene.hart...@befine-solutions.com*
> Internet: http://www.cryptshare.com
>
> =
>
> Your attachments are too large or too confidential for e-mail?
> Get to know Cryptshare!
>
> http://www.cryptshare.com
>
> =
>
>  
> 
>
> Amtsgericht Freiburg HRB 6144
> Vorstand Mark Forrest, Dominik Lehr
> Aufsichtsratsvorsitzender Thilo Braun
>
>
>
>


Re: gmap2, wicket 6.9 and ajax refresh

2013-07-30 Thread Martin Grigorov
Hi,

Yes, as you have found there is a ticket about this.

On Wed, Jul 31, 2013 at 12:55 AM, Gabriel Landon  wrote:

> Since I've upgrade from wicket 6.8.0 to wicket 6.9.1, many of my gmap panel
> are not working anymore when I do an ajax refresh on them.
>
> From what's I've discovered is that on the refresh the
> Wicket.Event.add(window, "onUnload", function(event) {
> google.maps.Unload();;});
> has became
> (function(){google.maps.Unload();})
>
> That is not good!
>
> The code in gmap2 has not changed.
> It use : response.render(OnEventHeaderItem.forScript("window", "onUnload",
>

But this looks wrong.
1) OnLoadHeaderItem can be used
2) or OnEventHeaderItem with 'unload' event. Note that there is no 'on'
prefix when using event registration


> "google.maps.Unload();"));
> that produce :
> @Override
> public void render(Response response)
> {
> JavaScriptUtils.writeJavaScript(response,
> "Wicket.Event.add(" +
> getTarget() + ", \"" +
> getEvent() + "\", function(event) { " +
> getJavaScript() + ";});");
> }
>
> In wicket 6.8 when I refresh the map, the program does go in the render
> function, but not in wicket 6.9.
> That is very strange...
>
> *I think it has something to do with :
> https://issues.apache.org/jira/browse/WICKET-5234*
>
> You can reproduce it using gmap2-exmaple in the "listener" page.
> Just click on the "true/false" button and then the map get stuck!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564.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
>
>


Avoid ListenerInvocationNotAllowedException on slow clients

2013-07-30 Thread René Hartwig

  
  
Hi there,

I am using Wicket Version 6.9.1 on a Jetty 8 Server and have a Page
opening up a modal dialog triggered by an AjaxSubmitLink.
Now I recognized that on slow Clients a User is capable of clicking
this link twice so that the server has already disabled the
behavior, but the Client has not yet redrawn the page and the second
click then causes a ListenerInvocationNotAllowedException.
Do you have a suggestion for me how I can avoid, or at least improve
this behavior?


Thank you and best regards,
René

-- 
   René
Hartwig
Senior Developer
   Befine
Solutions AG - The Cryptshare Company
Bebelstraße 17
  79108 Freiburg
  Germany
   Tel: +49 (0) 761 38913
  0
  Fax: +49 (0) 761 38913 115

E-Mail: rene.hart...@befine-solutions.com
Internet: http://www.cryptshare.com
   =
   Your attachments are
  too large or too confidential for e-mail?
  Get to know Cryptshare!
   http://www.cryptshare.com
   =
   
  
  Amtsgericht
Freiburg HRB 6144
Vorstand Mark Forrest, Dominik Lehr
Aufsichtsratsvorsitzender Thilo Braun
   
 

  



Re: gmap2, wicket 6.9 and ajax refresh

2013-07-30 Thread Gabriel Landon
Sorry to have bother you with this.
There's already an issue open for this for those who have the same problem!

https://issues.apache.org/jira/browse/WICKET-5248




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564p4660565.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



gmap2, wicket 6.9 and ajax refresh

2013-07-30 Thread Gabriel Landon
Since I've upgrade from wicket 6.8.0 to wicket 6.9.1, many of my gmap panel
are not working anymore when I do an ajax refresh on them.

>From what's I've discovered is that on the refresh the
Wicket.Event.add(window, "onUnload", function(event) {
google.maps.Unload();;});
has became 
(function(){google.maps.Unload();})

That is not good!

The code in gmap2 has not changed.
It use : response.render(OnEventHeaderItem.forScript("window", "onUnload",
"google.maps.Unload();"));
that produce :
@Override
public void render(Response response)
{
JavaScriptUtils.writeJavaScript(response, "Wicket.Event.add(" +
getTarget() + ", \"" +
getEvent() + "\", function(event) { " + getJavaScript() 
+ ";});");
}

In wicket 6.8 when I refresh the map, the program does go in the render
function, but not in wicket 6.9.
That is very strange...

*I think it has something to do with :
https://issues.apache.org/jira/browse/WICKET-5234*

You can reproduce it using gmap2-exmaple in the "listener" page.
Just click on the "true/false" button and then the map get stuck!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/gmap2-wicket-6-9-and-ajax-refresh-tp4660564.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: Ajax Refreshing Issue

2013-07-30 Thread dhongyt
Sorry I forgot to add that I have fixed this issue. I think it was because I
didn't apply it to the a panel.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-Refreshing-Issue-tp4660289p4660563.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: Ajax Refreshing Issue

2013-07-30 Thread Paul Bors
Have you tried it outside of Eclipse?

Create yourself a quick start and run it from the console.
Also that stack trace could be usefull.



-
~ Thank you,
p...@bors.ws
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-Refreshing-Issue-tp4660289p4660562.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: Ajax Refreshing Issue

2013-07-30 Thread dhongyt
I'm using Wicket 6.4.0



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-Refreshing-Issue-tp4660289p4660561.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: SVG mime-type incorrect

2013-07-30 Thread Martin Grigorov
On Tue, Jul 30, 2013 at 9:10 PM, Chris Snyder wrote:

> Good catch - thanks. Though it turns out that the mailcap stuff is all a
> red herring - they're just a stub for some code that somebody (probably in
> 1996 or thereabouts) thought they'd implement someday:
> > // For backward compatibility -- mailcap format files
> > // This is not currently used, but may in the future when we add ability
> > // to read BOTH the properties format and the mailcap format.
>
> Here's where the actual content-type loading takes place:
>
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/MimeTable.java#229
>
> To get this working, I copied the content-types.properties file from the
> Java lib directory to in the package next to the Wicket Start class, added
> an entry for SVG (the stock file is quite sparse), and added the following
> line in Start#main:
> > System.setProperty("content.types.user.table",
> Start.class.getResource("content-types.properties").getPath());
>
> After doing that, it works properly - the correct mime-type is served, and
> Chrome displays the image. This is hardly a good solution for a production
> environment, but it will suffice for now.
>
> Given how much of a mess that Java code is, it seems to me that Wicket's
> UrlResourceStream#getData method should be modified to not call
> URLConnection#getContentType at all. The behavior for when getContentType
> returns null - ask the Application [if it exists], or consult
> URLConnection#getFileNameMap - looks to be better for all cases.
>

I agree with you.
I think the code should first consult with Application#getMineType(), then
urlConnection#getContentType and finally UrlConnection#getFileNameMap.
urlConnection#getContentType uses #getHeaderName() and for
HttpUrlConnection this would matter because the http server can set
something custom.
Please file a ticket.


>
> Thanks so much for your help. I'm just getting into Wicket programming,
> and am very impressed with the helpfulness of the community.
>
> Thanks,
> Chris
> --
> Chris Snyder
> Web Developer, BioLogos
> 616.328.5208 x203
> biologos.org
>
> On Jul 30, 2013, at 14:23, Martin Grigorov  wrote:
>
> > You are right.
> > It tries with getHeaderName(String) which looks in MimeTable and falls
> back
> > to by stream.
> > I think you need to set the type in your mailcap file.
> >
> >
> > On Tue, Jul 30, 2013 at 8:16 PM, Chris Snyder  >wrote:
> >
> >> Except that URLConnection#getContentType doesn't even use MimeTable:
> >>
> >>
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/URLConnection.java?av=f#147
> >>
> >> URLConnection#guessContentTypeFromStream is what it's using:
> >>
> >>
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/net/URLConnection.java#URLConnection.guessContentTypeFromStream%28java.io.InputStream%29
> >> Ugh - what a mess. That seems like a very arbitrary set of filetypes to
> >> test for (FlashPix?). It sees that the SVG file starts with  it
> >> returns application/xml - not wrong, per se - but not accurate enough.
> >>
> >>> On my
> >>> machine
> >>
> System.err.println(URLConnection.getFileNameMap().getContentTypeFor("file.svg"));
> >>> prints null
> >> Same here. However, the following returns "application/xml" (test.svg
> must
> >> be an SVG file, of course):
> >>
> >>
> System.err.println(URLConnection.guessContentTypeFromStream(getClass().getResourceAsStream("test.svg")));
> >>
> >> Thanks,
> >> Chris
> >> --
> >> Chris Snyder
> >> Web Developer, BioLogos
> >> 616.328.5208 x203
> >> biologos.org
> >>
> >> On Jul 30, 2013, at 13:52, Martin Grigorov 
> wrote:
> >>
> >>> This is nasty indeed!
> >>>
> >>> According to
> >>>
> >>
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/MimeTable.java#MimeTable
> >>> the
> >>> mime types are loaded from mailcap files.
> >>> See "man update-mime"
> >>>
> >>>
> >>> On Tue, Jul 30, 2013 at 7:40 PM, Chris Snyder <
> chris.sny...@biologos.org
> >>> wrote:
> >>>
>  However, just above that (line 122) it gets the contentType from the
>  URLConnection, which returns "application/xml". Since
>  streamData.contentType is not null, it never gets to line 126.
> 
>  Thanks so much for your help!
> 
>  -Chris
>  --
>  Chris Snyder
>  Web Developer, BioLogos
>  616.328.5208 x203
>  biologos.org
> 
>  On Jul 30, 2013, at 13:30, Martin Grigorov 
> >> wrote:
> 
> > Hi,
> >
> > According to
> >
> 
> >>
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/util/resource/UrlResourceStream.java?source=cc#L126
> > if
> > theere is an application then it should be used before falling back.
> 
> 
> >>
> >>
>
>


WGET Session Invalid?

2013-07-30 Thread dhongyt
I have a wicket log in page that I would like to log in and create a session
so that I can wget and download files off my wicket website.

I do a:
wget --no-check-certificate --keep-session-cookies --save-cookies
cookies.txt
--post-data='signInForm2_hf_0&username=(username)&password=(password)'
https://dist01test.gravite.gov:8443/gravite_new/login?0-1.IFormSubmitListener-signInForm

I checkout the cookie and it seems okay.

But when I do:
get -d --no-check-certificate --load-cookies cookies.txt
https://dist01test.gravite.gov:8443/gravite_new/wicket/resource/org.apache.wicket.Application/fileResource?fileId=65935941

I get a 400 Bad Request and can not download the file.

I have logged in via the browser interface and exported my firefox cookie
and tested downloading which worked.

So I'm sure the issue is the creation of the session file now.

In this forum
http://apache-wicket.1842946.n4.nabble.com/render-to-file-td1925870.html#a1925871
Martijn said to try and use the ONE_PASS_RENDER and I was wondering what
that was and what it did?

Thanks!
David



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WGET-Session-Invalid-tp4660559.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



its that time of year again, 42lines is hiring java devs

2013-07-30 Thread Igor Vaynberg
the company i work for ( 42lines.net ) is growing and we are looking
for a few good devs.

about our approach:

* we are a distributed usa-based company
* everyone telecommutes either from home or a coworking space of your
choice (paid for by the company)
* we use a variation of agile methodology (daily scrums, iterations,
peer code reviews, etc)
* we offer a great compensation package

tech stack:

* wicket
* jpa/hibernate/querydsl
* cdi/weld
* resteasy
* jquery / jquery mobile

what we want from you:

* first and foremost you are smart and you know how to apply those
smarts to writing code
* you work on PST/EST time
* you have a decent internet connection capable of skype
* you understand (not just know) java and oop
* you are comfortable in sql, hibernate, and wicket

there is lots more info, including how to apply, available here:

https://www.42lines.net/2013/07/24/now-hiring-one-new-software-engineer/

cheers,
-igor

ps, if you have a question please email me personally.


Re: SVG mime-type incorrect

2013-07-30 Thread Chris Snyder
Good catch - thanks. Though it turns out that the mailcap stuff is all a red 
herring - they're just a stub for some code that somebody (probably in 1996 or 
thereabouts) thought they'd implement someday:
> // For backward compatibility -- mailcap format files
> // This is not currently used, but may in the future when we add ability
> // to read BOTH the properties format and the mailcap format.

Here's where the actual content-type loading takes place:
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/MimeTable.java#229

To get this working, I copied the content-types.properties file from the Java 
lib directory to in the package next to the Wicket Start class, added an entry 
for SVG (the stock file is quite sparse), and added the following line in 
Start#main:
> System.setProperty("content.types.user.table", 
> Start.class.getResource("content-types.properties").getPath());

After doing that, it works properly - the correct mime-type is served, and 
Chrome displays the image. This is hardly a good solution for a production 
environment, but it will suffice for now.

Given how much of a mess that Java code is, it seems to me that Wicket's 
UrlResourceStream#getData method should be modified to not call 
URLConnection#getContentType at all. The behavior for when getContentType 
returns null - ask the Application [if it exists], or consult 
URLConnection#getFileNameMap - looks to be better for all cases.

Thanks so much for your help. I'm just getting into Wicket programming, and am 
very impressed with the helpfulness of the community.

Thanks,
Chris
--
Chris Snyder
Web Developer, BioLogos
616.328.5208 x203
biologos.org

On Jul 30, 2013, at 14:23, Martin Grigorov  wrote:

> You are right.
> It tries with getHeaderName(String) which looks in MimeTable and falls back
> to by stream.
> I think you need to set the type in your mailcap file.
> 
> 
> On Tue, Jul 30, 2013 at 8:16 PM, Chris Snyder 
> wrote:
> 
>> Except that URLConnection#getContentType doesn't even use MimeTable:
>> 
>> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/URLConnection.java?av=f#147
>> 
>> URLConnection#guessContentTypeFromStream is what it's using:
>> 
>> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/net/URLConnection.java#URLConnection.guessContentTypeFromStream%28java.io.InputStream%29
>> Ugh - what a mess. That seems like a very arbitrary set of filetypes to
>> test for (FlashPix?). It sees that the SVG file starts with > returns application/xml - not wrong, per se - but not accurate enough.
>> 
>>> On my
>>> machine
>> System.err.println(URLConnection.getFileNameMap().getContentTypeFor("file.svg"));
>>> prints null
>> Same here. However, the following returns "application/xml" (test.svg must
>> be an SVG file, of course):
>> 
>> System.err.println(URLConnection.guessContentTypeFromStream(getClass().getResourceAsStream("test.svg")));
>> 
>> Thanks,
>> Chris
>> --
>> Chris Snyder
>> Web Developer, BioLogos
>> 616.328.5208 x203
>> biologos.org
>> 
>> On Jul 30, 2013, at 13:52, Martin Grigorov  wrote:
>> 
>>> This is nasty indeed!
>>> 
>>> According to
>>> 
>> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/MimeTable.java#MimeTable
>>> the
>>> mime types are loaded from mailcap files.
>>> See "man update-mime"
>>> 
>>> 
>>> On Tue, Jul 30, 2013 at 7:40 PM, Chris Snyder >> wrote:
>>> 
 However, just above that (line 122) it gets the contentType from the
 URLConnection, which returns "application/xml". Since
 streamData.contentType is not null, it never gets to line 126.
 
 Thanks so much for your help!
 
 -Chris
 --
 Chris Snyder
 Web Developer, BioLogos
 616.328.5208 x203
 biologos.org
 
 On Jul 30, 2013, at 13:30, Martin Grigorov 
>> wrote:
 
> Hi,
> 
> According to
> 
 
>> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/util/resource/UrlResourceStream.java?source=cc#L126
> if
> theere is an application then it should be used before falling back.
 
 
>> 
>> 



Re: SVG mime-type incorrect

2013-07-30 Thread Martin Grigorov
You are right.
It tries with getHeaderName(String) which looks in MimeTable and falls back
to by stream.
I think you need to set the type in your mailcap file.


On Tue, Jul 30, 2013 at 8:16 PM, Chris Snyder wrote:

> Except that URLConnection#getContentType doesn't even use MimeTable:
>
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/URLConnection.java?av=f#147
>
> URLConnection#guessContentTypeFromStream is what it's using:
>
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/net/URLConnection.java#URLConnection.guessContentTypeFromStream%28java.io.InputStream%29
> Ugh - what a mess. That seems like a very arbitrary set of filetypes to
> test for (FlashPix?). It sees that the SVG file starts with  returns application/xml - not wrong, per se - but not accurate enough.
>
> > On my
> > machine
> System.err.println(URLConnection.getFileNameMap().getContentTypeFor("file.svg"));
> > prints null
> Same here. However, the following returns "application/xml" (test.svg must
> be an SVG file, of course):
>
> System.err.println(URLConnection.guessContentTypeFromStream(getClass().getResourceAsStream("test.svg")));
>
> Thanks,
> Chris
> --
> Chris Snyder
> Web Developer, BioLogos
> 616.328.5208 x203
> biologos.org
>
> On Jul 30, 2013, at 13:52, Martin Grigorov  wrote:
>
> > This is nasty indeed!
> >
> > According to
> >
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/MimeTable.java#MimeTable
> > the
> > mime types are loaded from mailcap files.
> > See "man update-mime"
> >
> >
> > On Tue, Jul 30, 2013 at 7:40 PM, Chris Snyder  >wrote:
> >
> >> However, just above that (line 122) it gets the contentType from the
> >> URLConnection, which returns "application/xml". Since
> >> streamData.contentType is not null, it never gets to line 126.
> >>
> >> Thanks so much for your help!
> >>
> >> -Chris
> >> --
> >> Chris Snyder
> >> Web Developer, BioLogos
> >> 616.328.5208 x203
> >> biologos.org
> >>
> >> On Jul 30, 2013, at 13:30, Martin Grigorov 
> wrote:
> >>
> >>> Hi,
> >>>
> >>> According to
> >>>
> >>
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/util/resource/UrlResourceStream.java?source=cc#L126
> >>> if
> >>> theere is an application then it should be used before falling back.
> >>
> >>
>
>


Re: SVG mime-type incorrect

2013-07-30 Thread Chris Snyder
Except that URLConnection#getContentType doesn't even use MimeTable:
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/URLConnection.java?av=f#147

URLConnection#guessContentTypeFromStream is what it's using:
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/net/URLConnection.java#URLConnection.guessContentTypeFromStream%28java.io.InputStream%29
Ugh - what a mess. That seems like a very arbitrary set of filetypes to test 
for (FlashPix?). It sees that the SVG file starts with  On my
> machine 
> System.err.println(URLConnection.getFileNameMap().getContentTypeFor("file.svg"));
> prints null
Same here. However, the following returns "application/xml" (test.svg must be 
an SVG file, of course):
System.err.println(URLConnection.guessContentTypeFromStream(getClass().getResourceAsStream("test.svg")));

Thanks,
Chris
--
Chris Snyder
Web Developer, BioLogos
616.328.5208 x203
biologos.org

On Jul 30, 2013, at 13:52, Martin Grigorov  wrote:

> This is nasty indeed!
> 
> According to
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/MimeTable.java#MimeTable
> the
> mime types are loaded from mailcap files.
> See "man update-mime"
> 
> 
> On Tue, Jul 30, 2013 at 7:40 PM, Chris Snyder 
> wrote:
> 
>> However, just above that (line 122) it gets the contentType from the
>> URLConnection, which returns "application/xml". Since
>> streamData.contentType is not null, it never gets to line 126.
>> 
>> Thanks so much for your help!
>> 
>> -Chris
>> --
>> Chris Snyder
>> Web Developer, BioLogos
>> 616.328.5208 x203
>> biologos.org
>> 
>> On Jul 30, 2013, at 13:30, Martin Grigorov  wrote:
>> 
>>> Hi,
>>> 
>>> According to
>>> 
>> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/util/resource/UrlResourceStream.java?source=cc#L126
>>> if
>>> theere is an application then it should be used before falling back.
>> 
>> 



Re: SVG mime-type incorrect

2013-07-30 Thread Martin Grigorov
On my
machine 
System.err.println(URLConnection.getFileNameMap().getContentTypeFor("file.svg"));
prints null

On Tue, Jul 30, 2013 at 7:52 PM, Martin Grigorov wrote:

> This is nasty indeed!
>
> According to
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/MimeTable.java#MimeTable
>  the
> mime types are loaded from mailcap files.
> See "man update-mime"
>
>
> On Tue, Jul 30, 2013 at 7:40 PM, Chris Snyder 
> wrote:
>
>> However, just above that (line 122) it gets the contentType from the
>> URLConnection, which returns "application/xml". Since
>> streamData.contentType is not null, it never gets to line 126.
>>
>> Thanks so much for your help!
>>
>> -Chris
>> --
>> Chris Snyder
>> Web Developer, BioLogos
>> 616.328.5208 x203
>> biologos.org
>>
>> On Jul 30, 2013, at 13:30, Martin Grigorov  wrote:
>>
>> > Hi,
>> >
>> > According to
>> >
>> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/util/resource/UrlResourceStream.java?source=cc#L126
>> > if
>> > theere is an application then it should be used before falling back.
>>
>>
>


Re: SVG mime-type incorrect

2013-07-30 Thread Martin Grigorov
This is nasty indeed!

According to
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/sun/net/www/MimeTable.java#MimeTable
the
mime types are loaded from mailcap files.
See "man update-mime"


On Tue, Jul 30, 2013 at 7:40 PM, Chris Snyder wrote:

> However, just above that (line 122) it gets the contentType from the
> URLConnection, which returns "application/xml". Since
> streamData.contentType is not null, it never gets to line 126.
>
> Thanks so much for your help!
>
> -Chris
> --
> Chris Snyder
> Web Developer, BioLogos
> 616.328.5208 x203
> biologos.org
>
> On Jul 30, 2013, at 13:30, Martin Grigorov  wrote:
>
> > Hi,
> >
> > According to
> >
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/util/resource/UrlResourceStream.java?source=cc#L126
> > if
> > theere is an application then it should be used before falling back.
>
>


Re: SVG mime-type incorrect

2013-07-30 Thread Chris Snyder
However, just above that (line 122) it gets the contentType from the 
URLConnection, which returns "application/xml". Since streamData.contentType is 
not null, it never gets to line 126.

Thanks so much for your help!

-Chris
--
Chris Snyder
Web Developer, BioLogos
616.328.5208 x203
biologos.org

On Jul 30, 2013, at 13:30, Martin Grigorov  wrote:

> Hi,
> 
> According to
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/util/resource/UrlResourceStream.java?source=cc#L126
> if
> theere is an application then it should be used before falling back.



Re: SVG mime-type incorrect

2013-07-30 Thread Martin Grigorov
Hi,

According to
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/util/resource/UrlResourceStream.java?source=cc#L126
if
theere is an application then it should be used before falling back.


On Tue, Jul 30, 2013 at 7:22 PM, Chris Snyder wrote:

> Hi Martin,
>
> Thanks for the extremely prompt response. Unfortunately, it appears that
> Application#getMimeType isn't called for UrlResourceStream resources -
> UrlResourceStream#getData calls URLConnection#getContentType, at which
> point we've entrusted the mime-type to Java.
>
> Versions I should have included in my first email: I'm using Wicket 6.9.1,
> using the Jetty server referenced in the quickstart.
>
> Thanks,
> Chris
> --
> Chris Snyder
> Web Developer, BioLogos
> 616.328.5208 x203
> biologos.org
>
> On Jul 30, 2013, at 13:06, Martin Grigorov  wrote:
>
> > Hi,
> >
> > You can override org.apache.wicket.Application#getMimeType
> >
> >
> > On Tue, Jul 30, 2013 at 7:01 PM, Chris Snyder  >wrote:
> >
> >> I'm trying to serve SVG images as package resources. However, when I do
> >> so, the image files are served with a mime-type of application/xml,
> rather
> >> than the correct image/svg+xml. This causes strange behavior in Google
> >> Chrome - the image displays as a broken link when included in an 
> >> tag, but renders fine when the image URL is opened directly. If the
> >> resource is served from the main webapp directory rather than as a
> package
> >> resource, the correct mime-type is sent and Chrome displays the image
> >> properly.
> >>
> >> Delving into the code, it appears that the problem is Java's
> >> URLConnection.guessContentTypeFromStream() method, which doesn't support
> >> SVG files. I've verified this problem on both the Apple-supplied Java
> 1.6
> >> and the official Oracle Java 1.7, both on MacOS X.
> >>
> >> What would be the best way to work around this issue? I tried creating
> my
> >> own custom PackageResource wrapper, which had its own
> PackageResourceStream
> >> wrapper, but it quickly got unwieldy (as well as being a nightmare for
> >> future maintainability).
> >>
> >> My goal is to have a subclass of Image that returns either a reference
> to
> >> an SVG or a PNG depending on the browser version. I first noticed the
> >> mime-type problem with my subclass, but I verified that it also exists
> when
> >> using the standard Image class.
> >>
> >> Thanks in advance for your help!
> >> -Chris Snyder
> >> --
> >> Chris Snyder
> >> Web Developer, BioLogos
> >> 616.328.5208 x203
> >> biologos.org
> >>
> >>
>
>


Re: SVG mime-type incorrect

2013-07-30 Thread Chris Snyder
Hi Martin,

Thanks for the extremely prompt response. Unfortunately, it appears that 
Application#getMimeType isn't called for UrlResourceStream resources - 
UrlResourceStream#getData calls URLConnection#getContentType, at which point 
we've entrusted the mime-type to Java.

Versions I should have included in my first email: I'm using Wicket 6.9.1, 
using the Jetty server referenced in the quickstart.

Thanks,
Chris
--
Chris Snyder
Web Developer, BioLogos
616.328.5208 x203
biologos.org

On Jul 30, 2013, at 13:06, Martin Grigorov  wrote:

> Hi,
> 
> You can override org.apache.wicket.Application#getMimeType
> 
> 
> On Tue, Jul 30, 2013 at 7:01 PM, Chris Snyder 
> wrote:
> 
>> I'm trying to serve SVG images as package resources. However, when I do
>> so, the image files are served with a mime-type of application/xml, rather
>> than the correct image/svg+xml. This causes strange behavior in Google
>> Chrome - the image displays as a broken link when included in an 
>> tag, but renders fine when the image URL is opened directly. If the
>> resource is served from the main webapp directory rather than as a package
>> resource, the correct mime-type is sent and Chrome displays the image
>> properly.
>> 
>> Delving into the code, it appears that the problem is Java's
>> URLConnection.guessContentTypeFromStream() method, which doesn't support
>> SVG files. I've verified this problem on both the Apple-supplied Java 1.6
>> and the official Oracle Java 1.7, both on MacOS X.
>> 
>> What would be the best way to work around this issue? I tried creating my
>> own custom PackageResource wrapper, which had its own PackageResourceStream
>> wrapper, but it quickly got unwieldy (as well as being a nightmare for
>> future maintainability).
>> 
>> My goal is to have a subclass of Image that returns either a reference to
>> an SVG or a PNG depending on the browser version. I first noticed the
>> mime-type problem with my subclass, but I verified that it also exists when
>> using the standard Image class.
>> 
>> Thanks in advance for your help!
>> -Chris Snyder
>> --
>> Chris Snyder
>> Web Developer, BioLogos
>> 616.328.5208 x203
>> biologos.org
>> 
>> 



Re: SVG mime-type incorrect

2013-07-30 Thread Martin Grigorov
Hi,

You can override org.apache.wicket.Application#getMimeType


On Tue, Jul 30, 2013 at 7:01 PM, Chris Snyder wrote:

> I'm trying to serve SVG images as package resources. However, when I do
> so, the image files are served with a mime-type of application/xml, rather
> than the correct image/svg+xml. This causes strange behavior in Google
> Chrome - the image displays as a broken link when included in an 
> tag, but renders fine when the image URL is opened directly. If the
> resource is served from the main webapp directory rather than as a package
> resource, the correct mime-type is sent and Chrome displays the image
> properly.
>
> Delving into the code, it appears that the problem is Java's
> URLConnection.guessContentTypeFromStream() method, which doesn't support
> SVG files. I've verified this problem on both the Apple-supplied Java 1.6
> and the official Oracle Java 1.7, both on MacOS X.
>
> What would be the best way to work around this issue? I tried creating my
> own custom PackageResource wrapper, which had its own PackageResourceStream
> wrapper, but it quickly got unwieldy (as well as being a nightmare for
> future maintainability).
>
> My goal is to have a subclass of Image that returns either a reference to
> an SVG or a PNG depending on the browser version. I first noticed the
> mime-type problem with my subclass, but I verified that it also exists when
> using the standard Image class.
>
> Thanks in advance for your help!
> -Chris Snyder
> --
> Chris Snyder
> Web Developer, BioLogos
> 616.328.5208 x203
> biologos.org
>
>


SVG mime-type incorrect

2013-07-30 Thread Chris Snyder
I'm trying to serve SVG images as package resources. However, when I do so, the 
image files are served with a mime-type of application/xml, rather than the 
correct image/svg+xml. This causes strange behavior in Google Chrome - the 
image displays as a broken link when included in an  tag, but renders 
fine when the image URL is opened directly. If the resource is served from the 
main webapp directory rather than as a package resource, the correct mime-type 
is sent and Chrome displays the image properly.

Delving into the code, it appears that the problem is Java's 
URLConnection.guessContentTypeFromStream() method, which doesn't support SVG 
files. I've verified this problem on both the Apple-supplied Java 1.6 and the 
official Oracle Java 1.7, both on MacOS X.

What would be the best way to work around this issue? I tried creating my own 
custom PackageResource wrapper, which had its own PackageResourceStream 
wrapper, but it quickly got unwieldy (as well as being a nightmare for future 
maintainability).

My goal is to have a subclass of Image that returns either a reference to an 
SVG or a PNG depending on the browser version. I first noticed the mime-type 
problem with my subclass, but I verified that it also exists when using the 
standard Image class.

Thanks in advance for your help!
-Chris Snyder
--
Chris Snyder
Web Developer, BioLogos
616.328.5208 x203
biologos.org



Re: Preserve state of wicket page after page navigation

2013-07-30 Thread brazz
Now i tried to use multi window support feature of wicket. I think this would
be most elegant solution.

In every page i do:
super(ESSession.get().createAutoPageMap());

And in the application i set:
getPageSettings().setAutomaticMultiWindowSupport(true);

But still the objects are getting detached, so i get NEPs.
Shouln't it behave like every Page has its own distinct state?

Thanks for any hints!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preserve-state-of-wicket-page-after-page-navigation-tp4660511p4660542.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: Render email with Javascript

2013-07-30 Thread Marco Springer
I've used jasper reports for functionality like that.
http://community.jaspersoft.com/

All it really requires is a jrxml file that can be turned into a jasper file.
This in turn can be fed with data to produce charts or whatever.
This jrxml can be "designed" with iReport, which is also freely downloadable.

There is even a wicketstuff-jasper project to make things even easier to 
intergrate things.

Cheers,
Marco

On Tuesday, July 30, 2013 01:51:55 AM kevin94 wrote:
> In fact, my goal is to render the page in String to render it after in a PDF
> file attach to the mail.
> 
> 
> 
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Render-email-with-Javascript-tp4
> 660534p4660539.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

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



Re: Render email with Javascript

2013-07-30 Thread Martin Grigorov
My best experience with PDF generation out of HTML is with
http://search.maven.org/#search%7Cga%7C1%7Cflying-saucer-pdf.
But I don't think it supports neither JS nor SVG out of the box.
See
http://stackoverflow.com/questions/10437234/java-itext-flying-saucer-convert-html-containing-svg-tags-to-pdf


On Tue, Jul 30, 2013 at 10:51 AM, kevin94  wrote:

> In fact, my goal is to render the page in String to render it after in a
> PDF
> file attach to the mail.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Render-email-with-Javascript-tp4660534p4660539.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: Render email with Javascript

2013-07-30 Thread kevin94
In fact, my goal is to render the page in String to render it after in a PDF
file attach to the mail.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Render-email-with-Javascript-tp4660534p4660539.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: Render email with Javascript

2013-07-30 Thread Martin Grigorov
On Tue, Jul 30, 2013 at 10:26 AM, kevin94  wrote:

> Hi,
>
> I'm looking in this direction.
>

I think you should drop this idea.
Some users use web email clients - here you have some chance, but others
use desktop clients where the HTML renderer may not be fully functional
browser and your JS may not be executed at all.


>
> Thanks
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Render-email-with-Javascript-tp4660534p4660536.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: Render email with Javascript

2013-07-30 Thread kevin94
Hi,

I'm looking in this direction.

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Render-email-with-Javascript-tp4660534p4660536.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: Render email with Javascript

2013-07-30 Thread Martin Grigorov
Hi,

ComponentRenderer just produces the final markup out of a page/component.
You need to "run" this markup in a browser to execute any JavaScript in it.


On Tue, Jul 30, 2013 at 10:01 AM, kevin94  wrote:

> Hello,
>
> I'm trying to render an email with ComponentRenderer but the javascript
> which build charts is not executed.
> Are there any solution to execute javascript (which builds svg charts)
> before getting the html in String ?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Render-email-with-Javascript-tp4660534.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
>
>


Render email with Javascript

2013-07-30 Thread kevin94
Hello,

I'm trying to render an email with ComponentRenderer but the javascript
which build charts is not executed.
Are there any solution to execute javascript (which builds svg charts)
before getting the html in String ?

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Render-email-with-Javascript-tp4660534.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