Class A_CmsToolHandler
- All Implemented Interfaces:
I_CmsToolHandler
- Direct Known Subclasses:
CmsDefaultToolHandler,CmsInvisibleToolHandler,CmsOnlyAdminToolHandler,CmsToolRootHandler
- Since:
- 6.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty for the parameters argument.static final StringProperty for the path argument.static final StringProperty definition for the arguments.static final StringArgument separator.static final StringDefault disabled help text constant.static final StringArgument name and value separator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the confirmation Message.Returns the help text if disabled.getGroup()Returns the group.Returns the help text.Returns the path to the icon.getLink()Returns the link to the tool.getName()Returns the displayed name.Returns the evaluated map of parameters.getPath()Returns the tool path to install the tool in.floatReturns the relative position in the group.Returns the name for the menu or navbar.Returns the path to an optional small(16x16) icon.booleanReturns the state of the admin tool for a given workplace context.booleanReturns the visibility flag for a given workplace context.voidsetConfirmationMessage(String confirmationMessage) Sets the confirmation Message.voidsetDisabledHelpText(String disabledHelpText) Sets the help text if disabled.voidSets the group.voidsetHelpText(String helpText) Sets the help text.voidsetIconPath(String iconPath) Sets the icon path.voidSets the link.protected voidSets the link for the given resource.voidSets the name.protected voidsetParameters(CmsObject cms, String resourcePath) Sets the needed properties from theARGS_PROPERTY_DEFINITIONproperty of the given resource.voidsetParameterString(String paramString) Sets the parameter string.voidSets the path.voidsetPosition(float position) Sets the position.voidsetShortName(String shortName) Sets the short name.voidsetSmallIconPath(String smallIconPath) Sets the small icon path.booleansetup(CmsObject cms, CmsToolRootHandler root, String resourcePath) Default implementation.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opencms.workplace.tools.I_CmsToolHandler
isEnabled, isVisible
-
Field Details
-
ARG_PARAM_NAME
Property for the parameters argument.- See Also:
-
ARG_PATH_NAME
Property for the path argument.- See Also:
-
ARGS_PROPERTY_DEFINITION
Property definition for the arguments.- See Also:
-
ARGUMENT_SEPARATOR
Argument separator.- See Also:
-
DEFAULT_DISABLED_HELPTEXT
Default disabled help text constant.- See Also:
-
VALUE_SEPARATOR
Argument name and value separator.- See Also:
-
-
Constructor Details
-
A_CmsToolHandler
public A_CmsToolHandler()
-
-
Method Details
-
getConfirmationMessage
Returns the confirmation Message.- Specified by:
getConfirmationMessagein interfaceI_CmsToolHandler- Returns:
- the confirmation Message
-
getDisabledHelpText
Description copied from interface:I_CmsToolHandlerReturns the help text if disabled.- Specified by:
getDisabledHelpTextin interfaceI_CmsToolHandler- Returns:
- the help text if disabled
- See Also:
-
getGroup
Description copied from interface:I_CmsToolHandlerReturns the group.- Specified by:
getGroupin interfaceI_CmsToolHandler- Returns:
- the group
- See Also:
-
getHelpText
Description copied from interface:I_CmsToolHandlerReturns the help text.- Specified by:
getHelpTextin interfaceI_CmsToolHandler- Returns:
- the help text
- See Also:
-
getIconPath
Description copied from interface:I_CmsToolHandlerReturns the path to the icon.- Specified by:
getIconPathin interfaceI_CmsToolHandler- Returns:
- the path to the icon
- See Also:
-
getLink
Description copied from interface:I_CmsToolHandlerReturns the link to the tool.- Specified by:
getLinkin interfaceI_CmsToolHandler- Returns:
- the link
- See Also:
-
getName
Description copied from interface:I_CmsToolHandlerReturns the displayed name.- Specified by:
getNamein interfaceI_CmsToolHandler- Returns:
- the name
- See Also:
-
getParameters
Description copied from interface:I_CmsToolHandlerReturns the evaluated map of parameters.- Specified by:
getParametersin interfaceI_CmsToolHandler- Parameters:
wp- the workplace context- Returns:
- the parameters map
- See Also:
-
getPath
Description copied from interface:I_CmsToolHandlerReturns the tool path to install the tool in.- Specified by:
getPathin interfaceI_CmsToolHandler- Returns:
- the path
- See Also:
-
getPosition
Description copied from interface:I_CmsToolHandlerReturns the relative position in the group.- Specified by:
getPositionin interfaceI_CmsToolHandler- Returns:
- the position
- See Also:
-
getShortName
Description copied from interface:I_CmsToolHandlerReturns the name for the menu or navbar.- Specified by:
getShortNamein interfaceI_CmsToolHandler- Returns:
- the short name
- See Also:
-
getSmallIconPath
Description copied from interface:I_CmsToolHandlerReturns the path to an optional small(16x16) icon.- Specified by:
getSmallIconPathin interfaceI_CmsToolHandler- Returns:
- the path to an optional small(16x16) icon
- See Also:
-
isEnabled
Description copied from interface:I_CmsToolHandlerReturns the state of the admin tool for a given workplace context.- Specified by:
isEnabledin interfaceI_CmsToolHandler- Parameters:
wp- the workplace context- Returns:
trueif enabled- See Also:
-
isVisible
Description copied from interface:I_CmsToolHandlerReturns the visibility flag for a given workplace context.- Specified by:
isVisiblein interfaceI_CmsToolHandler- Parameters:
wp- the workplace context- Returns:
trueif visible- See Also:
-
setConfirmationMessage
Sets the confirmation Message.- Parameters:
confirmationMessage- the confirmation Message to set
-
setDisabledHelpText
Sets the help text if disabled.- Parameters:
disabledHelpText- the help text to set
-
setGroup
Sets the group.- Parameters:
group- the group to set
-
setHelpText
Sets the help text.- Parameters:
helpText- the help text to set
-
setIconPath
Sets the icon path.- Parameters:
iconPath- the icon path to set
-
setLink
Sets the link.- Parameters:
link- the link to set
-
setName
Sets the name.- Parameters:
name- the name to set
-
setParameterString
Sets the parameter string.- Parameters:
paramString- the parameter string to set
-
setPath
Sets the path.- Parameters:
path- the path to set
-
setPosition
Sets the position.- Parameters:
position- the position to set
-
setShortName
Sets the short name.- Parameters:
shortName- the short name to set
-
setSmallIconPath
Sets the small icon path.- Parameters:
smallIconPath- the samll icon path to set
-
setup
Default implementation.It takes the icon path from
property, or uses a default icon if undefined, the name is taken from theCmsPropertyDefinition.PROPERTY_NAVIMAGEproperty, or uses theCmsPropertyDefinition.PROPERTY_NAVTEXTproperty 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 aCmsPropertyDefinition.PROPERTY_TITLEto 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 theVALUE_SEPARATORproperty or a default text if undefined, if you want to customize a help text while disabled, use aCmsPropertyDefinition.PROPERTY_DESCRIPTIONas a separator in the same property.VALUE_SEPARATORThe group is taken from the
property, the position from theCmsPropertyDefinition.PROPERTY_NAVINFOand the install path is given by the folder structure if theCmsPropertyDefinition.PROPERTY_NAVPOSproperty does not include path information.ARGS_PROPERTY_DEFINITIONFor the icon path you can specify 2 paths separated by a
, 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}VALUE_SEPARATORThe confirmation message is taken from the
with keyARGS_PROPERTY_DEFINITION#ARG_CONFIRMATION_NAME- Specified by:
setupin interfaceI_CmsToolHandler- Parameters:
cms- the admin context (at opencms-workplace (re-)initialization time)root- the root contextresourcePath- the resource path of the file/folder to use as admin tool- Returns:
falseif something goes wrong- See Also:
-
toString
-
setLink
Sets the link for the given resource.Use the
resourcePathas link if it is not a folder. If it is a folder, try to use the folder default file property value as link. if not use theCmsToolManager.VIEW_JSPPAGE_LOCATION.- Parameters:
cms- the cms contextresourcePath- the path to the resource to set the link for
-
setParameters
Sets the needed properties from theARGS_PROPERTY_DEFINITIONproperty of the given resource.- Parameters:
cms- the cms contextresourcePath- the path to the resource to read the property from
-