File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes show/hide portlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "show/hide portlet?" Watch "show/hide portlet?" New topic
Author

show/hide portlet?

pulijala hari
Ranch Hand

Joined: May 14, 2005
Posts: 70
Hi,

How do I show/hide a portlet in a portal page in Websphere portals.

I have 4 portlet, but, initially the only portlet that should display is just the Welcome page portlet, and the other portlet will only show on the same page when its link has been clicked.

Is there anyway in rules where i can only set a rule like
'Show Portlet when conditon=value otherwise hide' instead of applying whole rule for the entire portal page.

Please help. Thanks.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

The invisible portlet is actually a pretty tricky thing to implement. I've had a number of customers ask, and have done a few hacks to make it happen. I'm not sure, but I think WebSphere Portal 6 has an invisible feature, but not earlier versions. I haven't seen it, and it may have been a dream, but I thought I saw something about it somewhere.

Anyways, here was one trick I used. It was actually for a portlet that should be invisible unless there was an 'alert'. What we did was we had the portlet output nothing in the view mode unless there was an alert. Then, we applied an invisible skin, where no icons or outlines were used. As a result, the portlet was only visible when there was an alert - other times, the user didn't even know it was there.

It's not exactly what you are asking, but maybe it'll give you some ideas.

You might want to rethink your layout though. That's probably better.

If logging in triggers the other portlets to appear, maybe you should just make it security based. The one portlet has anonymous access, and the others do not have anonymous access. Once a user logs in, the portlets that are on the page, but do not have anonymous access, magically become visible.

Just some ideas for you.

-Cameron McKenzie
pulijala hari
Ranch Hand

Joined: May 14, 2005
Posts: 70
Hi Cameron,

Thank you for the insight.
It will be very nice if you would share the code.
Can we apply different skins to portlets on a single page..
I was only able to apply skins and themes to an entire portal page rather individual portlets on a single portal page?

Please throw some ideas on this.

regards,
hari
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Indeed, you can apply different skins to different portlets on a page. There is one however: a theme can define which skins are valid, and for consistency sake, most themes only allow one skin. You have to ensure that multiple skins are allowed for a theme, including the invisible skin.

I apologize for not having the invisible skin. It's at a client site I worked at a few years ago when WebSphere Portal 5.0 was the hot ticket. Someone who develops skins should be able to put one together quickly. It's probably the simplest skin you could do, because there's nothing there.

I still think access restrictions might be the right way to go.

Good luck,

-Cameron
Adrian Enns
Ranch Hand

Joined: Aug 11, 2004
Posts: 48
I know in Weblogic 8.1 you can set "entitlements" of whether a portlet is visible or not by the role of the person who is logged in. Alternatively, I know you can also get access to the "desktop" of the portal application, then get all of the portlets associated with the desktop, and make specific portlets visible/invisible by the name/id of the portlet. Anyways, I'm not sure how this relates to Websphere, but I hope it helped somewhat.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: show/hide portlet?