WebSphere Portal 7.0 – Changing the Context Root
Version
Date
Author
Change
1.0
2011/07/29
Johannes Lebek, IBM
Initial release of the document
1.1
2011/08/09
Johannes Lebek, IBM
Added sample code for scripting
1.2
2011/08/30
Johannes Lebek, IBM
Corrections for vertical cluster setups
1.3
2011/11/15
Sven Stueven, IBM
Edited “Cluster note”
WebSphere Portal 7.0: Changing the Context RootPage 2/42
Table of Contents
Abstract.................................................................................................................................. 4
Introduction.............................................................................................................................4
Installation details...................................................................................................................4
Important notice................................................................................................................. 4
Required APARs................................................................................................................ 4
Detailed version information of the supported environment..............................................5
Changes using ConfigEngine tasks.......................................................................................7
Required changes after completing the configuration tasks ................................................11
XML configuration interface............................................................................................. 11
Dojo Changes.................................................................................................................. 11
/PageBuilder2 and /PortalTheme.................................................................................... 13
/wps_semanticTag........................................................................................................... 16
Personalization................................................................................................................ 17
JCR.................................................................................................................................. 18
WCM................................................................................................................................ 18
Syndicated Feed portlet...................................................................................................21
Search..............................................................................................................................22
People..............................................................................................................................24
Web Content Integrator (WCI).........................................................................................26
AJAX Proxy......................................................................................................................26
CatalogHandler................................................................................................................27
PolicyManager................................................................................................................. 28
TemplateLibrary............................................................................................................... 28
IEHS.................................................................................................................................28
Quickr Document Picker..................................................................................................29
Web Resource Servlet.....................................................................................................30
MashupCommonComponent...........................................................................................30
Manage search portlet.....................................................................................................34
Synchronize cluster members and update the Web server plugin ..................................36
Cleanup............................................................................................................................36
Overview of context paths and the location where to apply changes ..................................37
Basic Testing........................................................................................................................ 40
List defined context paths................................................................................................40
Web debugging tools....................................................................................................... 40
Multipart messages..........................................................................................................40
Scripting samples.................................................................................................................41
Changing the context root of a web application.............................................................. 41
Changing custom properties of a Resource Environment Provider ................................ 41
Changing files in WebDAV repositories...........................................................................41
WebSphere Portal 7.0: Changing the Context RootPage 3/42
Abstract
This document explains how you can modify the context root of a WebSphere Portal
installation for all parts of the product.
Introduction
The objective of this document is to describe how to change the default context root in
IBM® WebSphere® Portal / Web Content Management (WCM) version 7.0.0.1 CF06 to
better suit the requirements of your organization. There are more context root related
changes involved in WebSphere Portal 7.0 compared to prior versions of the product
because more components have been added.
This document changes the context root by prefixing /mynewcontextroot. Therefore the
entry URL for the portal installation will change from http://hostname:10039/wps/portal to
http://hostname:10039/mynewcontextroot/wps/portal.
Installation details
Important notice
The changes described in this document are complex and need to be tested
thoroughly on each particular environment where they are applied.
Future fixes and fixpacks may modify files and settings that have been modified
according to the instructions given in this document. Applying such a fix or fixpack
requires to repeat the procedure to change the context root, or at least verify all
locations where changes have been applied to check if any changes have been
reverted.
Due to the complexity of these changes it is highly recommended to create a
custom script that contains all the modification tasks described in this document.
This script should be written that way, that it can be executed multiple times – even
on an already modified system – with identical results. That way this script can be
used to ensure complete context root configuration even after the application of a
fix or fixpack.
Required APARs
APAR
Title
PM40829
CREATE-WCM-SERVLETPATH-VARIABLES CAUSES VARIABLE IN
MORE THAN ONE SCOPE IN WAS
PM42549
MODIFY-SERVLET-PATH DOES NOT CHANGE THE CONTEXT
ROOT FOR PERSONALIZATION_LISTS AND
PERSONALIZATION_WORKSPACE
CACHEPROXYSERVLET ISSUE AFTER CHANGING CONTEXT
ROOT
PM43056
WebSphere Portal 7.0: Changing the Context RootPage 4/42
CF6
PM43106
CHANGING CONTEXT ROOT FOR APPLICATIONS AFFECTS
PROFILE PICTURE OF PEOPLE FINDER PORTLET
PM43644
CLIENT-SIDE AGGREGATION RENDERING DOES NOT WORK
WITH CUSTOM WSRP CONTEXT ROOT
PM44344
IEHS_WAR + WEBRESOURCESERVLET.EAR CONTEXT ROOT
PM44517
UPDATE SCRIPTING COMPONENT WHEN CHANGING CONTEXT
ROOT FOR XMLACCESS
Detailed version information of the supported environment
The environment is WebSphere Portal 7.0.0.1 including APAR PM41442 (cumulative fix
CF06).
The output of wp_profile/PortalServer/bin/WPVersionInfo.sh shows:
WVER0010I: Copyright IBM Corporation 2002, 2010; All rights reserved.
WVER0011I: WebSphere Portal
WVER0012I: VersionInfo reporter version 1.10.1.1, dated 20110715_0326
-------------------------------------------------------------------------------IBM WebSphere Portal Product Installation Status Report
-------------------------------------------------------------------------------Report at date and time 2011-07-25T10:49:03+02:00
Installation
-------------------------------------------------------------------------------Product Directory
/opt/WebSphere/PortalServer
Version Directory
/opt/WebSphere/PortalServer/version
DTD Directory
/opt/WebSphere/PortalServer/version/dtd
Log Directory
/opt/WebSphere/PortalServer/version/log
Backup Directory
/opt/WebSphere/PortalServer/version/backup
TMP Directory
/tmp
Installation Platform
-------------------------------------------------------------------------------Name
IBM WebSphere Portal
Version
7.0
Technology List
-------------------------------------------------------------------------------MP
installed
WCM
installed
CFGFW
installed
Installed Product
-------------------------------------------------------------------------------Name
IBM WebSphere Portal Configuration Framework
Version
7.0.0.1
ID
CFGFW
Build Level
wp7001CF06_001_15 2011-07-19
Build Date
07/19/2011
Installed Product
-------------------------------------------------------------------------------Name
IBM WebSphere Portal MultiPlatform
WebSphere Portal 7.0: Changing the Context RootPage 5/42
Version
ID
Build Level
Build Date
7.0.0.1
MP
wp7001CF06_001_15 2011-07-19
07/19/2011
Installed Product
-------------------------------------------------------------------------------Name
IBM Lotus Web Content Management
Version
7.0.0.1
ID
WCM
Build Level
wp7001CF06_001_15 (7.0.0.1.CF_build_17.0.0)
Build Date
07/19/2011
-------------------------------------------------------------------------------End Installation Status Report
--------------------------------------------------------------------------------
WebSphere Portal 7.0: Changing the Context RootPage 6/42
Changes using ConfigEngine tasks
Notes:
•
When you specify the new context root, do not use a value that is identical to an
existing directory in a portlet WAR directory. For example, if you set the WebSphere
Portal context root as /images and there is also a portlet with the directory structure
/myPortlet.ear/myPortlet.war/images, this could cause a conflict, if the portlet
encodes URI references to resources in its own /images directory. In this situation,
the portlet cannot display images because WebSphere Portal looks for the image
resources according to its own context root path instead of the directory path that is
specified by the portlet WAR file.
•
To change the URI context root of a WSRP Producer portal, you do not need to
redeploy all portlets You only need to run the configuration task modify-servletpath, as described below.
To change the URI, perform the following steps:
Cluster note: If you modify the URI in a clustered environment, perform the steps
described here on the primary node only, except where specified otherwise.
Additionally, make sure that “AutoSync” is enabled at a frequency of 1 minute.
1.
Stop the WebSphere Portal server.
2.
Locate the files wkplc.properties and wkplc_comp.properties in the directory
wp_profile_root/ConfigEngine/properties. Create backup copies before changing
any values.
3.
Use a text editor to open the file wkplc.properties and enter the appropriate value
for your environment in the property WpsContextRoot. In this document we
assume that wps is modified to mynewcontextroot/wps.
Do not specify a leading slash for this property.
4.
Save and close the file.
5.
Use a text editor to open the wkplc_comp.properties file and enter
mynewcontextroot/wsrp for the WsrpContextRoot property.
6.
Save and close the file.
7.
Start server1 in a stand-alone environment or start the deployment manager and
nodeagent in a clustered environment.
8.
Open a command prompt and change to the wp_profile_root/ConfigEngine
directory.
9.
Perform the following steps to change the WebSphere Portal URI.
Per design this task changes the URI for the following applications:
•
wps
•
wcm
•
odc
WebSphere Portal 7.0: Changing the Context RootPage 7/42
•
pznpublish
•
UserProfileRESTServlet
•
PZN_Utilities
•
LWP_Mail_Servlets
•
SpellChecker
•
Personalization_Lists
•
Personalization_Workspace
a.To change the context root for the values that you entered in the
WpsContextRoot, run the following task:
•
UNIX: ./ConfigEngine.sh modify-servlet-path
-DPortalAdminPwd=password -DWasPassword=password
•
Windows: ConfigEngine.bat modify-servlet-path
-DPortalAdminPwd=password -DWasPassword=password
•
IBM i: ConfigEngine.sh modify-servlet-path
-DPortalAdminPwd=password -DWasPassword=password
Note: Check the output for any error messages before proceeding with the
next task. If any of the configuration tasks fail, verify the values in the
wkplc.properties and wkplc_comp.properties files.
b. Restart server1 and WebSphere_Portal servers.
Perform the following steps to modify context root for the out-of-the-box (OOB)
portlets. The modify-servlet-path task modifies the Portal Enterprise applications with
the new context root, whereas modify-servlet-path-portlets task modifies all the
PA_* applications within the scope of WebSphere Portal. Make sure you use the same
login account to run this config task, i.e., if you installed portal using root, then you
need to run the task as root. Otherwise, the task will fail. Note that it's safe to re-run
the ConfigEngine tasks, modify-servlet-path and modify-servlet-path-portlets, if you
ever need to do so.
10.
•
UNIX: ./ConfigEngine.sh modify-servlet-path-portlets
-DPortalAdminPwd=password -DWasPassword=password
•
Windows: ConfigEngine.bat modify-servlet-path-portlets
-DPortalAdminPwd=password -DWasPassword=password
•
IBM i: ConfigEngine.sh modify-servlet-path-portlets
-DPortalAdminPwd=password -DWasPassword=password
Note: Check the output for any error messages before proceeding with the next task. If
any of the configuration tasks fail, verify the values in the wkplc.properties and
wkplc_comp.properties files.
11.
Clustered environment only: Resynchronize the nodes and restart the cluster.
Cluster type
Steps
Static cluster
Perform the following steps if you have a static cluster:
• Open the deployment manager administrative console.
WebSphere Portal 7.0: Changing the Context RootPage 8/42
• Click System Administration -> Nodes, select the
primary node from the list, and click Full
Resynchronize.
• Click Servers -> Clusters.
• Select the cluster and click Stop.
• After the cluster has stopped, restart it by selecting the
cluster and clicking Start.
Dynamic cluster
Perform the following steps if you have a dynamic cluster:
• Open the deployment manager administrative console.
• Click System Administration -> Nodes, select the
primary node from the list, and click Full
Resynchronize.
• Click Servers -> Dynamic Clusters.
• Click on the required dynamic cluster that you want to
stop and restart.
• Click Dynamic cluster members.
• Select the member name that you want to stop and then
click the Stop button.
• Select the member name that you want to start and then
click the Start button.
Perform the following steps for each secondary instance of WebSphere Portal
within your cluster to create WebSphere environment variables that IBM Lotus Web
Content Management needs:
12.
a.
Locate the wkplc.properties and wkplc_comp.properties files on the
additional nodes in the wp_profile_root/ConfigEngine/properties directory
and create backup copies before changing any values.
b.
Use a text editor to open the wkplc.properties file and enter the appropriate
value for your environment in the WpsContextRoot property.
c.
Save and close the file.
d.
Use a text editor to open the wkplc_comp.properties file and enter the
appropriate value for WsrpContextRoot.
e.
Save and close the file.
f.
Run the following task to create the WebSphere environment variables for
Web Content Management:
•
UNIX: ./ConfigEngine.sh create-wcm-servletpath-variables
-DWasPassword=password
•
Windows: ConfigEngine.bat create-wcm-servletpath-variables
-DWasPassword=password
•
IBM i: ConfigEngine.sh create-wcm-servletpath-variables
WebSphere Portal 7.0: Changing the Context RootPage 9/42
-DWasPassword=password
Note: In a vertical cluster you need to run the configuration task for each
secondary instance of WebSphere Portal on the node.
•
Specify the name of the particular secondary instance as an additional
parameter of the configuration task by adding
-DServerName=additional_server_name to the command.
Note: Check the output for any error messages before proceeding with the
next task. If any of the configuration tasks fail, verify the values in the
wkplc.properties and wkplc_comp.properties files.
g.
Restart server1 and WebSphere_Portal servers.
WebSphere Portal 7.0: Changing the Context RootPage 10/42
Required changes after completing the configuration tasks
In a clustered environment you need to change files on each cluster node if the files are
located in either directory PortalServer or wp_profile. Directory
wp_profile/config/cells is an exception, because its content is synchronized by the
deployment manager.
You need to make all configuration changes in the WAS administrative console on the
deployment manager node in a clustered environment.
Requests to the XML configuration interface should be addressed to the primary cluster
node.
XML configuration interface
Modify the following files by replacing the old reference to the XMLAccess servlet
/wps/config with the updated context root /mynewcontextroot/wps/config:
a. PortalServer/base/wp.script/config/includes/wp.virtual_portal_cfg.xml
b. PortalServer/installer/wp.config/config/templates/restoreportlet.sh or
.bat
You need to modify file a only, if you did not apply APAR PM44517.
You can also achieve this by executing this script:
sed -i.bak -e 's#\([^A-Za-z09]\)/wps/config#\1/mynewcontextroot/wps/config#g'
PortalServer/base/wp.script/config/includes/wp.virtual_portal_cfg.xml
PortalServer/installer/wp.config/config/templates/restoreportlet.sh
Dojo Changes
For Dojo, you have to set the new context root and additionally four Dojo related properties
in the WebSphere Application Server administrative console as follows:
a. The default context root for Dojo is /portal_dojo. Change it here:
Applications → Application Types → WebSphere Enterprise Applications →
Enterprise Applications → Dojo_Resources → Context Root For Web
Modules.
b. Resource Environment Providers → WP GlobalThemeConfig → Custom
properties
◦ resources.js.dojo.contextRoot
WebSphere Portal 7.0: Changing the Context RootPage 11/42
◦ resources.js.dojo.system
◦ resources.js.dojo.v1.4.3
◦ resources.js.dojo.v1.3.2
Change references to /portal_dojo in the Portal theme:
1. Modify the following files:
◦ PortalServer/installer/wp.ear/installableApps/wps_theme.ear/wps_theme.w
ar/themes/html/Portal/banner_searchControl_for_migrated_themes.jspf
◦ PortalServer/installer/wp.ear/installableApps/wps_theme.ear/wps_theme.w
ar/themes/html/Portal/head_djConfig.jspf
◦ PortalServer/installer/wp.ear/installableApps/wps_theme.ear/wps_theme.w
ar/themes/html/Portal/head_links.jspf
◦ PortalServer/installer/wp.ear/installableApps/wps_theme.ear/wps_theme.w
ar/themes/html/Portal/js.jsp
2. Use a text editor to replace all references to /portal_dojo with
/mynewcontextroot/portal_dojo. Alternatively, use the following script to automate
this change:
sed -i.bak -e 's#\([^A-Za-z09]\)/portal_dojo#\1/mynewcontextroot/portal_dojo#g' $(egrep -lr '[^AZa-z0-9]/portal_dojo'
PortalServer/installer/wp.ear/installableApps/wps_theme.ear)
In theme csa2.theme there are some more references you need to change:
3. Download csa2.theme from WebDAV
(http://hostname:10039/mynewcontextroot/wps/mycontenthandler/dav/themelist)
4. Modify references to /portal_dojo to include new context root. Affected files are
theme.html and nls/theme*.html.
WebSphere Portal 7.0: Changing the Context RootPage 12/42
sed -i.bak -e 's#\([^A-Za-z09]\)/portal_dojo#\1/mynewcontextroot/portal_dojo#g' $(egrep -lr '[^AZa-z0-9]/portal_dojo' csa2.theme)
5. Upload the modified files to WebDAV.
/PageBuilder2 and /PortalTheme
1. Modify the applications context roots on the WAS console.
◦ PageBuilder2_Theme
◦ wps_theme
2. Export the currently deployed themes by using the XML configuration interface.
The connection URL changed due to the context root changes you made before.
Therefore, connect to http://hostname:10039/mynewcontextroot/wps/config.
◦ Request script to export themes and skins only:
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd" type="export">
<portal action="locate">
<skin action="export" objectid="*"/>
<theme action="export" objectid="*"/>
<content-node action="export"
uniquename="ibm.portal.HiddenPages"/>
<content-node action="export" uniquename="ibm.portal.Page
Customizer"/>
</portal>
</request>
a) Modify all context-root attributes in skin and theme items of the exported
XMLAccess configuration to use the new context root.
<skin action="update" active="true" contextroot="/mynewcontextroot/PortalTheme" default="false" domain="rel"
objectid="ZK_CGAH47L008LG50IAHUR9Q330S4" resourceroot="IBM"
type="default" uniquename="ibm.portal.skin.IBM">
b) Modify parameter pageStyle of the exported content-node entities by modifying
the context root of the parameter value:
WebSphere Portal 7.0: Changing the Context RootPage 13/42
<parameter name="pageStyle" type="string" update="set"><!
[CDATA[/mynewcontextroot/PageBuilder2/themes/html/PageBuilder2/css/mi
nimalStyles.css]]></parameter>
c) Reimport the XMLAccess file to change the portal configuration.
3. Modify the theme on WebDAV:
a) Download directory csa2.theme using a WebDAV connection to
http://hostname:10039/mynewcontextroot/wps/mycontenthandler/dav/themelist
b) Modify the references to the /PageBuilder2 context, on the csa2.theme static
files from WebDAV. You can use this script to make the change:
sed -i.bak -e
's#res:/PageBuilder2#res:/mynewcontextroot/PageBuilder2#g' $(egrep
-lr 'res:/PageBuilder2' csa2.theme)
▪ The changed files are Plain.html and nls/Plain*.html
c) Upload the modified files back to WebDAV.
4. Change the custom properties of the following Resource Environment Providers:
◦ WP Model Webdav ConfigService
▪ theme.contextroot.default
▪ skin.contextroot.default
◦ WP CommonComponentConfigService
▪ cc.theme.context
WebSphere Portal 7.0: Changing the Context RootPage 14/42
◦ WP DynamicContentSpotMappings
▪ asa
▪ bannerCommonActions
▪ bannerNav
▪ config
▪ configDynamic
▪ configGlobal
▪ head
▪ pageToolbar
▪ search
▪ status
▪ tabNav
WebSphere Portal 7.0: Changing the Context RootPage 15/42
/wps_semanticTag
1. Modify the enterprise application Live_Object_Framework by changing the context
root from /wps_semanticTag to its new value /mynewcontextroot/wps_semanticTag.
2. Update references to the old context root from the PageBuilder2 theme, common
files in wps.war and the actual Live_Object_Framework.ear application:
▪ PortalServer/theme/wp.mashup.cc.theme/installedApps/wp.mashup.cc.the
me.ear/PageBuilder2.war/themes/html/PageBuilder2/config.jsp
WebSphere Portal 7.0: Changing the Context RootPage 16/42
▪ PortalServer/installer/wp.ear/installableApps/wps.ear/wps.war/web2/s
emanticTagging/semanticTagging-init.jspf
▪ wp_profile/installedApps/<node
name>/wps.ear/wps.war/web2/semanticTagging/semanticTagging-init.jspf
▪ PortalServer/ui/wp.tagging.liveobject/semTagEar/Live_Object_Framewor
k.ear/META-INF/application.xml
You also can achieve this by executing this shell script:
sed -i.bak -e 's#\([^A-Za-z09]\)/wps_semanticTag#\1/mynewcontextroot/wps_semanticTag#g'
PortalServer/theme/wp.mashup.cc.theme/installedApps/wp.mashup.cc.them
e.ear/PageBuilder2.war/themes/html/PageBuilder2/config.jsp
wp_profile/installedApps/*/wps.ear/wps.war/web2/semanticTagging/seman
ticTagging-init.jspf
PortalServer/ui/wp.tagging.liveobject/semTagEar/Live_Object_Framework
.ear/META-INF/application.xml
3. Replace references in csa2.theme/js/init.js on WebDAV:
◦ Switch to the directory where you have copied the folder csa2.theme to.
◦ Replace all occurrences of the old context root with its new value using a text
editor, or run the following command respectively:
sed -i.bak -e 's#\([^A-Za-z09]\)/wps_semanticTag#\1/mynewcontextroot/wps_semanticTag#g' $(egrep
-lr '[^A-Za-z0-9]/wps_semanticTag' csa2.theme)
◦ Upload the modified file csa2.theme/js/init.js back to WebDAV.
4. Update wp.theme.extensions.impl.jar:
◦ Make sure application server instance WebSphere_Portal is stopped.
◦ Extract plugin.xml from
PortalServer/ui/wp.theme.extensions.impl/shared/app/wp.theme.extensi
ons.impl.jar:
AppServer/java/bin/jar -xf
PortalServer/ui/wp.theme.extensions.impl/shared/app/wp.theme.extensio
ns.impl.jar plugin.xml
◦ Update the context root in the following line of file plugin.xml:
url="/mynewcontextroot/wps_semanticTag/javascript/semanticTagService.js" />
◦ Package updated plugin.xml in wp.theme.extensions.impl.jar:
AppServer/java/bin/jar -uf
PortalServer/ui/wp.theme.extensions.impl/shared/app/wp.theme.extensio
ns.impl.jar plugin.xml
Personalization
Update the web module definitions via XML configuration interface:
1. Export definitions of Personalization web modules:
<?xml version="1.0" encoding="UTF-8"?>
<request type="export" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
WebSphere Portal 7.0: Changing the Context RootPage 17/42
instance" xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd">
<portal action="locate">
<web-app action="export" uid="pzn.6.ruleportlet.1001"/>
<web-app action="export" uid="pzn.6.author.1001"/>
</portal>
</request>
2. Change context root setting for both web modules in the XMLAccess script
created by the export action:
<context-root>/mynewcontextroot/wps/pznlist</context-root>
<context-root>/mynewcontextroot/wps/pznauthor</context-root>
3. Import the updated XMLAccess script.
JCR
•
Modify the context root of these applications in the WAS administrative console:
◦ content_j2ee
◦ JavaContentRepository
WCM
1. Modify the context root of these applications in the WAS administrative console:
◦ WCM_EXTENSION
◦ ilwwcm-wcmsearchseed
WebSphere Portal 7.0: Changing the Context RootPage 18/42
2. Set the JVM property wcm.searchseed.context.path:
◦ For each cluster node open the definition of WebSphere Variable
WPS_JVM_ARGUMENTS_EXT
◦ Modify the value by adding
-Dwcm.searchseed.context.path=/mynewcontextroot/wps/wcmsearchseed
3. Clean up WebSphere Variables defined for WCM.
This step is only necessary if APAR PM40829 is not applied before configuration
task modify-servlet-path is executed.
a. Navigate to Environment → WebSphere Variables
b. Filter view by WCM*
c. Select all duplicate entries that show the old context root
▪ WCM_CONTEXT_ROOT
▪ WCM_SEARCHSEED_CONTEXT_ROOT
▪ WCM_WPS_CONTEXT_ROOT
▪ WCM_WPS_DEFAULT_HOME
▪ WCM_WPS_PERSONALIZED_HOME
WebSphere Portal 7.0: Changing the Context RootPage 19/42
d. Delete the selected WebSphere Variables.
e. Save the configuration change.
4. Modify CSS files on WebDAV
a. Download directory common-resources from WebDAV resource
http://hostname:10039/mynewcontextroot/wps/mycontenthandler/dav/fstype1/
b. Change to the local copy of the common-resources directory.
c. Modify the references to /wps/DocEditor in the following files:
◦ common-resources/ibm/css/common.css
◦ common-resources/ibm/css/commonRTL.css
◦ common-resources/ibm/css/portal/ibmPortlets.css
WebSphere Portal 7.0: Changing the Context RootPage 20/42
d. Upload the modified files back to WebDAV.
You can make the file changes using the following script:
sed -i.bak -e 's#\([^A-Za-z09]\)/wps/DocEditor#\1/mynewcontextroot/wps/DocEditor#g' $(egrep -lr
'[^A-Za-z0-9]/wps/DocEditor' common-resources)
5. Modify the resource references in the authoring portlet JSP, if you have extended
the context root as in our example by prefixing /mynewcontextroot to /wps/portal.
If for example /wps is replaced by a different context, then the following change
must not be applied.
a. Edit file wp_profile/installedApps/*/PA_WCM_Authoring_UI.ear/ilwwcmauthoring.war/jsp/html/OdcEditor.jsp
b. Add a slash and two periods (/..) to these lines as shown here:
String ecmImg="../../../.." + portletResponse.encodeURI("/images/eecmLink.gif");
String tagHelperImg="../../../.." +
portletResponse.encodeURI("/images/tagHelper.png");
Again, you can automate this modification by a script as follows:
sed -i.bak1 -e 's#\(\.\./\.\./\.\.\)\(.*images/eecmLink\.gif\)#\1/..\2#g'
wp_profile/installedApps/*/PA_WCM_Authoring_UI.ear/ilwwcmauthoring.war/jsp/html/OdcEditor.jsp
sed -i.bak2 -e 's#\(\.\./\.\./\.\.\)\
(.*images/tagHelper\.png\)#\1/..\2#g'
wp_profile/installedApps/*/PA_WCM_Authoring_UI.ear/ilwwcmauthoring.war/jsp/html/OdcEditor.jsp
Syndicated Feed portlet
To configure the Syndicated Feed portlet on an alternate context root, perform the
following steps:
a. Log on to the WebSphere Application Server administrative console.
b. Navigate to Applications → Application Types → WebSphere enterprise
applications.
c. Search for the PA_wp.feedspace application using filter function and then open it.
d. Click Class Loading and update detection settings.
e. Select the following settings:
◦ Classes loaded with parent classloader first
◦ Single classloader for application
WebSphere Portal 7.0: Changing the Context RootPage 21/42
f. Click Apply and then click Save to save the settings.
Search
1. Modify the context root of these applications in the WAS administrative console:
◦ Feed_Servlet
◦ Seedlist_Servlet
WebSphere Portal 7.0: Changing the Context RootPage 22/42
2. Modify the resource environment provider WP ConfigService to update the search
feed context:
◦ Add the custom property searchFeedContext of type java.lang.String. For the
value, use the new context root followed by /searchfeed and a trailing slash /,
for example /mynewcontextroot/searchfeed/. The trailing slash is required.
3. Modify the portlet parameter OPEN_WCM_WINDOW for the portlet Search and Browse
using the XML configuration interface or the administrative portlet Manage Portlets:
WebSphere Portal 7.0: Changing the Context RootPage 23/42
People
1. Modify the context root of the following applications in the WAS administrative
console:
◦ lwp.addtosametimelist_war
◦ lwp_dynamicPersontag_war
WebSphere Portal 7.0: Changing the Context RootPage 24/42
◦ lwp_groupsViewer_war
◦ lwp_peoplePicker_war
◦ lwp_peoplefinder_war
◦ LWP_People
◦ ibm_personTagServlet_war
WebSphere Portal 7.0: Changing the Context RootPage 25/42
2. Update web module defintions via the XML configuration interface
a. Create an XMLAccess request script that will export all related web module
definitions, and execute it:
<?xml version="1.0" encoding="UTF-8"?>
<request type="export" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd">
<portal action="locate">
<web-app action="export" uid="peopleFinderJSR168.1.webmod"/>
<web-app action="export" uid="com.ibm.workplace.groups.viewer"/>
<web-app action="export" uid="com.ibm.workplace.people.picker"/>
<web-app action="export"
uid="com.ibm.wkplc.people.portal.portlet.dynamicpersontag.web.app"/>
<web-app action="export" uid="addtostlist.1.webmod"/>
</portal>
</request>
b. Modify the context root settings in the XMLAccess script that has been
created by the export:
<context-root>/mynewcontextroot/wps/PA_People_Finder</context-root>
<context-root>/mynewcontextroot/wps/PA_Groups_Viewer_App</contextroot>
<context-root>/mynewcontextroot/wps/PA_People_Picker_App</contextroot>
<context-root>/mynewcontextroot/wps/PA_dynamicpersontag</contextroot>
<contextroot>/mynewcontextroot/wps/PA_Add_to_Sam_st_Portlet</context-root>
c. Reimport the updated XMLAccess script.
Web Content Integrator (WCI)
•
Modify the context root of this application in the WAS administrative console:
◦ wci
AJAX Proxy
1. Modify the context root of this application in the WAS administrative console:
◦ AJAX Proxy Configuration
WebSphere Portal 7.0: Changing the Context RootPage 26/42
2. In the portal administrative portlet Manage Portlets modify the preference
proxy.servlet.path of portlet Resource Manager Portlet from /wps/myproxy to
/mynewcontextroot/wps/myproxy
You do not need to update the following two files, as their reference to the context root
/wps/myproxy is replaced with the current setting at runtime:
•
PortalServer/theme/wp.theme.dojo/installedApps/dojo.ear/dojo.war/com/ibm/w
orkplace/wcm/ecm/quickr/picker/launcher/DocPickerLauncher.js
•
PortalServer/theme/wp.theme.dojo/installedApps/dojo.ear/dojo.war/v1.4.3/co
m/ibm/workplace/wcm/ecm/quickr/picker/launcher/DocPickerLauncher.js
CatalogHandler
•
Modify the context root of this application in the WAS administrative console:
◦ CatalogHandler
WebSphere Portal 7.0: Changing the Context RootPage 27/42
PolicyManager
•
Modify the context root of this application in the WAS administrative console:
◦ WSPolicyManager
TemplateLibrary
•
Modify the context root of this application in the WAS administrative console:
◦ TemplateLibrary_Servlets
IEHS
1. Modify the context root of this application in the WAS administrative console:
◦ IEHS_war
2. Update the file
PortalServer/ext/common.ext/helpadvisorservice/shared/app/config/services/
helpadvisorservice.properties by adding property IEHS_CONTEXT_ROOT with the
value of the new context root.
You also can achieve this by executing the following script:
filename="PortalServer/ext/common.ext/helpadvisorservice/shared/app/c
onfig/services/helpadvisorservice.properties"
if grep -q "IEHS_CONTEXT_ROOT" $filename ; then
sed -i.bak -e 's#\(IEHS_CONTEXT_ROOT=\)/\?\
(wps/iehs\)#\1/mynewcontextroot/\2#g' $filename
WebSphere Portal 7.0: Changing the Context RootPage 28/42
else
sed -i.bak '$ a IEHS_CONTEXT_ROOT=/mynewcontextroot/wps/iehs\n'
$filename
fi
Quickr Document Picker
1. Modify the context root of this application in the WAS administrative console:
◦ Quickr_Document_Picker
2. Update the context root information in the following files:
◦ wp_profile/installedApps/<node name>/Quickr_Document_Picker.ear/METAINF/application.xml
◦ wp_profile/installedApps/<node
name>/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/WEBINF/jsp/js/config.jsp
◦ wp_profile/installedApps/<node
name>/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/js/quickr/pi
cker/picker-packaged.js
◦ wp_profile/installedApps/<node
name>/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/js/quickr/pi
cker/picker-packaged.js.uncompressed.js
◦ wp_profile/installedApps/<node
name>/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/js/quickr/pi
cker/widgets/DocumentPicker.js
◦ wp_profile/installedApps/<node
name>/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/js/quickr/pi
cker/widgets/PickerDialog.js
◦ wp_profile/installedApps/<node name>/EphoxEditLive.ear/editoreditlive.war/jsp/html/EditLiveJavaEditor.jsp
◦ wp_profile/installedApps/<node name>/PA_WCM_Authoring_UI.ear/ilwwcmauthoring.war/jsp/html/OdcEditor.jsp
The editing in step #2 above can also be achieved by executing this script:
sed -i.bak -e 's#\([^A-Za-z09]\)/docpicker#\1/mynewcontextroot/docpicker#g' $(egrep -lr '[^A-Zaz0-9]/docpicker'
wp_profile/installedApps/*/Quickr_Document_Picker.ear/
wp_profile/installedApps/*/EphoxEditLive.ear/
wp_profile/installedApps/*/PA_WCM_Authoring_UI.ear/)
WebSphere Portal 7.0: Changing the Context RootPage 29/42
Web Resource Servlet
1. Modify the context root of this application in the WAS administrative console:
◦ WebResourceServlet.ear
MashupCommonComponent
1. Modify the context root of these applications in the WAS administrative console:
◦ MashupCommonComponent
◦ MashupMaker_Integration
◦ eventExplorer
WebSphere Portal 7.0: Changing the Context RootPage 30/42
◦ feedReader
◦ websiteDisplayer
2. Modify the custom properties of Resource Environment Provider WP
GlobalThemeConfig:
◦ resources.js.builder.system
◦ resources.js.builder.v2.0
◦ resources.js.enabler.system
◦ resources.js.enabler.v2.0
WebSphere Portal 7.0: Changing the Context RootPage 31/42
3. Modify the custom properties mashup.*.context of Resource Environment Provider
WP Mashup ConfigService:
WebSphere Portal 7.0: Changing the Context RootPage 32/42
4. Modify the following properties of the Resource Environment Provider WP
CommonComponentConfigService:
◦ cc.builder.context
◦ cc.enabler.context
◦ cc.extensions.context
WebSphere Portal 7.0: Changing the Context RootPage 33/42
5. Modify the following files of theme csa2.theme in WebDAV. To do this, update their
reference to /mccbuilder to include the new context root:
◦ Plain.html
◦ theme.html
◦ nls/Plain*.html
◦ nls/theme*.html
You also can modify these files by running the following script:
sed -i.bak -e 's#\([^A-Za-z09]\)/mccbuilder#\1/mynewcontextroot/mccbuilder#g' $(egrep -lr '[^AZa-z0-9]/mccbuilder' csa2.theme)
Upload the modified files to WebDAV.
6. Update the preferences of iWidget-wrapping portlet definitions.
a. Export the corresponding portlet definitions using the XML configuration
interface:
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd" type="export">
<portal action="locate">
<web-app uid="com.ibm.wps.resolver.iwidget.portlet.webmod"
action="export"/>
</portal>
</request>
b. Open the output XMLAccess file and look for portlet items that contain
preference tags named com.ibm.portal.iw:iwidget:base.
c. Specify the new context root in the value item as shown in the following
example:
<preferences name="com.ibm.portal.iw:iwidget:base" update="set">
<value><!
[CDATA[res:/mynewcontextroot/mccfeedReader/feedReader.xml]]></value>
</preferences>
d. Search for occurrences of src="/feedReader and replace them with
src="/mynewcontextroot/feedReader.
e. Import the modified XMLAccess script to update the iWidget-wrapping portlet
definitions on the server.
Manage search portlet
1. Update the registered Application URI entries in the database table
jcr.DbSchema.ICMSTJCRNODEREGISTER, where jcr.DbSchema needs to be
replaced with the actual value of jcr.DbSchema that is configured in
wp_profile/ConfigEngine/properties/wkplc_dbdomain.properties, The example
assumes Apache Derby as the configuration database of WebSphere Portal and
jcr.DbSchema is JCR
a. Stop the server instance WebSphere_Portal on all cluster nodes.
b. Create a backup of the database.
For Apache Derby you can create a copy of the directory
WebSphere Portal 7.0: Changing the Context RootPage 34/42
/opt/WebSphere/wp_profile/PortalServer/derby/wpsdb,
if all application server
instances are stopped and no Java process is accessing the database instance.
c. Start AppServer/derby/bin/embedded/ij.sh
d. Connect to the Derby database “wpsdb”:
CONNECT
'jdbc:derby:/opt/WebSphere/wp_profile/PortalServer/derby/wpsdb';
e. Verify that the following SQL query returns 78:
SELECT COUNT(*) FROM JCR.ICMSTJCRNODEREGISTER WHERE
APPLICATIONURI='wps/mypoc/?view=auth&uri=wcm:oid:';
f. Update the database with the following SQL statement:
UPDATE JCR.ICMSTJCRNODEREGISTER SET
APPLICATIONURI='mynewcontextroot/wps/mypoc/?view=auth&uri=wcm:oid:'
WHERE APPLICATIONURI='wps/mypoc/?view=auth&uri=wcm:oid:';
g. Verify that all entries in the table now show the new URL:
SELECT * FROM JCR.ICMSTJCRNODEREGISTER;
h. Disconnect from the Derby database
exit;
i. Start WebSphere Portal
2. Rebuild the JCRCollection1 search collection. To do this, proceed as follows:
a. In the Administration area of WebSphere Portal go to Manage Search → Search
Collections
b. Follow the link Search and Browse the Collection for JCRCollection1
c. Click on Delete all icon, which deletes all the documents.
WebSphere Portal 7.0: Changing the Context RootPage 35/42
d. To confirm whether the documents are deleted in the directory JCRCollection1,
go to Administration → Manage Search → Search Collections and check the
Documents column of JCRCollection1. The expected value is 0.
The Delete all option deletes all the documents in JCRCollection1, so that the next crawl
will index the documents newly.
You should wait for two indexing intervals for the JCRCollection1 index directory to be
rebuilt with the modified root context. The interval is configured in the Schedulers section
of JCRCollection1.
To confirm whether the documents are collected in the directory JCRCollection1, go to
Administration → Manage Search → Search Collections, and check the Documents
column of JCRCollection1. If documents exist, the expected value is larger than 0.
Check the search results in portal. The shown results will display a URL with the modified
context root.
Additional information is available here:
https://www.ibm.com/developerworks/websphere/zones/portal/proddoc/portaljcrsearch/
Synchronize cluster members and update the Web server plugin
1. Follow the instructions on page 8, step 11 to synchronize the configuration, but
select all cluster members, not only the primary node.
2. Perform the following steps if you are using an external Web server.
a. Regenerate the Web server plug-in in WebSphere Application Server. If you
use a remote Web server, copy the generated file plugin-cfg.xml to the
remote server.
Important: Do not perform this step if you only change the Producer URI.
b. Restart the Web server.
c. Restart the servers server1 and WebSphere_Portal.
Cleanup
Execute these commands to clear temporary data:
•
•
•
rm -R wp_profile/temp/*
rm -R wp_profile/wstemp/*
rm -R wp_profile/tranlog/*
WebSphere Portal 7.0: Changing the Context RootPage 36/42
Overview of context paths and the location where to apply
changes
Context path
/contentapi
/docpicker
/enabler
/eventExplorer
/Feed
/feedReader
/jcr
/lwp/imageServlet
/lwp/peopleSearch
/lwp/templatelibraryExport
/mccbuilder
/mccenabler
/mcceventExplorer
/mccextensions
/mccfeedReader
/mccwebsiteDisplayer
/mmtheme
/mum
/PageBuilder2
/portal_dojo
/PortalTheme
/searchfeed
/seedlist
/themes
/wcmextension
/websiteDisplayer
/widgets
/wp_proxy
/wps
/wps_semanticTag
/wps/catalogHandler
/wps/ephox
/wps/iehs
/wps/mailServlets
/wps/PA_Add_to_Sam_st_Portlet
/wps/PA_appearance
/wps/PA_ApplicationCatalog
/wps/PA_Banner_Ad
/wps/PA_BksFinalJSRProject
WebSphere
Configuration administrative
Task
console
WebSphere Portal 7.0: Changing the Context RootPage 37/42
XML configuration
interface
WebDAV
File
modification
/wps/PA_Blurb
/wps/PA_Blurb_1
/wps/PA_Clients_Manager
/wps/PA_Community_Port_App
Context path
/wps/PA_Credential_Admin
/wps/PA_Document_Viewer
/wps/PA_DoWebAccessServlet
/wps/PA_dynamicpersontag
/wps/PA_DynamicUIApp
/wps/PA_Eecontentandlayout
/wps/PA_Feed_Service_Admin
/wps/PA_FrequentUsers
/wps/PA_FS_Disambiguation
/wps/PA_Groups_Viewer_App
/wps/PA_IBMCommonPIMPort
/wps/PA_Impersonation
/wps/PA_Import_XML
/wps/PA_IWidget_Wrapper
/wps/PA_Login_Portlet_App
/wps/PA_LotusNotes
/wps/PA_LtusDocumentViewer
/wps/PA_MageVirtualPortals
/wps/PA_Manage_Webservices
/wps/PA_Markups_Manager
/wps/PA_MosoftExchange2003
/wps/PA_MPagesandFavorites
/wps/PA_MyTeamspaces
/wps/PA_Palette_Port_App
/wps/PA_ParamConfig
/wps/PA_People_Finder
/wps/PA_People_Picker_App
/wps/PA_PersontagServlet
/wps/PA_Policy_Status
/wps/PA_PolicyEditor
/wps/PA_PolicyEditorCA
/wps/PA_PolicyExplorer
/wps/PA_Portlet_Manager
/wps/PA_portletWiring
/wps/PA_Principals_Manager
/wps/PA_Properties
/wps/PA_PropertiesPortApp
/wps/PA_PTransformationApp
/wps/PA_Reminder
/wps/PA_Resource_Manager
/wps/PA_ResourceView
WebSphere
Configuration administrative
Task
console
WebSphere Portal 7.0: Changing the Context RootPage 38/42
XML configuration
interface
WebDAV
File
modification
/wps/PA_Roles
/wps/PA_SametimeWhoIsHere
/wps/PA_Search_Center
/wps/PA_SearchSitemapPort
/wps/PA_Selfcare_Port_App
/wps/PA_Set_Permissions
/wps/PA_Settings
/wps/PA_SIAPI
Context path
/wps/PA_SmetimeContactList
/wps/PA_spa
/wps/PA_SQL_Query
/wps/PA_Tag_Cloud
/wps/PA_TateCatalogPortApp
/wps/PA_TCustomizerPortApp
/wps/PA_ThemesAndSkinsMgr
/wps/PA_Tracing
/wps/PA_UniqueNames
/wps/PA_URL_mapping
/wps/PA_WCM_Admin
/wps/PA_WCM_Authoring_UI
/wps/PA_WCMLRingPortJSR286
/wps/PA_Web
/wps/PA_WebScanner
/wps/PA_wp.feedspace
/wps/PA_WPS_Welcome
/wps/pznauthor
/wps/pznlist
/wps/pznpublish
/wps/pznutilities
/wps/richText
/wps/spellcheck
/wps/um
(UserProfileRESTServlet)
/wps/upCatalogHandler
/wps/wcm
/wps/wcm/basicauth
/wps/wcmsearchseed
/wps/wprs
/wps/WsrpProxyPortlet
/WSPolicyManager
/wsrp
WebSphere
Configuration administrative
Task
console
()
XML configuration
interface
WebSphere Portal 7.0: Changing the Context RootPage 39/42
WebDAV
File
modification
Basic Testing
You need to test the configuration changes to the context root thoroughly. After you have
applied all changes do the following:
1. Shut down the application server instances WebSphere_Portal and server1 if they
are running2. Clear the directories wp_profile/temp and wp_profile/wstemp and the browser
caches.
3. Start the WebSphere Application Server instance WebSphere_Portal.
Now you can do a test that covers all the functionality that you plan for production use. To
verify correct work of WebSphere Portal, monitor the runtime log, for example
wp_profile/logs/WebSphere_Portal/SystemOut.log.
List defined context paths
You can see a comprehensive list of all context paths that are defined in the WAS
configuration by generating the file plugin-cfg.xml. To creae that file, run the following
command:
AppServer/bin/GenPluginCfg.sh
The command only creates a file wp_profile/config/cells/plugin-cfg.xml if such file
does not exist yet. Rename or delete the existing file to create a new version.
Check the Uri entries for updated context roots, for example:
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid"
Name="/mynewcontextroot/wps/*"/>
Web debugging tools
Web debugging tools help to check HTTP traffic to see if any resources might not be
addressed correctly, for example HTTP 404 errors for images, JavaScript files or style
sheets.
Multipart messages
Multipart server responses can hide HTTP errors, such as 404, from those tools. To find
open issues , turn multipart responses off temporarily:
•
In the WAS administrative console open Resource Environment Provider WP
CommonComponentConfigService and set the value of the custom property
cc.multipart.enabled to false.
WebSphere Portal 7.0: Changing the Context RootPage 40/42
Scripting samples
Changing the context root of a web application
You can change the context root of a web application using a Jython script for the wsadmin
process. The edit option to change the context root is -CtxRootForWebMod.
Here is an example for application Dojo_Resources:
AdminApp.edit('Dojo_Resources', ['-CtxRootForWebMod',
[['Dojo_Resources', 'dojo.war,WEB-INF/web.xml',
'/mynewcontextroot/portal_dojo']]])
AdminConfig.save()
Changing custom properties of a Resource Environment Provider
To make changes to custom properties of a Resource Environment Provider, you also can
use a Jython command. In the following example the context root is changed for custom
property cc.builder.context of Resource Environment Provider WP
CommonComponentConfigService:
AdminConfig.modify(AdminConfig.getid('/ResourceEnvironmentProvider:WP
CommonComponentConfigService/J2EEResourcePropertySet:/J2EEResourcePro
perty:cc.builder.context/'), [['value',
'/mynewcontexroot/mccbuilder']])
AdminConfig.save()
If you need to create a new custom property for a Resource Environment Provider then
you can use the following Jython command. In this example custom property
searchFeedContext is added to Resoource Environment Provider WP ConfigService:
AdminConfig.create('J2EEResourceProperty',
AdminConfig.getid('/ResourceEnvironmentProvider:WP
ConfigService/J2EEResourcePropertySet:/'), [['name',
'searchFeedContext'], ['type', 'java.lang.String'], ['value',
'/mynewcontextroot/searchfeed/']])
AdminConfig.save()
Changing files in WebDAV repositories
1. You can obtain the files from WebDAV using a regular HTTP request. For example
you can retrieve the common-resources directory using this wget command:
cd /temp
wget -O common-resources.zip
"http://hostname:10039/mynewcontexroot/wps/contenthandler/dav/fstype1/common-resources?mime-type=application/zip"
The theme PageBuilder2 has two views in WebDAV. You can see the deployment
artifacts in directory PageBuilder2, when connecting to the /fs-type1/themes
resource, and the model view of the identical theme in directory csa2.theme, when
connecting to the /themelist resource.
You can choose either directory to make the changes listed above. Scripting the
change is easier when using directory PageBuilder2 in /fs-type1/themes:
WebSphere Portal 7.0: Changing the Context RootPage 41/42
cd /temp
wget -O PageBuilder2.zip
"http://hostname:10039/mynewcontextroot/wps/contenthandler/dav/fstype1/themes/PageBuilder2?mime-type=application/zip"
2. You need to extract the downloaded archives before you can make any changes to
the corresponding files.
3. Once you have made the required changes to the extracted files and updated the
archive with these files, you can upload the archive again using configuration task
webdav-deploy-zip-file:
/opt/WebSphere/wp_profile/ConfigEngine/ConfigEngine.sh webdav-deployzip-file -DTargetURI=dav:fs-type1/themes/PageBuilder2/
-DZipFilePath=/temp/PageBuilder2.zip
WebSphere Portal 7.0: Changing the Context RootPage 42/42
© Copyright 2026 Paperzz