org.opencms.workplace.tools
Class A_CmsToolHandler

java.lang.Object
  extended byorg.opencms.workplace.tools.A_CmsToolHandler
All Implemented Interfaces:
I_CmsToolHandler
Direct Known Subclasses:
CmsDefaultToolHandler, CmsInvisibleToolHandler, CmsOnlyAdminToolHandler, CmsRootToolHandler

public abstract class A_CmsToolHandler
extends Object
implements I_CmsToolHandler

Helper class to build easily other admin tool handlers.

Since:
6.0.0
Version:
$Revision: 1.18 $
Author:
Michael Moossen

Field Summary
static String ARG_PARAM_NAME
          Property for the params arg.
static String ARG_PATH_NAME
          Property for the path arg.
static String ARGS_PROPERTY_DEFINITION
          Property for the args.
static String ARGUMENT_SEPARATOR
          Argument separator.
static String DEFAULT_DISABLED_HELPTEXT
          Default disabled help text constant.
static String VALUE_SEPARATOR
          Argument name and value separator.
 
Constructor Summary
A_CmsToolHandler()
           
 
Method Summary
 String getDisabledHelpText()
          Returns the help text if disabled.
 String getGroup()
          Returns the group.
 String getHelpText()
          Returns the help text.
 String getIconPath()
          Returns the path to the icon.
 String getLink()
          Returns the link to the tool.
 String getName()
          Returns the displayed name.
 String getParameters()
          Returns the needed parameters.
 String getPath()
          Returns the tool path to install the tool in.
 float getPosition()
          Returns the relative position in the group.
 String getShortName()
          Returns the name for the menu or navbar.
 String getSmallIconPath()
          Returns the path to an optional small(16x16) icon.
 void setDisabledHelpText(String disabledHelpText)
          Sets the help text if disabled.
 void setGroup(String group)
          Sets the group.
 void setHelpText(String helpText)
          Sets the help text.
 void setIconPath(String iconPath)
          Sets the icon path.
 void setLink(String link)
          Sets the link.
 void setName(String name)
          Sets the name.
 void setParameters(String parameters)
          Sets the parameters.
 void setPath(String path)
          Sets the path.
 void setPosition(float position)
          Sets the position.
 void setShortName(String shortName)
          Sets the short name.
 void setSmallIconPath(String smallIconPath)
          Sets the small icon path.
 boolean setup(CmsObject cms, String resourcePath)
          Default implementation.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opencms.workplace.tools.I_CmsToolHandler
isEnabled, isVisible
 

Field Detail

ARG_PARAM_NAME

public static final String ARG_PARAM_NAME
Property for the params arg.

See Also:
Constant Field Values

ARG_PATH_NAME

public static final String ARG_PATH_NAME
Property for the path arg.

See Also:
Constant Field Values

ARGS_PROPERTY_DEFINITION

public static final String ARGS_PROPERTY_DEFINITION
Property for the args.

See Also:
Constant Field Values

ARGUMENT_SEPARATOR

public static final String ARGUMENT_SEPARATOR
Argument separator.

See Also:
Constant Field Values

DEFAULT_DISABLED_HELPTEXT

public static final String DEFAULT_DISABLED_HELPTEXT
Default disabled help text constant.

See Also:
Constant Field Values

VALUE_SEPARATOR

public static final String VALUE_SEPARATOR
Argument name and value separator.

See Also:
Constant Field Values
Constructor Detail

A_CmsToolHandler

public A_CmsToolHandler()
Method Detail

getDisabledHelpText

public String getDisabledHelpText()
Description copied from interface: I_CmsToolHandler
Returns the help text if disabled.

Specified by:
getDisabledHelpText in interface I_CmsToolHandler
Returns:
the help text if disabled
See Also:
I_CmsToolHandler.getDisabledHelpText()

getGroup

public String getGroup()
Description copied from interface: I_CmsToolHandler
Returns the group.

Specified by:
getGroup in interface I_CmsToolHandler
Returns:
the group
See Also:
I_CmsToolHandler.getGroup()

getHelpText

public String getHelpText()
Description copied from interface: I_CmsToolHandler
Returns the help text.

Specified by:
getHelpText in interface I_CmsToolHandler
Returns:
the help text
See Also:
I_CmsToolHandler.getHelpText()

getIconPath

public String getIconPath()
Description copied from interface: I_CmsToolHandler
Returns the path to the icon.

Specified by:
getIconPath in interface I_CmsToolHandler
Returns:
the path to the icon
See Also:
I_CmsToolHandler.getIconPath()

getLink

public String getLink()
Description copied from interface: I_CmsToolHandler
Returns the link to the tool.

Specified by:
getLink in interface I_CmsToolHandler
Returns:
the link
See Also:
I_CmsToolHandler.getLink()

getName

public String getName()
Description copied from interface: I_CmsToolHandler
Returns the displayed name.

Specified by:
getName in interface I_CmsToolHandler
Returns:
the name
See Also:
I_CmsToolHandler.getName()

getParameters

public String getParameters()
Returns the needed parameters.

Specified by:
getParameters in interface I_CmsToolHandler
Returns:
the parameters

getPath

public String getPath()
Description copied from interface: I_CmsToolHandler
Returns the tool path to install the tool in.

Specified by:
getPath in interface I_CmsToolHandler
Returns:
the path
See Also:
I_CmsToolHandler.getPath()

getPosition

public float getPosition()
Description copied from interface: I_CmsToolHandler
Returns the relative position in the group.

Specified by:
getPosition in interface I_CmsToolHandler
Returns:
the position
See Also:
I_CmsToolHandler.getPosition()

getShortName

public String getShortName()
Description copied from interface: I_CmsToolHandler
Returns the name for the menu or navbar.

Specified by:
getShortName in interface I_CmsToolHandler
Returns:
the short name
See Also:
I_CmsToolHandler.getShortName()

getSmallIconPath

public String getSmallIconPath()
Description copied from interface: I_CmsToolHandler
Returns the path to an optional small(16x16) icon.

Specified by:
getSmallIconPath in interface I_CmsToolHandler
Returns:
the path to an optional small(16x16) icon
See Also:
I_CmsToolHandler.getSmallIconPath()

setDisabledHelpText

public void setDisabledHelpText(String disabledHelpText)
Sets the help text if disabled.

Parameters:
disabledHelpText - the help text to set

setGroup

public void setGroup(String group)
Sets the group.

Parameters:
group - the group to set

setHelpText

public void setHelpText(String helpText)
Sets the help text.

Parameters:
helpText - the help text to set

setIconPath

public void setIconPath(String iconPath)
Sets the icon path.

Parameters:
iconPath - the icon path to set

setLink

public void setLink(String link)
Sets the link.

Parameters:
link - the link to set

setName

public void setName(String name)
Sets the name.

Parameters:
name - the name to set

setParameters

public void setParameters(String parameters)
Sets the parameters.

Parameters:
parameters - the parameters to set

setPath

public void setPath(String path)
Sets the path.

Parameters:
path - the path to set

setPosition

public void setPosition(float position)
Sets the position.

Parameters:
position - the position to set

setShortName

public void setShortName(String shortName)
Sets the short name.

Parameters:
shortName - the short name to set

setSmallIconPath

public void setSmallIconPath(String smallIconPath)
Sets the small icon path.

Parameters:
smallIconPath - the samll icon path to set

setup

public boolean setup(CmsObject cms,
                     String resourcePath)
Default implementation. It takes the icon path from CmsPropertyDefinition.PROPERTY_NAVIMAGE property, or uses a default icon if undefined, the name is taken from the CmsPropertyDefinition.PROPERTY_NAVTEXT property, or uses the CmsPropertyDefinition.PROPERTY_TITLE 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 VALUE_SEPARATOR 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 CmsPropertyDefinition.PROPERTY_DESCRIPTION property or a default text if undefined, if you want to custumize a help text while disabled, use a VALUE_SEPARATOR as a separator in the same property.

The group is taken from the CmsPropertyDefinition.PROPERTY_NAVINFO property, the position from the CmsPropertyDefinition.PROPERTY_NAVPOS and the install path is given by the folder structure if the ARGS_PROPERTY_DEFINITION property does not include path information.

For the icon path you can specify 2 paths separated by a VALUE_SEPARATOR, the first one will be used as a group icon (32x32), and the second as an menu icon (16x16).

Specified by:
setup in interface I_CmsToolHandler
Parameters:
cms - the admin context (at opencms-workplace (re-)initialization time)
resourcePath - the resource path of the file/folder to use as admin tool
Returns:
false if something goes wrong
See Also:
I_CmsToolHandler.setup(org.opencms.file.CmsObject, java.lang.String)

toString

public String toString()
See Also:
Object.toString()