When developing a web script, you may encounter an issue for which the solution is not
obvious. In this case, it is useful to step through the controller script code line by line to
pinpoint the cause of the issue.
The SkyVault content application server provides
a built-in JavaScript Debugger that can be applied to web scripts. It is a useful tool for
diagnosing the cause of issues and for stepping through the controller scripts of others to
learn how they have implemented capabilities and used SkyVault services.
Attention: If you are running SkyVault on Microsoft Windows as a Service then the
debugger may not display. A work around is to start SkyVault from the command line for
debugging purposes.
-
Log in:
- In your browser, enter: http://localhost:8080/alfresco/service/index
- If prompted, log in with the username admin and password admin.
-
Enable the JavaScript Debugger:
- Click Refresh Web Scripts on the Web Scripts Home page to ensure the Web Script Framework has cleared its caches.
- Click List Web Scripts.
- Click SkyVault JavaScript Debugger.
- Click Enable to launch the JavaScript Debugger in a separate window.
-
Invoke your web script:
- In your browser, enter: http://localhost:8080/alfresco/service/dir/Company%20Home
- Log in if required using username admin and password admin.
- If you see your web script's controller script inside the JavaScript Debugger window, you are ready to debug.
-
Debug the controller script:
- Click Step Over in the JavaScript Debugger to execute the currently highlighted line.
- Interrogate the value of the verbose variable by typing verbose in the Expression window of the JavaScript Debugger.
- Interrogate the value of the {folderpath} token by typing url.templateArgs.folderpath in the Expression window of the JavaScript Debugger.
-
Continue web script execution:
- Click Go in the JavaScript Debugger.
- If you see the output of your web script in the web browser, you have successfully used the JavaScript Debugger.