📄 a_cmstoolhandler.java
字号:
/*
* File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/tools/A_CmsToolHandler.java,v $
* Date : $Date: 2006/04/28 15:20:52 $
* Version: $Revision: 1.24 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
*
* Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software GmbH, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.workplace.tools;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsProperty;
import org.opencms.file.CmsPropertyDefinition;
import org.opencms.i18n.CmsMessages;
import org.opencms.jsp.CmsJspNavBuilder;
import org.opencms.jsp.CmsJspNavElement;
import org.opencms.main.CmsException;
import org.opencms.main.CmsLog;
import org.opencms.util.CmsStringUtil;
import org.opencms.workplace.CmsWorkplace;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.logging.Log;
/**
* Helper class to build easily other admin tool handlers.<p>
*
* @author Michael Moossen
*
* @version $Revision: 1.24 $
*
* @since 6.0.0
*/
public abstract class A_CmsToolHandler implements I_CmsToolHandler {
/** Property for the params arg.<p> */
public static final String ARG_PARAM_NAME = "params";
/** Property for the path arg.<p> */
public static final String ARG_PATH_NAME = "path";
/** Property definition for the args.<p> */
public static final String ARGS_PROPERTY_DEFINITION = "admintoolhandler-args";
/** Argument separator.<p> */
public static final String ARGUMENT_SEPARATOR = "|";
/** Default disabled help text constant.<p> */
public static final String DEFAULT_DISABLED_HELPTEXT = "${key." + Messages.GUI_TOOLS_DISABLED_HELP_0 + "}";
/** Argument name and value separator.<p> */
public static final String VALUE_SEPARATOR = ":";
/** Property for the confirmation message arg.<p> */
private static final String ARG_CONFIRMATION_NAME = "confirmation";
/** Confirmation message. */
private String m_confirmationMessage;
/** Help text or description if disabled. */
private String m_disabledHelpText;
/** Group to be included in. */
private String m_group;
/** Help text or description. */
private String m_helpText;
/** Icon path (32x32). */
private String m_iconPath;
/** Link pointer. */
private String m_link;
/** Display name. */
private String m_name;
/** Needed parameters. */
private String m_parameters;
/** Tool path to install in. */
private String m_path;
/** Relative position in group. */
private float m_position;
/** Menu item name. */
private String m_shortName;
/** Small icon path (16x16). */
private String m_smallIconPath;
/** The static log object for this class. */
private static final Log LOG = CmsLog.getLog(A_CmsToolHandler.class);
/**
* Returns the confirmation Message.<p>
*
* @return the confirmation Message
*/
public String getConfirmationMessage() {
return m_confirmationMessage;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getDisabledHelpText()
*/
public String getDisabledHelpText() {
return m_disabledHelpText;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getGroup()
*/
public String getGroup() {
return m_group;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getHelpText()
*/
public String getHelpText() {
return m_helpText;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getIconPath()
*/
public String getIconPath() {
return m_iconPath;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getLink()
*/
public String getLink() {
return m_link;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getName()
*/
public String getName() {
return m_name;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getParameters(org.opencms.workplace.CmsWorkplace)
*/
public Map getParameters(CmsWorkplace wp) {
Map argMap = new HashMap();
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_parameters)) {
String toolParams = wp.resolveMacros(m_parameters);
Iterator itArgs = CmsStringUtil.splitAsList(toolParams, "&").iterator();
while (itArgs.hasNext()) {
String arg = (String)itArgs.next();
int pos = arg.indexOf("=");
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(arg.substring(pos + 1))) {
argMap.put(arg.substring(0, pos), arg.substring(pos + 1));
}
}
}
return argMap;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getPath()
*/
public String getPath() {
return m_path;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getPosition()
*/
public float getPosition() {
return m_position;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getShortName()
*/
public String getShortName() {
return m_shortName;
}
/**
* @see org.opencms.workplace.tools.I_CmsToolHandler#getSmallIconPath()
*/
public String getSmallIconPath() {
return m_smallIconPath;
}
/**
* Sets the confirmation Message.<p>
*
* @param confirmationMessage the confirmation Message to set
*/
public void setConfirmationMessage(String confirmationMessage) {
m_confirmationMessage = confirmationMessage;
}
/**
* Sets the help text if disabled.<p>
*
* @param disabledHelpText the help text to set
*/
public void setDisabledHelpText(String disabledHelpText) {
m_disabledHelpText = disabledHelpText;
}
/**
* Sets the group.<p>
*
* @param group the group to set
*/
public void setGroup(String group) {
m_group = group;
}
/**
* Sets the help text.<p>
*
* @param helpText the help text to set
*/
public void setHelpText(String helpText) {
m_helpText = helpText;
}
/**
* Sets the icon path.<p>
*
* @param iconPath the icon path to set
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -