5 Replies Latest reply on Apr 11, 2011 4:20 AM by Thomas Delhoménie

    Gatein extension with custom login and "interceptor"

    Mario De Cicco Newbie

      Hi,

       

      My requirement is to have:

      -a "public" homepage with only login form (custom: css, img,...)

      -a "private" homepage with my custom portlet (ui, functions,..)

      -after login and before a redirect to the "private" homepage I must put some attributes in session for the various custom portlets

       

      How can I do this?

       

      Thanks

        • 1. Re: Gatein extension with custom login and "interceptor"
          Vu Viet Phuong Novice

          - "public" or "private" homepage customization

          I think you can freely use extension machanism to override what you want : override groovy template or override the HomePagePortlet or even config a new HomePage yourself (according to yours need)  --> please find an extension example in GateIn code ($GateIn/examples/extension)

           

           

          - after login and before a redirect to the "private" homepage I must put some attributes in session for the various custom portlets

          You should use the public render parameter to transfer information to many portlets. You can reference org.exoplatform.portal.application.state.PublicPropertiesPlugin, its configuration file is : $GateIn3.2.x/webui/portal/src/main/java/conf/portal/configuration.xml

          Write your own plugin and you can put public render parameters from portal side

          • 2. Re: Gatein extension with custom login and "interceptor"
            Mario De Cicco Newbie

            Hi, thanks for reply.

             

             

            -public/private homepage: how can I customize a different layout for the public homepage (login) and private? If i change the layout, this layout (via xml or via web) is for both

            -plugin: after I write a plugin (if is necessary) how can I call this plugin AFTER THE PORTAL LOGIN? it's necessary, for requirement, that after (or before) login I call my db for retrieve some user's custom attribute to put them in session. This is possible with plugin?

             

            For now I write a custom jsf login portlet (not override the login.jsp in a portal extension), and login to portal is provided by a redirect to the gatein login servlet (user and psw passed through parameters). Problems are:

            • layout of the portal page (login) and the destination page: if I change one, then also the other are changed
            • it's correct to write a custom login portlet or I must override the login in an extension?
            • 3. Re: Gatein extension with custom login and "interceptor"
              Vu Viet Phuong Novice

              -public/private homepage: you need codes to check directly in your homepage template or your portlet to switch layout or do anything you want (forexample redirect to another page) after login

               

              - plugin : you don't need to call this plugin yourself, portal will call it for you before it renders portlets (org.exoplatform.portal.application.state.ContextualPropertyManager)

               

              - login portlet or login.jsp are only UI, I don't think there are any problem when we override it

              • 4. Gatein extension with custom login and "interceptor"
                Mario De Cicco Newbie

                Sorry, but

                • if I write i custom login portlet (instead overwrite the login in the extension), how can I modify the configuration of the portal? If I try to call a private url of my portal, I visualize the gatein login and not my login portlet.
                  • Same for logout: after logout I would to delete my session object.
                • plugin: for public parameters, this must be set in the processAction() method of the portlet, true? If I have only jsf portlet, I don't have a myPortlet.java with this method, because I have portlet.xml init param that "redirect" to initial page myPage.xhtml. If i try to extend the genericFacesPortlet (with myPortlet.java) and then redirect to myPage.xhtml (in doView() method), my jsf managed bean don't called.
                • 5. Gatein extension with custom login and "interceptor"
                  Thomas Delhoménie Newbie
                  • You could of course create your own login portlet, but I think it is better to use the GateIn by overriding the login.jsp page. Moreover, this will be easier. If you really want to create your login portlet, you can change the login.jsp page to always redirect to this portlet.
                  • your session object will be automatically deleted with the session on logout