|
||||||||||
| 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 String |
ADMINTOOLS_ROOT_LOCATION
Root location for the tools. |
static String |
ADMINVIEW_ROOT_LOCATION
Root location of the administration view. |
static String |
HANDLERCLASS_PROPERTY
Property definition name to look for. |
static String |
NAVBAR_SEPARATOR
Navegation bar separator (html code). |
static String |
TOOLPATH_SEPARATOR
Tool path separator. |
static String |
VIEW_JSPPAGE_LOCATION
Location of the admin view jsp page. |
| Constructor Summary | |
|---|---|
CmsToolManager(CmsObject cms)
Default Constructor, called by the method. |
|
| Method Summary | |
|---|---|
String |
generateNavBar(String toolPath,
CmsWorkplace wp)
Returns the navegation bar html code for the given tool path. |
CmsTool |
getCurrentTool(CmsWorkplace wp)
Returns the current tool. |
String |
getCurrentToolPath(CmsWorkplace wp)
Returns the current tool path. |
String |
getParent(CmsWorkplace wp,
String toolPath)
Returns the path to the parent of the tool identified by the given tool path. |
String |
getRootToolPath(CmsWorkplace wp)
Returns the root tool path for the active user. |
List |
getToolHandlers()
Returns a list with all registered tools. |
String |
getToolPathForUrl(String url)
Returns the tool path for the given url. |
List |
getToolsForPath(String toolPath,
boolean includeSubtools)
Returns a list of all tools in the given path. |
CmsToolUserData |
getUserData(CmsWorkplace wp)
Returns the object for a given user. |
void |
initParams(CmsToolDialog wp,
String toolPath,
String rootToolPath)
This method initializes the tool manager for the current user. |
void |
jspForwardPage(CmsWorkplace wp,
String pagePath,
Map params)
Redirects to the given page with the given parameters. |
void |
jspForwardTool(CmsWorkplace wp,
String toolPath,
Map params)
Redirects to the given tool with the given parameters. |
static String |
linkForToolPath(CmsJspActionElement jsp,
String toolPath)
Returns the OpenCms link for the given tool path which requires no parameters. |
static String |
linkForToolPath(CmsJspActionElement jsp,
String toolPath,
Map params)
Returns the OpenCms link for the given tool path which requires parameters. |
CmsTool |
resolveAdminTool(String toolPath)
Returns the admin tool corresponding to the given abstract path. |
void |
setCurrentToolPath(CmsWorkplace wp,
String currentToolPath)
Sets the current tool path. |
void |
setRootToolPath(CmsWorkplace wp,
String rootToolPath)
Sets the root 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 String ADMINTOOLS_ROOT_LOCATION
public static final String ADMINVIEW_ROOT_LOCATION
public static final String HANDLERCLASS_PROPERTY
public static final String NAVBAR_SEPARATOR
public static final String TOOLPATH_SEPARATOR
public static final String VIEW_JSPPAGE_LOCATION
| Constructor Detail |
|---|
public CmsToolManager(CmsObject cms)
CmsWorkplaceManager.initialize(CmsObject) method.
cms - the cms context| Method Detail |
|---|
public static String linkForToolPath(CmsJspActionElement jsp,
String toolPath)
jsp - the jsp action elementtoolPath - the tool path
public static String linkForToolPath(CmsJspActionElement jsp,
String toolPath,
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 String generateNavBar(String toolPath,
CmsWorkplace wp)
toolPath - the pathwp - the jsp page
public CmsTool getCurrentTool(CmsWorkplace wp)
wp - the workplace object
public String getCurrentToolPath(CmsWorkplace wp)
wp - the workplace object
public String getParent(CmsWorkplace wp,
String toolPath)
The parent of the root is the same root.
wp - the workplace objecttoolPath - the abstract tool path
public String getRootToolPath(CmsWorkplace wp)
wp - the workplace object
public List getToolHandlers()
CmsToolpublic String getToolPathForUrl(String url)
url - the url of the tool
public List getToolsForPath(String toolPath,
boolean includeSubtools)
toolPath - the pathincludeSubtools - if the tools in subfolders should be also returned
public CmsToolUserData getUserData(CmsWorkplace wp)
CmsToolUserData object for a given user.
wp - the workplace object
public void initParams(CmsToolDialog wp,
String toolPath,
String rootToolPath)
wp - the jsp page comming fromtoolPath - the current tool pathrootToolPath - the root tool path
public void jspForwardPage(CmsWorkplace wp,
String pagePath,
Map params)
throws IOException,
ServletException
wp - the workplace objectpagePath - the path to the page to redirect toparams - the parameters to send
IOException - in case of errors during forwarding
ServletException - in case of errors during forwarding
public void jspForwardTool(CmsWorkplace wp,
String toolPath,
Map params)
throws IOException,
ServletException
wp - the workplace objecttoolPath - the path to the tool to redirect toparams - the parameters to send
IOException - in case of errors during forwarding
ServletException - in case of errors during forwardingpublic CmsTool resolveAdminTool(String toolPath)
toolPath - the path
null if not found
public void setCurrentToolPath(CmsWorkplace wp,
String currentToolPath)
wp - the workplace objectcurrentToolPath - the current tool path to set
public void setRootToolPath(CmsWorkplace wp,
String rootToolPath)
wp - the workplace objectrootToolPath - the root tool path to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||