Foren
Configuration Page for MVC Portlet
Phoenix Zerin, geändert vor 12 Jahren.
Configuration Page for MVC Portlet
Junior Member Beiträge: 60 Beitrittsdatum: 28.06.11 Neueste Beiträge
How do I create a new tab on the configuration view for an MVC plugin portlet?
EDIT: I noticed from this forum post that this feature has ben deprecated; is there a better way to control settings for all users per instance of a portlet?
Thanks!
EDIT: I noticed from this forum post that this feature has ben deprecated; is there a better way to control settings for all users per instance of a portlet?
Thanks!
Mani kandan, geändert vor 12 Jahren.
RE: Configuration Page for MVC Portlet
Expert Beiträge: 492 Beitrittsdatum: 15.09.10 Neueste Beiträge
Phoenix Zerin, geändert vor 12 Jahren.
RE: Configuration Page for MVC Portlet
Junior Member Beiträge: 60 Beitrittsdatum: 28.06.11 Neueste Beiträge
Thanks for the links Mani.
Do you know if there's an MVCPortlet way to accomplish this?
Do you know if there's an MVCPortlet way to accomplish this?
Mani kandan, geändert vor 12 Jahren.
RE: Configuration Page for MVC Portlet
Expert Beiträge: 492 Beitrittsdatum: 15.09.10 Neueste Beiträge
Phoenix Zerin, geändert vor 12 Jahren.
RE: Configuration Page for MVC Portlet
Junior Member Beiträge: 60 Beitrittsdatum: 28.06.11 Neueste Beiträge
I guess what I'm curious about is how one might implement a config mode in the same way as view/edit/help mode for a plugin portlet; that is:
docroot/WEB-INF/portlet.xml:
docroot/WEB-INF/src/.../MyPortletClass.java:
docroot/html/config.jsp:
The above doesn't work as expected, though (in fact, it doesn't seem to have any effect on the portlet's behavior whatsoever).
docroot/WEB-INF/portlet.xml:
<init-param>
<name>config-jsp</name>
<value>/html/config.jsp</value>
</init-param>
...
<supports>
...
<portlet-mode>CONFIG</portlet-mode>
</supports>
docroot/WEB-INF/src/.../MyPortletClass.java:
@Override
public void doConfig(RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException
{
...
}
docroot/html/config.jsp:
<p>This is my portlet in <b>config</b> mode.</p>
The above doesn't work as expected, though (in fact, it doesn't seem to have any effect on the portlet's behavior whatsoever).
Phoenix Zerin, geändert vor 12 Jahren.
RE: Configuration Page for MVC Portlet
Junior Member Beiträge: 60 Beitrittsdatum: 28.06.11 Neueste Beiträge
Interestingly, even using Liferay Developer Studio's own tool - the New Plugin Portlet wizard - I still can't get this to work. When creating a new portlet, I am presented with the opportunity to configure it with "config" mode, which causes the wizard to make changes very similar to what I posted above, except with one difference:
docroot/WEB-INF/portlet.xml:
Note "config" portlet mode instead of "CONFIG".
But this still seems to have no effect whatsoever upon my portlet's behavior; when I deploy my portlet and click on the wrench icon in my portlet's titlebar and select "Configure", I still don't see my custom config page anywhere.
docroot/WEB-INF/portlet.xml:
<init-param>
<name>config-jsp</name>
<value>/html/config.jsp</value>
</init-param>
...
<supports>
...
<portlet-mode>config</portlet-mode>
</supports>
Note "config" portlet mode instead of "CONFIG".
But this still seems to have no effect whatsoever upon my portlet's behavior; when I deploy my portlet and click on the wrench icon in my portlet's titlebar and select "Configure", I still don't see my custom config page anywhere.