3 Replies Latest reply on Dec 7, 2009 7:02 PM by Nick Belaevski

    New project - advice needed for user menus

    David Bolsover Newbie

      Hi all

      I'm just starting a new project for which I am commited to the use of RichFaces components for the presentation layer.

      The backend will be a SqlServer database; middleware is hibernate.

      I'm reasonably comfortable with the various components I'll be using - but one issue is giving me a few headaches and I'd be glad of any advice from users who may have experienced similar problems...

      The interface is to include a dynamically built menu where the individual menu items displayed depend on the users access privileges which are to be determined by a combination of thier role (administrator, customer, supplier, guest, etc.) and the specific, individually tailored menu items to which they have been granted access.

      The entire menu MUST be completely dynamic, driven from the database.
      It should be possible for an administrator to change the menu stucture for individual users, adding and removing items as required. My current intention is to use a <rich:toolbar> containing a combination of <rich:menuItem> and <rich:dropDownMenu> components.

      My questions are:
      1 What database structure best supports the scenario described above (users, menus and access rights etc)?
      2 Is the choice of richfaces components described above appropriate given that menuitems may be linked to static web pages, backend actions and in some cases even external executables?
      3 Does anyone have advice re any pitfals for the unwary?

        • 1. Re: New project - advice needed for user menus
          Ilya Shaikovsky Master

          1)


          2 Is the choice of richfaces components described above appropriate given that menuitems may be linked to static web pages, backend actions and in some cases even external executables?

          yes

          2) check this http://www.jboss.org/community/wiki/UsingrichisUserInRoleobject

          3) check richfaces-demo sources(download links at wiki and project site) to explore left menu code which implemented dynamically. It uses not db but simple properties files - but the approach is the same.

          • 2. Re: New project - advice needed for user menus
            David Bolsover Newbie

            Hi Ilya

            check this http://www.jboss.org/community/wiki/UsingrichisUserInRoleobject


            Thanks a useful link - unfortunately, I have to use a custom authentication mechanism in order to meet my clients demands - so standard basic or realm based roles are not available - I can however simulate by putting a custom bean (having a role attribute) in session scope when the user authenticates.

            check richfaces-demo sources(download links at wiki and project site) to explore left menu code which implemented dynamically. It uses not db but simple properties files


            Sorry I'm having trouble locating the demo you refer to... I've tried looking in the richfaces-demo here...

            /root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo-..

            But can find no examples of dynamic menus -can you be moe explicit as to where I need to look please?



            • 3. Re: New project - advice needed for user menus
              Nick Belaevski Master

               

              "bolsover" wrote:
              Hi Ilya

              check this http://www.jboss.org/community/wiki/UsingrichisUserInRoleobject


              Thanks a useful link - unfortunately, I have to use a custom authentication mechanism in order to meet my clients demands - so standard basic or realm based roles are not available - I can however simulate by putting a custom bean (having a role attribute) in session scope when the user authenticates.

              I'd suggest you to check Seam Security API.

              "bolsover" wrote:
              Sorry I'm having trouble locating the demo you refer to... I've tried looking in the richfaces-demo here...

              /root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo-..

              But can find no examples of dynamic menus -can you be moe explicit as to where I need to look please?


              This is demo for 4.x versions. Please check this one: http://anonsvn.jboss.org/repos/richfaces/tags/3.3.2.SR1/samples/richfaces-demo/