Plexus Connect - JavaScript Scripting
JavaScript scripting¶
This section will guide you step-by-step through running JavaScript scripts together with Plexus Connect application.
Before you start¶
Please note
- there is also the Python scripting feature available in Plexus Connect
- JavaScript scripting has limited usage compared to Python scripting
- there is no
APIpackage available - this implies that theAPIcan not be used for accessing Plexus Connect data from other systems
Usage and examples¶
Connect frontend usage¶
For using JavaScript for scripting in Connect frontend, a subclass of ConnectScript needs to be created first. This lets you react on user input and modify frontend state.
ConnectScript is a JavaScript script, which can be called by Connect frontend and can react on user actions like opening a view, clicking, querying, selection etc.
Example of a simple script:
For usage from Connect frontend, this script needs to be saved in
- for UNIX
~/.chemaxon/plexus-suite/scripts-data/{schemaId}/ - for Windows
~/chemaxon/plexus-suite/scripts-data/{schemaId}/
and mapped to the view using ViewId in the scripts.conf file in the same directory.
Directories in the scripting folder are automatically created during startup of the Connect server and named according to the deployed schemas.
Each deployed schema belongs to a folder with the same name {Schema_ID}. Scripts are classified per schema and identified by Schema_ID.
Content of the script.conf file:
view id;javascriptfile.js;pythonfile.py
213A0E201AB2EB5DA54552018904C869;hello_world.js;;
The ViewId can be obtained from the address bar. When a view is opened in a browser, the Connect URL contains the ViewID as it is shown in the following URL example:
http://your_server.com/grid/6C6F63616C6462_213A0E201AB2EB5DA54552018904C869/1