Published

Document the precedence of engine script bindings over global ones (XCOMMONS-3912)

Last modified by Michael Hamann on 2026/11/20 11:36

Documents XCOMMONS-3912 (XWiki 18.10.0RC1): the Scripting dev guide section on sharing variables between languages, and the release-note entry for 18.10.0RC1. A companion change request updates the Script Module page on extensions.xwiki.org.

Companion of the change request https://www.xwiki.org/xwiki/bin/view/ChangeRequest/Data/document-precedence-engine--30553dfe-8b32-4f19-b66b-ba260b52063a/: merge them together.

All changes

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.ThomasMortagne
1 +xwiki:XWiki.MichaelHamannNoAdmin
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -25,6 +25,8 @@
25 25  
26 26  Any script executed after this will be able to use ##myvar## variable directly. This is true also for **Velocity** since 8.3.
27 27  
28 +Set the binding in the engine scope, as above: a binding of the global scope is hidden by an engine scope binding with the same name, such as a Velocity variable set by a previous script. {{version before="18.10.0RC1"}}In Velocity, a global binding replaced the engine binding or Velocity variable with the same name each time a Velocity script was executed.{{/version}}
29 +
28 28  = Script Services =
29 29  
30 30  To expose an API to a script macro you simply need to implement the ##org.xwiki.script.service.ScriptService## component role (see [[Component Module>>Extension.Component Module]] to know more about components). Note that it is rather usual to not separate script-services between interface and implementation as the visibility is at a different level than that of java. Rather, script-service components should perform mostly delegation to other components or simple transformations (such as objects translation).
Nov 20, 2026, 11:36:26 AM

Approved by Michael Hamann

Approvers

Approvers have not been explicitly defined for this Change Request. Approvers will be based entirely on approval rights.

Get Connected