Eclipse Build System

The Content Server IDE Plug-In integrates with the Eclipse build system. When you change a source file and save it, it is immediately compiled and the object is updated in Content Server. Some changes, such as adding or removing object source files, will prompt a rebuild of the entire ospace. This happens automatically and the ospace is reloaded with the updated version.

If you would prefer not to have Eclipse building your changes in the background, you can turn off this functionality by deselecting Project > Build Automatically from the top-level Eclipse menu. Eclipse will still keep track of your changes, however, so you can trigger a build of the objects and ospaces that have changed by selecting Project > Build All. Build All does not necessarily initiate a build of all your module source code.

If you make major structural changes, it may be a good idea to rebuild everything.

  1. Run Project > Clean.

    Clean dialog

  2. Click OK.

  3. After a clean build, the Content Server instance is restarted automatically. You can also do a restart by clicking the restart button restart in Module Explorer toolbar.

    Module Explorer toolbar

  4. Next, click the green arrow which appears adjacent to the red square.

Debugging

Setting breakpoints

Breakpoints can be set in the editor for .os object source files, ad hoc scripts and script features. To set a breakpoint,

  1. Double-click in the margin at the desired line.

  2. When you run the script, or otherwise execute that line of code, you will be prompted to switch to the "Debug Perspective" in Eclipse. Execution will have stopped at that line and you can continue to step through and otherwise evaluate the state of your code.

Debug Perspective

Evaluating variables

All current variables are listed in the Variables view in the Debug perspective.

Variables view

Clicking on the variable displays the current value in the pane below.

Any "Object" type variables (ie., those that can be an used in a '.' operator expression) can be expanded to inspect constituent features or values.

Variable values can be changed by clicking and editing their value in the Value column.

Debugging Weblingo

Weblingo files can be debugged like other source files.

NOTE: When setting a breakpoint in a weblingo file, ensure that the breakpoint is set in your module's html folder in your Content Server install directory, not in the copy that you may have in your source folder. Currently, Content Server only obeys breakpoints in its copy of Weblingo HTML files.

Notes

Handling Script Errors

Script errors are run time errors that may happen when executing OScript. When Content Server runs as a service, script errors are recorded in the trace-logs folder of the logs folder. The trace logs contain an error message and the complete stack trace of OScript functions that were called before the error happened.

When Content Server is running in CSIDE and a script error occurs, the script execution is suspended and CSIDE stops in the debugger at the location where the script error occurred. After confirming the error message in a popup dialog, the call stack and variables can be examined in the debugger to determine the reason for the script error.

To continue execution after a script error, click the Resume button (F8) of the debugger. After resuming the trace log file is written to the trace-logs folder and also to the Eclipse console.

Alternatively, CSIDE can be configured to continue execution when script errors occur. To activate this behavior, the run configuration of the Content Server instance needs to be updated. Open the run configuration via Run > Run Configurations... on the main menu bar. Locate the Content Server instance in the left panel and then de-activate the check box Break on Script Errors on the Content Server tab. Apply the changes, close the run configuration and restart Content Server using the Module Explorer. Script errors are now only recorded in the Error Log view and written to the trace-logs folder and the Eclipse console.

Run Configuration