Skip to content

Rendering Hook Example

Shane Argo edited this page Jan 10, 2018 · 2 revisions

Javascript Hacks utilises the RenderingHook Interface (blackboard.servlet.renderinghook.RenderingHook) in the bb-taglibs.jar file of the Blackboard API. This page briefly explains it usage.

Implementing the Interface

The interface defines two methods:

  • getKey()
  • getContent()

public String getKey()

The string this method returns determines where the content gets injected. Valid keys at the time of writing are:

  • tag.editModeViewToggle.start - injects just before the edit mode button on learning systems pages.
  • tag.learningSystemPage.start - injects just before the content on learning systems pages.
  • jsp.topFrame.start - injects into the top frame in the frameset (with the tabs)
  • jsp.frameset.start - injects into page containing the primary Blackboard iframes.
  • tags.globalNavPage.start - injects into any page that has the global navigation controls.
  • tag.course.breadcrumb.control - injects before the page breadcrumbs.

public String getContent()

This is the string that will be injected directly into the source of the page.

Example

Wiring it up: bb-manifest.xml

The extension must be registered in the bb-manifest.xml. This is done by adding an . E.g.:

Output

The content is injected directly into the page source:

Which is then interpreted by the browser:

Source Code

Download

Download a working example.

Getting it working

This example was created using NetBeans IDE, but is very simple should be relatively easy to get working in any development environment.

Blackboard TagLibs Library

The netbeans project file assumes that there is a directory at the same level as the project directory named systemlib-sp10 which includes a bb-taglibs.jar library from SP8 or above (probably SP10). E.g.: