11 Replies Latest reply on Apr 30, 2008 7:54 AM by viggo.navarsete

    header.jsp  - How To?

    explorer

      Hi,

      Environment:

      Portal2.6
      JBoss4.2

      I am trying to write a new header.jsp, specific to the project.
      How to go about this? i am really confused.

      Documentation says that jboss-portal.sar 's joboss-service.xml needs to updated with the context path pointing to the custom header.jsp., But does that mean that the applicationi am building needs to be in the JBoss-Portal.sar?

      the structure is

      |->deploy
       |->myportal.war
       |->jboss-prtal.sar
       |->META-INF
       |->jboss-service.xml
      

      Where does my application "MyPortal" need to go? if its to be outside of .sar how to implement a custom header.jsp

      i have the custom header.jsp and tabs.jsp in myportal.war.
      i am trying to define my own theme and layout.

      Please advice me of any tutorials/sites which could explain these. the 2.6 documentation is good but do not explain things in detail.

      Thanks in advance..




        • 1. Re: header.jsp  - How To?
          rvkishore

          Env : JBoss portal 2.6 / AS 4.2


          I am running into the exact same issue. The documentation on what is a very common customization is really sparse. Would highly appreciate it if any of the JBoss folks throw some light on this.

          Thanks in advance

          • 2. Re: header.jsp  - How To?
            theute

            Why don't you try ? You can put your war anywhere.

            • 3. Re: header.jsp  - How To?
              rvkishore

              I put the exploded war file for my app in the jboss-portal.sar directory and changed the jboss-service.xml to reflect the changes. Still no luck. The server does not pick up the my header.jsp and tabs.jsp.

              • 4. Re: header.jsp  - How To?
                explorer

                I wasn't able to get hands on how to resolve the issue.
                So i came up with a solution that i would write header.jsp (custom, that has only the nav and no dashboard, this is what i intended), footer.jsp and then have them include in ever layout jsp's i might get. Can any one adivce a better way than this. But the point is i am not able access the portal's default objects. if ever want to use them. how should i approach...

                Also i want to disable the window state buttons for a portlet and even make them not to appear. Any suggestions?

                • 5. Re: header.jsp  - How To?
                  rvkishore

                  To remove the window state buttons you can set the windowrenderer to emptyrenderer.

                  <window>
                   <window-name>MyPortletWindow</window-name>
                   <instance-ref>
                   MyPortletInstance
                   </instance-ref>
                   <region>center</region>
                   <height>1</height>
                   <properties>
                   <!-- turn the decoration off for this portlet (i.e. no title and mode/state links) -->
                   <property>
                   <name>theme.decorationRendererId</name>
                   <value>emptyRenderer</value>
                   </property>
                   <property>
                   <name>theme.windowRendererId</name>
                   <value>emptyRenderer</value>
                   </property>
                   </properties>
                   </window>
                  


                  As for the original issue, I tried digging into the source code, The request dispatcher seems to be returning null for the getMarkup() method if the TargetContext is anything other than portal-core.

                  • 6. Re: header.jsp  - How To?
                    explorer

                    Hi Kishore,
                    Thanks for the reply,
                    Well can you please help me out on something else too.

                    How do you get to know that in

                    <property>
                     <name>theme.decorationRendererId</name>
                     <value>emptyRenderer</value>
                    </property>


                    there is something called as theme.decorationRendererId, Where can we find all the list of these Id things.



                    • 7. Re: header.jsp  - How To?
                      saigon_man

                      Explorer,
                      To display your own header.jsp in the portal (in my case, I use the default portal)

                      open jboss-portal.sar\META-INF\jboss-service.xml
                      go down to the line which contains the text "/portal-core"
                      rename this one to the name of your war file, i.e. /myportal
                      rename the paths below this line to be the path to your header.jsp and tab.jsp in your portal war

                      Restart jboss server and poitn to your portal url. It should display your own header.jsp
                      Hope this help

                      TL

                      • 8. Re: header.jsp  - How To?
                        johnnythehun

                        But what if one of my portals use my custom header or tabs.jsp, while another uses the default one.
                        Your suggestion would kill the one using the default core files, wouldn't it?

                        • 9. Re: header.jsp  - How To?
                          je.a.le

                           

                          "JohnnyTheHun" wrote:
                          But what if one of my portals use my custom header or tabs.jsp, while another uses the default one.
                          Your suggestion would kill the one using the default core files, wouldn't it?


                          just tried and not only it change tab menu for all portals but the admin portal too !!
                          We're probalby the only ones that want different menus for different portal....

                          More seriourly, I cannot even put my own code inside the layout definition because I don't know how to get a PortalNode ref !?!??
                          I looked at RegionTagHandler until some obscure render method.
                          PageCustomizerInterceptor doesn't help so much ( ControllerCommand/PageCommand ???)

                          any suggestion ???


                          • 10. Re: header.jsp  - How To?
                            viggo.navarsete

                            any updates on how to change the header and tab? I also want to have my customized header and tab, but don't want to change the defaults.
                            Not muc information in the reference guide about these challenges.

                            • 11. Re: header.jsp  - How To?
                              viggo.navarsete

                              if I create my own theme/layout and bundles it into a separate war file, and if I have the exact path for the header.jsp and tabs.jsp as described here:

                              <mbean
                               code="org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor"
                               name="portal:service=Interceptor,type=Command,name=PageCustomizer"
                               xmbean-dd=""
                               xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
                               <xmbean/>
                               <attribute name="TargetContextPath">/portal-core</attribute>
                               <attribute name="HeaderPath">/WEB-INF/jsp/header/header.jsp</attribute>
                               <attribute name="TabsPath">/WEB-INF/jsp/header/tabs.jsp</attribute>
                               <!-- Overrides the value of core.login.namespace in config.xml -->
                               <attribute name="LoginNamespace">dashboard</attribute>
                               <depends
                               optional-attribute-name="Config"
                               proxy-type="attribute">portal:service=ServerConfig</depends>
                               <depends
                               optional-attribute-name="PortalAuthorizationManagerFactory"
                               proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
                               </mbean>
                              




                              would then my own header.jsp and tabs.jsp from my own war file be preferred when rendering my portal?
                              Or am I forced to change the jboss-portal.sar/META-INF/jboss-service.xml in order to use my own customized header and tabs?