public abstract class A_CmsToolHandler extends java.lang.Object implements I_CmsToolHandler
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ARG_PARAM_NAME
Property for the parameters argument.
|
static java.lang.String |
ARG_PATH_NAME
Property for the path argument.
|
static java.lang.String |
ARGS_PROPERTY_DEFINITION
Property definition for the arguments.
|
static java.lang.String |
ARGUMENT_SEPARATOR
Argument separator.
|
static java.lang.String |
DEFAULT_DISABLED_HELPTEXT
Default disabled help text constant.
|
static java.lang.String |
VALUE_SEPARATOR
Argument name and value separator.
|
| Constructor and Description |
|---|
A_CmsToolHandler() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getConfirmationMessage()
Returns the confirmation Message.
|
java.lang.String |
getDisabledHelpText()
Returns the help text if disabled.
|
java.lang.String |
getGroup()
Returns the group.
|
java.lang.String |
getHelpText()
Returns the help text.
|
java.lang.String |
getIconPath()
Returns the path to the icon.
|
java.lang.String |
getLink()
Returns the link to the tool.
|
java.lang.String |
getName()
Returns the displayed name.
|
java.util.Map<java.lang.String,java.lang.String[]> |
getParameters(CmsWorkplace wp)
Returns the evaluated map of parameters.
|
java.lang.String |
getPath()
Returns the tool path to install the tool in.
|
float |
getPosition()
Returns the relative position in the group.
|
java.lang.String |
getShortName()
Returns the name for the menu or navbar.
|
java.lang.String |
getSmallIconPath()
Returns the path to an optional small(16x16) icon.
|
boolean |
isEnabled(CmsWorkplace wp)
Returns the state of the admin tool for a given workplace context.
|
boolean |
isVisible(CmsWorkplace wp)
Returns the visibility flag for a given workplace context.
|
void |
setConfirmationMessage(java.lang.String confirmationMessage)
Sets the confirmation Message.
|
void |
setDisabledHelpText(java.lang.String disabledHelpText)
Sets the help text if disabled.
|
void |
setGroup(java.lang.String group)
Sets the group.
|
void |
setHelpText(java.lang.String helpText)
Sets the help text.
|
void |
setIconPath(java.lang.String iconPath)
Sets the icon path.
|
protected void |
setLink(CmsObject cms,
java.lang.String resourcePath)
Sets the link for the given resource.
|
void |
setLink(java.lang.String link)
Sets the link.
|
void |
setName(java.lang.String name)
Sets the name.
|
protected void |
setParameters(CmsObject cms,
java.lang.String resourcePath)
Sets the needed properties from the
ARGS_PROPERTY_DEFINITION property of the given resource. |
void |
setParameterString(java.lang.String paramString)
Sets the parameter string.
|
void |
setPath(java.lang.String path)
Sets the path.
|
void |
setPosition(float position)
Sets the position.
|
void |
setShortName(java.lang.String shortName)
Sets the short name.
|
void |
setSmallIconPath(java.lang.String smallIconPath)
Sets the small icon path.
|
boolean |
setup(CmsObject cms,
CmsToolRootHandler root,
java.lang.String resourcePath)
Default implementation.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisEnabled, isVisiblepublic static final java.lang.String ARG_PARAM_NAME
public static final java.lang.String ARG_PATH_NAME
public static final java.lang.String ARGS_PROPERTY_DEFINITION
public static final java.lang.String ARGUMENT_SEPARATOR
public static final java.lang.String DEFAULT_DISABLED_HELPTEXT
public static final java.lang.String VALUE_SEPARATOR
public A_CmsToolHandler()
public java.lang.String getConfirmationMessage()
getConfirmationMessage in interface I_CmsToolHandlerpublic java.lang.String getDisabledHelpText()
I_CmsToolHandlergetDisabledHelpText in interface I_CmsToolHandlerI_CmsToolHandler.getDisabledHelpText()public java.lang.String getGroup()
I_CmsToolHandlergetGroup in interface I_CmsToolHandlerI_CmsToolHandler.getGroup()public java.lang.String getHelpText()
I_CmsToolHandlergetHelpText in interface I_CmsToolHandlerI_CmsToolHandler.getHelpText()public java.lang.String getIconPath()
I_CmsToolHandlergetIconPath in interface I_CmsToolHandlerI_CmsToolHandler.getIconPath()public java.lang.String getLink()
I_CmsToolHandlergetLink in interface I_CmsToolHandlerI_CmsToolHandler.getLink()public java.lang.String getName()
I_CmsToolHandlergetName in interface I_CmsToolHandlerI_CmsToolHandler.getName()public java.util.Map<java.lang.String,java.lang.String[]> getParameters(CmsWorkplace wp)
I_CmsToolHandlergetParameters in interface I_CmsToolHandlerwp - the workplace contextI_CmsToolHandler.getParameters(org.opencms.workplace.CmsWorkplace)public java.lang.String getPath()
I_CmsToolHandlergetPath in interface I_CmsToolHandlerI_CmsToolHandler.getPath()public float getPosition()
I_CmsToolHandlergetPosition in interface I_CmsToolHandlerI_CmsToolHandler.getPosition()public java.lang.String getShortName()
I_CmsToolHandlergetShortName in interface I_CmsToolHandlerI_CmsToolHandler.getShortName()public java.lang.String getSmallIconPath()
I_CmsToolHandlergetSmallIconPath in interface I_CmsToolHandlerI_CmsToolHandler.getSmallIconPath()public boolean isEnabled(CmsWorkplace wp)
I_CmsToolHandlerisEnabled in interface I_CmsToolHandlerwp - the workplace contexttrue if enabledI_CmsToolHandler.isEnabled(org.opencms.workplace.CmsWorkplace)public boolean isVisible(CmsWorkplace wp)
I_CmsToolHandlerisVisible in interface I_CmsToolHandlerwp - the workplace contexttrue if visibleI_CmsToolHandler.isVisible(org.opencms.workplace.CmsWorkplace)public void setConfirmationMessage(java.lang.String confirmationMessage)
confirmationMessage - the confirmation Message to setpublic void setDisabledHelpText(java.lang.String disabledHelpText)
disabledHelpText - the help text to setpublic void setGroup(java.lang.String group)
group - the group to setpublic void setHelpText(java.lang.String helpText)
helpText - the help text to setpublic void setIconPath(java.lang.String iconPath)
iconPath - the icon path to setpublic void setLink(java.lang.String link)
link - the link to setpublic void setName(java.lang.String name)
name - the name to setpublic void setParameterString(java.lang.String paramString)
paramString - the parameter string to setpublic void setPath(java.lang.String path)
path - the path to setpublic void setPosition(float position)
position - the position to setpublic void setShortName(java.lang.String shortName)
shortName - the short name to setpublic void setSmallIconPath(java.lang.String smallIconPath)
smallIconPath - the samll icon path to setpublic boolean setup(CmsObject cms, CmsToolRootHandler root, java.lang.String resourcePath)
It takes the icon path from property,
or uses a default icon if undefined, the name is taken from the
CmsPropertyDefinition.PROPERTY_NAVIMAGE property,
or uses the CmsPropertyDefinition.PROPERTY_NAVTEXT 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 CmsPropertyDefinition.PROPERTY_TITLE 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
VALUE_SEPARATOR property or a
default text if undefined, if you want to customize a help text while disabled, use a
CmsPropertyDefinition.PROPERTY_DESCRIPTION as a separator in the same property.VALUE_SEPARATOR
The group is taken from the property,
the position from the CmsPropertyDefinition.PROPERTY_NAVINFO
and the install path is given by the folder structure if the CmsPropertyDefinition.PROPERTY_NAVPOS
property does not include path information.ARGS_PROPERTY_DEFINITION
For 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_SEPARATOR
The confirmation message is taken from the with key
ARGS_PROPERTY_DEFINITION#ARG_CONFIRMATION_NAME
setup in interface I_CmsToolHandlercms - the admin context (at opencms-workplace (re-)initialization time)root - the root contextresourcePath - the resource path of the file/folder to use as admin toolfalse if something goes wrongI_CmsToolHandler.setup(org.opencms.file.CmsObject, CmsToolRootHandler, java.lang.String)public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()protected void setLink(CmsObject cms, java.lang.String resourcePath)
Use the resourcePath as 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 the CmsToolManager.VIEW_JSPPAGE_LOCATION.
cms - the cms contextresourcePath - the path to the resource to set the link forprotected void setParameters(CmsObject cms, java.lang.String resourcePath)
ARGS_PROPERTY_DEFINITION property of the given resource.cms - the cms contextresourcePath - the path to the resource to read the property from