Friday, May 21, 2010

How to attach default skin to Theme using xmlAccess

Today, I encountered a really interesting problem reported by my ex-colleague. While working on the portal, accidentally he has removed skins which are attached to default theme of the portal. Now this has resulted in him not able log in to the portal.This is due to no portlet display because of the skin being deleted.
When he tried log in using direct portal url which bypasses the log in portlet he found out the pages are there but portlets are not rendered while clicked on those pages. He was not even get back to the default settings using themes and skins page from the administration section.

Solution to this problem is getting back the default settings for the themes/skins using xmlAccess.
To resolve this we followed below steps.

1. We exported the complete portal configuration using xmlAccess. For this we have used sample ExportRelease.xml which comes with default portal installation. This can be found under [Portal_server_root]/doc/xml-samples. Here is a command to do that

./xmlaccess.bat -in C:/Program Files/IBM/WebSphere/PortalServer/doc/xml-samples/ExportRelease.xml -user wpsadmin -password wpsadmin -url http://localhost:10038/wps/config -out wpsserver_config.xml

2. Open the exported file, which in this case wpsserver_config.xml and find the entry which starts with theme action="update" active="true" default="true". Add a parameter defaultskinref="K_NO2UF4I1186E1026H4BLVI00E6" to it. Here value for the defaultskinref is the ID of the skin which is deployed in your environment. This will be a default skin to your theme. You can fine skins in the same xml file. Find using skin action="update" text.

3. Once updated and saved, import this xml file to your portal server using xmlAccess. Here is a command for it.

xmlaccess.bat -in C:/updatedXML/wpsserver_config.xml -user wpsadmin -password wpsadmin -url http://localhost:10038/wps/config

That's it. We are able to access portal as it was before the problem. :)

3 comments:

Anonymous said...

cool. Its really wonderful.

Anonymous said...

Cool. It is really wonderful

Sriram Prasad said...

thank you boss...
it helped alot...