Lightstreamer - Stock-List Demo - HTML (Dojo Toolkit) Client
*Note. Real-Time simulated Stock-List data is received from the Lightstreamer Server deployed at http://push.lightstreamer.com
If you want to install a version of this demo pointing to your local Lightstreamer Server, follow these steps:
- Note that, as prerequisite, the Lightstreamer - Stock- List Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it.
- Launch Lightstreamer Server.
- Download this project.
- Create the folders
/pages/demos/[demo_name]into your Lightstreamer server installation then copy here the content of
srcfolder of this project.
- Get the
lightstreamer_namespace.jsfile from Lightstreamer distribution (see compatibility notes below) and put it in the
srcfolder of the demo. The version required by this demo can be found in Lightstreamer version 5.1.2 to 7.0. Alternatively, you can build a
lightstreamer_namespace.jsfile from the online generator. In that case, be sure to include the LightstreamerClient, Subscription, ConnectionSharing, and StatusWidget modules and to use the "AMD with namespaced names" version.
- Download the Dojo Toolkit and copy the
dojoxfolder from the package to the
srcfolder of the demo. The demo requires the Dojo Toolkit v.1.8 or higher.
- Using the CommonJS Package Manager install dgrid, dijit and lightstreamer-store in the
srcfolder; dependencies for these packages will be automatically resolved by the cpm process:
- cpm install dgrid 0.3.8
- cpm install dijit
- cpm install lightstreamer-store
- The demo is now ready to be launched: navigate to
It is suggested to compress the dojo/dojox/dijit files in a single js source file to minimize startup times.
Head for the Dojo Web Builder and select the following packages:
Then click the "build" button and wait. Once the builder is done, a zip file will be downloaded; copy the files/folders from the archive in the
src/dojo foloder and reload the demo.
Once the demo is working in your environment, it is time to deploy it on a web server.
The demo currently connects to a local Lightstreamer server to get the stock data. It is possible to change this setting, making the demo point to a different server. Obviously, in this
Case, the DEMO adapter needs to be installed on the tagert server (currently, such adapter is installed by default).
To change the server, edit the
js/lsClient.js file and substitute the following line:
var lsClient = new LightstreamerClient(protocolToUse+"//localhost:"+portToUse,"DEMO");
var lsClient = new LightstreamerClient(myServer,"DEMO");
where myServer contains the address of the server (comprehending the port if different from the default one). As an example, to connect to a local server listening on port 8080 use:
var lsClient = new LightstreamerClient("http://localhost:8080","DEMO");
Lightstreamer Adapters Needed by This Client
- Lightstreamer - Stock-List Demo - Java Adapter
- Lightstreamer - Reusable Metadata Adapters- Java Adapter
- Lightstreamer - Stock-List Demos - HTML Clients
- Lightstreamer - Basic Stock-List Demo - jQuery (jqGrid) Client
- Lightstreamer - Basic Stock-List Demo - Java SE (Swing) Client
- Lightstreamer - Basic Stock-List Demo - .NET Client
- LightstreamerStore for Dojo
Lightstreamer Compatibility Notes
- Compatible with Dojo Toolkit v.1.8 or newer.