public class ClientScriptingHelper extends AbstractClientHelper
Encapsulates interpreter lifecycle, default imports, constant injection, and contextual bindings for client-side script execution.
| Constructor and Description |
|---|
ClientScriptingHelper(Client _client)
Constructs a scripting helper bound to the active client runtime context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
executeScript(AbstractScript s)
Convenience method to execute an
AbstractScript without supplemental parameters. |
void |
executeScript(AbstractScript s,
java.util.Map<java.lang.String,java.lang.Object> mapping)
Executes an
AbstractScript within the client runtime context, binding optional parameters. |
BeanShellScript |
getScript()
Returns the active BeanShell interpreter instance.
|
AbstractScript |
getScript(electric.xml.Element el)
Creates an
AbstractScript instance from an XML configuration element. |
void |
initScript()
Initializes the BeanShell scripting interpreter.
|
void |
setScript(BeanShellScript s)
Assigns an explicit BeanShell interpreter instance.
|
clientpublic ClientScriptingHelper(Client _client)
_ctx - context providing access to loaders, sessions, and environment servicespublic BeanShellScript getScript()
BeanShellScript instance, or null if not yet initializedpublic void setScript(BeanShellScript s)
s - script engine instance to bindpublic void initScript()
Configures default package imports (GUI, BOs, utilities), binds the client context,
and registers standard runtime constants (such as D_ZERO).
public AbstractScript getScript(electric.xml.Element el)
AbstractScript instance from an XML configuration element.
Extracts script language and source code from the given XML element. The script is retained uncompiled because the generated execution wrapper is discarded after invocation.
Note: Currently returns a BeanShell script instance regardless of the declared language, binding execution to the client’s primary interpreter context.
el - XML element containing script code and attributesAbstractScript, or null if el is nullpublic void executeScript(AbstractScript s)
AbstractScript without supplemental parameters.s - script instance to execute; ignored if nullpublic void executeScript(AbstractScript s, java.util.Map<java.lang.String,java.lang.Object> mapping)
AbstractScript within the client runtime context, binding optional parameters.s - script instance to execute; ignored if nullmapping - variable map injected into the script execution scope; may be nullCopyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.