info.magnolia.cms.servlets
Class CommandBasedMVCServletHandler
java.lang.Object
info.magnolia.cms.servlets.MVCServletHandlerImpl
info.magnolia.cms.servlets.CommandBasedMVCServletHandler
- All Implemented Interfaces:
- MVCServletHandler
- Direct Known Subclasses:
- AdminTreeMVCHandler, PageMVCHandler
public abstract class CommandBasedMVCServletHandler
- extends MVCServletHandlerImpl
This implementation tries first to get a command form it's command catalogue. If none is found it will call the
execute method of the default MVCServletHandlerImpl, which tries to execute through reflection a related method.
- Version:
- $Revision: 41137 $ ($Author: gjoseph $)
Constructor Summary |
protected |
CommandBasedMVCServletHandler(java.lang.String name,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
Method Summary |
java.lang.String |
execute(java.lang.String commandName)
Try to get the command from the catalog. |
protected org.apache.commons.chain.Command |
findCommand(java.lang.String commandName)
Used to get the command object. |
java.lang.String |
getCatalogueName()
|
protected Context |
getCommandContext(java.lang.String commandName)
The default implementation returns the current context. |
protected java.lang.String |
getViewNameAfterExecution(java.lang.String commandName,
Context ctx)
Default implementation returns the commandName itself. |
void |
setCatalogueName(java.lang.String catalogueName)
|
Methods inherited from class info.magnolia.cms.servlets.MVCServletHandlerImpl |
getCommand, getException, getExceptionStackTrace, getName, getRequest, getResponse, init, populateFromRequest, setCommand, setRequest, setResponse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CommandBasedMVCServletHandler
protected CommandBasedMVCServletHandler(java.lang.String name,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
- Parameters:
name
- request
- response
-
execute
public java.lang.String execute(java.lang.String commandName)
- Try to get the command from the catalog.
- Specified by:
execute
in interface MVCServletHandler
- Overrides:
execute
in class MVCServletHandlerImpl
- Returns:
- the name of the view to show (used in renderHtml)
getViewNameAfterExecution
protected java.lang.String getViewNameAfterExecution(java.lang.String commandName,
Context ctx)
- Default implementation returns the commandName itself.
- Returns:
- the view name returned by this execution
findCommand
protected org.apache.commons.chain.Command findCommand(java.lang.String commandName)
- Used to get the command object.
- Returns:
- the callable command object
getCommandContext
protected Context getCommandContext(java.lang.String commandName)
- The default implementation returns the current context.
- Parameters:
commandName
- the name of the command to be called
- Returns:
- the context to pass to the command
getCatalogueName
public java.lang.String getCatalogueName()
- Returns:
- Returns the catalogueName.
setCatalogueName
public void setCatalogueName(java.lang.String catalogueName)
- Parameters:
catalogueName
- The catalogueName to set.
Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.