[jboss-user] [JBoss Portal] - Is header content injection coded in portal 2.4.0 ?

mvera do-not-reply at jboss.com
Fri Nov 3 09:46:24 EST 2006


Hi,

I use JBossPortal 2.4.0 and i'm still trying to insert code in html header via RenderResponse API like this :

      RenderResponse rr = getRenderResponse();
  | 
  |       rr.addProperty("HEADER_CONTENT", _htmlBuff.toString());

But this doesn't work, I still have an empty head :

             <head>
  |              <title>My Layout</title>
  |              <meta http-equiv="Content-Type" content="text/html;" />
  |              <link rel='stylesheet' type='text/css' id='main_css' href='/portal-core/themes/phalanx/portal_style.css' />
  | <link rel='shortcut icon' href='/portal-core/themes/phalanx/images/favicon.ico' />
  |               </head>

I changed my layout (I hadn't understand this before) and I used the one provided inline in the reference guide :

            <%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
  |              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  |              <html xmlns="http://www.w3.org/1999/xhtml">
  |              <head>
  |              <title>My Layout</title>
  |              <meta http-equiv="Content-Type" content="text/html;" />
  |              <p:theme themeName='phalanx' />
  |              <p:headerContent />
  |              </head>
  | 

I used debugger in my code and in JBossPortal code. So I know that:
+ in my code the call to addProperty is executed and the value is not null
+ the layout used is the one I specified
+ the headerContent tag is executed

But I don't understand why my header is still empty.

So I downloaded JBossPortal src, looked at it and visited it with the debugger. It seemed to me that nothing is done to retreive the data set in response properties for the key "HEADER_CONTENT" and that only header content set by a declarative way is retreived.

I only found 2 ocurrences of HEADER_CONTENT in JBossPortal source :
      res.setProperty("HEADER_CONTENT", "<script>function wsrp_rewrite_OnFocus(){alert('hello button');}</script>");
  | 
and
   /**
  |     * Constant to set the content that should be injected into the HEAD tag of the pages markup.
  |     * <p>The content set in a portlet response property with this flag will be injected into the HEAD tag, if the portal
  |     * layout features the headercontent tag.</p>
  |     */
  |    public static final String HEADER_CONTENT = "HEADER_CONTENT";
  | 

I wonder if that functionnality is coded ? If I'm wrong, could anyone tell me in which class it is done so that I can use my debugger to find what is my problem.

Thanks,
Mickaël



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982981#3982981

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982981




More information about the jboss-user mailing list