Using the Custom Directory for Custom Applications
The Arbortext-path\custom subdirectory structure provides the means to implement custom applications. Where your application should be placed depends on the application purpose and programming language.
If you're implementing custom applications or scripts, the following information will assist you in determining the approach and location for your files:
• A custom Java program can be placed in custom\init, which supports a .class file that must implement a public static void main (String[] args) method. The method will be called at startup with no arguments (an empty String array). If an error occurs, it's reported interactively for Arbortext Editor or sent to the HTTP client for the Arbortext Publishing Engine.
A custom Java program can also be placed in custom\classes, which supports .class or .jar files.
We recommend putting Java applications in the custom\classes directory and calling or initializing them from the custom\init directory.
Paths to .jar files in custom\classes are automatically prepended to the embedded Arbortext Editor Java class path. Then the path to custom\classes is prepended, putting it first in the search order.
• A custom JavaScript, JScript, VBScript, or ACL application can be placed in custom\init or in custom\scripts. If you place your scripts in the custom\scripts directory, you can call them from a script or scripts you place in custom\init (which is processed at startup). Any code that exists outside a function definition in a script from custom\init is executed at startup time. Errors are reported if running interactively, otherwise they're suppressed.
You can create a simple JavaScript example file called simple_init.js. The script should contain the following line:
Application.alert("Hello from JavaScript");
Put the simple_init.js file in Arbortext-path\custom\init.
When the startup process loads scripts from custom\init, you will see a dialog box showing the Hello from JavaScript message.
Related Topics