Overview
This Building Block provides a module which displays the contents of the user's MyWebCT page and allows them to log into WebCT using a single sign-on (SS0) mechanism. In addition to a login button, the following components of the MyWebCT page can be displayed:
- Enrolments
- Announcements
- Bookmarks
- Calendar
- External courses
- Grades
- Notepad
System requirements
The B2WebCT Building Block is written for Blackboard Learn 9.0 (or higher). It requires the Community System to be licensed for the Blackboard Learn server. It includes the following dependent Java library files:
- b2context.jar, release 1.0.04 (or higher)
- org.apache.commons.httpclient
- org.jdom
Installation
This Building Block is installed by a Learn 9 system administrator in the same way as other Building Blocks. The following attribute privileges are required to be approved when making the Building Block active:
Type | Name | Action |
---|---|---|
java.net.SocketPermission | * | connect |
The Building Block uses web requests to the System Integration API Standard Adapter to obtain details of a user's MyWebCT page and to log them into WebCT. The GLCID and shared secret configuration settings (see below) should be identical to the settings from the WebCT server. For further details refer to the following WebCT documentation:
- System Integration Utility Guide - see the mywebct_xml API command in the section on "Exporting My Blackboard Contents"
- Automatic Signon Protocol - see the sections on "Configuring System Integration API Settings" and "Configuring Automatic Signon Settings"
Configuration settings
Click on the Settings button against the Building Block entry on the Installed Tools page from the System Admin tab. Textual default settings are dependent on the current language pack and so may differ from those specified below.
WebCT server
Name | Required? | Default value | Description |
---|---|---|---|
URL of WebCT server | Yes | Enter the URL for the WebCT server (e.g. http://www.webct.server.edu) | |
Institution GLCID | No | Enter the GLCID of the WebCT institution to connect to (leave blank to use the default setting configured in WebCT) | |
Shared secret: | Yes | Secret for the WebCT System Integration API Standard Adapter | |
Use MAC2? | Yes | Tick this box to use a MAC2 rather than a MAC to secure the connections to the WebCT server | |
Source field for WebCT username | Yes | Username | Select the field in which the WebCT username is stored in Learn 9; this may be the username, the student ID or the Batch UID |
Timeout | Yes | 30 | Timeout period in seconds for requests to the WebCT server for a user's MyWebCTXML details |
XML cache
Name | Required? | Default value | Description |
---|---|---|---|
Cache age | Yes | 0 | The number of minutes before which a new copy of a user's XML is requested from the WebCT server (0 will disable the cache) |
Cache size | Yes | 0 | The maximum number of entries permitted in the cache (0 will disable the cache) |
Course components
Display settings
The following settings apply to each course component:
Name | Default value | Description |
---|---|---|
Display by default? | No | |
Allow user to override? | No | Whether the user can override the display setting |
Hide when empty? | No | Whether the section is omitted completely if there is nothing to display |
Apply default XSL? | Yes | This setting is disabled when no customised XSL has been entered |
The order in which course components are displayed can be changed by dragging the rows to the required position; changes are only saved when clicking on the Submit button. Tick the Users can change order? box to allow users to change the order themselves. The default XSL (see below) can be customised via the action menu against the component name.
Login button settings
Name | Required? | Default value | Description |
---|---|---|---|
Login button text | Yes | Launch MyWebCT page | Enter the text to display on the login button |
Open WebCT in a new window? | Yes | Yes | Tick this box to have WebCT opened in a new browser window |
Name of new window | No | Name to use for the new window (leave blank for none) | |
Features for new window | No | toolbar=no,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes | Window features to pass to the JavaScript window.open method |
Enrolment settings
Name | Required? | Default value | Description |
---|---|---|---|
Login link title | Yes | Launch WebCT section | Enter the text to use as the title for login links |
Sort by term? | Yes | No | Tick this box to have enrolments sorted by term |
Terms to open by default | No | List all the terms (separated by commas) to be opened in the display by default | |
Default term name | Yes | No term | Name of term to use for sections not allocated to a term |
Sort order | Yes | Ascending | Enrolments may be sorted in ascending or descending order |
Default XSL
The display rendered by the module is made up of the output from parsing the XSL file for each of the course components to be included (in the selected order and enclosed in a div tag). The following parameters are available for passing to each XSL file:
- bb_base - URL of the Learn 9 server
- webct_base - URL of the WebCT server
- loginButton - text to display on the login button
- target - name of the target window for login links (optional)
- windowFeatures - features to be applied to a new window opened for WebCT (optional)
- loginTitle - title setting to apply to login links
- sortByTerm - its existence indicates that sections should be sorted by term
- openTerms - names of terms to expand by default (optional)
- unnamedTerm - name to use for sections which have not been allocated to a term
- enrollmentSortOrder - order of terms or sections (ascending or descending)
The default XSL used by each of the components making up the module display is given below.
- login:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="bb_base" />
<xsl:param name="loginButton" />
<xsl:param name="newWindow" />
<xsl:param name="target" />
<xsl:param name="windowFeatures" />
<xsl:template match="/">
<div style="margin: 2px; padding-top: 5px; padding-bottom: 5px; text-align: center;">
<xsl:choose>
<xsl:when test="$newWindow">
<a href="" alt="Launch myWebCT page" onclick="JavaScript: var w=window.open('{$bb_base}login','{$target}','{$windowFeatures}'); w.focus(); return false;" class="genericButton"><xsl:value-of select="$loginButton" /></a>
</xsl:when>
<xsl:otherwise>
<a href="{$bb_base}login" alt="Launch myWebCT page" class="genericButton"><xsl:value-of select="$loginButton" /></a>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
</xsl:stylesheet> - enrolments:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="bb_base" />
<xsl:param name="webct_base" />
<xsl:param name="hideEmpty" />
<xsl:param name="loginTitle" />
<xsl:param name="newWindow" />
<xsl:param name="target" />
<xsl:param name="windowFeatures" />
<xsl:param name="sortByTerm" />
<xsl:param name="openTerms" />
<xsl:param name="unnamedTerm" />
<xsl:param name="enrollmentSortOrder" />
<xsl:template match="homearea">
<xsl:apply-templates select="enrollment_list" />
</xsl:template>
<xsl:template match="enrollment_list">
<xsl:if test="not($hideEmpty) or not(noCourses)">
<h3><xsl:value-of select="title" /></h3>
<xsl:choose>
<xsl:when test="noCourses">
<p style="background-image: url('{$bb_base}images/info.png'); background-attachment: scroll; background-position: 10px; background-repeat: no-repeat; padding-top: 10px; padding-bottom: 10px; padding-left: 30px;">
<xsl:value-of select="noCourses" />
</p>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:choose>
<xsl:when test="$sortByTerm">
<ul class="portletList-img">
<xsl:for-each select="enrollment[not(lctxt/termDescription=preceding::*/termDescription)]">
<xsl:sort select="lctxt/termDescription" order="{$enrollmentSortOrder}" />
<li><a href="#" onclick="JavaScript: var el=document.getElementById('div{generate-id()}'); el.style.display=(el.style.display=='none')?'block':'none'; imgName=(el.style.display=='none')?'expand':'colapse'; document.getElementById('img{generate-id()}').src='/images/ci/icons/menu_'+imgName+'_all_li.gif'; return false;"><img alt="Click to expand/collapse" src="/images/ci/icons/menu_expand_all_li.gif" width="12" height="12" id="img{generate-id()}" /></a><xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="lctxt/termDescription != '--'">
<xsl:value-of select="lctxt/termDescription" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$unnamedTerm" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="contains(concat(',',$openTerms,','),lctxt/termDescription)">
<div id="div{generate-id()}">
<ul class="portletList-img">
<xsl:for-each select="../enrollment[lctxt/termDescription = current()/lctxt/termDescription]">
<xsl:sort select="lctxt/text1" />
<xsl:apply-templates select="current()" />
</xsl:for-each>
</ul>
</div>
</xsl:when>
<xsl:otherwise>
<div id="div{generate-id()}" style="display: none;">
<ul class="portletList-img">
<xsl:for-each select="../enrollment[lctxt/termDescription = current()/lctxt/termDescription]">
<xsl:sort select="lctxt/text1" />
<xsl:apply-templates select="current()" />
</xsl:for-each>
</ul>
</div>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</xsl:when>
<xsl:otherwise>
<ul class="portletList-img">
<xsl:apply-templates select="enrollment">
<xsl:sort select="lctxt/text1" order="{$enrollmentSortOrder}" />
</xsl:apply-templates>
</ul>
</xsl:otherwise>
</xsl:choose>
</div>
<xsl:if test="hiddenCoursesText">
<p style="background-image: url('{$bb_base}images/warning.png'); background-attachment: scroll; background-position: 10px; background-repeat: no-repeat; padding-top: 10px; padding-bottom: 10px; padding-left: 30px;">
<xsl:value-of select="hiddenCoursesText" />
</p>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="enrollment">
<li><img alt="" src="/images/ci/icons/bookopen_li.gif" width="12" height="12" /><xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="$newWindow">
<a href="#" onclick="JavaScript: var w=window.open('{$bb_base}login?url={lctxt/href1}'.replace('&','%26'),'{$target}','{$windowFeatures}'); w.focus(); return false;" title="{$loginTitle}"><xsl:value-of select="lctxt/text1" /></a>
</xsl:when>
<xsl:otherwise>
<a href="{$bb_base}login?url={substring-before(lctxt/href1, '&')}%26{substring-after(lctxt/href1, '&')}" title="{$loginTitle}"><xsl:value-of select="lctxt/text1" /></a>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="icon" /><br />
<xsl:text> </xsl:text><img alt="" src="/images/ci/icons/priority_normal.gif" width="12" height="12" /><xsl:value-of select="lctxt/alt1" /></li>
</xsl:template>
<xsl:template match="icon">
<img src="{$webct_base}{src}" alt="{alt}" title="{alt}" />
</xsl:template>
</xsl:stylesheet> - announcements:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="bb_base" />
<xsl:param name="hideEmpty" />
<xsl:template match="homearea">
<xsl:apply-templates select="campusAnnouncements" />
</xsl:template>
<xsl:template match="campusAnnouncements">
<xsl:if test="not($hideEmpty) or not(empty)">
<h3><xsl:value-of select="title" /></h3>
<xsl:choose>
<xsl:when test="empty">
<p style="background-image: url('{$bb_base}images/info.png'); background-attachment: scroll; background-position: 10px; background-repeat: no-repeat; padding-top: 10px; padding-bottom: 10px; padding-left: 30px;">
<xsl:value-of select="empty" />
</p>
</xsl:when>
<xsl:otherwise>
<ul class="portletList-img">
<xsl:apply-templates select="announcement" />
</ul>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="announcement">
<li><img alt="" src="/images/ci/icons/announcement_li.gif" width="12" height="12" /><xsl:text> </xsl:text><xsl:value-of select="text" /></li>
</xsl:template>
</xsl:stylesheet> - bookmarks:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="bb_base" />
<xsl:param name="hideEmpty" />
<xsl:template match="homearea">
<xsl:if test="not($hideEmpty) or not(campusbookmarks/empty and mybookmarks/empty)">
<xsl:apply-templates select="campusbookmarks" />
<xsl:apply-templates select="mybookmarks" />
</xsl:if>
</xsl:template>
<xsl:template match="campusbookmarks|mybookmarks">
<xsl:choose>
<xsl:when test="bookmark">
<h3><xsl:value-of select="title" /></h3>
<ul class="portletList-img">
<xsl:apply-templates select="bookmark" />
</ul>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="bookmark">
<li><img alt="" src="/images/ci/icons/globe_li.gif" width="12" height="12" /><xsl:text> </xsl:text><a href="{url}" target="_blank"> <xsl:value-of select="text" /></a></li>
</xsl:template>
</xsl:stylesheet> - calendar:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="bb_base" />
<xsl:param name="hideEmpty" />
<xsl:template match="homearea">
<xsl:apply-templates select="calendar_week" />
</xsl:template>
<xsl:template match="calendar_week">
<xsl:if test="not($hideEmpty) or not(noEvents)">
<h3><xsl:value-of select="title" /></h3>
<xsl:choose>
<xsl:when test="noEvents">
<p style="background-image: url('{$bb_base}images/info.png'); background-attachment: scroll; background-position: 10px; background-repeat: no-repeat; padding-top: 10px; padding-bottom: 10px; padding-left: 30px;">
<xsl:value-of select="noEvents" />
</p>
</xsl:when>
<xsl:otherwise>
<ul class="portletList-img">
<xsl:apply-templates select="day" />
</ul>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="day">
<li><a href="#" onclick="JavaScript: el=document.getElementById('div{generate-id()}'); el.style.display=(el.style.display=='none')?'block':'none'; imgName=(el.style.display=='none')?'expand':'colapse'; document.getElementById('img{generate-id()}').src='/images/ci/icons/menu_'+imgName+'_all_li.gif'; return false;"><img alt="Click to expand/collapse" src="/images/ci/icons/menu_expand_all_li.gif" id="img{generate-id()}" /></a><xsl:text> </xsl:text><xsl:value-of select="date" />
<div id="div{generate-id()}" style="display: none;">
<ul class="portletList-img">
<xsl:for-each select="entry">
<li><img alt="" src="/images/ci/icons/calendar_li.gif" width="12" height="12" /><xsl:text> </xsl:text><xsl:value-of select="." /></li>
</xsl:for-each>
</ul>
</div>
</li>
</xsl:template>
</xsl:stylesheet> - external courses:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="bb_base" />
<xsl:param name="hideEmpty" />
<xsl:template match="homearea">
<xsl:apply-templates select="externalCourses" />
</xsl:template>
<xsl:template match="externalCourses">
<xsl:if test="not($hideEmpty) or not(empty)">
<h3><xsl:value-of select="title" /></h3>
<xsl:choose>
<xsl:when test="empty">
<p style="background-image: url('{$bb_base}images/info.png'); background-attachment: scroll; background-position: 10px; background-repeat: no-repeat; padding-top: 10px; padding-bottom: 10px; padding-left: 30px;">
<xsl:value-of select="empty" />
</p>
</xsl:when>
<xsl:otherwise>
<ul class="portletList-img">
<xsl:apply-templates select="course" />
</ul>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="course">
<li><img alt="" src="/images/ci/icons/task_li.gif" width="12" height="12" /><xsl:text> </xsl:text><a href="{url}" target="_blank"> <xsl:value-of select="text" /></a></li>
</xsl:template>
</xsl:stylesheet> - grades:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="bb_base" />
<xsl:param name="hideEmpty" />
<xsl:template match="homearea">
<xsl:apply-templates select="myGrades" />
</xsl:template>
<xsl:template match="myGrades">
<xsl:if test="not($hideEmpty) or not(textNoGrades)">
<h3><xsl:value-of select="title" /></h3>
<xsl:choose>
<xsl:when test="textNoGrades">
<p style="background-image: url('{$bb_base}images/info.png'); background-attachment: scroll; background-position: 10px; background-repeat: no-repeat; padding-top: 10px; padding-bottom: 10px; padding-left: 30px;">
<xsl:value-of select="textNoGrades" />
</p>
</xsl:when>
<xsl:otherwise>
<ul class="portletList-img">
<xsl:apply-templates select="courseSectionGrades" />
</ul>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="courseSectionGrades">
<li><img alt="" src="/images/ci/icons/grades_li.gif" width="12" height="12" /><xsl:text> </xsl:text><xsl:value-of select="courseName" /> - <xsl:value-of select="sectionName" />: <xsl:value-of select="gradeItem/gradeName" /></li>
</xsl:template>
</xsl:stylesheet> - notepad:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xhtml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="bb_base" />
<xsl:param name="hideEmpty" />
<xsl:template match="homearea">
<xsl:apply-templates select="notepad" />
</xsl:template>
<xsl:template match="notepad">
<xsl:if test="not($hideEmpty) or not(empty)">
<h3><xsl:value-of select="title" /></h3>
<xsl:choose>
<xsl:when test="empty">
<p style="background-image: url('{$bb_base}images/info.png'); background-attachment: scroll; background-position: 10px; background-repeat: no-repeat; padding-top: 10px; padding-bottom: 10px; padding-left: 30px;">
<xsl:value-of select="empty" />
</p>
</xsl:when>
<xsl:otherwise>
<ul class="portletList-img">
<xsl:apply-templates select="item" />
</ul>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="item">
<li><img alt="" src="/images/ci/icons/task_li.gif" width="12" height="12" /><xsl:text> </xsl:text><xsl:value-of select="priority" /> - <xsl:value-of select="text" /></li>
</xsl:template>
</xsl:stylesheet>
Usage
The B2WebCT Building Block module is configured from the System Admin tab.
A sample display is shown below which is set to force the display of the login button for all users.
The module may be displayed on any Module page; its contents will replicate the user's MyWebCT page for those
components which have been selected. A sample display is shown below.
The above display is based on the following user customisation which does not include the External courses
component and displays the Grades component even when it is empty.
Troubleshooting
If you experience any problems using this Building Block try the following to trace the cause:
- check the webserver.log file to ensure the mywebct_xml and autosignon requests are being received by the WebCT server
- inspect the webct.log file for any reported errors
- ensure the configuration settings are correct and, where applicable, are consistent with the values entered on the WebCT server
- ensure that the correct source of a user's WebCT ID has been set in the configurations settings
Version history
Version | Date | Description |
---|---|---|
1.0.0 | 3 October 2010 | First public release |
1.0.1 | 4 October 2010 | Fixed permissions issue with Learn 9.1 Improved CSS |
1.0.2 | 12 October 2010 | Fixed SSO bug when GLCID is not specified Fixed error in URL for opening a WebCT section in the same window |
1.0.3 | 16 October 2010 | Added Swedish language translation (courtesy of Linnaeus University) Minor page format changes |
1.0.4 | 26 October 2010 | Added caching of XML retrieved from WebCT server Fixed error in enrolments XSL when a user has hidden courses |
1.0.5 | 27 October 2010 | Handle named changed to lowercase (b2webct) Cosmetic changes to XMLcache class |
1.0.6 | 6 November 2010 | Replaced stylesheet with style parameters to HTML elements to workaround IE issue when loading the module asynchronously Amended JavaScript for IE issues Corrected retrieval of XML cache age setting |
1.0.7 | 6 August 2011 | Added timeout for MyWebCTXML requests as a configuration setting |
Licence
This work is written by Stephen Vickers and is released under a Creative Commons GNU General Public Licence. The Swedish translation has been provided courtesy of Linnaeus University. The B2WebCT Building Block is available for download from OSCELOT where it is also possible to report bugs and submit feature requests.