Overview
This PowerLink is a tool designed for developers. It allows the details of system objects via an appropriate velocity template file. It also allows velocity templates being developed for other applications to be tested before they are deployed.
System requirements
The velocityInspector PowerLink is written for WebCT Vista 4.1.1 (or higher) and WebCT Campus Edition 6.1.1 (or higher). A list of dependencies is provided in the Installation section below.
Description
This tool allows a velocity template file to be uploaded and parsed by the velocity engine with the output being displayed in new browser window. The following WebCT objects are pre-defined and may be referenced from within the template:
- System - System properties (class java.utilProperties)
- Settings - proxy tool settings (class java.util.Map)
- Context - WebCT SSO context object (class com.webct.platform.sdk.security.authentication.module.WebCTSSOContext)
- Request - HTTP request object (class javax.servlet.http.HttpServletRequest)
- Session - current session value object (class com.webct.platform.sdk.context.gen.SessionVO)
- UserService - user service instance (class org.oscelot.webct.dao.UserService)
- User - current user value object (class org.oscelot.webct.dao.UserVO)
- LearningContextService - learning context service instance (class org.oscelot.webct.dao.LearningContextService)
- LearningContext - current learning context value object (class org.oscelot.webct.dao.LearningContextVO)
The LearningContext object can be used to obtain details of the term it is associated with and any members belonging to it. The UserService and LearningContextService objects can also be used to access details for other users and learning contexts.
Important note: the System properties include the WebLogic JNDI username and password for connecting to data sources. Thus, this tool should not be installed on a production server in order to protect the confidentiality of these values.
Installation
This PowerLink is installed in the same way as any other WebCT Vista 4+ PowerLink:
- Create a directory called velocityInspector in the deployablecomponents area of the WebCT domain directory on each application server (including the administration server for a cluster).
- Copy the velocityInspector.jar file into the velocityInspector directory.
- Copy the dependent library files (see below) into the same directory as the PowerLink or into the common directory so that it can be shared by other PowerLinks.
- Restart the WebCT service.
- Log into WebCT as serveradmin.
- In the Utilities, Settings area click on the link labelled velocityInspector module in the System Integration column.
- Enable the tool by selecting the radio button labelled True for the enable setting and click on the Save Values button at the bottom of the page.
- In the Utilities, PowerLinks Proxy Tools area click on the Add Proxy Tool button.
- Select velocityInspector module from the drop-down list and click on the Next button.
- Enter details as required in the boxes provided; for example:
- Proxy Tool Name: Velocity Inspector
- Version: 1.0
- Description: Parse a velocity template file.
- In the Utilities, Settings area click on the link labelled with the Proxy Tool Name entered in the previous step which should appear in the Tools column.
- Clear the tick in the Lock setting checkbox for the Enable Tool setting. Click on the Save Values button.
- Select the settings for the proxy tool again to enable the tool by default so that it is visible under the Add Content Link button within each section. Leaving it disabled will mean that Section Designers must enable the tool in each of their sections before it can be used.
The velocityInspector PowerLink depends upon the following Java library files:
- webctdao.jar
- org.apache.commons.fileupload
- velocity-dep-1.6-dev.jar
The velocity-dep-1.6-dev.jar is a development version of Velocity 1.6 which has yet to be released but is required as it includes a fix for a string resource loader bug. No issues have been found with this version but users may wish to be cautious about installing it on a production server. A copy of these dependent files (except for WebCTDAO) can be found in a separate download available from the OSCELOT project site (see below).
Configuration settings
This tool has no custom configuration settings.
Usage
The main page displayed when selecting this tool from with WebCT displays a form with a filename input box. The location of a velocity template file can be entered in this box, or located by clicking the Browse button. Click the Parse template file button to upload the file, parse it using the velocity engine and display the output in a new browser window. If no filename is specified then a default template file is parsed which displays the following information:
- System properties
- Proxy tool settings
- Request parameters
- WebCT SSO context object
- Current session value object
- Current subject value object
- Current user value object
- Current learning context value object
- Term object for the current learning context
- Members of the current learning context
The download file includes the following example templates:
- info.vm - a copy of the default template (see above)
- members.vm - details of each member of the current learning context
- lc_hierarchy.vm - details of each ancestor learning context and any learning groups belonging to the current learning context
As well as providing useful information, these template files also act as examples of how to prepare velocity templates. For further information refer to the Velocity User Guide.
Troubleshooting
If you experience any problems using this PowerLink try the following to trace the cause:
- inspect the webct.log file for any reported errors
- increase the logging level for com.spvsoftwareproducts to DEBUG either temporarily via serveradmin or more permanently via the log4j.properties file in the serverconfs directory.
Version history
Version | Date | Description |
---|---|---|
1.0.00 | 18 August 2008 | Initial release |
Licence
This work is written by Stephen Vickers and is released under a Creative Commons GNU General Public Licence. The velocityInspector PowerLink is available for download from OSCELOT where it is also possible to report bugs and submit feature requests.