Re: WebSocket for tapestry
1. No errors in JavaScript 2. I'm using 5.3.6 3. I did, all work ok and do not lose their ability to do ajax calls. The problem is as you guessed it. I changed the javascript like so and it works perfectly: tapestry-atmosphere.js ... if (pushTarget.update == 'PREPEND') { var insertion = new Hash(); insertion.set('top', content); element.insert(insertion.toJSON()); ... Thanks for the reply. On Tue, Jun 17, 2014 at 4:28 AM, Lance Java lance.j...@googlemail.com wrote: I'm starting to think this is caused by the js prepend function. It's simply: element.innerHTML = newHtml + element.innerHTML. I think this function needs to be smarter and do a dom based element addition rather than a String addition. I tried to avoid using prototype or jquery so it was agnostic so just did a quick and dirty string concat. I can see this would cause the problem. On 16 Jun 2014 23:22, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: That did it. Sorry to keep hitting this nail but, I stumbled across another one. As described above, the push targets will prepend a block on every update. Inside this bock, I have eventLinks that are rendered correctly after I put in the configuration. These eventLinks are supposed to be ajax. The eventLink rendered with the last block correctly calls the page via ajax, however all other eventLinks in blocks already displayed no longer make ajax calls. It looks as if they get deregistered somehow from the Tapestry onClick handler that makes ajax calls. Thanks. On Mon, Jun 16, 2014 at 3:40 AM, Lance Java lance.j...@googlemail.com wrote: See the configuration section here https://github.com/uklance/tapestry-offline On 16 Jun 2014 05:44, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Makes sense, thanks for the reply. Another thing that is odd. I seem to have trouble while rendering eventLinks inside a block that is a delagate of a pushTarget. in tml: atmos:pushTarget ... t:delegate to=tokenPlayHistoryBlock/ /atmos:pushTarget t:block t:id=tokenPlayedByUser a bunch of html markup /t:block in the java class public Block getTokenPlayHistoryBlock(){ switch based on conditions retun blockXXX; } Above works great until I try to add an eventLink in block: t:block t:id=tokenPlayedByUser a bunch of html markup a t:id=sentTokenPreviewLinkTHIS BREAKS IT/a /t:block Error: 2014-Jun-16 00:29:09 ioc.internal.RecursiveServiceCreationCheckWrapper org.apache.tapestry5.ioc.internal.OperationException: *Symbol 'tapestry-offline.serverName' is not defined.* at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87) at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) at org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:45) at $MasterObjectProvider_23570e7547da.provide(Unknown Source) at org.apache.tapestry5.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:871) at org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:57) at org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateInjection(InternalUtils.java:257) at org.apache.tapestry5.ioc.internal.util.InternalUtils.access$000(InternalUtils.java:50) at org.apache.tapestry5.ioc.internal.util.InternalUtils$4.invoke(InternalUtils.java:289) at org.apache.tapestry5.ioc.internal.util.InternalUtils$4.invoke(InternalUtils.java:286) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87) at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) at org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:293) at org.apache.tapestry5.ioc.internal.util.InternalUtils$23.invoke(InternalUtils.java:1488) at org.apache.tapestry5.ioc.internal.util.InternalUtils$23.invoke(InternalUtils.java:1483) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) at org.apache.tapestry5
Re: WebSocket for tapestry
That did it. Sorry to keep hitting this nail but, I stumbled across another one. As described above, the push targets will prepend a block on every update. Inside this bock, I have eventLinks that are rendered correctly after I put in the configuration. These eventLinks are supposed to be ajax. The eventLink rendered with the last block correctly calls the page via ajax, however all other eventLinks in blocks already displayed no longer make ajax calls. It looks as if they get deregistered somehow from the Tapestry onClick handler that makes ajax calls. Thanks. On Mon, Jun 16, 2014 at 3:40 AM, Lance Java lance.j...@googlemail.com wrote: See the configuration section here https://github.com/uklance/tapestry-offline On 16 Jun 2014 05:44, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Makes sense, thanks for the reply. Another thing that is odd. I seem to have trouble while rendering eventLinks inside a block that is a delagate of a pushTarget. in tml: atmos:pushTarget ... t:delegate to=tokenPlayHistoryBlock/ /atmos:pushTarget t:block t:id=tokenPlayedByUser a bunch of html markup /t:block in the java class public Block getTokenPlayHistoryBlock(){ switch based on conditions retun blockXXX; } Above works great until I try to add an eventLink in block: t:block t:id=tokenPlayedByUser a bunch of html markup a t:id=sentTokenPreviewLinkTHIS BREAKS IT/a /t:block Error: 2014-Jun-16 00:29:09 ioc.internal.RecursiveServiceCreationCheckWrapper org.apache.tapestry5.ioc.internal.OperationException: *Symbol 'tapestry-offline.serverName' is not defined.* at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87) at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) at org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:45) at $MasterObjectProvider_23570e7547da.provide(Unknown Source) at org.apache.tapestry5.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:871) at org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:57) at org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateInjection(InternalUtils.java:257) at org.apache.tapestry5.ioc.internal.util.InternalUtils.access$000(InternalUtils.java:50) at org.apache.tapestry5.ioc.internal.util.InternalUtils$4.invoke(InternalUtils.java:289) at org.apache.tapestry5.ioc.internal.util.InternalUtils$4.invoke(InternalUtils.java:286) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87) at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) at org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:293) at org.apache.tapestry5.ioc.internal.util.InternalUtils$23.invoke(InternalUtils.java:1488) at org.apache.tapestry5.ioc.internal.util.InternalUtils$23.invoke(InternalUtils.java:1483) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87) at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) at org.apache.tapestry5.ioc.internal.util.InternalUtils.createConstructorConstructionPlan(InternalUtils.java:1480) at org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.getPlan(ConstructorServiceCreator.java:52) at org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:61) at org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87) at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) at org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49) at org.apache.tapestry5.ioc.internal.SingletonServiceLifecycle.createService(SingletonServiceLifecycle.java:29) at org.apache.tapestry5.ioc.internal.LifecycleWrappedServiceCreator.createObject
Re: WebSocket for tapestry
'tapestry-offline.serverName'? Not event sure it is related to the atmosphere library, but seems to work in all other places, except when I put it into a pushTarget. I event tried to create the link in a separate method and return the URL. Same thing, as soon as I go componenResources.createEventLink, the error pops up. Thanks very much, Bogdan. On Sun, Jun 15, 2014 at 3:30 PM, Lance Java lance.j...@googlemail.com wrote: The disconnect event is fired by atmosphere under the hood (AtmosphereResourceEventListener.onDisconnect). Further reading here: https://github.com/Atmosphere/atmosphere/wiki/onDisconnect-tricks http://atmosphere.github.io/atmosphere/apidocs/org/atmosphere/cpr/AtmosphereResourceEventListener.html If you'll notice in the chat demo, I use a HttpSessionListener to cleanup any chat users that might not have disconnected https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/webapp/WEB-INF/web.xml https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/services/ChatHttpSessionListener.java On 15 Jun 2014 02:41, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Sorry, not that I read it, I should have been more specific. I do see the contribution of the ChatTopicListener in AppModule and the onConnect method gets called as expected when any push target creates a new AtmosphereResource. The one that I don't see called is the onDisconnect method. On Sat, Jun 14, 2014 at 8:42 PM, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Hi Lance, What is the way to listen for someone connecting and disconnecting from a topic? I see that you have TopicListenerImpl and ChatTopicListenerImpl having methods that listen for this type of thing. I don't see how they are used though. Thanks, Bogdan. On Wed, May 21, 2014 at 3:33 AM, Lance Java lance.j...@googlemail.com wrote: I've implemented this feature in tapestry-cometd but it's not been implemented in tapestry-atmosphere yet. I think it's only a couple of lines of javascript. I have just updated the outstanding issue with a possible solution here: https://github.com/uklance/tapestry-atmosphere/issues/5 Pull requests welcomed!! On 21 May 2014 04:21, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: I ended up using your atmosphere implementation and it works like a charm, so many thanks for that. I have an additional questions though. When returning the block to the client, basically your ChatDemo class ( https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/pages/ChatDemo.java#L65 ) -onChatMessage method, I want to be able to execute some client javascript that will parse a Long number and make it into a date using momentjs. Where can I patch in this piece of code? I tried changing the return type of the method to void and using AjaxRespRenderer to display the block and then call the javascript without much success. What would be a good solution here, listen on the client side for some event to be triggered or somehow make an ajax addScript() call from the server. Thanks, Bogdan. On Tue, May 13, 2014 at 12:15 PM, Bogdan Ivascu ivascu.bogdan...@gmail.comwrote: Hi Lance, I did see numerous discussions around your implementation. My goal here is to try and get a better understanding of where and how this framework can be extended. I am however pressed for time and if I cannot get it to work, I will most likely end up using your implementation. Thanks, Bogdan. On Tue, May 13, 2014 at 3:34 AM, Lance Java lance.j...@googlemail.com wrote: Take a look at tapestry-atmosphere [1] and tapestry-cometd [2] [1] https://github.com/uklance/tapestry-atmosphere [2] https://github.com/uklance/tapestry-cometd On 13 May 2014 02:10, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Hi everyone, I want to add webSocket support for my tapestry project and need a few pointers. What I have is a dead simple Servlet, implementing the java WebSocket api. I would like to bring this servlet into my tapestry project and have it managed by tapestry itself. To be more clear, I don't want to use the ignore path functionality to expose it, but rather have tapestry's filter control the access to this servlet. The biggest problem that I have right now is that I don't have a clear understanding of what I need to do to make this happen. Will this servlet be a service or a page with no tml, where would it sit, how do I configure tapestry so
Re: WebSocket for tapestry
Hi Lance, What is the way to listen for someone connecting and disconnecting from a topic? I see that you have TopicListenerImpl and ChatTopicListenerImpl having methods that listen for this type of thing. I don't see how they are used though. Thanks, Bogdan. On Wed, May 21, 2014 at 3:33 AM, Lance Java lance.j...@googlemail.com wrote: I've implemented this feature in tapestry-cometd but it's not been implemented in tapestry-atmosphere yet. I think it's only a couple of lines of javascript. I have just updated the outstanding issue with a possible solution here: https://github.com/uklance/tapestry-atmosphere/issues/5 Pull requests welcomed!! On 21 May 2014 04:21, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: I ended up using your atmosphere implementation and it works like a charm, so many thanks for that. I have an additional questions though. When returning the block to the client, basically your ChatDemo class ( https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/pages/ChatDemo.java#L65 ) -onChatMessage method, I want to be able to execute some client javascript that will parse a Long number and make it into a date using momentjs. Where can I patch in this piece of code? I tried changing the return type of the method to void and using AjaxRespRenderer to display the block and then call the javascript without much success. What would be a good solution here, listen on the client side for some event to be triggered or somehow make an ajax addScript() call from the server. Thanks, Bogdan. On Tue, May 13, 2014 at 12:15 PM, Bogdan Ivascu ivascu.bogdan...@gmail.comwrote: Hi Lance, I did see numerous discussions around your implementation. My goal here is to try and get a better understanding of where and how this framework can be extended. I am however pressed for time and if I cannot get it to work, I will most likely end up using your implementation. Thanks, Bogdan. On Tue, May 13, 2014 at 3:34 AM, Lance Java lance.j...@googlemail.com wrote: Take a look at tapestry-atmosphere [1] and tapestry-cometd [2] [1] https://github.com/uklance/tapestry-atmosphere [2] https://github.com/uklance/tapestry-cometd On 13 May 2014 02:10, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Hi everyone, I want to add webSocket support for my tapestry project and need a few pointers. What I have is a dead simple Servlet, implementing the java WebSocket api. I would like to bring this servlet into my tapestry project and have it managed by tapestry itself. To be more clear, I don't want to use the ignore path functionality to expose it, but rather have tapestry's filter control the access to this servlet. The biggest problem that I have right now is that I don't have a clear understanding of what I need to do to make this happen. Will this servlet be a service or a page with no tml, where would it sit, how do I configure tapestry so that it knows to create a new instance for each request. A nudge of where I could document myself regarding this type of integration would be most welcome. Thank you, Bogdan.
Re: WebSocket for tapestry
Sorry, not that I read it, I should have been more specific. I do see the contribution of the ChatTopicListener in AppModule and the onConnect method gets called as expected when any push target creates a new AtmosphereResource. The one that I don't see called is the onDisconnect method. On Sat, Jun 14, 2014 at 8:42 PM, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Hi Lance, What is the way to listen for someone connecting and disconnecting from a topic? I see that you have TopicListenerImpl and ChatTopicListenerImpl having methods that listen for this type of thing. I don't see how they are used though. Thanks, Bogdan. On Wed, May 21, 2014 at 3:33 AM, Lance Java lance.j...@googlemail.com wrote: I've implemented this feature in tapestry-cometd but it's not been implemented in tapestry-atmosphere yet. I think it's only a couple of lines of javascript. I have just updated the outstanding issue with a possible solution here: https://github.com/uklance/tapestry-atmosphere/issues/5 Pull requests welcomed!! On 21 May 2014 04:21, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: I ended up using your atmosphere implementation and it works like a charm, so many thanks for that. I have an additional questions though. When returning the block to the client, basically your ChatDemo class ( https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/pages/ChatDemo.java#L65 ) -onChatMessage method, I want to be able to execute some client javascript that will parse a Long number and make it into a date using momentjs. Where can I patch in this piece of code? I tried changing the return type of the method to void and using AjaxRespRenderer to display the block and then call the javascript without much success. What would be a good solution here, listen on the client side for some event to be triggered or somehow make an ajax addScript() call from the server. Thanks, Bogdan. On Tue, May 13, 2014 at 12:15 PM, Bogdan Ivascu ivascu.bogdan...@gmail.comwrote: Hi Lance, I did see numerous discussions around your implementation. My goal here is to try and get a better understanding of where and how this framework can be extended. I am however pressed for time and if I cannot get it to work, I will most likely end up using your implementation. Thanks, Bogdan. On Tue, May 13, 2014 at 3:34 AM, Lance Java lance.j...@googlemail.com wrote: Take a look at tapestry-atmosphere [1] and tapestry-cometd [2] [1] https://github.com/uklance/tapestry-atmosphere [2] https://github.com/uklance/tapestry-cometd On 13 May 2014 02:10, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Hi everyone, I want to add webSocket support for my tapestry project and need a few pointers. What I have is a dead simple Servlet, implementing the java WebSocket api. I would like to bring this servlet into my tapestry project and have it managed by tapestry itself. To be more clear, I don't want to use the ignore path functionality to expose it, but rather have tapestry's filter control the access to this servlet. The biggest problem that I have right now is that I don't have a clear understanding of what I need to do to make this happen. Will this servlet be a service or a page with no tml, where would it sit, how do I configure tapestry so that it knows to create a new instance for each request. A nudge of where I could document myself regarding this type of integration would be most welcome. Thank you, Bogdan.
Re: WebSocket for tapestry
If anyone else is reading this, how I worked around this issue. The page in question had an activate method that took two parameters. Depending on page context, it's sister passivate method would sometimes return null for one of the array parameters. I made sure this never happened by checking the parameters for null in onPassivate and adding string markers instead. Bogdan. On Wed, May 28, 2014 at 4:46 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: That's an unrelated but known issue. On Wed, 28 May 2014 17:42:19 -0300, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: An interesting issue with the atmos library. I put the webSocket code in my Layout component and there are no issues when I navigate about between pages that wrap themselves in this layout. I do encounter a NullPointer when this Layout contains another Layout and then the page. To be more clear: MainPagesLayout - MemberHomePage: works nicely. MainPagesLayout - EmailLayout - EmailInboxPage: throws NullPointer exception. Stack below in case anyone has the time to look at it: 2014-May-28 16:31:36 internal.services.DefaultRequestExceptionHandler java.lang.NullPointerException at org.apache.tapestry5.json.JSONObject.printValue( JSONObject.java:887) at org.apache.tapestry5.json.JSONArray.print(JSONArray.java:436) at org.apache.tapestry5.json.JSONObject.printValue( JSONObject.java:859) at org.apache.tapestry5.json.JSONObject.print(JSONObject.java:830) at org.apache.tapestry5.json.JSONObject.printValue( JSONObject.java:853) at org.apache.tapestry5.json.JSONArray.print(JSONArray.java:436) at org.apache.tapestry5.json.JSONObject.printValue( JSONObject.java:859) at org.apache.tapestry5.json.JSONObject.print(JSONObject.java:830) at org.apache.tapestry5.json.JSONCollection.toString(JSONCollection.java:47) at org.apache.tapestry5.json.JSONCollection.toString(JSONCollection.java:63) at org.apache.tapestry5.internal.services.DocumentLinkerImpl. add(DocumentLinkerImpl.java:228) at org.apache.tapestry5.internal.services.DocumentLinkerImpl. add(DocumentLinkerImpl.java:219) at org.apache.tapestry5.internal.services.DocumentLinkerImpl. addDynamicScriptBlock(DocumentLinkerImpl.java:204) at org.apache.tapestry5.internal.services.DocumentLinkerImpl. addScriptElements(DocumentLinkerImpl.java:158) at org.apache.tapestry5.internal.services.DocumentLinkerImpl.updateDocument( DocumentLinkerImpl.java:123) at org.apache.tapestry5.services.TapestryModule$25. renderMarkup(TapestryModule.java:1898) at $MarkupRenderer_7643a5097d2.renderMarkup(Unknown Source) at $MarkupRenderer_7643a5097cd.renderMarkup(Unknown Source) at org.apache.tapestry5.internal.services.PageMarkupRendererImpl. renderPageMarkup(PageMarkupRendererImpl.java:47) at $PageMarkupRenderer_7643a5097cb.renderPageMarkup(Unknown Source) at org.apache.tapestry5.internal.services.PageResponseRendererImpl. renderPageResponse(PageResponseRendererImpl.java:67) at $PageResponseRenderer_7643a5097c7.renderPageResponse(Unknown Source) at org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl. handle(PageRenderRequestHandlerImpl.java:64) at org.apache.tapestry5.services.TapestryModule$38.handle( TapestryModule.java:) at $PageRenderRequestHandler_7643a5097c9.handle(Unknown Source) at $PageRenderRequestHandler_7643a509765.handle(Unknown Source) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTermina tor.handlePageRender(ComponentRequestHandlerTerminator.java:48) at org.apache.tapestry5.services.InitializeActivePageName.handlePageRender( InitializeActivePageName.java:47) at $ComponentRequestHandler_7643a509766.handlePageRender(Unknown Source) at com.ar.model.security.AdminProtectionFilter.handlePageRender( AdminProtectionFilter.java:54) at $ComponentRequestFilter_7643a509763.handlePageRender(Unknown Source) at $ComponentRequestHandler_7643a509766.handlePageRender(Unknown Source) at com.ar.model.security.PageProtectionFilter.handlePageRender( PageProtectionFilter.java:53) at $ComponentRequestFilter_7643a509762.handlePageRender(Unknown Source) at $ComponentRequestHandler_7643a509766.handlePageRender(Unknown Source) at org.lazan.t5.atmosphere.services.internal.PageGlobalsComponentRequestFil ter.handlePageRender(PageGlobalsComponentRequestFilter.java:28) at $ComponentRequestHandler_7643a509766.handlePageRender(Unknown Source) at $ComponentRequestHandler_7643a50972c.handlePageRender(Unknown Source) at org.apache.tapestry5.internal.services.PageRenderDispatcher. dispatch(PageRenderDispatcher.java:45) at $Dispatcher_7643a50972f.dispatch(Unknown Source) at $Dispatcher_7643a509729.dispatch(Unknown Source) at org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator. service(TapestryModule.java:302
Re: WebSocket for tapestry
Thank you for the reply Lance. This was a very literal couple of lines of javascript. The solution you posted on Git works and the T5 Initilizers are being called as expected. On Wed, May 21, 2014 at 3:33 AM, Lance Java lance.j...@googlemail.comwrote: I've implemented this feature in tapestry-cometd but it's not been implemented in tapestry-atmosphere yet. I think it's only a couple of lines of javascript. I have just updated the outstanding issue with a possible solution here: https://github.com/uklance/tapestry-atmosphere/issues/5 Pull requests welcomed!! On 21 May 2014 04:21, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: I ended up using your atmosphere implementation and it works like a charm, so many thanks for that. I have an additional questions though. When returning the block to the client, basically your ChatDemo class ( https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/pages/ChatDemo.java#L65 ) -onChatMessage method, I want to be able to execute some client javascript that will parse a Long number and make it into a date using momentjs. Where can I patch in this piece of code? I tried changing the return type of the method to void and using AjaxRespRenderer to display the block and then call the javascript without much success. What would be a good solution here, listen on the client side for some event to be triggered or somehow make an ajax addScript() call from the server. Thanks, Bogdan. On Tue, May 13, 2014 at 12:15 PM, Bogdan Ivascu ivascu.bogdan...@gmail.comwrote: Hi Lance, I did see numerous discussions around your implementation. My goal here is to try and get a better understanding of where and how this framework can be extended. I am however pressed for time and if I cannot get it to work, I will most likely end up using your implementation. Thanks, Bogdan. On Tue, May 13, 2014 at 3:34 AM, Lance Java lance.j...@googlemail.com wrote: Take a look at tapestry-atmosphere [1] and tapestry-cometd [2] [1] https://github.com/uklance/tapestry-atmosphere [2] https://github.com/uklance/tapestry-cometd On 13 May 2014 02:10, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Hi everyone, I want to add webSocket support for my tapestry project and need a few pointers. What I have is a dead simple Servlet, implementing the java WebSocket api. I would like to bring this servlet into my tapestry project and have it managed by tapestry itself. To be more clear, I don't want to use the ignore path functionality to expose it, but rather have tapestry's filter control the access to this servlet. The biggest problem that I have right now is that I don't have a clear understanding of what I need to do to make this happen. Will this servlet be a service or a page with no tml, where would it sit, how do I configure tapestry so that it knows to create a new instance for each request. A nudge of where I could document myself regarding this type of integration would be most welcome. Thank you, Bogdan.
Re: WebSocket for tapestry
Source) at $RequestHandler_7643a50972a.service(Unknown Source) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:105) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:95) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119) at $RequestHandler_7643a50972a.service(Unknown Source) at $RequestHandler_7643a50971d.service(Unknown Source) at org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253) at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) at $HttpServletRequestHandler_7643a50971f.service(Unknown Source) at org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44) at $HttpServletRequestHandler_7643a50971f.service(Unknown Source) at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_7643a50971b.service(Unknown Source) at $HttpServletRequestHandler_7643a50971f.service(Unknown Source) at org.lazan.t5.atmosphere.services.internal.HttpServletHttpServletRequestFilter.service(HttpServletHttpServletRequestFilter.java:72) at org.lazan.t5.atmosphere.services.internal.AtmosphereHttpServletRequestFilter.service(AtmosphereHttpServletRequestFilter.java:50) at $HttpServletRequestHandler_7643a50971f.service(Unknown Source) at org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852) at $HttpServletRequestHandler_7643a50971f.service(Unknown Source) at $HttpServletRequestHandler_7643a509719.service(Unknown Source) at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) Bogdan. On Wed, May 21, 2014 at 3:33 AM, Lance Java lance.j...@googlemail.comwrote: I've implemented this feature in tapestry-cometd but it's not been implemented in tapestry-atmosphere yet. I think it's only a couple of lines of javascript. I have just updated the outstanding issue with a possible solution here: https://github.com/uklance/tapestry-atmosphere/issues/5 Pull requests welcomed!! On 21 May 2014 04:21, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: I ended up using your atmosphere implementation and it works like a charm, so many thanks for that. I have an additional questions though. When returning the block to the client, basically your ChatDemo class ( https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/pages/ChatDemo.java#L65 ) -onChatMessage method, I want to be able to execute some client javascript that will parse a Long number and make it into a date using momentjs. Where can I patch in this piece of code? I tried changing the return type of the method to void and using AjaxRespRenderer to display the block and then call the javascript without much success. What would be a good solution here, listen on the client side for some event to be triggered or somehow make an ajax addScript() call from the server. Thanks, Bogdan. On Tue, May 13, 2014 at 12:15 PM, Bogdan Ivascu ivascu.bogdan...@gmail.comwrote: Hi Lance, I did see numerous discussions around your implementation. My goal here is to try and get a better understanding of where and how this framework can be extended. I am however pressed for time and if I cannot get it to work, I will most likely end up using your implementation. Thanks, Bogdan. On Tue, May 13, 2014
Re: WebSocket for tapestry
I ended up using your atmosphere implementation and it works like a charm, so many thanks for that. I have an additional questions though. When returning the block to the client, basically your ChatDemo class ( https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/pages/ChatDemo.java#L65) -onChatMessage method, I want to be able to execute some client javascript that will parse a Long number and make it into a date using momentjs. Where can I patch in this piece of code? I tried changing the return type of the method to void and using AjaxRespRenderer to display the block and then call the javascript without much success. What would be a good solution here, listen on the client side for some event to be triggered or somehow make an ajax addScript() call from the server. Thanks, Bogdan. On Tue, May 13, 2014 at 12:15 PM, Bogdan Ivascu ivascu.bogdan...@gmail.comwrote: Hi Lance, I did see numerous discussions around your implementation. My goal here is to try and get a better understanding of where and how this framework can be extended. I am however pressed for time and if I cannot get it to work, I will most likely end up using your implementation. Thanks, Bogdan. On Tue, May 13, 2014 at 3:34 AM, Lance Java lance.j...@googlemail.comwrote: Take a look at tapestry-atmosphere [1] and tapestry-cometd [2] [1] https://github.com/uklance/tapestry-atmosphere [2] https://github.com/uklance/tapestry-cometd On 13 May 2014 02:10, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Hi everyone, I want to add webSocket support for my tapestry project and need a few pointers. What I have is a dead simple Servlet, implementing the java WebSocket api. I would like to bring this servlet into my tapestry project and have it managed by tapestry itself. To be more clear, I don't want to use the ignore path functionality to expose it, but rather have tapestry's filter control the access to this servlet. The biggest problem that I have right now is that I don't have a clear understanding of what I need to do to make this happen. Will this servlet be a service or a page with no tml, where would it sit, how do I configure tapestry so that it knows to create a new instance for each request. A nudge of where I could document myself regarding this type of integration would be most welcome. Thank you, Bogdan.
Re: WebSocket for tapestry
Hi Lance, I did see numerous discussions around your implementation. My goal here is to try and get a better understanding of where and how this framework can be extended. I am however pressed for time and if I cannot get it to work, I will most likely end up using your implementation. Thanks, Bogdan. On Tue, May 13, 2014 at 3:34 AM, Lance Java lance.j...@googlemail.comwrote: Take a look at tapestry-atmosphere [1] and tapestry-cometd [2] [1] https://github.com/uklance/tapestry-atmosphere [2] https://github.com/uklance/tapestry-cometd On 13 May 2014 02:10, Bogdan Ivascu ivascu.bogdan...@gmail.com wrote: Hi everyone, I want to add webSocket support for my tapestry project and need a few pointers. What I have is a dead simple Servlet, implementing the java WebSocket api. I would like to bring this servlet into my tapestry project and have it managed by tapestry itself. To be more clear, I don't want to use the ignore path functionality to expose it, but rather have tapestry's filter control the access to this servlet. The biggest problem that I have right now is that I don't have a clear understanding of what I need to do to make this happen. Will this servlet be a service or a page with no tml, where would it sit, how do I configure tapestry so that it knows to create a new instance for each request. A nudge of where I could document myself regarding this type of integration would be most welcome. Thank you, Bogdan.
WebSocket for tapestry
Hi everyone, I want to add webSocket support for my tapestry project and need a few pointers. What I have is a dead simple Servlet, implementing the java WebSocket api. I would like to bring this servlet into my tapestry project and have it managed by tapestry itself. To be more clear, I don't want to use the ignore path functionality to expose it, but rather have tapestry's filter control the access to this servlet. The biggest problem that I have right now is that I don't have a clear understanding of what I need to do to make this happen. Will this servlet be a service or a page with no tml, where would it sit, how do I configure tapestry so that it knows to create a new instance for each request. A nudge of where I could document myself regarding this type of integration would be most welcome. Thank you, Bogdan.
Re: IndieGogo campaign: a month of Apache Tapestry 5
Following Igor's book, slightly better documentation for the java script side coming in T5.4 will be a good start. Thanks, Bogdan. On Mon, Nov 25, 2013 at 4:08 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: Hi! I've just went live with an IndieGogo campaign so I can work a whole month in Tapestry itself and nothing else fixing bugs, implementing new stuff and working on the documentation. Here's the link: http://www.indiegogo.com/projects/a-month-of-apache- tapestry-5. Any questions, just ask. :) But I'll answer another one right now: regardless of the campaign succeeding or not, I'll continue posting stuff in the mailing list and doing my occasional code contributions the same way and I've been doing until now. In other words, nothing changes. Here's the campaign text, just in case, with all the details: Introduction Disclaimers: This campaign is done by me, Thiago, as an independent individual, not by the Apache Software Foundation or the Apache Tapestry project. I'm not representing the Foundation in any way in this campaign nor Apache endorses it. The Foundation has a policy of not paying for development work. All its members are voluntary, me included. Any code I'll write or change will pass the usual Tapestry team approval process. If this campaign isn't funded, I'll continue participating in the Tapestry project in the same way as always. I'm Thiago H. de Paula Figueiredo, an Apache Tapestry 5 committer and PMC (Project Management Committee) member. I've posted more than 5700 times in the user mailing lists. Apache Tapestry is an open-source, Java Web framework built and supported by a team of voluntary members who work on it for free and by love. I dream about the idea of being able to work on Apache Tapestry itself, on its codebase and documentation, not just in my free time. I'm very passionate about this framework. I envy the people who are paid to work on open source projects, so they can spend lots of time in the projects they love. I wish I could do the same, even if it was for a short period of time. I love open source, I love Apache Tapestry, I love to help people to solve their problems, know the framework better and code happier. That's what this campaign is about. Right now, I'm in a period between gigs, so I have a free schedule to work on it, and then I have an opportunity. But this free time cannot be free, because I, as you and everyone else, have bills to pay. So I thought it would be a perfect time to run a fixed-funding IndieGogo campaign to have me working exclusively on the Apache Tapestry codebase for a whole month, 160 hours on the clock, fixing some stuff, build other stuff and hopefully speeding up the 5.4 release. I'd work on the documentation too. Notice that, in terms of dollar per worked hour, it is signicantly lower than at my last gig. This campaign isn't about money, is about being able to work in what I love. What will be done? The actual issues to be worked will be discussed among the backers, but I've took a long look at the Apache Tapestry issue tracker (JIRA), starting for the most voted issues, checked which ones I could successfully fix or implement, then I came up with the following initial (not final) list. The order in which the issues will be tackled will also be discussed among the backers. Issue Description TAP5-2029 Copy annotations from service implementation to proxy TAP5-2235 Implement JCache (JSR 107) support in Tapestry-IoC TAP5-938 Expose ability to render a portion of a page (a Block, Component, etc.) without using internal services TAP5-244 Let Grid show column headings when no data TAP5-1515 Support for external assets TAP5-1470 Group CSS together to avoid IE's restriction of 31 external css files TAP5-245 Better documentation on development environment. TAP5-627 Allow injection of named spring beans TAP5-1403 Add support for Arrays in request parameters TAP5-1863 Rendering components in Alerts TAP5-1659 PageLink: page parameter should accept page-classes and page-instances TAP5-1941 Alerts component should check for XHR request in dismiss event handler TAP5-1718 Tapestry-beanvalidator isn't validating nested DTO objects / Doesn't mark the invalid fields in the UI TAP5-2130 Services interfaces that inherit from Runnable cause @Startup methods being called twice TAP5-2192 Add support for distributed documentation TAP5-2187 CSS relative URL rewriting isn't lenient enough TAP5-2185 Problem with the asset checksums and relative paths based on them TAP5-1998 DateField does not validate dates properly (Tapestry DateField converts invalid dates to valid ones) TAP5-2168 Asset Not Found messages are prompting to put assets into wrong location TAP5-1611 out-of-the-box way in Tapestry for replacing components Perks All perks include the addition of your name and URL in a thank-you page in my personal
Re: Proposal for a new book: Mastering Apache Tapestry
I would find a Tapestry book covering in depth Tap-Ioc very appealing. Another area of great interest for me is the client side part of Tapestry as I find myself writing more and more client side code these days. In depth ajax coverage would be a great addition to existing material, in my opinion. Securing tapestry pages also comes to mind. I read above Apache Camel, very interesting idea. On Thu, Aug 8, 2013 at 5:50 AM, Geoff Callender geoff.callender.jumpst...@gmail.com wrote: I completely agree. If the aim is to help Tapestry then why not do as described below by Alessi? Equally useful, in my opinion, would be to contribute advanced topic pages to Tapestry's web documentation. You would reach a much bigger audience. You could reach them sooner, because the contributions can be incremental. You could be responsive and up-to-date, because it's a cinch to modify. Besides, you know there's no money in technical books these days, yeah? Nonetheless, Thiago, I applaud your enthusiasm and your massive ongoing contribution to Tapestry. Cheers, Geoff On 07/08/2013, at 4:35 PM, Alessio Gambi wrote: I am not sure that there is enough of an audience for two books. Perhaps you can cooperate with Igor to get your content into his book? There would be a lot of marketing synergy there at least. Writing a book is a huge commitment and takes usually a lot of time; and if we consider the fast pace at which T5 is evolving lately I do not think that writing another one-man-book is the best strategy. Why don't we -as a community- collaborate towards a Web magazine/journal or any other form of periodic publication ? Main reasons that I see in favor of this more flexible (agile if you like): - papers are more focused and requires in general less effort than a book. They have a fixed number of pages so authors are 'forced' to just say what it is important... Extensive code and additional examples can be also published somewhere else. - articles are cheaper (free if the authors wish) to sell and easier to distribute (google scholar like) - several authors can contribute to a single article and several papers can be merged into a more concrete/solid publications (book chapters). Making collaboration a daily activity. - committers and other members of the community can contribute also by reviewing the various contributions. This will raise the quality of the publications and will give credibility to them. Remember that peer review is MUST be done in a voluntary fashion for many reasons, I - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org