You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Vitaly Baranovsky <vi...@gmail.com> on 2007/08/28 17:18:10 UTC

How can I obtain portlet entity id (fragment id) inside my portlet?

Good day!

I need to obtain portlet entity id (of fragment id) inside my portlet
web application? How can I do this?


For example, I have portlet HelloWorldPortlet. I've added it into
jetspeed/portal/default-page.psml thru admin interface. In
default-page.psml this portlet has {fragment
id="P-112d8cbcef3-10000"}. How can I obtain this id (
"P-112d8cbcef3-10000") inside java code of my portlet to store it to
my corporate database?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: How can I obtain portlet entity id (fragment id) inside my portlet?

Posted by Edgar Poce <ed...@gmail.com>.
Hi Vitaly,

 I think you can obtain the fragment id with the following code:

ContentFragment contentFragment = (ContentFragment) portletRequest
				.getAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE);
contentFragment.getId();

br,
edgar

On 8/28/07, Vitaly Baranovsky <vi...@gmail.com> wrote:
> Good day!
>
> I need to obtain portlet entity id (of fragment id) inside my portlet
> web application? How can I do this?
>
>
> For example, I have portlet HelloWorldPortlet. I've added it into
> jetspeed/portal/default-page.psml thru admin interface. In
> default-page.psml this portlet has {fragment
> id="P-112d8cbcef3-10000"}. How can I obtain this id (
> "P-112d8cbcef3-10000") inside java code of my portlet to store it to
> my corporate database?
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: How can I obtain portlet entity id (fragment id) inside my portlet?

Posted by Ate Douma <at...@douma.nu>.
Vitaly Baranovsky wrote:
> Good day!
> 
> I need to obtain portlet entity id (of fragment id) inside my portlet
> web application? How can I do this?

portlet-bridges-common >= 1.0.2 (available at runtime from shared/lib classloader):

   org.apache.portals.bridges.util.PortletWindowUtils
       public static String getPortletWindowId(PortletSession session)

Note: this method uses a JSR-168 compliant "trick", JSR-286 (Portlet API 2.0) will provide a formal API method for it.

Regards,

Ate

> 
> 
> For example, I have portlet HelloWorldPortlet. I've added it into
> jetspeed/portal/default-page.psml thru admin interface. In
> default-page.psml this portlet has {fragment
> id="P-112d8cbcef3-10000"}. How can I obtain this id (
> "P-112d8cbcef3-10000") inside java code of my portlet to store it to
> my corporate database?
> 
> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org