JS Console

Page reserved for super administrators (members of the GROUP_ALFRESCO_ADMINISTRATORS group).

This console runs server-side JavaScript code directly on the Alfresco server, with the rights of the user selected in the Run as field. It can read, modify or delete any content in the repository, bypassing the usual interface controls. Reserve its use for trusted technical administrators, for one-off diagnostics.

Purpose of this page

The JS Console lets you write and run an Alfresco script (server-side JavaScript) directly from the browser, without having to deploy it into the repository beforehand. It also lets you preview the rendering of a FreeMarker template (the templating engine used by Alfresco) applied to the result of the script.

Accessing the page

Pristy Portail menu: OOTBee Support Tools > JavaScript Console.

The console editors follow the editor theme and font chosen by the user (see Editor appearance).

Interface

The screen has two input areas, organized as tabs:

  • JavaScript: the main script to run.
  • FreeMarker Template: an optional template to format the script’s result.

A toolbar above the editor offers:

Field / buttonPurpose
Load / SaveLoad an existing script from the repository, or save the current script (overwriting an existing script or creating a new named script)
Run asName of the user under whose identity the script runs (admin by default)
TransactionThe script’s transaction mode: none, read-only, or read/write (allows changes)
URL argumentskey=value&key2=value2 parameters simulating HTTP request parameters passed to the script

Running a script

Click Execute (or use the Ctrl+Enter shortcut). Three result tabs are available:

  • Console: the output produced by the script (print(), logger.log(), etc.)
  • Template: the rendering of the FreeMarker template, if one was provided
  • Performance: the execution time of the script, the template and the webscript

On error, the offending line is automatically highlighted in the relevant JavaScript or FreeMarker editor, based on the analysis of the error stack returned by the server.

Loading and saving a script

The Load and Save menus show the tree of scripts already saved in the repository. [To verify] The exact location of this script folder in the Data Dictionary has not been confirmed. Saving over an existing script requires explicit confirmation before overwriting its content; the Save as new… option lets you create a new script under a chosen name.


Last Update - October 20, 2026
Call To Action 📣

Try Pristy

You can try the Pristy demo by signing up using the link below.

Demander une démo