-
1. Re: Change Page DisplayName Programmatically
explorer Aug 12, 2007 12:02 PM (in response to nidhi_hs)What do you mean by the Page Display name....
Page - node or Browser display name... -
2. Re: Change Page DisplayName Programmatically
nidhi_hs Aug 12, 2007 1:29 PM (in response to nidhi_hs)Browser display name. The name that gets displayed on the tabs.
-
3. Re: Change Page DisplayName Programmatically
nidhi_hs Aug 12, 2007 2:51 PM (in response to nidhi_hs)I acheived this by putting some logic in tabs.jsp.
-
4. Re: Change Page DisplayName Programmatically
explorer Aug 13, 2007 10:16 AM (in response to nidhi_hs)But you need to decide on where exactly you want to put it and how you want to change the name...
If you are putting in tabs.jsp then.. i have a question.. are you changing based on the portlets being rendered for a current page...
well usually you set the title using from portlets using renderer.setAttribute("headercontent",""); and having the headercontent tag in your layouts.
this would actually put any of ur meta,script,link or title.. anything for that case.. -
5. Re: Change Page DisplayName Programmatically
nidhi_hs Aug 13, 2007 10:24 AM (in response to nidhi_hs)I am not changing the portlet title. I am changing the page display name. When I say page display name I mean the name of the tab.
My requirement was to change the "Sign In" tab name to "My Account" after user logs in. So I have a logic in tabs.jsp to check if the user has logged in. -
6. Re: Change Page DisplayName Programmatically
explorer Aug 13, 2007 10:47 AM (in response to nidhi_hs)I have one issue. I hope you would have a solution for that.
I am trying to get access to objects that i am setting in portal session from portlet session. Is that possible.? -
7. Re: Change Page DisplayName Programmatically
nidhi_hs Aug 13, 2007 11:16 AM (in response to nidhi_hs)Yes its possible. I struggled hard to get this solution.
Here is how you get portal session from a portlet (am using JSF portlet) -
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
JBossActionRequest request = (JBossActionRequest) context.getRequest();
ServerInvocationContext serverContext = request.getControllerContext().getServerInvocation().getServerContext();
HttpServletRequest clientRequest = serverContext.getClientRequest();
HttpSession session = clientRequest.getSession();
context.getRequest() - will return JBossActionRequest or JBossRenderRequest based on the scenario -
8. Re: Change Page DisplayName Programmatically
explorer Aug 13, 2007 7:47 PM (in response to nidhi_hs)I am not using JSF
But i tried using the renderRequest...ServerInvocationContext serverContext = jrr.getControllerContext().getServerInvocation().getServerContext();
That call is throwing the following exception.19:36:16,531 ERROR [CommandServlet] Exception in command invocation java.lang.LinkageError: Class org/jboss/portal/core/controller/ControllerContext violates loader constraints at java.lang.ClassLoader.defineClass1(Native Method)
-
9. Re: Change Page DisplayName Programmatically
nidhi_hs Aug 13, 2007 8:55 PM (in response to nidhi_hs)Not sure on the error. Its working for me. Which version of Jboss portal are you using. Am using 2.6.1