IBM R1 manual Delivery server, Localizing page text

Page 33

specified with a value of “contentPage,” the returned value is stored in a pageContext object variable that can be referenced later in the page as a variable called “contentPage.” If no value is returned by the navigationControllerBean, the invalidForm.jsp page displays. Otherwise, the appropriate page for the current navigation mode in the application displays. The JSP include action determines which page to display by retrieving the contentPage attribute of the pageContext object variable, which was just set by the lms:navUtil tag.

Delivery server

The Delivery server has a framing JSP named delivery.jsp. This page contains resizable frames made up of the system.jsp, courseTree.jsp, courseTools.jsp, and activity.jsp files. Each JSP has a corresponding frameID value that is used by the doReloadFrame tag of the delivery-js tag library to determine how to populate a frame when it needs to be reloaded because of an action that occurred in another frame. The activity.jsp contains the activityTools.jsp and appropriate page content. Stepping through the source code of the delivery JSP illustrates how to perform standard JSP tasks, such as:

Including tag library descriptor files

Including JavaScript source code

Looking at the delivery.jsp source code also illustrates how the following tasks are handled by the Delivery server in particular:

Localizing page text

Populating a frameset in a JSP

Displaying errors to the user

Defining resizable frames

The source code for the delivery.jsp file is stored in the WEB-INF>classes>resources>ds directory.

Including tag library descriptor files

The page and taglib directives specify that the page contains Java code and that, like the adminTemplate.jsp, a Struts tag library is included, the Struts-bean.tld file. Unlike the adminTemplate, the delivery.tld and delivery-js.tld files are associated with the page, instead of the lms tag library.

<%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/WEB-INF/tld/delivery.tld" prefix="delivery" %> <%@ taglib uri="/WEB-INF/tld/delivery-js.tld" prefix="js" %> <%@ taglib uri="/WEB-INF/tld/Struts-bean.tld" prefix="bean" %>

Localizing page text

The title of the page is located in the DeliveryResources.properties file in the WEB- INF>classes>resources>ds>properties directory, which contains the following resource key:

ds.application.title= IBM Lotus Learning Management System

Note that the message tag that is being used to define the key to retrieve from the .properties file is using the “delivery” prefix. This indicates that the message tag resides in the delivery.tld file.

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title><delivery:message key="ds.application.title"/></title>

28 IBM Lotus Learning Management System Release 1 Customization Guide

Image 33
Contents Customization Guide Disclaimer Licensed Materials Property of IBMList of Trademarks Page Table of Contents Customization sets Creating a tabIndex 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 Editing an existing Help topic Replacing a context-sensitive 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 PagesAnatomy of a TLD file LMS JSP tag librariesServerNameWEB-INFtld Referencing the url tag in a JSP String formName = request.getParameterformNameDefining the url tag in the TLD file ServerNameWEB-INFclassescomlotuselearntaglib Rtexprvaluetrue/rtexprvalue Attribute TagLearning Management System server Anatomy of a JSPDefining a page as a JSP Localizing page content Including tag library descriptor filesReferencing 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 serverDisplaying errors to the user Script language=JavaScript src=js/delivery.js/scriptPopulating 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 JSPEditing existing JSP tags Changing the functionality of an individual JSPSpecifying the next page to display Canceling the submission of a form Submitting 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