Le 06/05/2018 à 20:46, Francisco Ortiz Peñaloza a écrit :
> Sorry for the OT but I interested in how you're using WebSockets and
> Seaside. 
> 
> Can you share how are you mix them together?
> 

Hi,

We do it in this project:

https://github.com/TelescopeSt/TelescopeCytoscape

This project allow to create a model of visualization (nodes and their
contents, layouts, interactions, and update mechanism) then to render it
with the CytoscapeJs visualization framework.

The Seaside part is really small. We just use Seaside to render an empty
div and initialize a cytoscape visualization inside. We could probably
do without Seaside but we did this project for a Seaside application.
(And we use the existing callbacks mechanism)

During the rendering we open a web socket and we generate the initial
cytoscape visualization inside the empty div generated by Seaside.

Then when the user interact with the visualization, it communicates the
interactions via the web socket to the Pharo server and if it should
impact the visualization, commands to do so are sent via the websocket
to the client.

In this project the main part for the websocket management are:

- TLCytoscapeComponent : The Seaside component registering the
visualization
(https://github.com/TelescopeSt/TelescopeCytoscape/blob/development/src/Telescope-Cytoscape/TLCytoscapeComponent.class.st)
- TLCytoscapeWebSocketDelegate : The class managing the websocket server
side
(https://github.com/TelescopeSt/TelescopeCytoscape/blob/development/src/Telescope-Cytoscape/TLCytoscapeWebSocketDelegate.class.st)
- CYSFileLibrary>>cytoscapeTelescopeJs : The javascript managing the
socket client side
(https://github.com/TelescopeSt/TelescopeCytoscape/blob/development/src/Telescope-Cytoscape-Libraries/CYSFileLibrary.class.st#L539)

If you need more details just ask :)


-- 
Cyril Ferlicot
https://ferlicot.fr

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to