At first let us see what is edit defaults mode ?
- Edit Defaults mode is one of the portlet mode available in JSR 168(Portlet API) .
- This mode is created to share some default preference values to all the users. (i.e., If admin set some preference values by using this edit defaults mode then this values will be a default preference values for all other users.)
- Any time admin can change others preference values by using this shared settings option.(i.e., if any body selected some theme if admin changes the theme by using this edit defaults mode then automatically it will reflect for all other users.)
- This mode will be applicable only for portal admin not for all users.
- You need make the following entry in portlet.xml
<portlet>...<supports><mime-type>text/html</mime-type><portlet-mode>edit</portlet-mode><portlet-mode>edit_defaults</portlet-mode></supports>...</portlet>
<custom-portlet-mode><description xml:lang="en">edit_defaults mode</description><portlet-mode>edit_defaults</portlet-mode></custom-portlet-mode>
</portlet-app>
You need to override doDispatch() of Generic Portlet. Sample code
// Added for Edit_Default_Mode
private static final PortletMode EDIT_DEFAULT_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( EDIT_DEFAULT_MODE.equals(mode) ) {
// System.out.println("Inside edit default mode condition : Bala S Murugan ::: ); doCustomConfigure(request, response);return;}}super.doDispatch(request, response);
}
Well once you create your portlet with edit_defaults mode then after deploying in websphere portal 6.0.If you login as a portal admin then you will see a new link "EDIT SHARED SETTINGS" in your portlet title bar.Where This "EDIT SHARED SETTINGS" is nothing but Edit_Defaults in Websphere 6.0.
1 comment:
nice artical about edit_defaults mode in JSR 168.
Post a Comment