Steps
a. Override generic portlet Dispatch method
private static final PortletMode CUSTOM_CONFIG_MODE = new PortletMode("config");
private static final PortletMode CUSTOM_EDIT_DEFAULTS_MODE = new PortletMode("edit_defaults");
protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException {
if (!WindowState.MINIMIZED.equals(request.getWindowState())){
PortletMode mode = request.getPortletMode();
if (CUSTOM_CONFIG_MODE.equals(mode)) {
doCustomConfigure(request, response);
return;
}
else if (CUSTOM_EDIT_DEFAULTS_MODE.equals(mode)) {
doCustomEditDefaults(request, response);
return;
}
}
super.doDispatch(request, response);
}
b. Add following in the portlet.xml
<custom-portlet-mode>
<portlet-mode>config</portlet-mode>
</custom-portlet-mode>
<custom-portlet-mode>
<portlet-mode>edit_defaults</portlet-mode>
</custom-portlet-mode>
Add following entries under the portlet tag
<supports>
<portlet-mode>config</portlet-mode>
<portlet-mode>edit_defaults</portlet-mode>
</supports>
No comments:
Post a Comment