7 Replies Latest reply on Feb 28, 2012 1:05 PM by Antoine Herzog

    Hide the top toolbar when logged in

    supermario Newbie

      Hello,

      I'm just starting with GateIn. We have to implement a little license key management for the customer. Therefor we want to use GateIn because, we don't want to start from scratch, but having an existing portal with user, role and permission management. Then we only have to implement the licenses key management in a Portlet.
      The customer should only login as normal "User" and has 2 or 3 menu entries. He should not see this toolbar on the top, because we don't need the "Change Language" or "Change skin". We also don't need the "Dashboard" and "Group" menu.
      Is it possible to hide the complete toolbar for normal users?
      If toolbar is hidden, then we also have to move the "Logout/Sign out" link to an other location.

      Thanks in advance for your help

        • 1. Re: Hide the top toolbar when logged in
          Thomas Heute Master

          The toolbar, breadcrumb... are portlets, so it's convenient to write your own portlet to adapt them, you can use the one that comes out of the box to help you.

          See for example how to get the path to build a breadcrumb in:
          http://anonsvn.jboss.org/repos/gatein/portal/tags/3.0.0-Beta03/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java

          loadSelectedPath()

          • 2. Re: Hide the top toolbar when logged in
            supermario Newbie

            Yes, the breadcrumb is a portlet. I can go to the "Site Editor->Edit Layout" and remove the portlet and replace it with an own breadcrumb portlet. But I hoped it would be possible to modify this nodes-array from the portlet. Okay, then I make a copy of the existing UIBreadcumbPortlet and customize it.

            But for the toolbar, I can not remove this portlet. When I am logged in as Root and Click on "Site Editor->Edit Layout", I can see only "Banner", "Navigation", "Breadcrumb" and "Portal Page" boxes. But the toolbar on the top isn't shown in this Layout view. So where can I disable/remove this toolbar only for the normal users? For the Admin this toolbar is needed, otherwise I can not access the "Group" functions, "Page" functions, ...

            • 3. Re: Hide the top toolbar when logged in
              Thomas Heute Master

               

              "SuperMario77" wrote:
              Yes, the breadcrumb is a portlet. I can go to the "Site Editor->Edit Layout" and remove the portlet and replace it with an own breadcrumb portlet. But I hoped it would be possible to modify this nodes-array from the portlet. Okay, then I make a copy of the existing UIBreadcumbPortlet and customize it.


              Not sure what you mean, the breadcrumb portlet shows where you are and just take the portal page structure into account. It's just a view on nodes you already have like the SiteMap

              "SuperMario77" wrote:
              But for the toolbar, I can not remove this portlet. When I am logged in as Root and Click on "Site Editor->Edit Layout", I can see only "Banner", "Navigation", "Breadcrumb" and "Portal Page" boxes. But the toolbar on the top isn't shown in this Layout view. So where can I disable/remove this toolbar only for the normal users? For the Admin this toolbar is needed, otherwise I can not access the "Group" functions, "Page" functions, ...


              It should be possible to set the security rules on the various portlets accordingly in Group->Administration->Application Registry then the System Category and select access permissions on the "User Toolbar * Portlets", but there is currently one or more issues preventing this at the moment :( I've opened a Jira https://jira.jboss.org/jira/browse/GTNPORTAL-343

              • 4. Re: Hide the top toolbar when logged in
                supermario Newbie

                 

                It should be possible to set the security rules on the various portlets accordingly in Group->Administration->Application Registry then the System Category and select access permissions on the "User Toolbar * Portlets"

                Thanks for your answer.
                So, if the bug is fixed (in Beta04 or final), then I could set the permission of these 3 "User Toolbar * Portlets" to only "administrators" and then the 3 Toolbar buttons are not displayed for a normal user. But why are these Toolbar Portlets not accessible/visible in the "Edit Layout" view?
                I actually want to remove the complete Toolbar for a normal user, because the user should also not change the language and also not change the skin, which are menu entries in this "GateIn Logo Circle"-menu in toolbar top-left. So, I want to remove the toolbar and show the "Sign out" Link anywhere else on the page. Is this possible? How?

                • 5. Re: Hide the top toolbar when logged in
                  Oleksii Vavilkin Newbie

                  +1

                  Any solution? I'm very interested.

                  And, btw, It would be nice to add 'sign in' panel somehow. I've noticed that it is attached to the "banner" portlet, so once I delete it - I cannot log in the portal.

                  • 6. Re: Hide the top toolbar when logged in
                    Thomas Heute Master

                    In fact the part that is not in the layout is defined in an XML file:

                    02portal.war:/WEB-INF/conf/portal/portal/sharedlayout.xml

                     

                    if you change the:

                        <container template="system:/groovy/portal/webui/container/UIToolbarContainer.gtmpl">
                          <access-permissions>*:/platform/users</access-permissions>
                    

                     

                    Unfortunately this part is not accessible from the Administration portlet (the access permissions for those particular portlets are not persisted in JCR)

                     

                    with:

                        <container template="system:/groovy/portal/webui/container/UIToolbarContainer.gtmpl">
                          <access-permissions>*:/platform/administrators; *:/organization/management/executive-board</access-permissions

                     

                    Then the bar should not be displayed for non-admin.

                    You would then need to add a link to logout somewhere else for example in your new layout or logo portlet

                     

                    I hope this helps even if it took me some time to answer :-/

                    • 7. Re: Hide the top toolbar when logged in
                      Antoine Herzog Master

                      See also the Jira, for the location of the sharedlayout.xml file.

                      https://issues.jboss.org/browse/GTNPORTAL-2363

                       

                      Antoine

                      JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.

                      http://www.sysemo.com/Sysemo-expertise-portails-jboss-portal.php