public abstract class MarkerDroplet extends DynamoServlet implements MarkerConstants
It provides the base input, output and oparam parameter names, as well as convenience methods for extracting the parameter and configurable property values.
The service method calls the abstract doService method which extensions must implement. doService is called within a transaction demarcation of the current transaction if there's one in place. Otherwise one is created.
This class defines a choice of several oparams to render upon successful completion of the marker operation in doService. The implemention of the doService should return the oparam name to render on success.
This class also defines several output params that can be provided on successful completion of the marker operation. The implementation of doService should set the appropriate output param values before returning.
Implementations of doService should throw exceptions when errors occurs. The service method of this class with catch those exceptions, set the error message output parameter to the text of the exception, and render the error oparam.
For marker droplets that do property comparisons to find matching markers,
such as hasMarker or removeMarkers, a special token string can be used to indicate that a
marker property can be any value. The token string is defined by the ANY_VALUE
property. If this token string is provided as the
comparison value, then the marker's value is not is included when finding matching
markers.
For example,
param name="value" value="bean:HasMarker.ANY_VALUE"
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static ParameterName |
DATA_PARAM
the input parameter name for the data parameter
|
static ParameterName |
DUPLICATION_MODE_PARAM
the input parameter name for the duplicationMode parameter
|
static java.lang.String |
EMPTY_OPARAM
the name for the empty output parameter.
|
static java.lang.String |
ERROR_MSG_PARAM
the name for the errorMsg output parameter.
|
static java.lang.String |
ERROR_OPARAM
the name for the error output parameter.
|
static java.lang.String |
FALSE_OPARAM
the name for the false output parameter.
|
static ParameterName |
ITEM_ID_PARAM
the input parameter name for the itemId parameter
|
static ParameterName |
ITEM_PARAM
the input parameter name for the item parameter
|
static ParameterName |
KEY_PARAM
the input parameter name for the key parameter
|
static ParameterName |
MARKED_ITEM_TYPE_PARAM
the input parameter name for the markedItemType parameter
|
static java.lang.String |
MARKER_COUNT
the name for the markerCount output parameter.
|
static java.lang.String |
MARKER_ELEMENT
the name for the marker output parameter.
|
static ParameterName |
MARKER_EXTPROPS_PARAM
the input parameter name for the extendedProperties parameter
|
static ParameterName |
MARKER_ITEM_TYPE_PARAM
the input parameter name for the markerItemType parameter
|
static ParameterName |
MARKER_MANAGER_PARAM
the input parameter name for the markerManager parameter
|
static ParameterName |
MARKER_PROPERTY_NAME_PARAM
the input parameter name for the markerPropertyName parameter
|
static java.lang.String |
MARKERS_ELEMENT
the name for the markers output parameter.
|
protected RepositoryMarkerManager |
mRepositoryMarkerManager |
protected javax.transaction.TransactionManager |
mTransactionManager |
static java.lang.String |
OUTPUT_OPARAM
the name for the output output parameter.
|
static java.lang.String |
TRUE_OPARAM
the name for the true output parameter.
|
static ParameterName |
VALUE_PARAM
the input parameter name for the value parameter
|
mAllowCleanupRequest, mParameters
SERVLET_INFO_KEY
SERVICE_INFO_KEY
ALLOW_DUPLICATES, ANY_VALUE, DEFAULT_MARKER_ID_PROPERTY_NAME, DEFAULT_MARKER_ITEM_TYPE, DEFAULT_MARKER_PROPERTY_NAME, DEFAULT_MARKER_SORT_PROPERTY_NAME, MARKER_CREATIONDATE_PROPERTY_NAME, MARKER_DATA_PROPERTY_NAME, MARKER_DUPLICATIONMODE_PROPERTY_NAME, MARKER_KEY_PROPERTY_NAME, MARKER_OWNER_PROPERTY_NAME, MARKER_RESOURCE_NAME, MARKER_VALUE_PROPERTY_NAME, NO_DUPLICATES, PARAM_DATA, PARAM_DUPMODE, PARAM_EXTENDED_PROPERTIES, PARAM_ITEM, PARAM_ITEM_ID, PARAM_KEY, PARAM_MARKED_ITEM_TYPE, PARAM_MARKER_ITEM_TYPE, PARAM_MARKER_MANAGER, PARAM_MARKER_PROPERTY_NAME, PARAM_VALUE, REPLACE_DUPLICATES, sResourceBundle
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
MarkerDroplet() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
doService(DynamoHttpServletRequest req,
DynamoHttpServletResponse res)
This method is called by the service method to perform
the droplet's processing.
|
java.lang.String |
getANY_VALUE()
Returns the token string that indicates a property value can be anything.
|
protected java.lang.String |
getData(DynamoHttpServletRequest req)
Returns the data parameter value from the request
|
java.lang.String |
getDefaultDuplicationMode()
Returns the default duplication mode
|
java.lang.String |
getDefaultMarkedItemType()
Returns the default marked item type used when referencing a marked
item by id
|
java.lang.String |
getDefaultMarkerItemType()
Returns the default marker item type used when creating new markers
|
java.lang.String |
getDefaultMarkerPropertyName()
Returns the default property name for storing markers on an item
|
protected java.lang.String |
getDuplicationMode(DynamoHttpServletRequest req)
Returns either the duplicationMode parameter value or the defaultDuplicationMode
|
java.util.Map |
getExtendedProperties(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method can be extended to provide the extended property map.
|
protected RepositoryItem |
getItem(DynamoHttpServletRequest req)
Returns the item param from the request.
|
protected java.lang.String |
getItemId(DynamoHttpServletRequest req)
Returns the item id param from the request
|
protected java.lang.String |
getKey(DynamoHttpServletRequest req)
Returns the key parameter value from the request
|
protected java.lang.String |
getMarkedItemType(DynamoHttpServletRequest req)
Returns either the markedItemType parameter value or the defaultMarkedItemType
|
protected java.lang.String |
getMarkerItemType(DynamoHttpServletRequest req)
Returns either the markerItemType parameter value or the defaultMarkerItemType
|
protected RepositoryMarkerManager |
getMarkerManager(DynamoHttpServletRequest req)
Returns either the markerManager param value or the configured
RepositoryMarkerManager.
|
protected java.lang.String |
getMarkerPropertyName(DynamoHttpServletRequest req)
Returns either the markerPropertyName parameter value or the defaultMarkerPropertyName
|
RepositoryMarkerManager |
getRepositoryMarkerManager()
Returns the marker manager used by the droplet
|
javax.transaction.TransactionManager |
getTransactionManager()
Returns the transaction manager used by the droplet
|
protected java.lang.String |
getValue(DynamoHttpServletRequest req)
Returns the value parameter value from the request
|
void |
service(DynamoHttpServletRequest req,
DynamoHttpServletResponse res)
This method first calls the validateInput method, followed by
the doService method.
|
void |
setDefaultDuplicationMode(java.lang.String pDefaultDuplicationMode)
Sets the default duplication mode.
|
void |
setDefaultMarkedItemType(java.lang.String pDefaultMarkedItemType)
Sets the default marked item type used when referencing a marked
item by id
|
void |
setDefaultMarkerItemType(java.lang.String pDefaultMarkerItemType)
Sets the default marker item type used when creating new markers
|
void |
setDefaultMarkerPropertyName(java.lang.String pDefaultMarkerPropertyName)
Sets the default property name for storing markers on an item
|
void |
setRepositoryMarkerManager(RepositoryMarkerManager pRepositoryMarkerManager)
Sets the marker manager used by the droplet
|
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets the transaction manager used by the droplet
|
protected void |
validateInput(DynamoHttpServletRequest req,
DynamoHttpServletResponse res)
Validates the input parameters.
- verifies that there's an item or itemid. - verifies that there's a repository marker manager. |
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
destroy, getServletConfig, getServletInfo, setServletInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final ParameterName ITEM_PARAM
public static final ParameterName ITEM_ID_PARAM
public static final ParameterName DUPLICATION_MODE_PARAM
public static final ParameterName KEY_PARAM
public static final ParameterName VALUE_PARAM
public static final ParameterName DATA_PARAM
public static final ParameterName MARKER_PROPERTY_NAME_PARAM
public static final ParameterName MARKER_ITEM_TYPE_PARAM
public static final ParameterName MARKED_ITEM_TYPE_PARAM
public static final ParameterName MARKER_MANAGER_PARAM
public static final ParameterName MARKER_EXTPROPS_PARAM
public static final java.lang.String ERROR_MSG_PARAM
public static final java.lang.String MARKER_COUNT
public static final java.lang.String MARKER_ELEMENT
public static final java.lang.String MARKERS_ELEMENT
public static final java.lang.String ERROR_OPARAM
public static final java.lang.String OUTPUT_OPARAM
public static final java.lang.String TRUE_OPARAM
public static final java.lang.String FALSE_OPARAM
public static final java.lang.String EMPTY_OPARAM
protected RepositoryMarkerManager mRepositoryMarkerManager
protected javax.transaction.TransactionManager mTransactionManager
public void setRepositoryMarkerManager(RepositoryMarkerManager pRepositoryMarkerManager)
public RepositoryMarkerManager getRepositoryMarkerManager()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public java.util.Map getExtendedProperties(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
protected RepositoryItem getItem(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected java.lang.String getItemId(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected RepositoryMarkerManager getMarkerManager(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected java.lang.String getKey(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected java.lang.String getValue(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected java.lang.String getData(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected java.lang.String getMarkedItemType(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected java.lang.String getMarkerItemType(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected java.lang.String getMarkerPropertyName(DynamoHttpServletRequest req) throws MarkerException
MarkerException
protected java.lang.String getDuplicationMode(DynamoHttpServletRequest req) throws MarkerException
MarkerException
public java.lang.String getANY_VALUE()
For example,
public void setDefaultMarkerPropertyName(java.lang.String pDefaultMarkerPropertyName)
public java.lang.String getDefaultMarkerPropertyName()
public void setDefaultMarkerItemType(java.lang.String pDefaultMarkerItemType)
public java.lang.String getDefaultMarkerItemType()
public void setDefaultMarkedItemType(java.lang.String pDefaultMarkedItemType)
public java.lang.String getDefaultMarkedItemType()
public void setDefaultDuplicationMode(java.lang.String pDefaultDuplicationMode)
public java.lang.String getDefaultDuplicationMode()
protected void validateInput(DynamoHttpServletRequest req, DynamoHttpServletResponse res) throws MarkerException
on
- validation errorMarkerException
public abstract java.lang.String doService(DynamoHttpServletRequest req, DynamoHttpServletResponse res) throws MarkerException, javax.servlet.ServletException, java.io.IOException
MarkerExeceptions should be thrown for errors in processing, which will cause the errorMsg parameter to be set with the exception text, and the error oparam to be rendered.
Implementations should set the necessary output parameters for rendering after successful processing, and return the name of the oparam name to render on success.
MarkerException
javax.servlet.ServletException
java.io.IOException
OUTPUT_OPARAM
,
TRUE_OPARAM
,
FALSE_OPARAM
,
EMPTY_OPARAM
public void service(DynamoHttpServletRequest req, DynamoHttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException
The error output param is rendered for any Exceptions thrown by validateInput or doService.
If an error occurs, this method will set the error message output parameter based on the the exception's text, and render the error oparam.
If doService completes successfully the oparam name returned by that method is rendered.
This class statically defines the oparam names for successful completion.
service
in class DynamoServlet
req
- the request to be processedres
- the response object for this requestjavax.servlet.ServletException
- an application specific error occurred
processing this requestjava.io.IOException
- an error occurred reading data from the request
or writing data to the response.validateInput(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)
,
doService(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)
,
ERROR_MSG_PARAM
,
ERROR_OPARAM