How to - Installing Content Script Online Debugger (with video)
How to - Installing Content Script Online Debugger (with video)
Objective
With Module Suite, is it possible open a debugger for the Content Scripts: this debugger allow to add breakpoints in the scripts and perform an execution step by step, evaluating the values of the viriables.
This debugger uses the default options provided by the Java Virtual Machine.
Software version
This is valid for all the product versions
The debugger tool is available only for Windows environments.
Before start these steps, check on OpenText official documentation the JDK embedded with Content Script. Versions older than 16.2.8 embed Java8 (or lower). Versions from 16.2.8 embed OpenJDK11.
In order to enable the Content Script debugger, please follow these steps:
Stop Content Server instance
Only for Java8 or lower copy the tools.jar from a Java JDK installation to the amlib/amdebugfolder in the anscontentscript module
Enable JVM debugging in opentext.ini file, adding the the following line in the [javaserver]section (please replace X with the first free number in the sequence of the Java Options already in the file)
JavaVMOption_1X=-Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=cssharedmemory for Java8 (or lower)
JavaVMOption_1X=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:9009 for OpenJDK11
Start your Content Server instance
For version that uses OpenJDK version, in Base Configuration set the properties in this way (for older versions keep the default ones)
In the Content Script Volume, open the CSMenufolder
Create a new Template Folderwith name S43200. This is the typeid of the Content Scripts and this will enable the additional menu for this type of objects.
In the folder created at previous step, add a Content Script object with the following body
menu = amgui.getCSMenu().appendItem("Debug", "${url}?func=amcs.executeadmcs&script=debug.cs&csnode=${nodeID}",true, 0)
amgui.returnCSMenu(menu)
Execution
This video shows the steps listed in previous section and show also how to use the debugger