The enterprises are drifting fast towards Node.js, especially because of its proven performance characteristics. Here, I have tried to utilize some of its features in SAP BusinessObjects Design Studio.
Here’s how I have implemented the Real-time Chat prototype component based on Node.js, express and socket.io.
1. I have used the socket.io chat example from its official website. I installed the node server on my local machine by installing required dependencies such express, node, socket.io libraries using package.JSON and started server file by a command node index.js.
2. Once the server got started, I created a simple chat component in SAP BusinessObjects Design Studio as a socket client. To load socket.io library, I used the require.js module.
3. After the completion of socket client code in component.js file, I executed the SAP BusinessObjects Design Studio application in browser. As you can see, the component looks like this in design mode,
4. Each session will be considered as an individual user. When application is executed on the browser, the user can enter their name to join the chat server. I executed the application locally on a browser (the server is locally running on my system as I mentioned before).
5. To actually use the component, I opened the application URL in a different Google Chrome window and joined as another user. The application will indicate the number of participants for that session.
6. As you can see below, the server has detected that there are two participants.
7. The chat messages appear in both the windows as shown above. When one of the users quits the session (closes the browser window), a message appears as shown below:
As mentioned above, each session will be considered as an individual user. This real time chat component can be implemented as part of a dashboard, wherein a number of users who have opened the same application can view and communicate through the dashboard.
Lot more can be done by incorporating Node.js in SAP BusinessObjects Design Studio and this is just an example. So what are we waiting for? Let’s chat!