Monday, April 19, 2010

How to create empty virtual portal using configuration Task

This post is more in continuation of my last blog entry regarding changing host name for your existing virtual portal. Fulfilling this task requires you to create an empty virtual portal as mentioned in a separate step.

Here is how you can create virtual portal with the help of configuration task create-virtual-portal.

1. Back up wkplc.properties file under
/WebSphere/wp_profile/ConfigEngine/properties folder.

2. Modify it for the following configuration properties and save.

# Title of the Virtual Portal
VirtualPortalTitle=
# Realm of the Virtual Portal
VirtualPortalRealm=
# Hostname of the Virtual Portal.
If you set the hostname, the portal sets the hostname, and the portal
parameter context is ignored.

VirtualPortalHostName=
# Context of the Virtual Portal
VirtualPortalContext=
# File which contains language specific information for the Virtual Portal
VirtualPortalNlsFile=
# VirtualPortalObjectId: ObjectId of the Virtual Portal
# The ObjectId is needed to modify, delete Virtual Portals and
# can be obtained by running task list-all-virtual-portals
# Note: Do not delete the default Virtual Portal (ObjectId ends with _0)
VirtualPortalObjectId=

3. Run the following command to create an empty virtual portal using above mentioned parameters.
./ConfigEngine.sh create-virtual-portal

4.
Execute the ./ConfigEngine.sh list-all-virtual-portals task to make sure that the virtual portal is created on the target environment.

5. You can access virtual portal through http://localhost:10040/wps/portal/ URL. You will get a blank page with message "Error 404: There is no content available."

In my next blog I will show you how you can populate empty virtual portal.

Thursday, April 15, 2010

Using a new host name for an existing virtual portal

Currently while working on my project I encountered an issue as a result of upgrading portal to 6.1.0.3.
The issue was regarding virtual portal that I created before an upgrade and assigned "Host Name" parameter to it. To troubleshoot the issue I had to change the "Host Name" value, in fact needed to remove it. Anyone played with Virtual portal might have got that this is not possible by just editing the virtual portal settings using Administrative portlet. You can not modify this entry after you assigned it. I have gone through the infocenter and found that this is know limitation for virtual portal and one has to follow below mentioned series of steps to achieve this task.

1. Export the content of your existing virtual portal using xmlAccess interface.

[Portal_server_root]/bin $ ./xmlaccess.sh -user admin -password secrete -url http://hostname:port/wps/config/virtual_portal_context -in /opt/IBM/WebSphere/PortalServer/doc/xml-samples/Export.xml -out result.xml

2. Delete existing virtual portal using manage virutal portal portlet.


3. Clean up any references to the deleted virtual portal by using the Task.xml of xmlAccess.

./xmlaccess.sh -user admin -password secrete -url http://hostname:port/wps/config -in /opt/IBM/WebSphere/PortalServer/doc/xml-samples/Task.xml -out result_cleanup.xml

4. Create a new empty virtual portal by running configuration task
create-virtual-portal. Use the context of the deleted virtual portal and do not provide any host name parameter value.

5. Import the contents of the original virtual portal to the new virtual portal using xmlAccess interface.

./xmlaccess.sh -user admin-password secrete -url http://hostname:port/wps/config/New_virtual_Portal_Context -in /opt/IBM/WebSphere/PortalServer/bin/result.xml -out result_import_VP.xml


Now you are ready to access your virtual portal :). Hope this helps the community in some way.


Saturday, April 10, 2010

How to remove maximize and minimize links in the Portlet context menu

In certain cases it is an desired behavior to disable the minimize and maximize functionality of portlets in IBM WebSphere Portal. you can achieve this behavior by following the simple step mentioned here.

1. Take a backup of portletContextMenu.jsp file from your custom theme war file. It can be loacated at
(WarFileName)/themes/html/Portal folder, where (WarFileName)
is the name of your web application containing your themes.

2. Open the portletContextMenu.jsp file and search for the following elements for the minimize and maximize links. Remove the following two "c-rt:if" elements:



3. Save the modified file in your web application and redeploy the web application. Pages with your custom theme applied will now not render any minimize and maximize links in the portlet context menu.