3 Replies Latest reply on Apr 17, 2007 11:13 AM by antoine_h

    Custom Window State

    engela

      Does the JBoss Portal (2.4) support custom window states? Which class do I need to overwrite if I want to add my custom window state?

      For printing the content of a portlet I quite like to introduce a custom window state 'print' which is mapped by by layout descriptor to print.jsp, which will only display the portlet without heading or navigation.

      <layouts>
       <layout>
       <name>mylayout</name>
       <uri>/layouts/mylayout/index.jsp</uri>
       <uri state="maximized">/layouts/mylayout/maximized.jsp</uri>
       <uri state="print">/layouts/mylayout/print.jsp</uri>
       <regions>
       <region name="left"/>
       <region name="center"/>
       <region name="navigation"/>
       </regions>
       </layout>
      </layouts>


      Is that possible?

      Thanks,

      Anette

        • 1. Re: Custom Window State
          antoine_h

          yes, this seems the right way, for what I know.
          look at the jsr-168 for defining custom window states.
          there is an example with "1/2 maximized" state, if I remember well.
          To make sure you have declared all that is needed for this state in other places (portal description, etc...).

          By the way, thanks for your post about Acegi :
          http://jboss.org/index.html?module=bb&op=viewtopic&t=104244
          And so the wiki.

          I have a question : to use a SecurityContextHolder, I used the acegi filters.
          As you don't talk about it : is it because you did another way ?
          I will complement the wiki with the filter stuff, when my integration is finished (and clean).
          If you don't want to post for security matters, you can contact me by mail (on my website).
          Thanks.


          • 2. Re: Custom Window State
            engela

            Hi Antoine,

            Sorry I can't help you as I only used Acegi to login but didn't do any filtering and I haven't used it since. I am currently using the LdapExtLoginModule to authenticate against my LDAP server which is sufficient for the time being.

            With regards to custom window states I have added the my custom window state to the portal descriptor:

            <deployments>
             <deployment>
             <parent-ref />
             <if-exists>overwrite</if-exists>
             <portal>
             <portal-name>myportal</portal-name>
             :
             <supported-modes>
             <mode>view</mode>
             </supported-modes>
             <supported-window-states>
             <window-state>normal</window-state>
             <window-state>maximized</window-state>
             <window-state>print</window-state>
             </supported-window-states>
             :
             </deployement>
            </deployements>


            I have added the custom window state to the portlet descriptor:




            <?xml version="1.0" encoding="UTF-8"?>
            <portlet-app>
             :
             <custom-window-state>
             <description>window without header and menu for printing</description>
             <name>print</name>
             </custom-window-state>
            </portlet-app>



            The portal accepts the window state but uses the default jsp 'index.jsp'. I don't know what I have to do for the portal to use the 'print.jsp'

            Best Regards,

            Anette



            • 3. Re: Custom Window State
              antoine_h

              Hello,
              It seems more a pb of wiring.

              did you look at the layout strategy source code ?
              may be this feature has not been much tested (used ?), and there is a bug, when routing to the proper jsp file.
              as you can write your own, you may do one and see with logs what happen and why it does not work...

              best regards,