The crm.messagingakioma.SocketConnection class is used to encapsulate every socket communication. The class provides methods, for connect, disconnect, seting global listeners and functionalities like showMessage, openContainer and others.
Ui-connector routes:
Code Block | ||
---|---|---|
| ||
var controller = require('../controllers/ui-connector'); router.get('*', controller.all); |
...
This URL will emit an "openContainer" event for the user axadmin and open the offerNewG container. The crm.messaging.SocketConnection have a method called "setUpGlobalListeners" which set various listeners on akioma.socket, inclusive openContainer listener.
Treegrid socket functionality:
...
The node.js will listen on the room event and check the action. If it's "join", perform an socket.join room and emit an event "room_{data.name}" with the action and the coresponding user. Swat-webui listen to that event and call a treeRoomNotification saying that someone joined or leaved. The notification will be visible only if 2 different users work on the same treegrid.