How to get a page id from portlet?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > How to get a page id from portlet?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to get a page id from portlet?  
bernar_l


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-07-04 10:34 AM

Hi all,

I try to get from a portlet code, the page Id where the portlet is running.
Does someone know how to do it using the IBM portlet API?

Thxs





[ Post a follow-up to this message ]



    Re: How to get a page id from portlet?  
Oliver Meyer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-07-04 11:41 AM

Bernar,
the portlet does not know which page it is located on. Therefore, as far
as I know, this is not possible.

Oliver

bernar_l wrote:
>
> Hi all,
>
> I try to get from a portlet code, the page Id where the portlet is running
.
> Does someone know how to do it using the IBM portlet API?
>
> Thxs





[ Post a follow-up to this message ]



    Re: How to get a page id from portlet?  
Michael Yashin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-04 08:07 PM

Hi,

Yes you can do it. You should use Object Model v5 API. It is not
public available. Try asking IBM Support....

You should write something like this:

-------
import com.ibm.portal.*;
import com.ibm.portal.navigation.*;
import com.ibm.wps.model.ModelUtil;

ModelUtil util = ModelUtil.from(request)
NavigationNode node =
(NavigationNode)util.getNavigationSelectionModel().getSelectedNode();
//this gives you SYSTEM id of the page it MUST be
String id = node.getContentNode().getObjectID().toString();
//this gives you USER id of the page USUALLY it is not entered by
users 
String id2 = node.getContentNode().getObjectID().getUniqueName()
-------

Hope it helps.

Regards,
Michael Yashin





[ Post a follow-up to this message ]



    Re: How to get a page id from portlet?  
cburleso@us.ibm.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-14-04 07:10 PM

You can also get a unique identifyer for the portlet by using

String pid = portletResponse.encodeNamespace("");







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:56 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register