DownloadLink and ProgressBar
Hi All, I have a wicket DownloadLink where I generate file dynamically and download it. It works. The process of dynamic File generation might take some time and like to show ProgressBar which show how much the generation has progressed. How Can I do that. I am using wicket 1.5.8 Thank you very much. add(new DownloadLink(export, new LoadableDetachableModelFile() { private static final long serialVersionUID = 840863954694163375L; @Override protected File load() { File exportTempDir = getGeneratedFile(); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451.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: DownloadLink and ProgressBar
Hi, 1-Replace the download link by an AJAX link. 2-Launch file generation on a background thread. Pass a class to this thread that serves as context fro passing information from generating thread with web threads (keeping a reference to thisi context on the page). 3-Make a progress panel visible + an AJAX timer that pols the server for progress. 4-Once file is generated replace progress panel with a download link (or use trick in [1] to trigger file dowmload) References 1- https://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow On Sat, Nov 16, 2013 at 10:29 AM, seyaw seidy...@gmail.com wrote: Hi All, I have a wicket DownloadLink where I generate file dynamically and download it. It works. The process of dynamic File generation might take some time and like to show ProgressBar which show how much the generation has progressed. How Can I do that. I am using wicket 1.5.8 Thank you very much. add(new DownloadLink(export, new LoadableDetachableModelFile() { private static final long serialVersionUID = 840863954694163375L; @Override protected File load() { File exportTempDir = getGeneratedFile(); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451.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: logout on session destroy
You can write a unboundListener and register it in your sessionStore. This code should be in your application init() getSessionStore().registerUnboundListener( new ISessionStore.UnboundListener() { @Override public void sessionUnbound(String sessionId) { // logout timestamp in the database } }); François Meillet Formation Wicket - Développement Wicket Le 15 nov. 2013 à 23:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Hi all, it's quite frustrating, a simple thing gets complicated. I have a Webapp with login page and logout button. If the user clicks the logout I write a logout timestamp in the database. Now I want to write the same timestamp when the session expires. Only thing I have found on the Web is to use WebApplication.sessionUnbound with Session ID. When this method is called the AuthenticatedWebSession is still dead I think or maybe I cant get the Object. Other thing I found is the method onInvalidate() in the webSession, but this method is never called. (i'm on Wicket 6.1.) What is the right way to do the trick?? Thanks in advance Dirk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: logout on session destroy
Thanks, that works, but how can I get my WebSession Object?? In there the user is stored and I need the id of the user. WebSession.get() does not work Thanks in advance Dirk Am 16.11.2013 11:04, schrieb Francois Meillet: You can write a unboundListener and register it in your sessionStore. This code should be in your application init() getSessionStore().registerUnboundListener( new ISessionStore.UnboundListener() { @Override public void sessionUnbound(String sessionId) { // logout timestamp in the database } }); François Meillet Formation Wicket - Développement Wicket Le 15 nov. 2013 à 23:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Hi all, it's quite frustrating, a simple thing gets complicated. I have a Webapp with login page and logout button. If the user clicks the logout I write a logout timestamp in the database. Now I want to write the same timestamp when the session expires. Only thing I have found on the Web is to use WebApplication.sessionUnbound with Session ID. When this method is called the AuthenticatedWebSession is still dead I think or maybe I cant get the Object. Other thing I found is the method onInvalidate() in the webSession, but this method is never called. (i'm on Wicket 6.1.) What is the right way to do the trick?? Thanks in advance Dirk - 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: logout on session destroy
Maybe bind sessionId with user ID when session is created? on a persistence storage? So that you can recover user ID with the session Id On Sat, Nov 16, 2013 at 12:19 PM, Dirk Wichmann dir...@team-wichmann.dewrote: Thanks, that works, but how can I get my WebSession Object?? In there the user is stored and I need the id of the user. WebSession.get() does not work Thanks in advance Dirk Am 16.11.2013 11:04, schrieb Francois Meillet: You can write a unboundListener and register it in your sessionStore. This code should be in your application init() getSessionStore().registerUnboundListener( new ISessionStore.UnboundListener() { @Override public void sessionUnbound(String sessionId) { // logout timestamp in the database } }); François Meillet Formation Wicket - Développement Wicket Le 15 nov. 2013 à 23:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Hi all, it's quite frustrating, a simple thing gets complicated. I have a Webapp with login page and logout button. If the user clicks the logout I write a logout timestamp in the database. Now I want to write the same timestamp when the session expires. Only thing I have found on the Web is to use WebApplication.sessionUnbound with Session ID. When this method is called the AuthenticatedWebSession is still dead I think or maybe I cant get the Object. Other thing I found is the method onInvalidate() in the webSession, but this method is never called. (i'm on Wicket 6.1.) What is the right way to do the trick?? Thanks in advance Dirk - 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 -- Regards - Ernesto Reinaldo Barreiro
Re: logout on session destroy
In this case, override the onInvalidate() method in your custom session. from the api : onInvalidate is a callback method that is executed when the user session is invalidated either by explicit call to {@link org.apache.wicket.Session#invalidate()} or due to HttpSession expiration. François Meillet Formation Wicket - Développement Wicket Le 16 nov. 2013 à 12:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Thanks, that works, but how can I get my WebSession Object?? In there the user is stored and I need the id of the user. WebSession.get() does not work Thanks in advance Dirk Am 16.11.2013 11:04, schrieb Francois Meillet: You can write a unboundListener and register it in your sessionStore. This code should be in your application init() getSessionStore().registerUnboundListener( new ISessionStore.UnboundListener() { @Override public void sessionUnbound(String sessionId) { // logout timestamp in the database } }); François Meillet Formation Wicket - Développement Wicket Le 15 nov. 2013 à 23:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Hi all, it's quite frustrating, a simple thing gets complicated. I have a Webapp with login page and logout button. If the user clicks the logout I write a logout timestamp in the database. Now I want to write the same timestamp when the session expires. Only thing I have found on the Web is to use WebApplication.sessionUnbound with Session ID. When this method is called the AuthenticatedWebSession is still dead I think or maybe I cant get the Object. Other thing I found is the method onInvalidate() in the webSession, but this method is never called. (i'm on Wicket 6.1.) What is the right way to do the trick?? Thanks in advance Dirk - 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: logout on session destroy
sorry, there is no methode onInvalidate() to overwrite?? not in AuthenticatedWebSession or WebSession or in Session (I use Wicket 6.1) Am 16.11.2013 12:47, schrieb Francois Meillet: In this case, override the onInvalidate() method in your custom session. from the api : onInvalidate is a callback method that is executed when the user session is invalidated either by explicit call to {@link org.apache.wicket.Session#invalidate()} or due to HttpSession expiration. François Meillet Formation Wicket - Développement Wicket Le 16 nov. 2013 à 12:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Thanks, that works, but how can I get my WebSession Object?? In there the user is stored and I need the id of the user. WebSession.get() does not work Thanks in advance Dirk Am 16.11.2013 11:04, schrieb Francois Meillet: You can write a unboundListener and register it in your sessionStore. This code should be in your application init() getSessionStore().registerUnboundListener( new ISessionStore.UnboundListener() { @Override public void sessionUnbound(String sessionId) { // logout timestamp in the database } }); François Meillet Formation Wicket - Développement Wicket Le 15 nov. 2013 à 23:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Hi all, it's quite frustrating, a simple thing gets complicated. I have a Webapp with login page and logout button. If the user clicks the logout I write a logout timestamp in the database. Now I want to write the same timestamp when the session expires. Only thing I have found on the Web is to use WebApplication.sessionUnbound with Session ID. When this method is called the AuthenticatedWebSession is still dead I think or maybe I cant get the Object. Other thing I found is the method onInvalidate() in the webSession, but this method is never called. (i'm on Wicket 6.1.) What is the right way to do the trick?? Thanks in advance Dirk - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: logout on session destroy
Update to the 6.12 version or follow Ernesto's advice or write your own HttpSessionStore. François Meillet Formation Wicket - Développement Wicket Le 16 nov. 2013 à 13:17, Dirk Wichmann dir...@team-wichmann.de a écrit : sorry, there is no methode onInvalidate() to overwrite?? not in AuthenticatedWebSession or WebSession or in Session (I use Wicket 6.1) Am 16.11.2013 12:47, schrieb Francois Meillet: In this case, override the onInvalidate() method in your custom session. from the api : onInvalidate is a callback method that is executed when the user session is invalidated either by explicit call to {@link org.apache.wicket.Session#invalidate()} or due to HttpSession expiration. François Meillet Formation Wicket - Développement Wicket Le 16 nov. 2013 à 12:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Thanks, that works, but how can I get my WebSession Object?? In there the user is stored and I need the id of the user. WebSession.get() does not work Thanks in advance Dirk Am 16.11.2013 11:04, schrieb Francois Meillet: You can write a unboundListener and register it in your sessionStore. This code should be in your application init() getSessionStore().registerUnboundListener( new ISessionStore.UnboundListener() { @Override public void sessionUnbound(String sessionId) { // logout timestamp in the database } }); François Meillet Formation Wicket - Développement Wicket Le 15 nov. 2013 à 23:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Hi all, it's quite frustrating, a simple thing gets complicated. I have a Webapp with login page and logout button. If the user clicks the logout I write a logout timestamp in the database. Now I want to write the same timestamp when the session expires. Only thing I have found on the Web is to use WebApplication.sessionUnbound with Session ID. When this method is called the AuthenticatedWebSession is still dead I think or maybe I cant get the Object. Other thing I found is the method onInvalidate() in the webSession, but this method is never called. (i'm on Wicket 6.1.) What is the right way to do the trick?? Thanks in advance Dirk - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: logout on session destroy
I have updated to 6.12 (without any pane, fantastic... I cannot believe that it was so easy) Thanks a lot now it works Cheers Dirk Am 16.11.2013 14:05, schrieb Francois Meillet: Update to the 6.12 version or follow Ernesto's advice or write your own HttpSessionStore. François Meillet Formation Wicket - Développement Wicket Le 16 nov. 2013 à 13:17, Dirk Wichmann dir...@team-wichmann.de a écrit : sorry, there is no methode onInvalidate() to overwrite?? not in AuthenticatedWebSession or WebSession or in Session (I use Wicket 6.1) Am 16.11.2013 12:47, schrieb Francois Meillet: In this case, override the onInvalidate() method in your custom session. from the api : onInvalidate is a callback method that is executed when the user session is invalidated either by explicit call to {@link org.apache.wicket.Session#invalidate()} or due to HttpSession expiration. François Meillet Formation Wicket - Développement Wicket Le 16 nov. 2013 à 12:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Thanks, that works, but how can I get my WebSession Object?? In there the user is stored and I need the id of the user. WebSession.get() does not work Thanks in advance Dirk Am 16.11.2013 11:04, schrieb Francois Meillet: You can write a unboundListener and register it in your sessionStore. This code should be in your application init() getSessionStore().registerUnboundListener( new ISessionStore.UnboundListener() { @Override public void sessionUnbound(String sessionId) { // logout timestamp in the database } }); François Meillet Formation Wicket - Développement Wicket Le 15 nov. 2013 à 23:19, Dirk Wichmann dir...@team-wichmann.de a écrit : Hi all, it's quite frustrating, a simple thing gets complicated. I have a Webapp with login page and logout button. If the user clicks the logout I write a logout timestamp in the database. Now I want to write the same timestamp when the session expires. Only thing I have found on the Web is to use WebApplication.sessionUnbound with Session ID. When this method is called the AuthenticatedWebSession is still dead I think or maybe I cant get the Object. Other thing I found is the method onInvalidate() in the webSession, but this method is never called. (i'm on Wicket 6.1.) What is the right way to do the trick?? Thanks in advance Dirk - 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 - 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: DownloadLink and ProgressBar
Thank you Ernesto for your prompt response. 1. is okay. Then for 2. I suppose I start the thread from the onclick method of the ajax link. Can you explain a bit how to start the file genaration with a thread? and for 3. how to pol the server for the progress? Thank you very much -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662460.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