WebSphere Portal Server - Personalization and request attributes in WP 6.0

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > December 2007 > Personalization and request attributes in WP 6.0





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Personalization and request attributes in WP 6.0

2007-07-25, 7:22 pm

Hi guys,
I was able to use personalization rules based on request parameters to hide or show a portlet on a page.
Now I'd like to understand if it's possible to accomplish the following scenario by using request attributes:
Portlet A and Portlet B are placed on the same page.
Portlet A sets a request attribute (request.setAttribute("myattribute","myvalue").
Portlet B should be visible only when "myvalue" is a specific value.

I wasn't able to exploit built-in pzn object and rules to do that.
So, I tried to create a custom application object to extract the attribute from the request and expose it to visibility rules.
The application object can access the personalization RequestContext object,
but it's not clear to me exactly the relation between PortletRequest,HttpServletRequest and RequestContext.
I don't know if the problem is due to the order that Portal follows to render portlets and invoke personalization rules.
Any help really appreciated.

2007-07-26, 7:20 am

I found a solution for my issue.
The problem was related to HttpServletRequest attributes scope.
If you set the attribute out of the portlet container ( i.e. into Default.jsp) you can apply directly visibility rules on pzn Request object without pzn coding.

2007-07-26, 1:22 pm

> I found a solution for my issue.
> The problem was related to HttpServletRequest
> attributes scope.
> If you set the attribute out of the portlet container
> ( i.e. into Default.jsp) you can apply directly
> visibility rules on pzn Request object without pzn
> coding.


Are you using IBM Legacy Portlets or JSR 168 Portlets?

2007-07-26, 1:22 pm

I'm using only jsr168 portlets.
I was able to set HttpServletRequest attributes even in my portlet code.
Harisankar Gopalan

2007-07-27, 7:22 pm

HI,
How you applied rules on pzn request object ? You mean by creating rules in Admin console .


I too want to set attribute in request .I have tried by setting attributes in request. It didn't work . Can you provide sample code how you set attributes and how you applied rules for that request object.

Thanks
Hari

2007-07-30, 1:23 pm

Yes, you can use pzn Web UI to set a new dynamic property to the Request object named like the request attribute you want to set ("manage properties").

As quick test you can set attribute in Default.jsp of Portal theme before screen render... for instance ...

<% request.setAttribute("show","true"); %>
<table style="width:100%; height:100%;" cellpadding="0px" ....

Your visibility rule will like as ...

Show page or portlet when
current Request.show is true
Otherwise hide

after that you have just to map your rule to your portlet in Portal Web UI
("manage pages").

hope this helps.




andrius.kurtinaitis@sintagma.lt

2007-12-20, 7:39 am

That's tricky. There is no "Request" resource collection in the "attribute" menu if you create the rule when accessing the it through the Manage Pages -&gt; Select page -&gt; Edit properties.<br />
<br />
Because there is no "Request" resource collection, you cannot access "manage properties" of this collection... I could only add the dynamic property for request object through Launch -&gt; Personalization. But showing the page still does not work. The pag
e is still not displayed. The Default.jsp contains exactly the same line you posted before. Also the page display rule is exactly the same. The page simply does not display. Are the any means to see why it does so?
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com