Scripting implementation

Metrici uses server-side JavaScript, i.e. JavaScript that runs on the server. This is different from most uses of JavaScript that run in the browser. (Metrici also supports browser-based JavaScript - see Web development.)

JavaScript can access the underlying data only through an API (see Scripting reference) and by Scripting services. These functions are all available through an application object exposed to the script. These only allow the user to perform actions that they are permitted to perform. The JavaScript has no other access to the data or functionality of the application.

Scripts can be run in various ways:

  • Using the run, execute, call and require methods on node URLs.
  • Using the Run Script / Execute Script services through the Submit Service Request screen, or through the web services interface.
  • Internally within the NodeController themselves (for validation, derivation and extension scripts).

The different ways of calling scripts all use the same basic conventions for passing data in and out of scripts.