Re: WebSocket for tapestry

2014-06-19 Thread Lance Java
Ok, thanks for reporting, I've raised an issue here
https://github.com/uklance/tapestry-atmosphere/issues/22


Re: WebSocket for tapestry

2014-06-18 Thread Bogdan Ivascu
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 
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"  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 
> > wrote:
> >
> > > See the "configuration" section here
> > > https://github.com/uklance/tapestry-offline
> > > On 16 Jun 2014 05:44, "Bogdan Ivascu" 
> > 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:
> > > > 
> > > > 
> > > > 
> > > >
> > > > 
> > > > a bunch of html markup
> > > > 
> > > >
> > > > 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:
> > > >
> > > > 
> > > >a bunch of html markup
> > > > THIS BREAKS IT
> > > > 
> > > >
> > > > 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$2

Re: WebSocket for tapestry

2014-06-17 Thread Lance Java
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"  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 
> wrote:
>
> > See the "configuration" section here
> > https://github.com/uklance/tapestry-offline
> > On 16 Jun 2014 05:44, "Bogdan Ivascu" 
> 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:
> > > 
> > > 
> > > 
> > >
> > > 
> > > a bunch of html markup
> > > 
> > >
> > > 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:
> > >
> > > 
> > >a bunch of html markup
> > > THIS BREAKS IT
> > > 
> > >
> > > 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
> > >
> > >
> >
> or

Re: WebSocket for tapestry

2014-06-17 Thread Lance Java
Hmm. Interesting.

1. Are there any javascript errors in the console?
2. Which version of Tapestry are you using?
3. Try adding an ajax eventlink to the page that's not in a PushTarget
(normal page render). Is it affected in the same way?
4. Is the markup for the link in 3 any different from the PushTarget link
markup?
5. Can you capture the json for the PushTarget update?
On 16 Jun 2014 23:22, "Bogdan Ivascu"  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 
> wrote:
>
> > See the "configuration" section here
> > https://github.com/uklance/tapestry-offline
> > On 16 Jun 2014 05:44, "Bogdan Ivascu" 
> 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:
> > > 
> > > 
> > > 
> > >
> > > 
> > > a bunch of html markup
> > > 
> > >
> > > 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:
> > >
> > > 
> > >a bunch of html markup
> > > THIS BREAKS IT
> > > 
> > >
> > > 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.tape

Re: WebSocket for tapestry

2014-06-16 Thread Bogdan Ivascu
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 
wrote:

> See the "configuration" section here
> https://github.com/uklance/tapestry-offline
> On 16 Jun 2014 05:44, "Bogdan Ivascu"  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:
> > 
> > 
> > 
> >
> > 
> > a bunch of html markup
> > 
> >
> > 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:
> >
> > 
> >a bunch of html markup
> > THIS BREAKS IT
> > 
> >
> > 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.Lifec

Re: WebSocket for tapestry

2014-06-16 Thread Lance Java
See the "configuration" section here
https://github.com/uklance/tapestry-offline
On 16 Jun 2014 05:44, "Bogdan Ivascu"  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:
> 
> 
> 
>
> 
> a bunch of html markup
> 
>
> 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:
>
> 
>a bunch of html markup
> THIS BREAKS IT
> 
>
> 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(LifecycleWrappedServiceCreator.java:46)
> at
>
> org.apache.tapestry5.ioc.internal.AdvisorStackBuilder.createObject(AdvisorStackBuilder.java:63)
> at
>
> org.apache.tapestry5.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:54)
> at
>
> org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:60)
> 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.Operat

Re: WebSocket for tapestry

2014-06-15 Thread Bogdan Ivascu
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:





a bunch of html markup


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:


   a bunch of html markup
THIS BREAKS IT


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(LifecycleWrappedServiceCreator.java:46)
at
org.apache.tapestry5.ioc.internal.AdvisorStackBuilder.createObject(AdvisorStackBuilder.java:63)
at
org.apache.tapestry5.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:54)
at
org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:60)
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.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:66)
at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:54)
at $OfflineRequestGlobals_23570e7549e2.delegate(Unknown Source)
at $OfflineR

Re: WebSocket for tapestry

2014-06-15 Thread Lance Java
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"  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  >
> 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 
> > 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" 
> 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
> >> > wrote:
> >> >
> >> > > 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" 
> >> > 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

2014-06-14 Thread Bogdan Ivascu
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 
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 
> 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"  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
>> > wrote:
>> >
>> > > 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" 
>> > 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

2014-06-14 Thread Bogdan Ivascu
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 
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"  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
> > wrote:
> >
> > > 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  > >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" 
> > 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

2014-06-02 Thread Thiago H de Paula Figueiredo
The bug that caused the stack trace below was fixed in Tapestry 5.4, but  
not released yet. I don't know how a null value on onPassivate() could be  
related. Tapestry does handle null activation context values without any  
problems.


On Fri, 30 May 2014 16:58:25 -0300, Bogdan Ivascu  
 wrote:


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 $D

Re: WebSocket for tapestry

2014-05-30 Thread Bogdan Ivascu
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_76

Re: WebSocket for tapestry

2014-05-28 Thread Thiago H de Paula Figueiredo

That's an unrelated but known issue.

On Wed, 28 May 2014 17:42:19 -0300, Bogdan Ivascu  
 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.ComponentRequestHandlerTerminator.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.PageGlobalsComponentRequestFilter.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)
at
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
at $RequestHandler_7643a50972a.service(Unknown Source)
at
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902)
at $RequestHandler_7643a50972a.service(Unknown Source)
at
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892)
at $RequestHandler_7643a50972a.service(Unknown Source)
at
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
at $RequestHandler_7643a5097

Re: WebSocket for tapestry

2014-05-28 Thread Bogdan Ivascu
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.ComponentRequestHandlerTerminator.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.PageGlobalsComponentRequestFilter.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)
at
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
at $RequestHandler_7643a50972a.service(Unknown Source)
at
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902)
at $RequestHandler_7643a50972a.service(Unknown Source)
at
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892)
at $RequestHandler_7643a50972a.service(Unknown Source)
at
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
at $RequestHandler_7643a50972a.service(Unknown Source)
at com.ar.services.AppModule$1.service(AppModule.java:137)
at $RequestFilter_7643a509724.service(Unknown 

Re: WebSocket for tapestry

2014-05-28 Thread Bogdan Ivascu
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 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"  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
> > wrote:
> >
> > > 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  > >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" 
> > 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

2014-05-21 Thread Lance Java
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"  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
> wrote:
>
> > 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  >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" 
> 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

2014-05-20 Thread Bogdan Ivascu
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
wrote:

> 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 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"  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

2014-05-14 Thread Lance Java
If you just want Tapestry to manage an existing servlet, you can copy the
technique used by
AtmosphereHttpServletRequestFilter.

Make sure you set the async flag on the tapestry filter

   
app
org.apache.tapestry5.TapestryFilter
true

 On 14 May 2014 04:22, "Bogdan Ivascu"  wrote:

> 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  >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" 
> 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

2014-05-13 Thread Lance Java
In it's current state, it won't work with jquery as there's a tiny
dependency on prototype's json support. There's possibly two lines of
javascript that need to switch to jquery's json support.

https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/resources/org/lazan/t5/atmosphere/components/tapestry-atmosphere.js


Re: WebSocket for tapestry

2014-05-13 Thread Bogdan Ivascu
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 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"  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

2014-05-13 Thread Lance Java
In particular, you'll be interested in the usage of
HttpServletHttpServletRequestFilter.

https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/internal/HttpServletHttpServletRequestFilter.java
https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/internal/AtmosphereHttpServletRequestFilter.java
https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/AtmosphereModule.java#L82


Re: WebSocket for tapestry

2014-05-13 Thread Michael Dukaczewski

Is tapestry-atmosphere compatible with Tapestry 5.4?



Am 13.05.14 10:27, schrieb Lance Java:

In particular, you'll be interested in the usage of
HttpServletHttpServletRequestFilter.

https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/internal/HttpServletHttpServletRequestFilter.java
https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/internal/AtmosphereHttpServletRequestFilter.java
https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/AtmosphereModule.java#L82



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



Re: WebSocket for tapestry

2014-05-13 Thread Lance Java
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"  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

2014-05-10 Thread Bogdan Ivascu
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.