Structure of scripts
Scripts allow functions that are not yet present in FirstSpirit to be implemented quickly. They can, for example, also be used for complex migration scenarios and connecting external systems.
FirstSpirit supports a script language called BeanShell. The syntax of this language is heavily based on JAVA but is much more straightforward in many ways thanks to features such as dynamic typing for global variables and functions instead of static typing, as well as (limited) reflexive access to the program itself plus many other functions besides.
Scripting with BeanShell provides a high degree of flexibility for template developers. Working with scripts is not a trivial matter, however. Therefore, a careful check should be carried out to see whether a corresponding function is already available in FirstSpirit before implementing a script.
There are different tabs in the SiteArchitect workspace for each script. These tabs can be used to configure all the necessary settings and definitions.
- Properties: All of the settings required for the script can be made here.
- Form: The input components that are to be called during the script runtime are defined here.
- Rules: Rules can be defined to influence elements or properties.
- Template set: This contains the actual BeanShell source code for the presentation channels.
For more detailed information on developing scripts in BeanShell, see Scripting under Template development.