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?
My "test" link didn't not show up even I login.
Is my "<item title='test' ..> in right place?
Yes, it is in the right place. Did the Home link appear after you logged in?
Home link alway appear with or without login
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
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.
Thx a lot for your help Sherman.
I will try this out later and will let you know the result
It works !