Add a conf menu to my portlet

liferay, portlet

Solution

Yup you can do it by first of all adding this to your portlet.xml as a child of the "portlet" node:

    <init-param>
        <name>config-jsp</name>
        <value>/html/config.jsp</value>
    </init-param>

The in your liferay-portlet.xml you need to add this as a child of the "portlet" node:

<configuration-action-class>com.yourportlet.action.ConfigurationActionImpl</configuration-action-class>

Then you need to create this files in the directories you've specified in your XML, and your ConfigurationActionImpl should implement the ConfigurationAction interface so the skeleton would look like this:

public class ConfigurationActionImpl implements ConfigurationAction {

@Override
public String render(PortletConfig config, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception {                   
    return "/html/config.jsp";
}

Let me know if this helps or you have any other questions! :)

Problem

I'm trying to add a tab in the conf of my custom portlet, beside the natives import/export and permissions. Like in this image : http://imageshack.us/photo/my-images/716/sampledn.png/ This tab had to allow, to change the value of a parameter in a conf.properties which define some variable. How can I do that? Regards.

Original source