IBM R1 manual Anatomy of a TLD file, LMS JSP tag libraries, ServerNameWEB-INFtld

Page 25

a user makes a request or performs an action, the server handles the action, and then retrieves the appropriate JSP to display the response in HTML. You can find documentation defining the JSP 1.2 specification, on which the LMS JSPs are based, at http://java.sun.com/products/jsp/.

The servers in the LMS application display their responses to requests differently. The Learning Management System server displays its responses using either a popup JSP or a template JSP that provides additional formatting to the page, called the adminTemplate.jsp. The Delivery server displays its responses using a framing JSP called delivery.jsp. To step through the source code for these pages, see “The Anatomy of a JSP.”

LMS JSP tag libraries

The servers that host the LMS application support custom JSP tags from multiple JSP tag libraries. Each library has a tag library descriptor (TLD) file, which is an XML-formatted file that defines the attributes of the JSP tags in the library and the Java classes to call when each tag is encountered on a page.

The tag library descriptor files in the IBM Lotus LMS are named as follows:

IBM Lotus Learning Management System tag library descriptor files

Tag Library Name

Purpose:

lms.tld

Executes the basic functionality of the LMS application. Used by the JSPs in

 

every component of the LMS application.

Struts-bean.tld

Calls JavaBeans™ from a JSP. Based on the Struts architecture.

Struts-html.tld

Defines the basic HTML content of a JSP, such as button and checkbox elements.

 

Based on the Struts architecture.

Struts-logic.tld

Incorporates common programmatic logic into a JSP. Based on the Struts

 

architecture.

The Delivery and Offline Learning Client servers contain the following TLD files in addition to those listed above:

Tag Library Name

Purpose:

chat.tld

Executes the functionality used in conducting a live chat from within the

 

application.

delivery.tld

Defines the functionality specific to the delivery and offline servers, such as the

 

activity and course tools.

delivery-js.tld

Customizes the frames used to format the delivery and offline client

 

applications.

These TLD files are stored in the following directory:

[serverName]>WEB-INF>tld

where [serverName] is one of the following directory names:

“LMM”: Represents the Learning Management System server

“DS”: Represents the Delivery server

“DUC”: Represents the Offline Learning Client server

The anatomy of a TLD file

The tag library descriptor (TLD) file is a text file in XML format that defines the JSP tags used in an application. In this section we will look at one such JSP tag. The url tag is a tag that references a Uniform Resource Locator (URL). It belongs to the lms tag library and is defined in the lms.tld file.

This section illustrates how to:

Reference a tag in a JSP

Define a tag in the TLD file

20 IBM Lotus Learning Management System Release 1 Customization Guide

Image 25
Contents Customization Guide Licensed Materials Property of IBM DisclaimerList of Trademarks Page Table of Contents Creating a tab Customization setsIndex Customizing the user interface Acronyms and abbreviations Disclaimer and a word about conventionsAcronym or What it stands for Abbreviation Page Changing settings Chapter Changing settings through the user interface or XMLPage To add a role to the system Chapter Controlling access to features through permissionsTo assign a role to a user To modify permissions settings for an existing roleTo automatically assign a role to a user To explicitly assign a role to a userControlling access to features Page Anatomy of a Help topic Chapter Customizing HelpScript Background-repeat repeat-x Mosaic-bgScript Head Replacing a context-sensitive Help topic Editing an existing Help topicLmsform action=/prefSubmit.do % Adding your own Help topic HREF=shenrolled.html target=topEnrolled courses/Abr HREF=shnotifications.html target=topNotifications/AbrOverview Chapter Customizing JavaServer PagesLMS JSP tag libraries Anatomy of a TLD fileServerNameWEB-INFtld String formName = request.getParameterformName Referencing the url tag in a JSPDefining the url tag in the TLD file ServerNameWEB-INFclassescomlotuselearntaglib Rtexprvaluetrue/rtexprvalue Attribute TagAnatomy of a JSP Learning Management System serverDefining a page as a JSP Including tag library descriptor files Localizing page contentReferencing Struts tags Including the JSPs that comprise the main template Including JavaScript source codeLogicnotPresent LogicnotMatch Td class=formBoxTitleBg colspan=3 valign=middle nowrapDiv class=formBoxPositionInner DivLogicpresent LogicnotPresent logicpresent name=invalidFormLocalizing page text Delivery serverScript language=JavaScript src=js/delivery.js/script Displaying errors to the userPopulating a frameset in a JSP Defining resizable frames Frameset Html Making global changesChanging the application style Applying customization setsServerNamecsslanguageCodebrowserType Editing existing CSS filesLanguage-version Browser-versionReplacing CSS files Adding your own CSS filesChanging the font size or font style of the application @import urlmyStyles.cssServerNameWEB-INFclassesresourcesserverNameproperties Updating page textApplication.title = IBM Lotus Learning Management System Titlelmsmessage key=application.title //titleAdding and replacing graphics Lmslinklmsimg src=images/name.gif… //lmslinkLearning Management System server Replacing the application logoImage.alt.logo = IBM Lotus Learning Management System Delivery serverReplacing a reference to a CSS style Changing individual JSPsDeliverylogoURL resource=images/myCompanyLogo.gif Changing the style of an individual JSPChanging the functionality of an individual JSP Editing existing JSP tagsSpecifying the next page to display Submitting a form Canceling the submission of a formEditing form Bean values with the lmshidden tag Lmshidden name=%=formName% property=unmodifiedKeywords Removing JSP tagsLmshidden property=userEvent Custom fieldsIt then checks to see if its a text box type field LogicnotPresent Logicequal Page Customizing user searches Chapter Customizing SearchAdding Ldap attributes to User Search pages Attribute name=HealthPlanChoice type=java.lang.StringRemoving fields from User Search pages HealthPlanChoice = Employees Health PlanCustomizing course management and resource searches Customizing Offerings Catalog searchesAdding custom fields to the Offerings Catalog Removing fields from Offerings Search pagesRemoving fields from the Search pages Creating a customization set Chapter Customization setsLMM De en Etc De en etc. SalesCSPage Attribute Name Type Modified Size Path Customization sets Page Users Chapter Creating a tab@ taglib uri=/WEB-INF/tld/lms.tld prefix=lms % Users.jspTd width=1 valign=top Page Users.rosterUsers.subtitle = Roster Users Navigation.xml Users.rosterUsers.search.confirm Users.rosterUsers.searchTrail TrailManageRoles TrailTrail TrailManageProfiles Trail TrailManageUsersName tag page names and resourced text Content tag JSP file namesTarget tag struts action-mapping Label tag breadcrumbsUsers.rosterUsers.search.confirm Title tag title bar text Adding custom permissionsPermissions tag permission to display HelpPage tag context-sensitive HelpOid UpdatetimeName Permid0000000000000000PERM 0000000000003000PERM 0000000000009300PERM Copy the JSPs ExamplePage Creating a tab END Index Content Area Creating a tab Div Second linked page customGoodbye.jsp looks like this Page Create Help files Customtab.htmlCustomtabb.html Select Maxpermid from Permission Add permissions to the LMS databaseEdit ApplicationResources.properties Navigation Edit navigation.xmlAssign permissions Namestudenthome/nameCreating a tab Page Index