Topic
  • 2 replies
  • Latest Post - ‏2011-03-10T21:10:20Z by vinothkp
vinothkp
vinothkp
8 Posts

Pinned topic PageBuilder Theme question

‏2011-03-07T17:26:14Z |
Hi,

I am trying to display the username of the logged in user on a tab instead of the tab id. I was able to do that in the Portal theme and with the help of the forums on the PortalWeb2 theme. Now, I want to achieve the same thing with the PageBuilder theme.

Here is what I had done so far.....

I created a tab with the name "Username" which will have to be replaced by the user id of the logged in user.

I modified the tabNav.jsp file on the Portal server at PortalServerRoot/theme/wp.mashup.cc.theme/installedApps/wp.mashup.cc.theme.ear/PageBuilder2.war/themes/html/PageBuilder2/tabNav.jsp

In the line, where it says.....

<a hre="?uri.......>

instead of

<portal-fmt:out>${node.title}</portal-fmt:out>

I am including the following.....

<c:choose>
<c:when test="${node.title eq 'Username'}">
<portal-fmt:user attribute="cn"/>
</c:when>
<c:otherwise>
<portal-fmt:out>${node.title}</portal-fmt:out>
</c:otherwise>
</c:choose>

It does replace the tab name with the user name, but the tab names get refreshed and changes to the original tab name "Username".

This is because, in the subsequent lines of code in the tabNav.jsp, there is a call to the ControlledNavWidget.xml?pragma=cache.....

This refreshes the tab names and reverts it back to Username.

this file is present in PortalServerRoot\ui\wp.mashup.cc.deploy\installedApps\MashupCommonComponent.ear\mm.builder.war\widget-catalog\ControlledNavWidget.xml

This is being controlled by the file

PortalServerRoot\ui\wp.mashup.cc.deploy\installedApps\MashupCommonComponent.ear\mm.builder.war\widget-catalog\ControlledNavWidget.js
Is there any pointers anybody can lead me to in displaying the username instead of the tab name. I can provide more information if necessary.

Thanks in Advance.
Updated on 2011-03-10T21:10:20Z at 2011-03-10T21:10:20Z by vinothkp
  • DavidNixon
    DavidNixon
    138 Posts

    Re: PageBuilder Theme question

    ‏2011-03-10T20:39:48Z  
    No great ideas on this one. The client side code is reseting this back to Username in an attempt to make sure our page names are in sync with the current Portal state.

    hack 1: Add a new onload event to switch it back to the user name
    hack 2: The reloading is happening in the model reload function so you could hack around in there.

    Look for dojo.declare( "com.ibm.widgets.TreeModeled" to find the reload function.

    Relevant files:
    PortalServer\theme\wp.theme.dojo\installedApps\dojo.ear\dojo.war\v1.4.3\com\ibm\themes\PageBuilder2\theme.js.uncompressed.js
    PortalServer\theme\wp.theme.dojo\installedApps\dojo.ear\dojo.war\v1.4.3\com\ibm\themes\PageBuilder2\theme.js

    I'll propose use case here for "variable named pages". I'm not sure how common the case would be. Maybe we could have some support for a few variables like ${username} and ${department} ?
  • vinothkp
    vinothkp
    8 Posts

    Re: PageBuilder Theme question

    ‏2011-03-10T21:10:20Z  
    No great ideas on this one. The client side code is reseting this back to Username in an attempt to make sure our page names are in sync with the current Portal state.

    hack 1: Add a new onload event to switch it back to the user name
    hack 2: The reloading is happening in the model reload function so you could hack around in there.

    Look for dojo.declare( "com.ibm.widgets.TreeModeled" to find the reload function.

    Relevant files:
    PortalServer\theme\wp.theme.dojo\installedApps\dojo.ear\dojo.war\v1.4.3\com\ibm\themes\PageBuilder2\theme.js.uncompressed.js
    PortalServer\theme\wp.theme.dojo\installedApps\dojo.ear\dojo.war\v1.4.3\com\ibm\themes\PageBuilder2\theme.js

    I'll propose use case here for "variable named pages". I'm not sure how common the case would be. Maybe we could have some support for a few variables like ${username} and ${department} ?
    Hi David,

    thanks for responding..... here is the solution for this which i got the answer from another forum.....

    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14591342

    And as a follow up is where I posted the other question to which you responded as well. How do we make the tabNav.jsp under PortalServerRoot to be clustered?

    The ideal solution seems to be creating a custom war file that contains the files under
    PortalServerRoot/theme/wp.mashup.cc.theme/installedApps/wp.mashup.cc.theme.ear/PageBuilder2.war/themes/html/PageBuilder2

    and deploy this in the portal server making it accessible under wp_profile. But, how can i create a custom theme war based on the Pagebuilder theme? RAD provides just Portal and PortalWeb2 options.

    Is there a PageBuilder.war base source that we can import to develop our own custom theme?

    Thanks in Advance.