[opencms-dev] Where does CmsAdminMenu get the menu items?

Michael Moossen m.moossen at alkacon.com
Thu Aug 4 09:56:17 CEST 2005


Hi, Alexander!

> i have not  been able to figure out where is the ToolManager or the 
> ToolHandlers through which iterates specified.
The tool manager looks under /system/workplace/admin for all files or folders
with the 'admintoolhandler-class' property set, and using this info it creates
a new tool into a internal tree of tools where each tool can be accessed by a
'tool path'. with a tool path you can set up, followings:
a localized name, a localized description (helptext), a localized group name, a
relative position of the tool in its group, a big icon, a small icon (for the
menu), tool path, required parameters, if visible, if enabled.
you can use the CmsDefaultToolHandler and/or extend it.
lokk at the properties of files and folders under /system/workplace/admin, i
would also recommend to use our CmsWidgetDialog and A_CmsListDialog for
building your GUI.
the important method of a tool handler is the setup(CmsObject, String), here the
javadoc for that method:
---
     * It takes the icon path from <code>{@link
org.opencms.file.CmsPropertyDefinition#PROPERTY_NAVIMAGE}</code> property, 
     * or uses a default icon if undefined, the name is taken from the 
     * <code>{@link
org.opencms.file.CmsPropertyDefinition#PROPERTY_NAVTEXT}</code> property, 
     * or uses the <code>{@link
org.opencms.file.CmsPropertyDefinition#PROPERTY_TITLE}</code> property if
undefined, 
     * or an default text, if still undefined. if you want 2 different names,
one for the big icon tools and one for 
     * the menu/navbar entries, use a <code>{@link
A_CmsToolHandler#VALUE_SEPARATOR}</code> to separate them in the property.
     * (if you do so, the first one is for big icons and the second one for
menu/navbar entries). the help text is taken from the 
     * <code>{@link
org.opencms.file.CmsPropertyDefinition#PROPERTY_DESCRIPTION}</code> property or
a
     * default text if undefined, if you want to custumize a help text while
disabled, use a 
     * <code>{@link A_CmsToolHandler#VALUE_SEPARATOR}</code> as a separator in
the same property.<p> 
     * 
     * The group is taken from the <code>{@link
org.opencms.file.CmsPropertyDefinition#PROPERTY_NAVINFO}</code> property,
     * the position from the <code>{@link
org.opencms.file.CmsPropertyDefinition#PROPERTY_NAVPOS}</code>
     * and the install path is given by the folder structure if the <code>{@link
#ARGS_PROPERTY_DEFINITION}</code>
     * property does not include path information.<p>
     * 
     * For the icon path you can specify 2 paths separated by a <code>{@link
A_CmsToolHandler#VALUE_SEPARATOR}</code>, 
     * the first one will be used as a group icon (32x32), and the second as an
menu icon (16x16). The paths are relative
     * to the /system/workplace/resources/ folder. If the tool is disabled, the
names of the icons are composed as 
     * ${name}_disabled.${ext}<p>
---

but the tool manager does not allows to have more than one root for tools... :(
you can only have a new group in the same view.

-- 
Regards
Michael Moossen
Alkacon Software Gmbh - The OpenCms Experts

http://www.alkacon.com



Quoting Alexander Wallace <aw at avatartechnology.com>:

> Hi all... I have created a new "View" in the workplace, and i would like to 
> give it the same look and feel as the Administration View (the new one)...
> 
> I'm trying to figure out if i should reuse the CmsAdminMenu class or write my
> 
> own menu class. For that reason I was hoping to find somewhere in the code, 
> what tells CmsAdminMenu which menu items to add... I'm looking at the 
> installMenu() method, that's where the rendering takes place, but i have not
> 
> been able to figure out where is the ToolManager or the ToolHandlers through
> 
> which iterates specified.
> 
> Can someone give me a clue here if i should follow this path, where to look,
> 
> what's better to do what i want? Any help is greatly appreciated...
> 
> Thanks!
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the opencms-dev mailing list