6 Replies Latest reply on Jan 5, 2006 10:46 AM by mholzner

    Getting a maximized Window to display

    jaredmladner

      Hi, I just started working with JBoss Portal 2.2. I have a portal deployed with portlets showing. I have a custom layout that is working as well. One of my portlets is the UserPortletInstance provided by JBoss and another is my HeaderPortlet. I have set my uri in the portal-layouts.xml file to point to my jsp and the alternate uri to point to my maximized.jsp if the state="maximized". Everything works fine until I select the User Profile or List Users on the UserPortlet. The UserPortlet is displayed in the maximized state but my other portlet is not shown. It is being redirected to the maximized.jsp, but I cannot get my HeaderPortlet to display. Any help would be appreciated.

      Thanks
      Jared


      portal-layouts.xml

      <layouts>
       <layout>
       <name>2ColumnLayout</name>
       <uri>/layouts/twoColumns.jsp</uri>
       <uri state="maximized">/layouts/maximized.jsp</uri>
       <regions>
       <region name="header" />
       <region name="navigation" />
       <region name="breadcrumb" />
       <region name="left" />
       <region name="center" />
       </regions>
       </layout>
      </layouts>
      


      *-object.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <deployments>
       <deployment>
       <parent-ref />
       <if-exists>overwrite</if-exists>
       <portal>
       <portal-name>GDCPortal</portal-name>
       <properties>
       <!-- Set the layout for the default portal -->
       <!-- see also portal-layouts.xml -->
       <property>
       <name>layout.id</name>
       <value>2ColumnLayout</value>
       </property>
       <!-- Set the theme for the default portal -->
       <!-- see also portal-themes.xml -->
      
       <!-- set the default render set name (used by the render tag in layouts) -->
       <!-- see also portal-renderSet.xml -->
       <property>
       <name>theme.renderSetId</name>
       <value>divRenderer</value>
       </property>
       <!-- set the default strategy name (used by the strategy interceptor) -->
       <!-- see also portal-strategies.xml -->
       <property>
       <name>layout.strategyId</name>
       <value>maximizedRegion</value>
       </property>
       </properties>
       <supported-modes>
       <mode>view</mode>
       <mode>edit</mode>
       <mode>help</mode>
       </supported-modes>
       <supported-window-states>
       <window-state>normal</window-state>
       <window-state>minimized</window-state>
       <window-state>maximized</window-state>
       </supported-window-states>
       <page>
       <page-name>default</page-name>
       <properties />
       <window>
       <window-name>UserPortletWindow</window-name>
       <instance-ref>UserPortletInstance</instance-ref>
       <region>left</region>
       <height>0</height>
       </window>
       <window>
       <window-name>FacesHeaderPortletWindow</window-name>
       <instance-ref>FacesHeaderPortletInstance</instance-ref>
       <region>header</region>
       <height>0</height>
       <properties>
       <!-- use the window renderer from the emptyRenderer renderSet -->
       <property>
       <name>theme.windowRendererId</name>
       <value>emptyRenderer</value>
       </property>
       <!-- use the decoration renderer from the emptyRenderer renderSet -->
       <property>
       <name>theme.decorationRendererId</name>
       <value>emptyRenderer</value>
       </property>
       <!-- use the portlet renderer from the emptyRenderer renderSet -->
       <property>
       <name>theme.portletRendererId</name>
       <value>emptyRenderer</value>
       </property>
       </properties>
       </window>
       <window>
       <window-name>GDCCMSPortletWindow</window-name>
       <instance-ref>GDCCMSPortletInstance</instance-ref>
       <region>center</region>
       <height>0</height>
       </window>
       </page>
      
       </portal>
       </deployment>
       <deployment>
       <if-exists>overwrite</if-exists>
       <instance>
       <instance-name>GDCCMSPortletInstance</instance-name>
       <component-ref>gdcportal.GDCCMSPortlet</component-ref>
       </instance>
       </deployment>
      </deployments>
      



        • 1. Re: Getting a maximized Window to display

          does your maximized.jsp select for the maximized region ?

           <p:region regionName='maximized' regionID='regionMaximized'/>
          


          Via
           <property>
           <name>layout.strategyId</name>
           <value>maximizedRegion</value>
           </property>
          

          you are using the maximized region strategy, which
          a) assures that there is only one maximized portlet at a time , and
          b) reassigns the maximized portlet to the 'maximized' region

          The 'regionName' in the region tag selects that. The 'regionID' is the CSS id that is rendered for this region. This id is selected by the theme css (depending on what theme you are using that is one of the css files in the themes folder on the core war (like /themes/phalanx/portal_style.css)



          • 2. Re: Getting a maximized Window to display
            jaredmladner

            Yes, maximized.jsp does select the maximized region. The headerPortlet is displayed with the UserPortlet until the UserPortlet goes to maximized, then the UserPortlet is the only portlet on the page.

            maximized.jsp

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            <%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>
             <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
            
             <!-- insert the dynamically determined theme elements here, or use the 'simple-sample' theme by default -->
             <p:theme themeName='simple-sample' />
            
             <body>
            
             <!-- header table -->
             <table width="100%" bgcolor="#000000">
             <tr>
             <td align="center">
             <p:region regionName='header'/>
             </td>
             </tr>
             </table>
            
             <!-- navigation table -->
             <table width="100%" bgcolor="#cc9966">
             <tr>
             <td align="center">
             <p:region regionName='navigation'/>
             </td>
             </tr>
             </table>
            
            
             <!-- breadcrumb table -->
             <table width="100%" bgcolor="#000000">
             <tr>
             <td align="center">
             <p:region regionName='breadcrumb'/>
             </td>
             </tr>
             </table>
            
             <!-- maximized table with columns -->
             <table width="100%" bgcolor="#FFFFFF">
             <tr>
             <td align="center">
             <p:region regionName='maximized' regionID='regionMaximized'/>
             </td>
             </tr>
             </table>
             </body>
            </html>
            


            twoColumns.jsp
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            <%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>
             <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
            
             <!-- insert the dynamically determined theme elements here, or use the 'simple-sample' theme by default -->
             <p:theme themeName='simple-sample' />
            
             <body>
            
             <!-- header table -->
             <table width="100%" bgcolor="#000000">
             <tr>
             <td align="center">
             <p:region regionName='header'/>
             </td>
             </tr>
             </table>
            
             <!-- navigation table -->
             <table width="100%" bgcolor="#cc9966">
             <tr>
             <td align="center">
             <p:region regionName='navigation'/>
             </td>
             </tr>
             </table>
            
            
             <!-- breadcrumb table -->
             <table width="100%" bgcolor="#000000">
             <tr>
             <td align="center">
             <p:region regionName='breadcrumb'/>
             </td>
             </tr>
             </table>
            
             <!-- center table with columns -->
             <table width="100%" bgcolor="#FFFFFF">
             <tr>
             <td width="30%" bgcolor="#cc9966" padding="top"><p:region regionName='left'/></td>
             <td class="centerColumn"><p:region regionName='center'/></td>
             </tr>
             </table>
             </body>
            </html>
            



            • 3. Re: Getting a maximized Window to display

              the behaviour of the maximizing strategy is that once a portlet is maximized, it will ommit the render process for all other portlets. It assumes that at the end of the render process all you want to display is the one maximized portlet, so it saves the portlet container the effort to render portlets that wont be displayed anyway. The only exception to that rule are portlets in the 'navigation' region. They are being let through. Take a look at the Strategy implementation class (org.jboss.portal.theme.impl.strategy.MaximizingStrategyImpl in the theme module).

              If you want your portlets in the header region (and others) to still show up if there is a maximized portlet on the page, then you'll either need to change the strategy, or write your own, and point to it via the portal property:

               <property>
               <name>layout.strategyId</name>
               <value>your strategy here</value>
               </property>
              


              Please consult the theme documentation for details on how to write and configure your own strategy.


              • 4. Re: Getting a maximized Window to display
                jaredmladner

                Thank you for the clarification. Makes sense now. I am now working on writing my own Strategy.

                • 5. Re: Getting a maximized Window to display
                  jaredmladner

                  I see how to make the Layout use the custome strategy and the API for MaximizingStrategyImpl class, but where can I view the source code for that class.

                  Thanks

                  • 6. Re: Getting a maximized Window to display

                    you'll havwe to get the code from CVS:

                    cvs -d :pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jboss co jboss-portal-2.2
                    


                    the strategy is in the theme module : jboss-portal-2.2/theme/src/main/org/jboss/portal/theme/impl/strategy/MaximizingStrategyImpl.java)