8 Replies Latest reply on May 1, 2004 11:40 PM by gwmlam

    Need help on Menu Block

    gwmlam

      Greeting all,

      Can anyone show me how to add a menu item in Main menu block.
      I have try to play with "menu-block-service.xml" file under JBoss server nuke directory but with no success. Here is what I add to xml file

      Thanks in Advance

      .
      .
      .

      <attribute name="Before">
       <menu>
       <item title="Home" url="index.html" description="Back to the home page."/>
       <item title="Test" url="test.html" description="test."/>
       </menu>
      
       </attribute>
       <attribute name="Security">
       <security>
       <permission group="*" level="READ" pattern="::"/>
       <permission group="*" level="READ" pattern="menu:Home:"/>
       <permission group="*" level="READ" pattern="menu:Test:"/>
       <permission group="*" level="READ" pattern="module:bb:main"/>


        • 1. Re: Need help on Menu Block


          The Before and After attributes add static links into the menu.

          The rest of the menu relies on what the installed modules want to be displayed, based on the module MBean descriptor Configuration attribute, such as:

          <attribute name="Configuration">
           <module>
           <operation
           name="main"
           display-name="My Account"
           description="My Account"
           image=""
           hint=""/>
           </module>
          </attribute>
          


          Given the permission you set up for the test.html, you should see a link to test.html just under the Home link after you have logged in. If this is not working, what are you seeing?


          Sherman

          • 2. Re: Need help on Menu Block
            gwmlam

            Sherman,

            My "test" link didn't not show up even I login.
            Is my "<item title='test' ..> in right place?

            • 3. Re: Need help on Menu Block


              Yes, it is in the right place. Did the Home link appear after you logged in?

              • 4. Re: Need help on Menu Block
                gwmlam

                Home link alway appear with or without login

                • 5. Re: Need help on Menu Block
                  gwmlam

                  I put some debug message in MenuBlock.setBefore method. I found it first add item "test" in menuBefore array, but then it reset menuBefore array and put "Home" item in it.

                  However, its work if I use jmx-console to add menu items instead of using xml . Any idea?

                  Thanks in advance

                  • 6. Re: Need help on Menu Block


                    By default, the modules persist their config information from the MBean descriptor into the database the first time the MBean is started, and on subsequent starts, get their information from the database. This allows using the jmx-console to change config info after Nukes is installed.

                    I think the behavior you saw in the debugging is exactly right. The MBean starts and gets the Before attributes from the MBean descriptor, and then updates the running MBean with the Before attribute in the database.

                    Try deleting all rows in the nukes_services_attributes table where pn_sid = 'org.jboss.nukes.core.modules.core.blocks.MenuBlock', and restarting Nukes. The database will get refreshed with your Before attribute now.


                    Sherman

                    • 7. Re: Need help on Menu Block
                      gwmlam

                      Thx a lot for your help Sherman.
                      I will try this out later and will let you know the result

                      • 8. Re: Need help on Menu Block
                        gwmlam

                        Sherman,
                        It works !
                        Thx