|
||||||||||
| 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 |
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 |
ROOT_SEPARATOR
Tool root separator. |
static 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 String |
TOOLPATH_SEPARATOR
Tool path separator. |
static 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. |
String |
generateNavBar(String toolPath,
CmsWorkplace wp)
Returns the navegation bar html code for the given tool path. |
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. |
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. |
List |
getToolHandlers()
Returns a list with all registered tools. |
List |
getToolRoots()
Returns a list of tool roots. |
List |
getToolsForPath(CmsWorkplace wp,
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(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,
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 rootKey,
String toolPath)
Returns the admin tool corresponding to the given abstract path. |
void |
setBaseToolPath(CmsWorkplace wp,
String baseToolPath)
Sets the base tool path. |
void |
setCurrentRoot(CmsWorkplace wp,
String key)
Sets the current user's root key. |
void |
setCurrentToolPath(CmsWorkplace wp,
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 String ADMINVIEW_ROOT_LOCATION
public static final String HANDLERCLASS_PROPERTY
public static final String NAVBAR_SEPARATOR
public static final String ROOT_SEPARATOR
public static final String ROOTKEY_DEFAULT
public static final String TOOLPATH_SEPARATOR
public static final String VIEW_JSPPAGE_LOCATION
| Constructor Detail |
|---|
public CmsToolManager()
| 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 void addToolRoot(CmsToolRootHandler toolRoot)
toolRoot - the tool root to addpublic void configure(CmsObject cms)
CmsWorkplaceManager.initialize(CmsObject) method.
cms - the admin cms context
public String generateNavBar(String toolPath,
CmsWorkplace wp)
toolPath - the pathwp - the jsp page
public 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 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 List getToolHandlers()
CmsToolpublic List getToolRoots()
CmsToolRootHandler objects
public List getToolsForPath(CmsWorkplace wp,
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(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 comming from
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 forwarding
public CmsTool resolveAdminTool(String rootKey,
String toolPath)
rootKey - the tool roottoolPath - the path
null if not found
public void setBaseToolPath(CmsWorkplace wp,
String baseToolPath)
wp - the workplace objectbaseToolPath - the base tool path to set
public void setCurrentRoot(CmsWorkplace wp,
String key)
wp - the workplace contextkey - the current user's root key to set
public void setCurrentToolPath(CmsWorkplace wp,
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 | |||||||||