Vivek Agarwal’s Portal/Java Blog

An IBM Gold Consultant’s weblog about IBM, Lotus, WebSphere, J2EE, IT Processes, and other IT technologies

How do you add a “create a new sibling page” link in a WebSphere Portal v6 theme?

Posted by Vivek Agarwal on February 16, 2008


This blog entry is straight plagiarism! I got this from Keith (a co-worker) and thought that it was pretty cool and decided to share his work. Keith has been doing some cool stuff for an Xtivia client and some of this work has been around some serious theme customizations. One of those theme customizations that he had to figure out was how to add a persistent link to the theme which will add a new page at the currently selected level of navigation in WPE. This is useful for many situations including where you have a tab based navigation, you can have a “New page” tab where users can simply specify a page name and add a new tab at the same level as the other tabs. It goes like this:

<c:forEach var="i" begin="${themePolicy.topNavigationStartLevel}" end="${themePolicy.topNavigationStopLevel}" step="1">

<portal-navigation:navigation startLevel="${i}" stopLevel="${i}"><%-- New page --%>

<%

NavigationNode currentNode = (NavigationNode)wpsSelectionModel.getSelectedNode();

NavigationNode parentNode = (NavigationNode)wpsNavModel.getParent(currentNode);

String parentIDString = com.ibm.wps.portlets.admin.AdminPortletUtils.getStringObjectID(parentNode.getContentNode().getObjectID());

%>

<portal-internal:adminlinkinfo name="PROPERTIES_PORTLET">

<portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>"

layoutNode='<%= wpsCompositionNode %>'

portletWindowState="Solo"

accessControlCheck="CreatePage"

themeTemplate="">

<portal-navigation:urlParam name="init" value="init" />

<portal-navigation:urlParam name="OCN" value="<%= parentIDString %>" />

<portal-navigation:urlParam name="WCN" value="<%= parentIDString %>"/>

<portal-navigation:urlParam name="PAT" value="PTQ" />

<portal-navigation:urlParam name="PNT" value="PNTC" />

<portal-navigation:urlParam name="psh" value="push" />

<a href="<% wpsURL.write(out); %>">New Page</a>

</portal-navigation:urlGeneration>

</portal-internal:adminlinkinfo>

</portal-navigation:navigation>

</c:forEach>

Direct Keith quote: It could be cleaned up, but you get the idea. The relevant points are that you need to pass the parent’s ObjectID String into the OCN and WCN url parameters for the urlGeneration tag, and you need to use the AdminPortletUtils.getStringObjectID(ObjectID id) in order to transform an ObjectID into a String.

Hoping that my plagiarism comes handy for somebody! 🙂

Advertisements

6 Responses to “How do you add a “create a new sibling page” link in a WebSphere Portal v6 theme?”

  1. paulovj said

    your plagiarism is a life saver, sir.
    we lost this funcionality when upgrading from wps5.1, and I spent the last week trying to fix it.

    many thanks.

  2. Lakshmikanth said

    Can you please tell how to fetch back the paramaeters sent by tags?

  3. Jean said

    Where I will add this code? In topNav.jspf?

    Could you help me?

  4. Jean said

    Hi.

    I do it and works fine. I did add the code in topNav.jspf file.

  5. Jean said

    Could we to custom the create page portlet?

  6. masutyf said

    мастурбатор анус Флешлайт – помпа мастурбатор, мастурбатор, великий мастурбатор, великом мастурбаторе, мастурбатор видео, сибирский мастурбатор, мастурбаторы. Сайт fleshlayt.ru

Sorry, the comment form is closed at this time.

 
%d bloggers like this: