IBM R1 manual Titlelmsmessage key=application.title //title, Adding and replacing graphics

Page 41

A number of the tags in the lms custom tag library, such as the button or img tags, contain attributes that reference .properties file entries to supply language-specific text on the page. One tag, the message tag, is specifically designed to retrieve .properties file entries. For example, the title of the adminTemplate.jsp is supplied using the message tag. Instead of defining its title as <title>IBM Lotus Learning Management System</title>, the adminTemplate.jsp specifies the content of the HTML title tag as follows:

<title><lms:message key="application.title" /></title>

<lms:message … /> contains the backend code that looks up the string value to display on the page. The key attribute of the message tag, key=”application.title,” defines the resource key in the

.properties file to retrieve. In this example, the resource key to retrieve is the application.title resource key. At request time, the server executes the Java code specified in the message tag, it determines which .properties file to associate with the current browser, and then retrieves from it the resource key supplied by the key attribute. Since the ApplicationResource.properties file contains the following resource key:

application.title = IBM Lotus Learning Management System

the title that displays on the adminTemplate JSP is “IBM Lotus Learning Management System.” Using the message tag, you enable the application to dictate which text to display. For example, the .properties file could supply the title in Spanish if the locale code specified by the browser request is the Spanish language code “es.” In this case, the application retrieves the application.title resource key from the ApplicationResource_es.properties file which can be set up to contain a Spanish-language version of the title.

You can edit existing .properties file entries or add new entries to existing files. Any changes you make to .properties file entries are reflected in any JSPs that references those entries.

To edit page text:

1.Open the .properties file for the language code you want to edit from the WEB- INF>classes>resources>[serverName]>properties directory in a text editor.

If you are editing .properties files in a customization set, open the .properties file from the [serverName]>WEB-INF>classes>resources>[serverName]>customSetName>properties instead. See “Applying customization sets.”

2.Edit the resource key you want to change, then save and close the file.

3.Ask the server administrator to refresh the file on the server. Your changes are not visible until this step is completed.

Adding and replacing graphics

You can add or replace the default graphics that display in the LMS application with your own custom graphics files.

To add graphics:

1.Add a new image file by copying it into the [serverName]>images directory.

If you are adding a graphics file to a customization set, copy it to the [serverName]>customSetName>images directory. See “Creating a customization set.”

2.Rewrite any references to the old file name with the new graphic file name.

For example, if the new graphic file is called userName.gif, you can replace the following tag:

<lms:link><lms:img src=”images/name.gif”… /></lms:link>

with:

<lms:link><lms:img src=”images/userName.gif” … /></lms:link>

36 IBM Lotus Learning Management System Release 1 Customization Guide

Image 41
Contents Customization Guide List of Trademarks DisclaimerLicensed Materials Property of IBM Page Table of Contents Index Customization setsCreating a tab 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 Lmsform action=/prefSubmit.do % Editing an existing Help topicReplacing a context-sensitive Help topic Adding your own Help topic HREF=shenrolled.html target=topEnrolled courses/Abr HREF=shnotifications.html target=topNotifications/AbrOverview Chapter Customizing JavaServer PagesServerNameWEB-INFtld Anatomy of a TLD fileLMS JSP tag libraries Defining the url tag in the TLD file Referencing the url tag in a JSPString formName = request.getParameterformName ServerNameWEB-INFclassescomlotuselearntaglib Rtexprvaluetrue/rtexprvalue Attribute TagDefining a page as a JSP Learning Management System serverAnatomy of a JSP Referencing Struts tags Localizing page contentIncluding tag library descriptor files 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 serverPopulating a frameset in a JSP Displaying errors to the userScript language=JavaScript src=js/delivery.js/script 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 JSPSpecifying the next page to display Editing existing JSP tagsChanging the functionality of an individual JSP Editing form Bean values with the lmshidden tag Canceling the submission of a formSubmitting a form 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