Wednesday, February 18, 2009

Portlet Personalization, visibility rules using only lower case

In Websphere Portal, we want to hide some portlets in certain pages according to the user's group. Personalization function in the portal can be used for this.

I want to show the portlet if the user is in the group MYUsers. The fullname of the group is CN=MYUsers. Thus I've created a new Rule type Visibility.

Show page or portlet when
current Portal Users.Groups includes CN=MYUsers
Otherwise hide

By applying the rule to the portlet, it should hide the portlet if the login user is not in the MYUsers group. But there are some issue for the above rule. Using an LDAP browser, the group name is CN=MYUsers. But when applying it to the rule, it doesn't seem to be working.

The group name have to be set to lowercase to get it working.

Show page or portlet when
current Portal Users.Groups includes cn=myusers
Otherwise hide

The documentation does not state that the group name have to be in lowercase. Thanks to my colleague, after much trying around, he found that lowercase group name is working.

Thursday, February 12, 2009

Apple's Design Process

There's an interesting article here from Michael Lopp, senior engineering manager at Apple, who tried to assess how Apple can ‘get’ design when so many other companies try and fail.

10 to 3 to 1
Apple designers come up with 10 entirely different mock ups of any new feature. Not, Lopp said, "seven in order to make three look good", which seems to be a fairly standard practice elsewhere. They'll take ten, and give themselves room to design without restriction. Later they whittle that number to three, spend more months on those three and then finally end up with one strong decision.

Tuesday, February 03, 2009

IBM Lotus Web Content Management Rendering Portlet

IBM have release an update to the Web Content Viewer portlet. You can download it from the portlet catalog.

The IBM® Lotus® Web Content Management Rendering Portlet provided with this package is a solution which updates and improves how the rendering of Web content is performed in IBM WebSphere® Portal. While the existing Web Content Viewer portlet (referred to in the WebSphere Portal documentation as a "rendering portlet") has evolved throughout several versions to implement sophisticated Web content rendering functions, it is still based on the deprecated IBM Portlet API. By contrast, the new JSR 286 Web Content Viewer has been entirely redeveloped based on the Java™ Portlet Specification 2.0 (JSR 286). In addition to the benefits afforded by JSR 286, the JSR 286 Web Content Viewer in this package also enables other features for Web content management, such as a new Web content portal page type and support for the standard search seedlist 1.0 format.

Wednesday, January 14, 2009

Hiding navigation on web page when printing

When printing a web page, we want to maximise the content area for printing. To do this, I want to hide the navigation area when user is printing the page.

For example in a page, there are 3 area, header, left navigation and content.

<div id="header">header</div>
<div id="nav">Left navigation</div>
<div id="content">Content area</div>


When user click on print, only the content area is printed. This can be control using a seperate CSS to hide certain area when printing.
The sample is below.

Add the css link in the page. The media type = "print".

<link rel="stylesheet" type="text/css" media="print" href="print.css" />


In print.css

#header{display:none}
#nav{display:none}


This would hide the header and the nav div tag when printing.

Portlet Factory 6.1.2

Portlet Factory 6.1.2 is out. You can get the 60 days trial version here.
It looks like 6.1.2 is a new version and not an upgrade or fixpack for PF 6.1.

Friday, January 09, 2009

Highlighted Selected Content in Menu - WebSphere Content Management System

In a WebSphere Portal page, I inserted a few Web Content Viewer portlets. The top portlets shows a menu list the content. The bottom portlet will display the selected content from the list. The issue I had was highlighting the selected content in the menu.

From the forum, there were some suggestions but it didn't work for my case.

I manage to solve it by using the Content ID. The idea is, when the content is loaded, it can find which link in the menu is selected by the Content ID. Thus you can add in code to change the attributes.

In the menu component, I add in a class which is the content ID into the links.

<A HREF="<Placeholder tag="href"/>" class="<Placeholder tag="Idnum"/>"><Element context="autoFill" type="content" key="headline"/></A>


Then in the presentation template I added dojo code to put in another class into the selected content.

<script>
dojo.addOnLoad(function(){
dojo.query(".<IDCmpnt context="current" type="content" field="id"/>")
.addClass("selectedContent")
});
</script>
<style>
.selectedContent{color:black;font-weight:bold;}
</style>


Thus when the content is loaded, it will search the page for the class <Idnum> and add in the class selectedContent. For the Idnum here, I use a class instead of id because in certain pages, there are more than 1 links to the same content.

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.