Documente Academic
Documente Profesional
Documente Cultură
CREATION WEBSPHERE
PORTAL 8.5 CF1
Michele Buccarello
8/12/2014
This document describe how to create a custom theme for portal 8.5 CF1.
CUSTOM THEME CREATION WEBSPHERE PORTAL 8.5 CF1
Table of Contents
ENVIROMENT CHECK ................................................................................................................................... 2
EXTRACT THEME DYNAMIC AND STATIC PART ............................................................................................. 2
Extract Dynamic part................................................................................................................................ 2
Extract Static part .................................................................................................................................... 3
Preparing RAD 9.1 for theme packaging ....................................................................................................... 4
Preparation for dynamic area................................................................................................................... 4
Create the dynamic war ....................................................................................................................... 4
Preparation for static area ....................................................................................................................... 7
Create the static war ............................................................................................................................ 7
Setting the access in web.xml ............................................................................................................... 9
Preparing the EAR for deployment ........................................................................................................... 9
CREATING DYNAMIC CONTENT SPOTS ......................................................................................................... 9
Changes introduced in Portal 8.5 ............................................................................................................. 9
Create the plugin.xml in the dynamic war ...............................................................................................11
Replace the module in all theme profiles ................................................................................................14
Replace the new Dynamic Content Spots ...................................................................................................14
Deploy Theme and Register in Websphere Portal via xmlaccess .................................................................15
Deploy the ear in console ........................................................................................................................15
Register theme with the xml access below ..............................................................................................17
Use Theme Analyzer Portlet and Validation Report .................................................................................21
ENVIROMENT CHECK
This guide cover the creation of custom theme for websphere Portal 8.5. To package the theme you need:
1) RAD 9.1 (older version are supported but install the suggested version)
2) WebDav Client ( I use CyberDuck )
3) Portal 8.5 cf1 on a local or remote machine ( in my case I have a local installation)
You need to copy this two area of files in two separated folders, in my case I create on folder named
Portal_85_theme and in this folder you need to create two folder:
- theme_dynamic
- theme_static
C:\IBM85\WebSphere\PortalServer\theme\wp.theme.themes\default85\installedApps\DefaultTheme85.ear
\DefaultTheme85.war
- skins
- themes
- WEB-INF
- Web.xml
- ibm-web-bnd.xmi
- ibm-web-ext.xmi
http://localhost:10039/wps/mycontenthandler/dav/fs-type1/themes/?mime-type=application/zip
In these steps we made an EAR with two WAR, one for static area and one for dynamic area.
2) Select as target runtime WebSphere Application Server v8.5, web module version 2.4
Press next next review the context root if is right and then press finish.
3) Now copy the resources located in the dynamic folder in the webcontent directory of the dynamic
war, below you see the screenshot and a map of the file location :
skins → WebContent/skins
themes → WebContent/themes
WEB-INF/ → WebContent/WEB-INF
Press next next and in the final window check the context root and then press finish.
2) Now copy the resources located in the static folder in the webcontent directory of the static war,
below you see the screenshot and a map of the file location :
themes → WebContent/themes
In this step you need to add the yellow line to enable the access for anonymous user to the static files and
remove the green line. The web.xml is located in CustomThemeStatic\WebContent\WEB-INF\web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID"
version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-
app_2_4.xsd">
<display-name>CustomThemeStatic</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<description>A regular expression that defines which of the resources in the WAR file
can be served by the portal war datasource. </description>
<param-name>com.ibm.portal.whitelist</param-name>
<param-value>.*</param-value>
</context-param>
<context-param>
<description>A regular expression that defines which of the resources in the WAR file
cannot be served by the portal war datasource.</description>
<param-name>com.ibm.portal.blacklist</param-name>
<param-value>WEB-INF/.*</param-value>
</context-param>
</web-app>
Right-click on the EAR project (in my case is Custom8001ThemeCF5) and select Java EE -- Prepare
for deployment.
- Go to Resources -> Resource Environment -> -> Resource environment providers -> WP
DynamicContentSpotMappings.
- Select Custom Properties.
- Select New
Custom Theme Portal 8.5 CF1
Author:Michele Buccarello Page 9
CUSTOM THEME CREATION WEBSPHERE PORTAL 8.5 CF1
At the link below you find the official documentations for creating the dynamic content spots in portal 8
http://www-
10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=V8+Update%3A+Supplemental+Document
ation#action=openDocument&res_title=Creating_a_dynamic_content_spot_wp8001&content=pdcontent
http://www-
10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=V8+Update%3A+Supplemental+Document
ation#action=openDocument&res_title=Working_with_dynamic_content_spots_wp8001&content=pdcont
ent
From portal 8.0.0.1 also is possibile to register via plugin.xml all dynamic content spot but you must reboot
portal to register the dynamic content spot in the plugin.xml.
In portal 8.5 the resources aggregation framework is able to dynamically load every dynamic content spot
or module registered via plugin.xml, to load the changes simply use the theme analyzer portlet ( THANKS
FOR THIS GREAT TOOL!!!!) go in control center and click invalidate cache link.
<extension id="customTheme_dynamicContentSpots_85"
point="com.ibm.portal.resourceaggregator.module">
<module id="customTheme_dynamicContentSpots_85">
</plugin>
In the static war go in the profiles folder and replace in all profiles wp_dynamicContentSpots_85 with
customTheme_dynamicContentSpots_85
Change the dynamic content spots in every file in the NLS folder.
This change must be done for all theme_*.html files , for a fast replace I use notepad++ I open every
theme_xx.html and I do a find replace in all opened document, and in the find replace box I put:
- FIND: 85theme_
- REPLACE: CustomTheme85_
Export the ear from rad and install in portal via the integrated solution console:
Press NEXT
Save the xml below in a file and import via portal administration.
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_8.0.0.xsd" type="update" >
<portal action="locate">
<localedata locale="en">
</localedata>
</skin>
<localedata locale="en">
</localedata>
</skin>
<localedata locale="en">
</localedata>
</skin>
<localedata locale="en">
</localedata>
</skin>
<localedata locale="en">
<title>Custom Theme</title>
<description/>
</localedata>
</theme>
</portal>
</request>
In this portlet there are many useful reports and utilities, below the steps to run the theme validation
report:
If you want to add new dynamic content spot in the plugin after the first deploy, to load the new dynamic
content spot you must invalidate the cache via Theme Analizer Portlet, below the steps to do the
invalidation: