2013-06-10

How to read the WebSphere Portal page mode.

In order to find out the view or edit mode of a portal page in WebSphere Portal 8 the portlet can read the public rendering parameter of the toolbar state:

Just add this to the portlet.xml file

<public-render-parameter>                                              
  <description>Shared render parameter that holds the toolbar state.</description>                                                      
  <identifier>toolbarstate</identifier>                                
  <qname xmlns:utb='http://www.ibm.com/xmlns/prod/websphere/portal/publicparams/utb'>utb:state</qname>                                                  
</public-render-parameter>                                              
                                                                       
Inside the <portlet> tag you need to add:                                                                                                    
<supported-public-render-parameter>toolbarstate</supported-public-render-parameter>

The value is then red using a normal:
 String statevalue = renderRequest.getparameter("toolbarstate");


No comments:

Post a Comment