|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class allows you to add new commands to the Web Client's servlet and also to extend the servlet's commands. It is recommended that your custom commands all have a "x-" prefix to avoid name clashes with any future extensions to the Web Client's commands. If a custom command has the same name as a builtin command, the custom command will never be called.
If the names of your custom commands correspond with the names of the methods
implementing them (apart from the "x-" prefix), then you should extend
GenericCommandHandler
instead of
implementing this interface (see the
AuditTrailHandler
sample).
The custom commands are accessible through the 'trigger tag' returned
by the getTriggerTagFor()
method. Note that the Viewer
used must call this method in order
for the trigger tags to be displayed.
Method Summary | |
---|---|
void |
destroy()
This method is called by the Web Client in its servlet's destroy() method. |
ResponsePage |
execute(java.lang.String command,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This method is called every time a custom command is to be executed. |
byte[] |
getCredentials(javax.servlet.http.HttpServletRequest request)
This method is called by the BuiltinHandler as a pre-logon hook
to enable third party authentication. |
java.lang.String |
getHandlerInfo()
Returns a String that contains information about the handler such as its author, version, and copyright information. |
java.lang.String |
getTriggerTagFor(int list,
RequestContext context)
This method can be called by Viewer s to obtain a HTML tag that
triggers user-defined commands. |
void |
init(Config config)
This method is called by the Web Client in its servlet's init() method. |
void |
onLogoff(SessionContext context)
This method is called whenever a user has logged off. |
void |
onLogon(RequestContext context)
This method is called whenever a new user has logged on. |
Method Detail |
public void init(Config config)
init()
method. Here you have access to the servlet's
properties file as well as the default command handler.config
- The servlet's configuration and initialization parameterspublic void destroy()
destroy()
method. Free any resources here that you
might have cached.public java.lang.String getHandlerInfo()
public java.lang.String getTriggerTagFor(int list, RequestContext context)
Viewer
s to obtain a HTML tag that
triggers user-defined commands.list
- Denotes the list for which the trigger tag is queried.context
- The RequestContext
which was passed to the Viewer
calling this method.list
.public ResponsePage execute(java.lang.String command, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.NoSuchMethodException, ClientException
ResponsePage
representing the
results of command
.command
- The name of the command (the value of the
command
request parameter)request
- The request the client has made of the servletresponse
- The response the servlet sends to the clientcommand
ClientException
- If an error occurred.java.lang.NoSuchMethodException
- If the command was not handled.public void onLogon(RequestContext context)
context
- The RequestContext
for the newly added session.public void onLogoff(SessionContext context)
context
- The SessionContext
for the session that will
be removed.public byte[] getCredentials(javax.servlet.http.HttpServletRequest request) throws ClientException
BuiltinHandler
as a pre-logon hook
to enable third party authentication.request
- The logon request sent by the clientnull
if normal logon processing is required. If
a non-null value is returned, the
ExecutionService.logon4()
method will be called
instead of the ExecutionService.logon2()
and an
authentication exit must have been installed on the server.ClientException
- If an error occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |