public boolean setup(CmsObject cms, CmsToolRootHandler root, String resourcePath) {

        try {
            resourcePath = cms.getSitePath(cms.readResource(resourcePath));
        } catch (CmsException e) {
            // should not happen
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        CmsJspNavElement navElem = new CmsJspNavBuilder(cms).getNavigationForResource(resourcePath);

        String name = navElem.getNavText();
        if (CmsMessages.isUnknownKey(name)) {
            name = navElem.getTitle();
        }
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) {
            name = "${key." + Messages.GUI_TOOLS_DEFAULT_NAME_0 + "}";
        }
        String shortName = name;
        if (name.indexOf(VALUE_SEPARATOR) >= 0) {
            shortName = name.substring(0, name.indexOf(VALUE_SEPARATOR));
            name = name.substring(name.indexOf(VALUE_SEPARATOR) + 1);
        }
        setName(name);
        setShortName(shortName);

        String iconPath = navElem.getNavImage();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(iconPath)) {
            iconPath = "admin/images/default_tool_big.png:admin/images/default_tool_small.png";
        }
        String smallIconPath = iconPath;
        if (iconPath.indexOf(VALUE_SEPARATOR) >= 0) {
            smallIconPath = iconPath.substring(iconPath.indexOf(VALUE_SEPARATOR) + 1);
            iconPath = iconPath.substring(0, iconPath.indexOf(VALUE_SEPARATOR));
        }
        setIconPath(iconPath);
        setSmallIconPath(smallIconPath);

        String helpText = navElem.getDescription();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(helpText)) {
            helpText = "${key." + Messages.GUI_TOOLS_DEFAULT_HELP_0 + "}";
        }
        String disabledHelpText = DEFAULT_DISABLED_HELPTEXT;
        if (helpText.indexOf(VALUE_SEPARATOR) >= 0) {
            disabledHelpText = helpText.substring(helpText.indexOf(VALUE_SEPARATOR) + 1);
            helpText = helpText.substring(0, helpText.indexOf(VALUE_SEPARATOR));
        }
        setHelpText(helpText);
        setDisabledHelpText(disabledHelpText);

        String group = navElem.getInfo();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(group)) {
            group = "${key." + Messages.GUI_TOOLS_DEFAULT_GROUP_0 + "}";
        }

        String path = resourcePath;
        setLink(cms, resourcePath);
        if (CmsResource.isFolder(path)) {
            path = CmsToolManager.TOOLPATH_SEPARATOR
                + resourcePath.substring(
                    root.getUri().length(),
                    resourcePath.lastIndexOf(CmsToolManager.TOOLPATH_SEPARATOR));
        } else {
            if (resourcePath.lastIndexOf('.') > -1) {
                path = CmsToolManager.TOOLPATH_SEPARATOR
                    + resourcePath.substring(root.getUri().length(), resourcePath.lastIndexOf('.'));
            } else {
                path = CmsToolManager.TOOLPATH_SEPARATOR + resourcePath.substring(root.getUri().length());
            }
        }
        // install point
        setPath(path);
        setGroup(group);
        setPosition(navElem.getNavPosition());

        // parameters
        setParameters(cms, resourcePath);

        return !path.equals(resourcePath);
    }
public boolean setup ( CmsObject cms , CmsToolRootHandler root , String resourcePath ) { try { resourcePath = cms . getSitePath ( cms . readResource ( resourcePath ) ) ; } catch ( CmsException e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } CmsJspNavElement navElem = new CmsJspNavBuilder ( cms ) . getNavigationForResource ( resourcePath ) ; String name = navElem . getNavText ( ) ; if ( CmsMessages . isUnknownKey ( name ) ) { name = navElem . getTitle ( ) ; } if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( name ) ) { name = "${key." + Messages . GUI_TOOLS_DEFAULT_NAME_0 + "}" ; } String shortName = name ; if ( name . indexOf ( VALUE_SEPARATOR ) >= 0 ) { shortName = name . substring ( 0 , name . indexOf ( VALUE_SEPARATOR ) ) ; name = name . substring ( name . indexOf ( VALUE_SEPARATOR ) + 1 ) ; } setName ( name ) ; setShortName ( shortName ) ; String iconPath = navElem . getNavImage ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( iconPath ) ) { iconPath = "admin/images/default_tool_big.png:admin/images/default_tool_small.png" ; } String smallIconPath = iconPath ; if ( iconPath . indexOf ( VALUE_SEPARATOR ) >= 0 ) { smallIconPath = iconPath . substring ( iconPath . indexOf ( VALUE_SEPARATOR ) + 1 ) ; iconPath = iconPath . substring ( 0 , iconPath . indexOf ( VALUE_SEPARATOR ) ) ; } setIconPath ( iconPath ) ; setSmallIconPath ( smallIconPath ) ; String helpText = navElem . getDescription ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( helpText ) ) { helpText = "${key." + Messages . GUI_TOOLS_DEFAULT_HELP_0 + "}" ; } String disabledHelpText = DEFAULT_DISABLED_HELPTEXT ; if ( helpText . indexOf ( VALUE_SEPARATOR ) >= 0 ) { disabledHelpText = helpText . substring ( helpText . indexOf ( VALUE_SEPARATOR ) + 1 ) ; helpText = helpText . substring ( 0 , helpText . indexOf ( VALUE_SEPARATOR ) ) ; } setHelpText ( helpText ) ; setDisabledHelpText ( disabledHelpText ) ; String group = navElem . getInfo ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( group ) ) { group = "${key." + Messages . GUI_TOOLS_DEFAULT_GROUP_0 + "}" ; } String path = resourcePath ; setLink ( cms , resourcePath ) ; if ( CmsResource . isFolder ( path ) ) { path = CmsToolManager . TOOLPATH_SEPARATOR + resourcePath . substring ( root . getUri ( ) . length ( ) , resourcePath . lastIndexOf ( CmsToolManager . TOOLPATH_SEPARATOR ) ) ; } else { if ( resourcePath . lastIndexOf ( '.' ) > - 1 ) { path = CmsToolManager . TOOLPATH_SEPARATOR + resourcePath . substring ( root . getUri ( ) . length ( ) , resourcePath . lastIndexOf ( '.' ) ) ; } else { path = CmsToolManager . TOOLPATH_SEPARATOR + resourcePath . substring ( root . getUri ( ) . length ( ) ) ; } } setPath ( path ) ; setGroup ( group ) ; setPosition ( navElem . getNavPosition ( ) ) ; setParameters ( cms , resourcePath ) ; return ! path . equals ( resourcePath ) ; }
Default implementation.<p>

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 customize 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>

The confirmation message is taken from the <code>{@link #ARGS_PROPERTY_DEFINITION}</code> with key
<code>#ARG_CONFIRMATION_NAME</code>

@see org.opencms.workplace.tools.I_CmsToolHandler#setup(org.opencms.file.CmsObject, CmsToolRootHandler, java.lang.String)