Start page / Template development / Scripting

Scripting in FirstSpirit

Scripts can be used to automate different types of operating sequences / user input sequences in FirstSpirit. A script is used to describe the sequence to be executed and if necessary can make changes to the FirstSpirit data structure. Scripts enable fast implementation of functions which are not yet available in FirstSpirit. Further areas of use are, for example, complex migration scenarios and the interfacing of external systems.

Important FirstSpirit scripts are a lightweight way of integrating new functionalities into FirstSpirit. For reasons of stability, however, it is recommended that functionalities that are required and used in the long term be implemented as a FirstSpirit module with executable or plugin.

Script language BeanShell

The supported script language in FirstSpirit is BeanShell. The BeanShell syntax is highly based on JAVA but offers numerous simplifications, for example, dynamic instead of static typification of global variables and functions, as well as (limited) reflexive access to the program itself and many other functions:

Further information on this script language is available on the website www.beanshell.org, which also provides a detailed manual (EN).

Scripting with BeanShell offers a high degree of flexibility for the template developer. However, working with scripts is not trivial, therefore, before using a script it is necessary to check whether a corresponding function already exists in FirstSpirit!

Script contexts

Scripts can be used in different contexts of FirstSpirit:

  • Template scripts, menu scripts and context menu scripts run in SiteArchitect and in ContentCreator and, among other things, can make input windows available to the editor. These types of scripts are therefore very suitable for project-specific automation of frequently recurring operations within the editorial process. These scripts can be inserted or hidden in the context menu on the basis of additional information (e.g. logged in user, type of currently selected object).
  • Service scripts (in the background of the FirstSpirit server)
  • Pre or postdeployment scripts

Making scripts

New scripts can be created in the Scripts folder in the Template Store, by using the context menu, item “New” / “Create new script”.

For more information see also Chapter Scripts.

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.12 | Data privacy