|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.nucleus.TimedOperationService
atg.nucleus.servlet.ServletService
atg.nucleus.servlet.HttpServletService
atg.servlet.DynamoServlet
atg.integrations.MapRPCDroplet
public class MapRPCDroplet
This Servlet executes the RPC Command and renders its output paramter. Also sets the result parameter with output of the command execution. If an exception is generated by the command execution then an error parameter is rendered setting exception< parameter with the exception thrown.
Input parameters are passed into this droplet in different ways as following.
ServletException
is thrown when this happens. One exception to
this is if you want to set some default value for any parameters, you should
populate the Map property of this with default values and make an entry
for the key from the page context.
A complete description of the parameters to this droplet are:
inputProperties
Map property of the
droplet, and just pass the parameter names in this parameter. This droplet
parses the parameter names in this property and tries to get the value
for these parameters from the page. If any of the parameters is not found
in the page, this droplet looks for it in the inputProperties
Map property and populates the value of this parameter.
It is illegal to pass this parameter and inputParameters
to
the droplet. But it is legal to pass this parameter and setting the
inputProperties
in the properties of this droplet.
inputParameterNames
parameter.
inputParameterNames
page parameter to set default values to
some of the parameters.
The following is the sample code to use this droplet:
<droplet bean="/atg/integrations/MapRPCDroplet">
<param name="command" value="bean:/atg/integrations/jdbc/QueryForUser"/>
<param name="inputParameterNames" value="UserId">
<param name="UserId" value="bean:Profile.Id">
<java>/* a result DynamicBean put into the result /</java>
<oparam name="output">
The users email address is: <valueof param="result.emailAddress"/>
</oparam>
<oparam name="error">
Unable to execute query, the following exceptions occured: <valueof param="exception"/>
</oparam>
</droplet>
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
static ParameterName |
COMMAND
|
static java.lang.String |
ERROR
|
static java.lang.String |
EXCEPTION
|
static ParameterName |
INPUT_PARAMETERS
|
static ParameterName |
INPUT_PARAMTER_NAMES
|
static java.lang.String |
OUTPUT
|
static java.lang.String |
RESULT
|
Fields inherited from class atg.servlet.DynamoServlet |
---|
mAllowCleanupRequest, mParameters |
Fields inherited from class atg.nucleus.servlet.ServletService |
---|
SERVLET_INFO_KEY |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
MapRPCDroplet()
|
Method Summary | |
---|---|
CommandResult |
executeCommand(Command pCommand,
java.util.Map pInputMap)
Executes the command with the inputMap passed. |
Command |
getCommand()
This is the Command object the droplet tries to execute with the given input. |
protected java.util.Map |
getInputParameterMap(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Returs the input parameters configured for this droplet. |
java.util.Properties |
getInputParameters()
This property indicates the map property to pass as the input to the Command execution. |
protected java.util.Map |
getInputParameters(Command pCommand,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Returns the input parameters Map to pass to Command. |
protected java.lang.Object |
getParameterValue(java.lang.String pParameterName,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Returns the parameter value for the given parameter name. |
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Executes the Command with the given input parameters and renders the output paramter, setting result paramter
to the CommandResult from Command execution. |
void |
setCommand(Command pCommand)
Sets Command to Execute. |
void |
setInputParameters(java.util.Properties pInputParameters)
Sets input parameters |
Methods inherited from class atg.servlet.DynamoServlet |
---|
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter |
Methods inherited from class atg.nucleus.servlet.ServletService |
---|
destroy, getServletConfig, getServletInfo, init, setServletInfo |
Methods inherited from class atg.nucleus.TimedOperationService |
---|
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static final ParameterName INPUT_PARAMTER_NAMES
public static final ParameterName INPUT_PARAMETERS
public static final ParameterName COMMAND
public static final java.lang.String OUTPUT
public static final java.lang.String RESULT
public static final java.lang.String EXCEPTION
public static final java.lang.String ERROR
Constructor Detail |
---|
public MapRPCDroplet()
Method Detail |
---|
public Command getCommand()
command
. But it is
invalid to pass it using both ways.
public void setCommand(Command pCommand)
pCommand
- public java.util.Properties getInputParameters()
public void setInputParameters(java.util.Properties pInputParameters)
pInputParameters
- public void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
output
paramter, setting result
paramter
to the CommandResult from Command execution. If command execution throws
an exception it renders the error
parameter, setting the
exception
to the exception thrown.
service
in class DynamoServlet
pRequest
- pResponse
-
javax.servlet.ServletException
- if input paramters are configured invalidly like,
setting the inputParameters
and
inputParameterNames
from the page context.
java.io.IOException
- an error occurred reading data from the request
or writing data to the response.public CommandResult executeCommand(Command pCommand, java.util.Map pInputMap) throws CommandInvocationException, CommandTimeoutException
pCommand
- the command to executepInputMap
- the input map to pass to command.
CommandInvocationException
- if Command execution throws any
exception.
CommandTimeoutException
- if timeout occurs while invoking the command.
InvalidInputException
- if input object passed is invalid.protected java.util.Map getInputParameters(Command pCommand, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
- if validity checks fail for input paramters.
java.io.IOException
protected java.util.Map getInputParameterMap(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
ServletException
if any of them fail.
javax.servlet.ServletException
- if validity checks fail for input paramters.
java.io.IOException
protected java.lang.Object getParameterValue(java.lang.String pParameterName, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
inputParameters
map.
pParameterName
- the parameter name to fetch the value for.
javax.servlet.ServletException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |