|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.workflow.portlet.client.GenericCommandHandler
This class provides a generic implementation of
CommandHandler
's execute()
method which maps the command name directly to the name of the method to
be invoked and allows easy access to the ApplicationContext
.
Constructor Summary | |
---|---|
GenericCommandHandler()
|
Method Summary | |
---|---|
void |
destroy()
This convenience method has an empty implementation. |
ResponsePage |
execute(java.lang.String command,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This method is called by the BuiltinHandler to invoke user-defined
commands. |
Config |
getConfig()
This method allows subclasses to access the Web Client's configuration. |
ApplicationContext |
getContext()
This method allows subclasses to access the Web Client's context. |
byte[] |
getCredentials(javax.servlet.http.HttpServletRequest request)
This method returns null so the normal logon processing
takes place. |
java.lang.String |
getHandlerInfo()
Returns a String that contains information about the handler such as its author, version, and copyright information. |
static SessionContext |
getSessionContext(javax.servlet.http.HttpServletRequest request)
This method allows subclasses to extract the SessionContext
from an HTTP request object. |
java.lang.String |
getTriggerTagFor(int list,
RequestContext context)
Returns a String that contains HTML code to trigger a user defined command. |
void |
init(Config config)
This method must be called by subclasses in their init()
method. |
void |
onLogoff(SessionContext context)
This hook has an empty implementation. |
void |
onLogon(RequestContext context)
This hook has an empty implementation. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GenericCommandHandler()
Method Detail |
public void init(Config config)
init()
method.init
in interface CommandHandler
config
- The servlet's configuration and initialization parameterspublic void destroy()
destroy
in interface CommandHandler
public java.lang.String getHandlerInfo()
getHandlerInfo
in interface CommandHandler
public java.lang.String getTriggerTagFor(int list, RequestContext context)
getTriggerTagFor
in interface CommandHandler
list
- Denotes the list for which the trigger tag is queried.context
- The RequestContext
which was passed to the Viewer
calling this method.public ResponsePage execute(java.lang.String command, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.NoSuchMethodException, ClientException
BuiltinHandler
to invoke user-defined
commands. It maps any command commandName
to an invocation
of the public ResponsePage commandName(HttpServletRequest, HttpServletResponse)
method, stripping the recommended x-
prefix if present.execute
in interface CommandHandler
command
- The name of the commandrequest
- The request the client has made of the servletresponse
- The response the servlet sends to the clientcom.ibm.workflow.servlet.client.ClientException
- If an error occurred.public void onLogon(RequestContext context)
onLogon
in interface CommandHandler
context
- The RequestContext
of the newly added sessionpublic void onLogoff(SessionContext context)
onLogoff
in interface CommandHandler
context
- The SessionContext
of the session to be removedpublic byte[] getCredentials(javax.servlet.http.HttpServletRequest request) throws ClientException
null
so the normal logon processing
takes place.getCredentials
in interface CommandHandler
request
- The logon request sent by the clientnull
com.ibm.workflow.servlet.client.ClientException
- If an error occurred.public final Config getConfig()
configuration
public final ApplicationContext getContext()
public static SessionContext getSessionContext(javax.servlet.http.HttpServletRequest request) throws ClientException
SessionContext
from an HTTP request object.request
- The request the client has made of the servletcom.ibm.workflow.servlet.client.ClientException
- If no session
is associated with the HTTP request.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |