Friday, December 26, 2008

Prepend javascript to an action button - Portlet Factory

I am creating a form, which is submitted and a thank you page is display. Only the Form section is change to Thank You after submission, without refreshing the whole page.

I used a Button builder and set that in the Post-Action Behavior. The issue that I had was when submitting, the button stays active. If the connection is fast, it does not matter but when I was working at a slow connection place, when submitting, it takes a few seconds before the Thank you page shows but the button is still active.

The button calls an action. I want the button to run additional Javascript before running the action. From the forum, I manage to find the solution.

The HTML Event Action can be used. Select the location you want to insert the javascript. Action type, I use "Run a script". Then put in the javascript. In Advance, use Prepend new value.



This is very useful to add in more actions before the button action is triggered.

Thursday, November 20, 2008

Marking portal pages as hidden under the content root

In WebSphere Portal, when creating a new page under content root, it will be shown on the quick links navigation.
If you do not want a page that you create to appear in the main menu, you can hide the page. You can use own customize links or navigation to access the page via direct URL mapping.

To hide the page, it can be done through WebSphere Portal XML configuration interface. You do this by setting the hidden flag for the page parameter for the content-node tag in XML. You can use the following XML snippet:

<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd" type="update" create-oids="true">
<portal action="locate">
<content-node action="update" uniquename="com.mypage" active ="true">
<parameter name="com.ibm.portal.Hidden" type="string" update="set"><![CDATA[true]]></parameter>
</content-node>
</portal>
</request>

Make sure the uniquename is correct. You can get further details here.

This is a lot of work to achieve a simple thing. Wouldn't it be great if there's an option at the page property to hide or show it in the navigation.

Sunday, October 26, 2008

Happy Deepavali

Happy Deepavali to all Indians.

Monday, October 20, 2008

My Wife blog

My wife, Trista started blogging. And also complaining that I'm away from her for a few months. Currently in Denmark working on WebSphere Portal project. Will be back Malaysia soon.

Her blog is here.

Friday, October 03, 2008

WebSphere Portal V6.1.0.1 Beta

Here's a simple way to get people started to test / pilot WebSphere Portal.
IBM WebSphere Portal 6.1 Beta, Its the NEW beta 1, release of WebSphere Portal V6.1.0.1 Beta. It is available on VM Suse image. Just load the VM image and start the server. As simple as that.

Thursday, October 02, 2008

Configuring WebSphere Portal for site analysis logging

I have been missing in action for quite a while. My connection was limited because my previous company block most of the blogging sites. I have just join a new company and partial of my time will be located in Denmark. What suppose to be a Lotus Domino job turns out to be more working on WebSphere Portal. Luckily I have previous experience to let me carry out my task.

The portal implementation here is still on going. Thus one thing I can for see is that they will need statistic on the number of logons and pages access. By default WebSphere site analysis logging is not enable. Thus I took the initiative to enable the logging.

1) Open WebSphere admin console
2) In the navigation open the Resources section
3) Click Resource Environment Providers.
4) In the Resource Environment Providers frame make the following selection, depending on your environment:
* If running standalone, select Browse nodes and select the node.
* If installed in a cluster, select Browse Clusters and select the cluster.
5) Select the service to which you want to make changes. In this case select "WP SiteAnalyzerLogService"
6) Click Custom Properties. More info can be found here.

7) Restart the server to make the changes become effective.


Awstats can be use to present the generated logs in more friendly manner. There is an article here describing the steps.
Alternate to this, you can use third party tools. If your company policy allows, free site tracker can be used too. I have been using Google Analytics for some sites, it is easy to setup and it does provide detail informations.

Tuesday, February 05, 2008

Gong Xi Fat Chai

It's the time of the year again. Chinese New Year is around the corner (7th Feb). This year will be different, as I just got married. I have to give Ang Pow (red packet) instead of receiving. To all Chinese around the world Gong Xi Fat Chai.