Keel 2.1RC2

org.keel.clients.webapp
Class AbstractWebappClientConnector

java.lang.Object
  extended byorg.keel.clients.AbstractClientConnector
      extended byorg.keel.clients.webapp.AbstractWebappClientConnector
All Implemented Interfaces:
ClientConnector, WebappClientConnector
Direct Known Subclasses:
CocoonClientConnector, MaverickClientConnector, StrutsClientConnector, VelocityClientConnector, Webwork2ClientConnector

public abstract class AbstractWebappClientConnector
extends AbstractClientConnector
implements WebappClientConnector

This abstract class provides all the features needed to go between a webapp's HttpServletRequest/Response (or similar) request/response pairs and Keel's request/response pair.

Version:
$Revision: 1.5 $ $Date: 2004/05/11 20:28:32 $
Author:
Michael Nash, Schatterjee Created on May 3, 2003

Field Summary
protected static java.lang.String COMMAND_PARAM
           
protected static int COMMAND_PARAM_LEN
           
protected  boolean initParamsParsed
           
protected static java.lang.String KEEL_MODEL_PARAM
           
protected static java.lang.String MODEL_PARAM
           
protected static java.lang.String PARAMETER_PARAM
           
 
Fields inherited from class org.keel.clients.AbstractClientConnector
clientContext, log, myClients
 
Constructor Summary
AbstractWebappClientConnector()
           
 
Method Summary
protected  KeelRequest createRequest()
           
protected  KeelResponse execute(WebappRequest wreq, WebappResponse wres, java.lang.String defaultModelName)
          This method is called after the webapp-specific request/response pair has been wrapped into a WebappRequest and WebappResponse pair.
protected  java.lang.String getWebappPath(WebappRequest request, java.lang.String configPath)
           
protected  KeelRequest makeKeelRequest(WebappRequest wreq, java.lang.String defaultModelName)
          Convert a webapp-request to a Keel-request
protected  WebappResponse makeWebappResponse(KeelRequest kreq, KeelResponse kres, WebappResponse wres, WebappRequest wreq, java.lang.String modelName)
          Convert a Keel response to a webapp response
protected  java.util.Map parseInitParameters(WebappRequest wreq)
           
protected  java.lang.String preProcessParamName(java.lang.String oneParamName)
           
protected  void processCommandParam(WebappRequest wreq, KeelRequest kreq, java.lang.String oneParamName)
           
protected  void processNonCommandParam(WebappRequest wreq, KeelRequest kreq, java.lang.String oneParamName)
           
protected  void setRequestAttributes(WebappRequest wreq, KeelRequest kreq)
           
protected  void setRequestCookies(WebappRequest wreq, KeelRequest kreq)
           
protected  void setRequestModel(WebappRequest wreq, KeelRequest kreq, java.lang.String defaultModelName)
           
protected  void setRequestParameters(WebappRequest wreq, KeelRequest kreq)
           
protected  void setResponseCookies(KeelResponse kres, WebappResponse wres)
           
 
Methods inherited from class org.keel.clients.AbstractClientConnector
createClients, execute, getClient, removeClient, setContext, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.keel.clients.webapp.WebappClientConnector
execute, getForward
 
Methods inherited from interface org.keel.clients.ClientConnector
execute, setContext, setLogger
 

Field Detail

PARAMETER_PARAM

protected static final java.lang.String PARAMETER_PARAM
See Also:
Constant Field Values

COMMAND_PARAM

protected static final java.lang.String COMMAND_PARAM
See Also:
Constant Field Values

COMMAND_PARAM_LEN

protected static final int COMMAND_PARAM_LEN

MODEL_PARAM

protected static final java.lang.String MODEL_PARAM
See Also:
Constant Field Values

KEEL_MODEL_PARAM

protected static final java.lang.String KEEL_MODEL_PARAM
See Also:
Constant Field Values

initParamsParsed

protected boolean initParamsParsed
Constructor Detail

AbstractWebappClientConnector

public AbstractWebappClientConnector()
Method Detail

execute

protected KeelResponse execute(WebappRequest wreq,
                               WebappResponse wres,
                               java.lang.String defaultModelName)
                        throws ClientException,
                               ModelException
This method is called after the webapp-specific request/response pair has been wrapped into a WebappRequest and WebappResponse pair.

Throws:
ClientException
ModelException

makeKeelRequest

protected KeelRequest makeKeelRequest(WebappRequest wreq,
                                      java.lang.String defaultModelName)
                               throws ClientException
Convert a webapp-request to a Keel-request

Parameters:
wreq - The supplied webapp request
defaultModelName - The model-name to use if none in params-list
Returns:
The Keel request
Throws:
ClientException

makeWebappResponse

protected WebappResponse makeWebappResponse(KeelRequest kreq,
                                            KeelResponse kres,
                                            WebappResponse wres,
                                            WebappRequest wreq,
                                            java.lang.String modelName)
                                     throws ClientException
Convert a Keel response to a webapp response

Parameters:
kres - The Keel response
Returns:
The webapp response
Throws:
ClientException

setRequestCookies

protected void setRequestCookies(WebappRequest wreq,
                                 KeelRequest kreq)
                          throws ClientException
Throws:
ClientException

setRequestParameters

protected void setRequestParameters(WebappRequest wreq,
                                    KeelRequest kreq)
                             throws ClientException
Throws:
ClientException

setRequestAttributes

protected void setRequestAttributes(WebappRequest wreq,
                                    KeelRequest kreq)

setRequestModel

protected void setRequestModel(WebappRequest wreq,
                               KeelRequest kreq,
                               java.lang.String defaultModelName)
                        throws ClientException
Throws:
ClientException

setResponseCookies

protected void setResponseCookies(KeelResponse kres,
                                  WebappResponse wres)
                           throws ClientException
Throws:
ClientException

processNonCommandParam

protected void processNonCommandParam(WebappRequest wreq,
                                      KeelRequest kreq,
                                      java.lang.String oneParamName)

processCommandParam

protected void processCommandParam(WebappRequest wreq,
                                   KeelRequest kreq,
                                   java.lang.String oneParamName)
                            throws ClientException
Throws:
ClientException

preProcessParamName

protected java.lang.String preProcessParamName(java.lang.String oneParamName)

createRequest

protected KeelRequest createRequest()

parseInitParameters

protected java.util.Map parseInitParameters(WebappRequest wreq)
                                     throws ClientException
Throws:
ClientException

getWebappPath

protected java.lang.String getWebappPath(WebappRequest request,
                                         java.lang.String configPath)
                                  throws ClientException
Throws:
ClientException

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.