Professional Documents
Culture Documents
Authors:
Contents
OVERVIEW............................................................................................................................................................4
INTRODUCTION..................................................................................................................................................................4
DURATION...........................................................................................................................................................................5
LAB 1 THEME CUSTOMIZATION....................................................................................................................................6
1.1 CREATE THEME DEVELOPMENT PAGE.........................................................................................................................6
1.2 CREATE CUSTOM THEME................................................................................................................................................9
1.3 INVESTIGATE DYNAMIC CONTENT SPOTS..................................................................................................................20
1.4 CHANGING THE PAGE LOGO.........................................................................................................................................24
1.5 CREATING CUSTOM STYLES.........................................................................................................................................29
1.6 THEME PROFILES............................................................................................................................................................42
1.7 THEME MODULES............................................................................................................................................................47
APPENDIX A NOTICES.............................................................................................................................................................52
APPENDIX B TRADEMARKS AND COPYRIGHTS..................................................................................................................54
Overview
In IBM WebSphere Portal, themes allows you to customize the overall look and feel of the page. In
addition to themes, skins allows you to customize the decoration around individual portlets on a page.
This lab will focus on themes, but the knowledge and concepts you learn will also apply to the
customization of skins.
Modern websites and browsers enable incredible new capabilities that can greatly enhance your user's
web experiences. However, these capabilities are not without cost in terms of large page sizes and more
process in the browser when each page is rendered. These capabilities are worth it when you need
them, but removing them for an entire site or including them only on pages that take advantage of these
capabilities provides for more flexibility.
The new WebSphere Portal modularized theme provides a flexible framework that:
Minimizes download size by giving you the control to specify just the capabilities
that are needed for a certain scenario or use case.
Minimizes the number of requests by combining necessary resources.
Previous themes required a monolithic design and that the same content was downloaded for every
page. Theme optimization allows the theme to be highly adaptive to the content you are displaying on
certain pages. For example, on pages where only simple content is displayed you can define a
lightweight profile. A lightweight profile causes the system to download few static resources such as
JavaScript and CSS files. However, on pages where more advanced scenarios are required you can
choose to switch to a more powerful profile that causes more resources to download than on the other
pages. This way you have only the capabilities you need on certain pages, but all other pages do not
pay the penalty. As a result the overall system performance increases significantly.
Theme optimization uses modules and profiles to achieve the flexibility that allows you to achieve better
performance. Modules are the components of the new theme that define capabilities. Examples are
Tagging&Rating, Dojo, or jQuery. Profiles define sets of modules which can be assigned per page. A
default profile is used if no page-specific profile is defined.
By applying these concepts it is possible to turn on and off an arbitrary number of features for certain
pages, develop modules independent of each other for greater development speed and flexibility, easily
add new capabilities later on into an existing theme and build an altogether new theme with the existing
one. This building block concept allows the new theme to work side by side through self contained
modules without risking the existing theme.
Introduction
In this lab you will learn how to customize the look-and-feel of the portal page. This will include the
following:
Please note that the lab has been written for all persons to complete. However, in order to gain
full benefits, some web design knowledge would be beneficial. This includes an understanding
of HTML, Style Sheets (CSS), and JavaScript.
Duration
You should be able to complete this lab in approximately 60 minutes.
__2. Click on the CTC Demo link located towards the top of the page:
__3. Click the Edit Mode link to switch from view mode to edit mode.
__5. Enter ThemeDev as the page name and ThemeDev as the friendly URL name. Select
Standalone Topic as the page template to base this new page on, and click Create.
__6. Click the Save button (located in the top right corner of the page) to save the changes.
__7. Click the View Mode link to switch from edit mode to view mode.
__8. Complete the following steps to shorten the rich text content on the page. (This makes is easier
later when you want to move portlets around on the page for testing.)
__a. Move the mouse over the sample rich text content and click on the Edit icon.
__b. Scroll down to the Body section. Use the rich text editor to shorten the text to just a few
lines.
__c. Click on Save and then Save and Publish button. Click on the Close button.
__1. Complete the following steps to setup the AnyClient WebDAV client: Ignore update message for
newer version.
__d. Click the Rename button and enter themelist as the new site name.
__e. Select WebDav as the protocol to use. Then enter the remaining values:
Host : http://portalww.demos.ibm.com:10039/wps/mycontenthandler/dav/themelist
Username : wpadmin
Password : passw0rd
Local Dir : /root/Desktop
__f. Verify your new site appears as follows and then click the Save button to save.
__h. Click the Rename button and enter fs-type1 as the new site name.
__i. Select WebDav as the protocol to use. Then enter the remaining values:
Host : http://portalww.demos.ibm.com:10039/wps/mycontenthandler/dav/fs-type1
Username : wpadmin
Password : passw0rd
Local Dir : /root/Desktop
__j. Verify your new site appears as follows and then click the Save button to save.
__2. Select the themelist site and click the Connect button.
IMPORTANT
__3. The AnyClient interface allows you to move files between the Local System and the Remote
System (which in this case is the Portal Server). Highlight the ctc.80 folder that is listed under
Remote System and click the green arrow to copy it to your local desktop.
__4. WAIT until you see a File Transfer Complete message. (The transfers progress bar may not
always be accurate.) This may take 1-2 minutes.
I M P O R T A N T !!
__5. Go to your desktop. Rename the copied folder from ctc.80 to ctcCustom.
__7. Open the ctcCustom\metadata\localized_en.properties file in a text editor, and change the
title property value to CTC Custom Theme. Save and close the file.
__8. Open the ctcCustom\theme.html file in a text editor. Locate the <body> tag and insert the
following line immediately afterwards:
<div>ctcCustomTheme</div>
IMPORTANT!
In the case of the out-of-box Portal V8 Theme, you will see lines similar
to the following in it's theme.html file:
This indicates that when the browser is using the English language,
then the theme_en.html file located within the nls directory will be used.
This means, that if you want makes changes that affect all languages,
then you have multiple files to update.
__9. Navigate to AnyConnect Client. Complete the following steps to use the AnyConnect client to
copy the entire ctcCustom folder from your local desktop into the WebDAV Themelist directory:
__a. Click the refresh toolbar button to update the local system directory listing.
__b. Highlight the ctcCustom folder that is listed under Local System and click the green
arrow to copy it to the themelist directory on the Portal server.
NOTE: If you are prompted that a metadata.properties file already exists, choose the
option to copy and replace (you want to use the version of the file that was previously
updated and not the system generated version).
__c. WAIT until you see a File Transfer Complete message. (The transfers progress bar
may not always be accurate.) This may take 1-2 minutes.
__d. Verify that the ctcCustom folder now appears under the Remote System themelist
directory.
__10. From the web browser, navigate to Administration-->Themes and Skins page. (If needed,
open a browser window, go to http://portalww.demos.ibm.com:10039/wps/portal and login
as wpadmin/passw0rd). Observe your new theme appears in the list of installed themes:
__11. Complete the following steps to update your ThemeDev page to use this newly created theme:
__b. Click the Edit Mode link to switch from view mode to edit mode.
__c. Move your mouse into the Page Properties section and click the edit link (as shown in
the figure below):
__d. From the Page Properties dialog window, go to the Advanced tab. Select CTC Custom
Theme as the theme and click Save.
__e. Click on View Mode to switch from edit mode to view mode.
__f. Observe the ThemeDev page is now using the new theme, as indicated by the small
message that was inserted at the top of the page:
NOTE: Use the folder that you saved on your local desktop. Opening files directly on the
WebDAV drive is also supported, but its performance is dependent on the WebDAV client being
used.
__2. Observe that this is a static HTML file that contains the typical HTML elements and CSS class
attributes. Also observe that HTML tags are also used to specify dynamic content spots, where
dynamic content will be inserted during runtime (as shown in the figure below). When done
reviewing the HTML, close the ctcCustom\theme.html file.
__7. Search for the 80theme_topNav property. (This is the name of the dynamic content spot
previously mentioned.) Observe that the property points to the navigation.jsp file (along with
some parameters that are passed in the URL).
__8. (Optional) As described in the WebSphere Portal InfoCenter, the out of box WebSphere Portal
dynamic resources for themes are located within the C:\IBM\WebSphere\PortalServer\theme\
wp.theme.themes\default80\installedApps\DefaultTheme80.ear\DefaultTheme80.war\themes
directory. As such, if you would like to see the contents of the navigation.jsp file, open the
following file in a text editor:
C:\IBM\WebSphere\PortalServer\theme\wp.theme.themes\default80\installedApps\Default
Theme80.ear\DefaultTheme80.war\themes\html\dynamicSpots\navigation.jsp
Close the file when you are finished reviewing. Do NOT make any changes to this file.
I M P O R T A N T!
__9. Click the Logout link in the upper right corner of the browser window to logout from the
WebSphere Application Server Integration Solutions Console.
__10. (Optional) As previously mentioned in the beginning of this section, the second way to
reference a dynamic content spot is by a 'direct name' (i.e. res:/ctc_theme/jsp/HomeLink.jsp). If
you would like to see the contents of the HomeLink.jsp file, open the following file in a text
editor:
C:\IBM\WebSphere\wp_profile\installedApps\portalCell\CTC.ear\ctc.war\jsp
Close the file when you are finished reviewing. Do NOT make any changes to this file.
__3. Right-Click on the CTC Logo image and select Inspect Element from the popup menu. Use
Firebug.
NOTE: Use the folder that you saved on your local desktop. Opening files directly on the
WebDAV drive is also supported, but its performance is dependent on the WebDAV client being
used.
__7. Copy the customlogo.png file (located in your lab files directory under Themes Folder) into the
ctcCustom\images directory on your local desktop.
__8. Complete the following steps to copy the updated files into the ctcCustom WebDAV directory on
the Portal server:
__a. From AnyClient select File-->Site Manager from the menu bar.
__b. Select the fs-type1 site and click the Connect button.
IMPORTANT
__c. Navigate to the /root/Desktop/ctcCustom directory on the local system and the /fs-
type1/themes/ctcCustom directory on the remote system. Select the theme.html file
on the local system and click the green arrow to copy it to the portal server (as shown in
the figure below).
__d. Navigate to the /root/Desktop/ctcCustom/images directory on the local system and the
/fs-type1/themes/ctcCustom/images directory on the remote system. Select the
customlogo.png file on the local system and click the green arrow to copy it to the
portal server (as shown in the figure below).
__9. Clear the web browser cache and reload the browser page. Observe that the new logo
appears:
__2. Click the Edit Mode link to switch from view mode to edit mode.
__3. From the edit shelf/palette, go to the Style tab. If you do not see the colors, make sure you
check the folders under AnyConnect Client. Files under Local and Remote System should
match.
Folder files should match. Check for json files (styles.json)and if you see any files missing under
Remote System, copy from Local system to Remote System.
__4. Select the Red style. The Red CSS Stylesheet is automatically applied. Observe there is a slight
change in the appearance of the page (i.e. red banner):
__5. Next select the Black style. The Black CSS Stylesheet is automatically applied. Observe there
is a slightly more obvious change in the appearance of the page (i.e. black banner and page
margins):
__6. Select the Default style to go back to the original setting. Click Save and then click the View
Mode link to switch from edit mode to back to view mode.
At this point you have seen the effect different styles can
have on the theme. In the next set of steps, you will
learn how to create your own customized style.
__7. Complete the following steps to create a new directory structure for a new custom style:
NOTE: Use the folder that you saved on your local desktop. Opening files directly on the
WebDAV drive is also supported, but its performance is dependent on the WebDAV
client being used.
__b. Within the css directory, create a new folder named ctcCustom.
__c. Within the ctcCustom directory, create a new file named ctcCustom.css. Leave the file
blank for now.
__d. Copy the icon.gif file from your lab files directory (under Themes Styles folder) into
the ctcCustom directory.
Please Note Once you open AnyClient, it is recommended you Disconnect and Connect again.
This is to avoid any issues with connectivity. Please ensure you follow this step every time when
you work with AnyClient and for all of the sections outlined below before you transfer files from
Local System to a Remote System.
__8. Complete the following steps to add the new style to the edit shelf/palette:
NOTE: Use the folder that you saved on your local desktop. Opening files directly on the
WebDAV drive is also supported, but its performance is dependent on the WebDAV
client being used.
__c. Add the following line to the styles.json. Refer to the screenshot below to help you
ensure its inserted in the correct location. Don't forget to add a comma to separate
this newly added line from the previous one.
NOTE: This should be entered in a single line. In the screenshot below, word-wrap was
turned on to make viewing easier. In addition, instead of manually typing this in, you
can copy/paste from the styles.txt helper file (located in the lab files directory under
Themes Styles folder)).
Please Note Once you open AnyClient, it is recommended you Disconnect and Connect again.
This is to avoid any issues with connectivity. Please ensure you follow this step every time when
you work with AnyClient and for all of the sections outlined below before you transfer files from
Local System to a Remote System.
__9. Clear the web browser cache and reload the browser page.
__10. Click the Edit Mode link to switch from view mode to edit mode.
__11. From the edit shelf/palette, go to the Style tab. You should see your newly defined CTC
Custom Style in the list:
__12. Select the CTC Custom Style and click the Save button.
NOTE: You will NOT see any changes to the page as no custom styles have been added to the
style sheet yet.
__13. Click the View Mode link to switch from edit mode to back to view mode.
Now that you have your own style sheet defined, you
can start to add your own custom styling. For the
purposes of this lab, you will use FireBug for inspecting
CSS styling elements.
__14. Right-Click on the top navigation bar, left of the Home link at the top of the page, and select
Inspect Element from the popup menu.
__15. Observe that the top navigation bar is generated by the following HTML:
<div class=wpthemeHeader>
Also observe that the wpthemeHeader style contains a background-color value of #424142.
__16. Within the Firebug Style window, adjust the value of the background-color property to blue.
Observe Firebug instantly updates the browser window.
__17. Complete the following steps to make the change in the background color persistant:
NOTE: Use the folder that you saved on your local desktop. Opening files directly on the
WebDAV drive is also supported, but its performance is dependent on the WebDAV
client being used.
.wpthemeHeader {
background-color: blue;
}
__18. Follow the same advice as before. Disconnect and Connect to AnyClient. From AnyClient,
navigate to the /root/Desktop/ctcCustom/css directory on the local system and the /fs-
type1/themes/ctcCustom/css directory on the remote system. Select the ctcCustom.css file
on the local system and click the green arrow to copy it to the portal server (as shown in the
figure below).
__19. Clear the web browser cache and reload the browser page. Navigate to ThemeDev page under
CTC Demo. Observe that the top navigation banner remains blue. Please note If you do not
see a blue banner, check if you have done all the steps correctly with AnyClient and that there
are no mistakes with ctcCustom.css file. Also observe that the ctcCustom.css style sheet
override the default background-color property value (hence the term 'cascading' style sheets).
__20. Right-click to the left of the search box and select Inspect Element (firebug) from the popup
menu.
__21. Using Firebug, you are able to quickly locate the HTML that is associated to that area of the
page:
__22. In the Firebug window, highlight the <div class=search role=search> line. Observe there
is a style of float: left; currently applied. Click to the left of the style property to disable it, as
show in the figure below:
__23. Disabling the float property did have an 'visible' effect yet. In the Firebug window, highlight the
<div class=actions> line (as shown in the figure below). Observe there is a style of width:
45%; currently applied. Click to the left of the style property to disable it, as show in the figure
below.
Observe that this causes the search box to move below the actions links.
__24. The repositioning of the search box is not yet perfect. It still needs to be 'nudged' over to the left
sightly so it is more inline with the above actions links. In the Firebug Style window, click slightly
below the disabled float property. A textbox will appear. Add a new style property named
padding-right and assign a value of 20px (as shown in the figure below).
Observe that the search box has been repositioned. Now all that remains is to make the
changes persistent by updating the ctcCustomized.css style sheet.
__25. Complete the following steps to make the change in the search bar position persistant:
NOTE: Use the folder that you saved on your local desktop. Opening files directly on the
WebDAV drive is also supported, but its performance is dependent on the WebDAV
client being used.
.contentBanner .search {
float: none !important;
padding-right: 20px;
}
.contentBanner .right {
float: right;
width: auto !important;
}
__26. Clear the web browser cache and reload the browser page. Observe that the search bar has
been repositioned. Also observe that the ctcCustom.css style sheet override the default property
values.
IMPORTANT!
S P E C I A L N O T E:
Usually, the profiles and module contributions are determined once, when
the portal server is started and then they are used unchanged. Updates to
the system are not included until a server restart occurs, for performance
reasons.
This has already been done for you on the lab image.
__1. Navigate to the ctcCustom\profiles directory on your desktop. Make a copy of the
profiles_full.json file and name it profiles_ctc.json.
__2. Open the profile_ctc.json file in a text editor. Locate the section which defines the title for the
en language title, and change the value from Full to CTC Full (as shown in the figure below
).
__5. From the previous section, you should still have a web browser open and on the ThemeDev
page. (If not, login to the portal as wpadmin and navigate back to the CTC Demo-->ThemeDev
page.) Clear the web browser cache and reload the ThemeDev page.
__6. From the ThemeDev page, click the Edit Mode link to switch from view mode to edit mode.
__7. Move your mouse into the Page Properties section and click the edit link (as shown in the figure
below):
__8. From the Page Properties dialog window, go to the Advanced tab. Select CTC Full as the
profile and click Save.
NOTE: If you do not see CTC Full listed in the profile list, please clear your browser cache.
__9. Click the More button. Observe that the drop down menu currently contains an option for
assigning page permissions.
__10. Click on View Mode to switch from edit mode to view mode.
__11. Complete the following steps to remove the Assign Page Permissions feature:
__a. Open the profile_ctc.json file in a text editor. Locate the line which list the
mm_page_sharing_permission module and remove it.
__12. Clear the browser cache and reload the ThemeDev page.
__13. Click the Edit Mode link to switch from view mode to edit mode.
__14. Click the More button. Observe that the option for assigning page permissions no longer
appears (as the module that provided this capability has been removed from the profile).
__15. Click on View Mode to switch from edit mode to view mode.
A module represents an individual part of an overall theme, and can be a Style Sheet, JavaScript code,
HTML Markup. Profiles define which groups of modules will be used. In addition, profiles can define
which modules are loaded when the page is initially loaded, and which modules are loaded at a later
time (also known as deferred loading). Modules can also specify dependencies on other modules. So, if
a module is requested, it will automatically load any other modules it depends on. This 'modularization'
allows you to more easily add/remove features to a theme and allow for optimization. In this section, you
will learn about theme modules by creating your own custom module and adding it to the custom profile
created in the previous section.
__1. From your desktop, go into ctcCustom\contributions folder. Create a new file named
ctcModules.json.
__2. Open the newly created ctcModules.json file in a text editor and add the following text. When
done, save and close the file.
NOTE: You can copy the text from the helper file named ctcModules.json.txt, which is
located in your lab files directory.
__3. The implementation of this module has been defined to be within /js/geotrack.js. This file has
been provided for you. Copy the geotrack.js file from your lab files directory into ctcCustom/js
directory on your desktop.
__4. At this point, you've created a contributions files that defines one module. Complete the
following steps to add this module to the custom profile you created in the previous section.
__b. Add geotrack to the list of modules, as shown in the figure below.
__5. Complete the following steps to copy the updated files from the local desktop to the portal
server:
__6. Clear the browser cache and reload the ThemeDev page.
__7. The FireFox will prompt you if you want to share your location. Click the Share button.
__8. This module does NOT add any 'visual' component to the page. Instead, a hidden tag
containing geolocation information is added to the HTML page DOM. To see the tag, right-click
anywhere on the page and select Inspect Element to open the Firebug window. Scroll down to
the bottom of the Firebug HTML window and look for the asa.geo.location data that was
inserted by the new module:
IMPORTANT!
__9. Logout and close the web browser. This completes the lab.
Appendix A Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently available in
your area. Any reference to an IBM product, program, or service is not intended to state or imply that
only that IBM product, program, or service may be used. Any functionally equivalent product, program,
or service that does not infringe any IBM intellectual property right may be used instead. However, it is
the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or
service.
IBM may have patents or pending patent applications covering subject matter described in this
document. The furnishing of this document does not grant you any license to these patents. You can
send license inquiries, in writing, to:
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property
Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-
INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states
do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement
may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in
any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part
of the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Appendix Page 51
IBM Software
Any performance data contained herein was determined in a controlled environment. Therefore, the
results obtained in other operating environments may vary significantly. Some measurements may have
been made on development-level systems and there is no guarantee that these measurements will be
the same on generally available systems. Furthermore, some measurements may have been estimated
through extrapolation. Actual results may vary. Users of this document should verify the applicable data
for their specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products, their
published announcements or other publicly available sources. IBM has not tested those products and
cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of
those products.
All statements regarding IBM's future direction and intent are subject to change or withdrawal without
notice, and represent goals and objectives only.
This information contains examples of data and reports used in daily business operations. To illustrate
them as completely as possible, the examples include the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names and addresses used by an
actual business enterprise is entirely coincidental. All references to fictitious companies or individuals are
used for illustration purposes only.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs
in any form without payment to IBM, for the purposes of developing, using, marketing or distributing
application programs conforming to the application programming interface for the operating platform for
which the sample programs are written. These examples have not been thoroughly tested under all
conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these
programs.
Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel
SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the
United States, other countries, or both.
ITIL is a registered trademark, and a registered community trademark of The Minister for the Cabinet
Office, and is registered in the U.S. Patent and Trademark Office.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle
and/or its affiliates.
Cell Broadband Engine is a trademark of Sony Computer Entertainment, Inc. in the United States, other
countries, or both and is used under license therefrom.
Linear Tape-Open, LTO, the LTO Logo, Ultrium, and the Ultrium logo are trademarks of HP, IBM Corp.
and Quantum in the U.S. and other countries.
Appendix Page 53
NOTES
NOTES