-
1. Re: How to get a portlet's instance name from the portlet cl
julien1 Mar 31, 2008 6:32 PM (in response to porcho)it's not really possible to do that.
you could probably add an portlet instance interceptor that would take the portlet instance name and set it as a request attribute, really quite easy to do but would be targetted for 2.6 for instance as you would use an internal API of the portal.
You can look at the org.jboss.portal.core.model.instance.InstanceSecurityInterceptor to base your work on.
This interceptor is then declared in jboss-portal.sar/META-INF/jboss-service.xml -
2. Re: How to get a portlet's instance name from the portlet cl
julien1 Mar 31, 2008 6:32 PM (in response to porcho)BTW, the instance name can only be known at runtime and not in init() method as a same portlet could be invoked by 2 different instances.
-
3. Re: How to get a portlet's instance name from the portlet cl
porcho Apr 2, 2008 9:21 AM (in response to porcho)Thanks for your help. I've created the portlet interceptor and added it to the stack in jboss-service.xml, as you suggested; and made the portlet instance's name a request attribute. And it worked!
Thanks once again. -
4. Re: How to get a portlet's instance name from the portlet cl
pmn92 Apr 2, 2008 9:52 AM (in response to porcho)An alternative to get portlet instance data is to put them into the portlet-instances.xml preferences.