Websockets: Server to browser connection lost?

2017-03-08 Thread Gonzalo Aguilar Delgado
Hello,


As I told still doing testing with the web sockets. It seems that a
reconnection doesn't fully work. I don't know why.

If the connection is the first the browser does. It works nice. The
server sends a message to the client (browser) and the browser responds
with a request for data.

That works nicely.

But when I reload the page, most of times doesn't work.

2017-03-08 18:19:14,117 [http-bio-8080-exec-29] DEBUG
com.level2.dashboard.web.component.websocket.MessengerWebSocketResource
- Connected application
com.level2.dashboard.PandoraApplicationImpl@49b8641c with session id
AAD6510DE8CA72C6CE7FF1FD4F1CF03D
2017-03-08 18:19:14,117 [http-bio-8080-exec-29] WARN 
com.level2.dashboard.web.component.websocket.WebSocketClientManagerImpl
- The client
a13f637ea458fb61807e65429a9c18e3f5e8dd46cbe2d46cd1cc0894b4abb2f is
already connected, resending id

The server receives a connection. And in response it sends a message to
the client with a client ID. The client should respond. but it seems
browser never receives the message.

Why it doesn't work? Can connection be dropped or messages lost?

I added some logs to see if the socket is closed but it's ok.
@Override
public boolean sendMessage(ConnectionIdentifier identifier, String
message)
{
Application application =
Application.get(identifier.getApplicationName());
IWebSocketSettings webSocketSettings =
IWebSocketSettings.Holder.get(application);
IWebSocketConnectionRegistry webSocketConnectionRegistry =
webSocketSettings.getConnectionRegistry();
IWebSocketConnection connection =
webSocketConnectionRegistry.getConnection(application,
identifier.getSessionId(), identifier.getKey());
if (connection == null || !connection.isOpen())
{
log.warn("Connection is closed!!!");
return false;
}
try {
connection.sendMessage(message);
} catch (IOException e) {
log.warn("Cannot send message: {}", e.getMessage());
return false;
}
return true;
}
So Why I cannot send it. Or why the client is not receiving it?

Best regards,




Re: Access denied

2017-03-08 Thread Zala Pierre GOUPIL
Mmmmh actually, the access denied page appears as soon as the component is
clicked! Not just when a value is submitted.

On Wed, Mar 8, 2017 at 5:19 PM, Zala Pierre GOUPIL 
wrote:

> No, it doesn't have such calculations. Could the problem be
> websockets-related?
>
> On Wed, Mar 8, 2017 at 5:14 PM, Martin Grigorov 
> wrote:
>
>> Hi,
>>
>> I think your AjaxEditableLabel has logic to calculate whether it is
>> enabled
>> or not.
>> It seems it is enabled for the initial rendering but later when Wicket
>> tries to post the new value after edit it calculates to 'disabled'
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Wed, Mar 8, 2017 at 4:54 PM, Zala Pierre GOUPIL <
>> goupilpie...@gmail.com>
>> wrote:
>>
>> > Good afternoon,
>> >
>> > I use Wicket 7.6.0. When clicking on an AjaxEditableLabel, I get the
>> > following message in the logs:
>> >
>> > behavior not enabled; ignore call. Behavior
>> > org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$
>> > LabelAjaxBehavior@1bab91c8
>> > at component [Component id = label]
>> >
>> > And there's an access denied in the browser. What am I supposed to do,
>> > please? It is related to the resource guards, I guess, but I can't
>> figure
>> > out what to provide them.
>> >
>> > Thanks a lot,
>> >
>> > Pierre
>> >
>> >
>> >
>> > --
>> > Je n'aime pas seulement ma vie, mais aussi celle des autres.
>> >
>> > (Blade Runner)
>> >
>>
>
>
>
> --
> Je n'aime pas seulement ma vie, mais aussi celle des autres.
>
> (Blade Runner)
>



-- 
Je n'aime pas seulement ma vie, mais aussi celle des autres.

(Blade Runner)


Re: Access denied

2017-03-08 Thread Zala Pierre GOUPIL
No, it doesn't have such calculations. Could the problem be
websockets-related?

On Wed, Mar 8, 2017 at 5:14 PM, Martin Grigorov 
wrote:

> Hi,
>
> I think your AjaxEditableLabel has logic to calculate whether it is enabled
> or not.
> It seems it is enabled for the initial rendering but later when Wicket
> tries to post the new value after edit it calculates to 'disabled'
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Mar 8, 2017 at 4:54 PM, Zala Pierre GOUPIL  >
> wrote:
>
> > Good afternoon,
> >
> > I use Wicket 7.6.0. When clicking on an AjaxEditableLabel, I get the
> > following message in the logs:
> >
> > behavior not enabled; ignore call. Behavior
> > org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$
> > LabelAjaxBehavior@1bab91c8
> > at component [Component id = label]
> >
> > And there's an access denied in the browser. What am I supposed to do,
> > please? It is related to the resource guards, I guess, but I can't figure
> > out what to provide them.
> >
> > Thanks a lot,
> >
> > Pierre
> >
> >
> >
> > --
> > Je n'aime pas seulement ma vie, mais aussi celle des autres.
> >
> > (Blade Runner)
> >
>



-- 
Je n'aime pas seulement ma vie, mais aussi celle des autres.

(Blade Runner)


Re: Access denied

2017-03-08 Thread Martin Grigorov
Hi,

I think your AjaxEditableLabel has logic to calculate whether it is enabled
or not.
It seems it is enabled for the initial rendering but later when Wicket
tries to post the new value after edit it calculates to 'disabled'

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 8, 2017 at 4:54 PM, Zala Pierre GOUPIL 
wrote:

> Good afternoon,
>
> I use Wicket 7.6.0. When clicking on an AjaxEditableLabel, I get the
> following message in the logs:
>
> behavior not enabled; ignore call. Behavior
> org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$
> LabelAjaxBehavior@1bab91c8
> at component [Component id = label]
>
> And there's an access denied in the browser. What am I supposed to do,
> please? It is related to the resource guards, I guess, but I can't figure
> out what to provide them.
>
> Thanks a lot,
>
> Pierre
>
>
>
> --
> Je n'aime pas seulement ma vie, mais aussi celle des autres.
>
> (Blade Runner)
>


Access denied

2017-03-08 Thread Zala Pierre GOUPIL
Good afternoon,

I use Wicket 7.6.0. When clicking on an AjaxEditableLabel, I get the
following message in the logs:

behavior not enabled; ignore call. Behavior
org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$LabelAjaxBehavior@1bab91c8
at component [Component id = label]

And there's an access denied in the browser. What am I supposed to do,
please? It is related to the resource guards, I guess, but I can't figure
out what to provide them.

Thanks a lot,

Pierre



-- 
Je n'aime pas seulement ma vie, mais aussi celle des autres.

(Blade Runner)


Re: wicketstuff-datastore-memcached guide

2017-03-08 Thread Martin Grigorov
Hi,

See the tests of the project.
https://github.com/wicketstuff/core/blob/master/datastores-parent/datastore-memcached/src/test/java/org/wicketstuff/datastores/memcached/app/MemcachedApplication.java
shows how to setup the data store.
You can set the hosts and port in IMemcachedSettings.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 8, 2017 at 3:51 PM, ssamarin  wrote:

> Hello,
>
> I've been looking for a guide/howto for wicketstuff-datastore-memcached,
> but
> no luck so far.
>
> So, I put 2 new jars in the classpath:
> wicketstuff-datastore-memcached-7.3.0.jar and spymemcached-2.12.2.jar
>
> Is there any configuration parameters somewhere? Like memcached host and
> port?
>
> Would appreciate hints.
>
> Regards, Stepan.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/wicketstuff-datastore-memcached-guide-tp4677272.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


wicketstuff-datastore-memcached guide

2017-03-08 Thread ssamarin
Hello, 

I've been looking for a guide/howto for wicketstuff-datastore-memcached, but
no luck so far.

So, I put 2 new jars in the classpath:
wicketstuff-datastore-memcached-7.3.0.jar and spymemcached-2.12.2.jar 

Is there any configuration parameters somewhere? Like memcached host and
port? 

Would appreciate hints.

Regards, Stepan.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicketstuff-datastore-memcached-guide-tp4677272.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Question regarding jquery-ui menu

2017-03-08 Thread Maxim Solodovnik
Hello Sebastien,

I would like to create Menu without icons (and without space for icons)
I tried to set icon to be null, and icon to be JQueryIcon.NONE, but
unfortunately it doesn't help
I believe code of Menu.java line 256 need to be changed, to hide icon
block if it wasn't specified
WDYT? do you need PR? :)

And I have to report http://www.7thweb.net/wicket-jquery-ui is down :(


-- 
WBR
Maxim aka solomax

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



Re: Websockets for graph data streaming

2017-03-08 Thread Zala Pierre GOUPIL
Good morning,

Would you mind sharing that library with us, please?

Regards,

Pierre Goupil



Le 8 mars 2017 09:28, "Gonzalo Aguilar Delgado"  a
écrit :

> Hi Martin,
>
> Thank you a lot. I'm almost done!!!
>
> It's so great. I made a clientside library that allows widgets to register
> for data streams. And the Websockets library integrated with Wicket
> subscribe delivers the specific data to each subscriptor.
>
> It takes just one connection. And I loove it!
>
> Best regards,
>
> El 07/03/17 a las 21:45, Martin Grigorov escribió:
>
> Hi,
>
> On Tue, Mar 7, 2017 at 10:07 AM, Gonzalo Aguilar Delgado 
>  wrote:
>
>
> Hi Martin,
>
> I must say I was working with websockets yesterday. And it's delightful
> experience. Have to check how it does scale but it seams just great.
>
> I have a doubt. Since I'm doing fully async I'm doing fully async request
> with WebSocketResource. I suppose that there's no way to update the
> interface from there. I mean, if we are sending a message because a model
> changed on server. Can I trigger the repain of a widget? I suppose this
> option is only available if using behavior right?
>
>
> Correct!
>
>
>
> I saw the broadcast example you did. But does it worth mix WebSocketResource
> and WebSocketBehavior?
>
> What is best, more scalable?
>
>1. Doing a WebSocketResource with 1 connection that via Javascript
>notifies all components in page.
>2. Use WebSocketResource + 1 WebSocketBehavior per component, and then
>broadcast to all.
>
> Even if you have many WebSocketBehaviors in your components Wicket will
>
> create only one WebSocket connection per page. A web socket message sent by
> the browser will be delivered to all behavior instances. You have to decide
> whether the message is applicable for a given behavior or should be
> discarded.
>
> The drawback of using WebSocketBehavior is that during the processing of a
> message the Page instance will be locked, so WS messages are processed
> sequencially and any Ajax requests at the same time will wait for the page
> to be unlocked.
>
>
>
>
>
> As I told what I'm doing is a Javascript hub that receives messages (via
> WebSocketResource) and sends to the widgets async so they can update. But
> I suppose that following this approach it's quite difficult update
> components from Javascript. And so the opposite. If a component updates
> it's internal model on server, there's no way to push to the interface.
>
> Can I have both? The ability to update components (graphs mainly) from
> javascript datasource, but from time to time, update components on wicket
> and send updates to the UI (html)?
>
>
> You can use org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster to
> repaint Wicket components initiated at the server side. You will need to
> preserve the page id to able to notify a specific page. Or
> WebSocketBehavior should keep some extra information, e.g. userId, to
> decide whether a given PushMessage is for it or not.
>
>
>
> Best regards,
>
>
>
> El 06/03/17 a las 09:08, Martin Grigorov escribió:
>
> Hi,
>
>
> On Mon, Mar 6, 2017 at 3:57 AM, Gonzalo Aguilar Delgado 
>   wrote:
>
>
> Hello,
>
> I'm using the fantastic Decebals dashboard, adding a widget json
> registry and some other improvements. The idea is to provide data
> streaming functionality like the one provided by graphana, kibana and
> friends.
>
> So the server will contain the datasources. And the dashboard will apply
> to one or more datasources on the server.
>
> But I don't know what's the best way to go with wicket.
>
> My first idea is to provide a websocket connection with a DataManager
> for each user dashboard (only 1 at a time active), subscribe to
> datasources, and receive the streaming over the websockets. The
> DataManager then will keep track of what topic each chart wants to
> receive and multiplex the result to each chart via Javascript.
>
> This way there's only 1 connection to the server. But data can be shared
> among widgets. I suppose it's not easy task.
>
> The other way is do ajax with each chart. But I think this would make a
> lot of calls to the server and I suppose it's not scalable.
>
> S. What's the best way to go?!
>
>
> I'd use WebSockets for this!
>
>
>
> Any good chart integration on wicket apart of highcharts? D3js or
> similar...
>
>
> The demo app forhttp://wicketinaction.com/2012/07/wicket-6-native-websockets/ 
> uses Google
> Charts library without any Wicket component integration.
>
>
>
> Preview of the current work is this link:
>
> https://pbs.twimg.com/media/C6M_hG6WYAEeysz.jpg
>
>
>
> --
> [image: Gonzalo Aguilar Delgado] *Level2 CRM*
>   Gonzalo Aguilar Delgado
>   Consultor CRM - Ingeniero en Informática
>
> M. +34 607 81 42 76 <+34%20607%2081%2042%2076> <+34%20607%2081%2042%2076>
> T. +34 918 40 95 78 <+34%20918%2040%2095%2078> <+34%20918%2040%2095%2078>
> E. 

Re: Websockets for graph data streaming

2017-03-08 Thread Martin Grigorov
You made my day, Gonzalo!
Awesome!


On Wed, Mar 8, 2017 at 9:10 AM, Gonzalo Aguilar Delgado <
gagui...@level2crm.com> wrote:

> Hi Martin,
>
> Thank you a lot. I'm almost done!!!
>
> It's so great. I made a clientside library that allows widgets to register
> for data streams. And the Websockets library integrated with Wicket
> subscribe delivers the specific data to each subscriptor.
>
> It takes just one connection. And I loove it!
>
> Best regards,
>
> El 07/03/17 a las 21:45, Martin Grigorov escribió:
>
> Hi,
>
> On Tue, Mar 7, 2017 at 10:07 AM, Gonzalo Aguilar Delgado 
>  wrote:
>
>
> Hi Martin,
>
> I must say I was working with websockets yesterday. And it's delightful
> experience. Have to check how it does scale but it seams just great.
>
> I have a doubt. Since I'm doing fully async I'm doing fully async request
> with WebSocketResource. I suppose that there's no way to update the
> interface from there. I mean, if we are sending a message because a model
> changed on server. Can I trigger the repain of a widget? I suppose this
> option is only available if using behavior right?
>
>
> Correct!
>
>
> I saw the broadcast example you did. But does it worth mix WebSocketResource
> and WebSocketBehavior?
>
> What is best, more scalable?
>
>1. Doing a WebSocketResource with 1 connection that via Javascript
>notifies all components in page.
>2. Use WebSocketResource + 1 WebSocketBehavior per component, and then
>broadcast to all.
>
> Even if you have many WebSocketBehaviors in your components Wicket will
>
> create only one WebSocket connection per page. A web socket message sent by
> the browser will be delivered to all behavior instances. You have to decide
> whether the message is applicable for a given behavior or should be
> discarded.
>
> The drawback of using WebSocketBehavior is that during the processing of a
> message the Page instance will be locked, so WS messages are processed
> sequencially and any Ajax requests at the same time will wait for the page
> to be unlocked.
>
>
> As I told what I'm doing is a Javascript hub that receives messages (via
> WebSocketResource) and sends to the widgets async so they can update. But
> I suppose that following this approach it's quite difficult update
> components from Javascript. And so the opposite. If a component updates
> it's internal model on server, there's no way to push to the interface.
>
> Can I have both? The ability to update components (graphs mainly) from
> javascript datasource, but from time to time, update components on wicket
> and send updates to the UI (html)?
>
>
> You can use org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster to
> repaint Wicket components initiated at the server side. You will need to
> preserve the page id to able to notify a specific page. Or
> WebSocketBehavior should keep some extra information, e.g. userId, to
> decide whether a given PushMessage is for it or not.
>
>
>
> Best regards,
>
>
>
> El 06/03/17 a las 09:08, Martin Grigorov escribió:
>
> Hi,
>
>
> On Mon, Mar 6, 2017 at 3:57 AM, Gonzalo Aguilar Delgado 
>  
>  wrote:
>
>
> Hello,
>
> I'm using the fantastic Decebals dashboard, adding a widget json
> registry and some other improvements. The idea is to provide data
> streaming functionality like the one provided by graphana, kibana and
> friends.
>
> So the server will contain the datasources. And the dashboard will apply
> to one or more datasources on the server.
>
> But I don't know what's the best way to go with wicket.
>
> My first idea is to provide a websocket connection with a DataManager
> for each user dashboard (only 1 at a time active), subscribe to
> datasources, and receive the streaming over the websockets. The
> DataManager then will keep track of what topic each chart wants to
> receive and multiplex the result to each chart via Javascript.
>
> This way there's only 1 connection to the server. But data can be shared
> among widgets. I suppose it's not easy task.
>
> The other way is do ajax with each chart. But I think this would make a
> lot of calls to the server and I suppose it's not scalable.
>
> S. What's the best way to go?!
>
>
> I'd use WebSockets for this!
>
>
>
> Any good chart integration on wicket apart of highcharts? D3js or
> similar...
>
>
> The demo app forhttp://wicketinaction.com/2012/07/wicket-6-native-websockets/ 
> uses Google
> Charts library without any Wicket component integration.
>
>
>
> Preview of the current work is this link:
>
> https://pbs.twimg.com/media/C6M_hG6WYAEeysz.jpg
>
>
>
> --
> [image: Gonzalo Aguilar Delgado] *Level2 CRM*
>   Gonzalo Aguilar Delgado
>   Consultor CRM - Ingeniero en Informática
>
> M. +34 607 81 42 76 <+34%20607%2081%2042%2076> <+34%20607%2081%2042%2076>
> T. +34 918 40 95 78 <+34%20918%2040%2095%2078> <+34%20918%2040%2095%2078>
> E. gagui...@level2crm.com
>
>
>
>
>
> --
> [image: Gonzalo Aguilar Delgado] 

Re: Websockets for graph data streaming

2017-03-08 Thread Gonzalo Aguilar Delgado
Hi Martin,

Thank you a lot. I'm almost done!!!

It's so great. I made a clientside library that allows widgets to
register for data streams. And the Websockets library integrated with
Wicket subscribe delivers the specific data to each subscriptor.

It takes just one connection. And I loove it!

Best regards,


El 07/03/17 a las 21:45, Martin Grigorov escribió:
> Hi,
>
> On Tue, Mar 7, 2017 at 10:07 AM, Gonzalo Aguilar Delgado <
> gagui...@level2crm.com> wrote:
>
>> Hi Martin,
>>
>> I must say I was working with websockets yesterday. And it's delightful
>> experience. Have to check how it does scale but it seams just great.
>>
>> I have a doubt. Since I'm doing fully async I'm doing fully async request
>> with WebSocketResource. I suppose that there's no way to update the
>> interface from there. I mean, if we are sending a message because a model
>> changed on server. Can I trigger the repain of a widget? I suppose this
>> option is only available if using behavior right?
>>
> Correct!
>
>> I saw the broadcast example you did. But does it worth mix WebSocketResource
>> and WebSocketBehavior?
>>
>> What is best, more scalable?
>>
>>1. Doing a WebSocketResource with 1 connection that via Javascript
>>notifies all components in page.
>>2. Use WebSocketResource + 1 WebSocketBehavior per component, and then
>>broadcast to all.
>>
>> Even if you have many WebSocketBehaviors in your components Wicket will
> create only one WebSocket connection per page. A web socket message sent by
> the browser will be delivered to all behavior instances. You have to decide
> whether the message is applicable for a given behavior or should be
> discarded.
>
> The drawback of using WebSocketBehavior is that during the processing of a
> message the Page instance will be locked, so WS messages are processed
> sequencially and any Ajax requests at the same time will wait for the page
> to be unlocked.
>
>>
>>
>> As I told what I'm doing is a Javascript hub that receives messages (via
>> WebSocketResource) and sends to the widgets async so they can update. But
>> I suppose that following this approach it's quite difficult update
>> components from Javascript. And so the opposite. If a component updates
>> it's internal model on server, there's no way to push to the interface.
>>
>> Can I have both? The ability to update components (graphs mainly) from
>> javascript datasource, but from time to time, update components on wicket
>> and send updates to the UI (html)?
>>
> You can use org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster to
> repaint Wicket components initiated at the server side. You will need to
> preserve the page id to able to notify a specific page. Or
> WebSocketBehavior should keep some extra information, e.g. userId, to
> decide whether a given PushMessage is for it or not.
>
>> Best regards,
>>
>>
>>
>> El 06/03/17 a las 09:08, Martin Grigorov escribió:
>>
>> Hi,
>>
>>
>> On Mon, Mar 6, 2017 at 3:57 AM, Gonzalo Aguilar Delgado 
>>  wrote:
>>
>>
>> Hello,
>>
>> I'm using the fantastic Decebals dashboard, adding a widget json
>> registry and some other improvements. The idea is to provide data
>> streaming functionality like the one provided by graphana, kibana and
>> friends.
>>
>> So the server will contain the datasources. And the dashboard will apply
>> to one or more datasources on the server.
>>
>> But I don't know what's the best way to go with wicket.
>>
>> My first idea is to provide a websocket connection with a DataManager
>> for each user dashboard (only 1 at a time active), subscribe to
>> datasources, and receive the streaming over the websockets. The
>> DataManager then will keep track of what topic each chart wants to
>> receive and multiplex the result to each chart via Javascript.
>>
>> This way there's only 1 connection to the server. But data can be shared
>> among widgets. I suppose it's not easy task.
>>
>> The other way is do ajax with each chart. But I think this would make a
>> lot of calls to the server and I suppose it's not scalable.
>>
>> S. What's the best way to go?!
>>
>>
>> I'd use WebSockets for this!
>>
>>
>>
>> Any good chart integration on wicket apart of highcharts? D3js or
>> similar...
>>
>>
>> The demo app 
>> forhttp://wicketinaction.com/2012/07/wicket-6-native-websockets/ uses Google
>> Charts library without any Wicket component integration.
>>
>>
>>
>> Preview of the current work is this link:
>>
>> https://pbs.twimg.com/media/C6M_hG6WYAEeysz.jpg
>>
>>
>>
>> --
>> [image: Gonzalo Aguilar Delgado] *Level2 CRM*
>>   Gonzalo Aguilar Delgado
>>   Consultor CRM - Ingeniero en Informática
>>
>> M. +34 607 81 42 76 <+34%20607%2081%2042%2076>
>> T. +34 918 40 95 78 <+34%20918%2040%2095%2078>
>> E. gagui...@level2crm.com
>>
>>
>>
>>
>>

-- 
Gonzalo Aguilar Delgado *Level2 CRM*
  Gonzalo Aguilar Delgado
  Consultor CRM - Ingeniero en Informática

M. +34 607 81 42 76
T. +34 918 40 95 78
E.