Provide customization tools


WebSphere Portal provides tags that support rendering tool images for editing portlets, pages, and labels. The tools are rendered when the user selects the Show Tools icon in the portal tool bar.

The customization tools must be available only for the selected node. Therefore, make sure the markup is placed within the tag...

<wps:if nodeInSelectionPath="yes">

Use of the Show Tools icon and the corresponding markup for generating the customization tools for portlets and nodes has a high impact on performance.

The JSP and Java code for generating customization tools for navigation nodes is shown below. This is the code used for the navigation tree. However, this code is the same as the code used for single level navigation. The only difference is in the HTML markup.

  • The <wps:urlGeneration/> tag and conditional coding are used to generate links to edit the layout of the page or the change the properties of a label, depending on the node type.

  • The parameters passed by the <wps:urlParam/> tag are specific to the Edit Layout and Properties portlets and must be coded as shown.

<%-- display show tools buttons --%>

<wps:if nodeInSelectionPath="yes">
<wps:if showTools="yes">
    
<%-- link to customizer if node is a page --%>
<wps-internal:adminlinkinfo name="<%=AdminUniqueNamesMappingService.CONTENT_LAYOUT%>">

<%
  if (((ContentNodeType.COMPOSITION).toString()).equals(wpsContentNodeTypeString)) 
  {
%>

<wps:urlGeneration contentNode="<%=wpsContentNode%>" 
                   portletWindowState="Normal" 
                   pacCheck="<%=CreateUrlCommand.PAC_EDIT_LAYOUT%>">

   <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_INIT %>" 
                 value="init" />

   <wps:urlParam name="<%= SharedParamConstants.WORKING_CONTENT_NODE%>" 
                 value="<%= wpsContentNodeID %>"/>

   <wps:urlParam name="<%= SharedParamConstants.ORIGIN_CONTENT_NODE %>" 
                 value="<%= wpsContentNodeID %>" />

   <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_PUSH %>" 
                 value="push" />

     <a class="wpsNavSelectedNode" href="<% wpsURL.write(out); %>" >

       <img class="wpsNavNodeIcon" 
            alt="<wps:text key="link.editlayout" bundle="nls.engine"/>" 
            src="<wps:urlFindInTheme file='show_tools_edit.gif'/>"  
            align="absmiddle">

     </a>  

</wps:urlGeneration>

<%
      }
%>

</wps-internal:adminlinkinfo>

<%-- link to properties portlet if node is a label --%>
<wps-internal:adminlinkinfo name="<%=AdminUniqueNamesMappingService.PROPERTIES_PORTLET%>">

<%
  if (((ContentNodeType.LABEL).toString()).equals(wpsContentNodeTypeString)) {
%>

<wps:urlGeneration contentNode="<%=wpsContentNode%>"
                   compositionNode='<%= wpsCompositionNode %>' 
                   portletWindowState="Solo" 
                   pacCheck="<%=CreateUrlCommand.PAC_EDIT_LAYOUT%>">

   <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_INIT %>" 
                 value="init" />

   <wps:urlParam name="<%= SharedParamConstants.ORIGIN_CONTENT_NODE %>" 
                 value="<%= wpsContentNodeID %>" />

   <wps:urlParam name="<%= SharedParamConstants.WORKING_CONTENT_NODE%>" 
                 value="<%= wpsContentNodeID %>"/>

   <wps:urlParam name="<%= SharedParamConstants.PROPERTIES_ACTION_TYPE %>" 
                 value="<%= SharedParamConstants.PROPERTIES_ACTION_TYPE_EDIT %>" />

   <wps:urlParam name="<%= SharedParamConstants.PROPERTIES_CONTENT_NODE_TYPE %>" 
                 value="<%= SharedParamConstants.PROPERTIES_CONTENT_NODE_TYPE_LABEL %>" /> 

   <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_PUSH %>" 
                 value="push" />

    <a class="wpsNavSelectedNode" href="<% wpsURL.write(out); %>" >

      <img class="wpsNavNodeIcon" 
           alt="<wps:text key="link.editlayout" bundle="nls.engine"/>" 
           src="<wps:urlFindInTheme file='show_tools_properties.gif'/>"  
           align="absmiddle"></a>  

</wps:urlGeneration>

<%
  }
%>

</wps-internal:adminlinkinfo>
    
</wps:if>
</wps:if>
<%-- end show tools buttons --%>

 

See also

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.