The JavaScript API provides a number of root objects which are available from your JavaScript code.
The root objects have various types, depending on which part of the system they expose. For example, the common repository concepts, such as the Company Home folder and the logged in user, are represented through objects of type ScriptNode. These objects support the full range of properties and object-oriented API of the ScriptNode class.
Depending on the context in which the script is invoked, other types of root object are available that represent aspects of the system such as server details, user information, request headers and parameters passed to the script. Further, a variety of services are accessible from your JavaScript code, each of these services has a corresponding root object, on which properties can be accessed and a variety of methods called as dictated by the service’s API.
The root objects available to your JavaScript code will depend on the context in which the code is invoked. Different contexts will have access to a different set of root objects. There are several contexts to be considered:
- Repository Web scripts
- Surf Web Scripts (see Surf JavaScript Root Objects)
- Rules/actions
- Workflow
- Share
This information looks at the most commonly used root objects. More specialized root objects are described in more detail in the relevant sections of this documentation.