-
1. Re: get portlet information from portletrenderer ?
cpage Feb 21, 2006 5:36 AM (in response to cpage)hi
here is my class :public class CpagePortletRenderer implements PortletRenderer { /** * @see PortletRenderer#render */ public void render(RenderContext renderContext, PortletContext state, WindowResult result) throws RenderException { renderStart(renderContext); renderContext.getMarkupFragment().append("\n<!-- début contenu de la portlet -->" ); renderContext.getMarkupFragment().append(result.getContent()); renderContext.getMarkupFragment().append("\n<!-- Fin contenu de la portlet -->\r\t\t\t\t" ); renderEnd(renderContext); }
I want to have the name of the portlet which is in the window container.
i think it's something like ::
myInstance.getComponentRef() ....
how can i have the myInstance object, from the instanceID ?
thanks !
i take a look at the management portlet but i'm not good with jsf technology.
regards
Lionel -
2. Re: get portlet information from portletrenderer ?
cpage Mar 22, 2006 11:15 AM (in response to cpage)up :p
in the portletcontext, i have information about, the instance, the window, the region but nothing about the portlet itself.
i want to read some of init-param, put in the portlet-xml for the portlet i'am rendering.
for example: what icone is set to this portlet ?
thanks for help ! -
3. Re: get portlet information from portletrenderer ?
cpage Mar 22, 2006 11:53 AM (in response to cpage)ok, i can have the icon of the portlet if i had a property "icon" to the portletwindow in the -portal.xml
it's a little bitt dirty :p -
4. Re: get portlet information from portletrenderer ?
cpage Mar 23, 2006 4:40 AM (in response to cpage)hi,
accessing window properties when portlet is rendering work, but i have to stop my server if i change the properties.
am i the only one who wants to access portlet properties in the renderer when the portal and the portlets are rendering ?
ty -
5. Re: get portlet information from portletrenderer ?
mholzner Mar 27, 2006 11:56 AM (in response to cpage)I'm not sure what exactly you want here. Is it the data from the portlet.xml ?
The WindowResult class should give you all the portlet info you need. The RenderContext and WindowContext allow you to get to the layout/theme specific information.
If all of that doesn't suffice, you can always set a response property in the portlet's doView method, and pick it up in your renderer. -
6. Re: get portlet information from portletrenderer ?
mholzner Mar 27, 2006 11:58 AM (in response to cpage)would read-only access to the portlet preferences solve the issue for you ?
-
7. Re: get portlet information from portletrenderer ?
cpage Mar 27, 2006 2:30 PM (in response to cpage)ty mholzner for your response :p
what i want to do :
each portlet in my portal must have their own icon in the left side of their header.
so, in my renderset, i have to render the right icon for the right portlet.
to know which icon is set for a portlet, my first idea was to set an init-param for each portlet in the portlet.xml and to read the init-param "icon" in the renderset for each portlet i'am rendering
the problem :
i have no information about the portlet in windowresult, rendercontext or portletcontext except the generate content fragment of the portlet.
first solution :
set a property "icon" for each window in -object.xml
i can access to the properties so i can render the right icon for the right window and so for the right portlet.
the problem of that method (except it's not a clean solution:p) is that i can't change the icon dynamically for my portlet, i have to restart the server if i make a change.
for the moment, this solution is acceptable for me but in the near future, i think it will raise some problems.
thank you in advance
best regards
lionel