|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.workplace.tools.CmsToolManager
public class CmsToolManager
Manages the registered tools, actualizing its state every time the workplace is reinitialize.
Manages also the configuration settings for the administration view, and provides several tool related methods.
Field Summary | |
---|---|
static java.lang.String |
ADMINVIEW_ROOT_LOCATION
Root location of the administration view. |
static java.lang.String |
HANDLERCLASS_PROPERTY
Property definition name to look for. |
static java.lang.String |
NAVBAR_SEPARATOR
Navigation bar separator (html code). |
static java.lang.String |
ROOT_SEPARATOR
Tool root separator. |
static java.lang.String |
ROOTKEY_DEFAULT
Key for the default tool root, if there is no configured root with this a key, a new one will be configured. |
static java.lang.String |
TOOLPATH_SEPARATOR
Tool path separator. |
static java.lang.String |
VIEW_JSPPAGE_LOCATION
Location of the default admin view jsp page. |
Constructor Summary | |
---|---|
CmsToolManager()
Default constructor. |
Method Summary | |
---|---|
void |
addToolRoot(CmsToolRootHandler toolRoot)
Adds a new tool root to the tool manager. |
void |
configure(CmsObject cms)
Called by the method. |
java.lang.String |
generateNavBar(java.lang.String toolPath,
CmsWorkplace wp)
Returns the navigation bar html code for the given tool path. |
java.lang.String |
getBaseToolPath(CmsWorkplace wp)
Returns the base tool path for the active user. |
CmsToolRootHandler |
getCurrentRoot(CmsWorkplace wp)
Returns the current user's root handler. |
CmsTool |
getCurrentTool(CmsWorkplace wp)
Returns the current tool. |
java.lang.String |
getCurrentToolPath(CmsWorkplace wp)
Returns the current tool path. |
java.lang.String |
getParent(CmsWorkplace wp,
java.lang.String toolPath)
Returns the path to the parent of the tool identified by the given tool path. |
java.util.List |
getToolHandlers()
Returns a list with all registered tools. |
java.util.List |
getToolRoots()
Returns a list of tool roots. |
java.util.List |
getToolsForPath(CmsWorkplace wp,
java.lang.String baseTool,
boolean includeSubtools)
Returns a list of all tools in the given path. |
CmsToolUserData |
getUserData(CmsWorkplace wp)
Returns the object for a given user. |
boolean |
hasToolPathForUrl(java.lang.String url)
Returns true if there is at least one tool registered using the given url. |
void |
initParams(CmsToolDialog wp)
This method initializes the tool manager for the current user. |
void |
jspForwardPage(CmsWorkplace wp,
java.lang.String pagePath,
java.util.Map params)
Redirects to the given page with the given parameters. |
void |
jspForwardTool(CmsWorkplace wp,
java.lang.String toolPath,
java.util.Map params)
Redirects to the given tool with the given parameters. |
static java.lang.String |
linkForToolPath(CmsJspActionElement jsp,
java.lang.String toolPath)
Returns the OpenCms link for the given tool path which requires no parameters. |
static java.lang.String |
linkForToolPath(CmsJspActionElement jsp,
java.lang.String toolPath,
java.util.Map params)
Returns the OpenCms link for the given tool path which requires parameters. |
CmsTool |
resolveAdminTool(java.lang.String rootKey,
java.lang.String toolPath)
Returns the admin tool corresponding to the given abstract path. |
void |
setBaseToolPath(CmsWorkplace wp,
java.lang.String baseToolPath)
Sets the base tool path. |
void |
setCurrentRoot(CmsWorkplace wp,
java.lang.String key)
Sets the current user's root key. |
void |
setCurrentToolPath(CmsWorkplace wp,
java.lang.String currentToolPath)
Sets the current tool path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ADMINVIEW_ROOT_LOCATION
public static final java.lang.String HANDLERCLASS_PROPERTY
public static final java.lang.String NAVBAR_SEPARATOR
public static final java.lang.String ROOT_SEPARATOR
public static final java.lang.String ROOTKEY_DEFAULT
public static final java.lang.String TOOLPATH_SEPARATOR
public static final java.lang.String VIEW_JSPPAGE_LOCATION
Constructor Detail |
---|
public CmsToolManager()
Method Detail |
---|
public static java.lang.String linkForToolPath(CmsJspActionElement jsp, java.lang.String toolPath)
jsp
- the jsp action elementtoolPath
- the tool path
public static java.lang.String linkForToolPath(CmsJspActionElement jsp, java.lang.String toolPath, java.util.Map params)
Please note: Don't overuse the parameter map because this will likely introduce issues with encoding. If possible, don't pass parameters at all, or only very simple parameters with no special chars that can easily be parsed.
jsp
- the jsp action elementtoolPath
- the tool pathparams
- the map of required tool parameters
public void addToolRoot(CmsToolRootHandler toolRoot)
toolRoot
- the tool root to addpublic void configure(CmsObject cms)
CmsWorkplaceManager.initialize(CmsObject)
method.
cms
- the admin cms contextpublic java.lang.String generateNavBar(java.lang.String toolPath, CmsWorkplace wp)
toolPath
- the pathwp
- the jsp page
public java.lang.String getBaseToolPath(CmsWorkplace wp)
wp
- the workplace object
public CmsToolRootHandler getCurrentRoot(CmsWorkplace wp)
wp
- the workplace context
public CmsTool getCurrentTool(CmsWorkplace wp)
wp
- the workplace object
public java.lang.String getCurrentToolPath(CmsWorkplace wp)
wp
- the workplace object
public java.lang.String getParent(CmsWorkplace wp, java.lang.String toolPath)
The parent of the root is the same root.
wp
- the workplace objecttoolPath
- the abstract tool path
public java.util.List getToolHandlers()
CmsTool
public java.util.List getToolRoots()
CmsToolRootHandler
objectspublic java.util.List getToolsForPath(CmsWorkplace wp, java.lang.String baseTool, boolean includeSubtools)
wp
- the workplace contextbaseTool
- the pathincludeSubtools
- if the tools in subfolders should be also returned
CmsTool
objectspublic CmsToolUserData getUserData(CmsWorkplace wp)
CmsToolUserData
object for a given user.
wp
- the workplace object
public boolean hasToolPathForUrl(java.lang.String url)
true
if there is at least one tool registered using the given url.
url
- the url of the tool
true
if there is at least one tool registered using the given urlpublic void initParams(CmsToolDialog wp)
wp
- the jsp page coming frompublic void jspForwardPage(CmsWorkplace wp, java.lang.String pagePath, java.util.Map params) throws java.io.IOException, javax.servlet.ServletException
wp
- the workplace objectpagePath
- the path to the page to redirect toparams
- the parameters to send
java.io.IOException
- in case of errors during forwarding
javax.servlet.ServletException
- in case of errors during forwardingpublic void jspForwardTool(CmsWorkplace wp, java.lang.String toolPath, java.util.Map params) throws java.io.IOException, javax.servlet.ServletException
wp
- the workplace objecttoolPath
- the path to the tool to redirect toparams
- the parameters to send
java.io.IOException
- in case of errors during forwarding
javax.servlet.ServletException
- in case of errors during forwardingpublic CmsTool resolveAdminTool(java.lang.String rootKey, java.lang.String toolPath)
rootKey
- the tool roottoolPath
- the path
null
if not foundpublic void setBaseToolPath(CmsWorkplace wp, java.lang.String baseToolPath)
wp
- the workplace objectbaseToolPath
- the base tool path to setpublic void setCurrentRoot(CmsWorkplace wp, java.lang.String key)
wp
- the workplace contextkey
- the current user's root key to setpublic void setCurrentToolPath(CmsWorkplace wp, java.lang.String currentToolPath)
wp
- the workplace objectcurrentToolPath
- the current tool path to set
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |