public abstract class AbstractResourceHandler extends AbstractBaseResourceHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright notice field.
|
APPLICATION_ATOM_XML, APPLICATION_JSON, APPLICATION_XHTML_XML, APPLICATION_XML, CHANGE_VERB, PARAMETER_ACTION, PARAMETER_ACTION_DESCRIPTION, PARAMETER_CATALOG_ID, PARAMETER_CATALOG_ID_DESCRIPTION, PARAMETER_CURRENCY, PARAMETER_CURRENCY_DESCRIPTION, PARAMETER_FOR_USER, PARAMETER_FOR_USER_DESCRIPTION, PARAMETER_FOR_USER_ID, PARAMETER_FOR_USER_ID_DESCRIPTION, PARAMETER_LANG_ID, PARAMETER_LANG_ID_DESCRIPTION, PARAMETER_LOCALE, PARAMETER_LOCALE_DESCRIPTION, PARAMETER_MODE, PARAMETER_MODE_DESCRIPTION, PARAMETER_PAGE_NUMBER, PARAMETER_PAGE_NUMBER_DESCRIPTION, PARAMETER_PAGE_SIZE, PARAMETER_PAGE_SIZE_DESCRIPTION, PARAMETER_PROFILE_NAME, PARAMETER_PROFILE_NAME_DESCRIPTION, PARAMETER_QUERY, PARAMETER_QUERY_DESCRIPTION, PARAMETER_RESET_PASSWORD_DESCRIPTION, PARAMETER_RESPONSE_FORMAT, PARAMETER_RESPONSE_FORMAT_DESCRIPTION, PARAMETER_STORE_ID, PARAMETER_STORE_ID_DESCRIPTION, PARAMETER_WORKSPACE_IDENTIFIER, PARAMETER_WORKSPACE_IDENTIFIER_DESCRIPTION, PARAMETER_WORKSPACE_NAME, PARAMETER_WORKSPACE_NAME_DESCRIPTION, PARAMETER_WORKSPACE_TASK, PARAMETER_WORKSPACE_TASK_DESCRIPTION, PARAMETER_WORKSPACE_TASKGROUP, PARAMETER_WORKSPACE_TASKGROUP_DESCRIPTION, PROCESS_VERB, RESPONSE_200_DESCRIPTION, RESPONSE_201_DESCRIPTION, RESPONSE_204_DESCRIPTION, RESPONSE_400_DESCRIPTION, RESPONSE_401_DESCRIPTION, RESPONSE_403_DESCRIPTION, RESPONSE_404_DESCRIPTION, RESPONSE_500_DESCRIPTION
Constructor and Description |
---|
AbstractResourceHandler() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
createMapForProvider(commonj.sdo.DataObject dataArea,
java.lang.String resourceName,
java.lang.String urlParamGrpName)
This method will create a Map for entity providers using a DataObject.
|
java.util.Map<java.lang.String,java.lang.Object> |
createMapForProvider(commonj.sdo.DataObject dataArea,
java.lang.String resourceName,
java.lang.String urlParamGrpName,
boolean flattenNoun)
Deprecated.
Replaced by the method signature
createMapForProvider(DataObject, String, String)
which doesn't include the flattenNoun option. The option to
flatten the root noun is now stored in the BOD mapping
configuration file. |
javax.ws.rs.core.Response |
generateResponseForEntireDataObject(java.lang.String responseFormat,
commonj.sdo.DataObject dataArea)
Deprecated.
This method shouldn't be used.
|
java.util.Map<java.lang.String,java.lang.Object> |
getMapFromRequest(javax.servlet.http.HttpServletRequest request,
java.lang.String responseFormat)
This method gets Map from HttpServletRequest based on JSON or XML input
format.
|
java.lang.String |
getStoreId()
Extract the current store ID from the business context.
|
java.lang.Long |
getUserId()
Get the current request user ID
|
boolean |
isRequestInPreviewMode()
Test if the request is executed in preview mode.
|
java.util.Map<java.lang.String,java.lang.Object> |
mergeMapsForProvider(java.util.Map<java.lang.String,java.lang.Object> map1,
java.util.Map<java.lang.String,java.lang.Object> map2)
Merge map1 and map2 for providers.
|
javax.ws.rs.core.Response |
prepareAndValidate(java.lang.String storeId,
java.lang.String resourceName,
java.lang.String httpMethod,
javax.servlet.http.HttpServletRequest request,
java.lang.String responseFormat)
This method is reserved to do initialization as needed.
|
addError, createMapForProviderWithResultData, documentApi, generateResponseFromHttpStatusCodeAndRespData, getActionRegistry, getBooleanParameterValue, getClassDescription, getDoubleParameterValue, getDoubleParameterValues, getEnumeratedParameterValue, getErrorCodeFromMessage, getExternalResourceName, getFormattedMessage, getFormattedMessageWithLocale, getFormattingGroupName, getInstrumentor, getIntegerParameterValue, getIntegerParameterValues, getLongParameterValue, getLongParameterValues, getParameterValue, getParameterValue, getParameterValues, getQueryRegistry, getRequest, getResponse, getUriInfo, handleException, initializeActionRegistry, initializeQueryRegistry, performAction, postProcess, preProcess, registerOperationWithMethodSignature, runQuery, staticConvertStreamToString, throwInvalidQueryNameException, throwInvalidQueryNameException, throwRestException, throwRestExceptionIfErrorsAreDetected, validatePageNumberPageSize
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResourceName
public static final java.lang.String COPYRIGHT
public java.util.Map<java.lang.String,java.lang.Object> getMapFromRequest(javax.servlet.http.HttpServletRequest request, java.lang.String responseFormat) throws java.lang.Exception
request
- the requestresponseFormat
- the response formatjava.lang.Exception
- the exceptionpublic javax.ws.rs.core.Response prepareAndValidate(java.lang.String storeId, java.lang.String resourceName, java.lang.String httpMethod, javax.servlet.http.HttpServletRequest request, java.lang.String responseFormat)
storeId
- the store idresourceName
- the resource namehttpMethod
- the http methodrequest
- the requestresponseFormat
- the response format shortcut. Response format is used to
resolve the media type for the REST response. If response
format is not provided, then Accept
header is
used to resolve the media type for the REST response. Refer to
MediaTypeHelper.getResponseMediaType(String, Request)
for more details on the response media type resolution.@Deprecated public javax.ws.rs.core.Response generateResponseForEntireDataObject(java.lang.String responseFormat, commonj.sdo.DataObject dataArea)
responseFormat
- the response format shortcut.dataArea
- the data area@Deprecated public java.util.Map<java.lang.String,java.lang.Object> createMapForProvider(commonj.sdo.DataObject dataArea, java.lang.String resourceName, java.lang.String urlParamGrpName, boolean flattenNoun)
createMapForProvider(DataObject, String, String)
which doesn't include the flattenNoun option. The option to
flatten the root noun is now stored in the BOD mapping
configuration file.dataArea
- DataObject returned from OAGIS serviceresourceName
- resource nameurlParamGrpName
- URLParmeterGroup name in BOD mapping fileflattenNoun
- True indicates that if there is a list with only one noun then
the data in the noun will be put as top-level elements (the
list level will be removed). False indicates that a single
noun in a list will remain that way. Use false for URIs that
are specified with a unique ID.public java.util.Map<java.lang.String,java.lang.Object> createMapForProvider(commonj.sdo.DataObject dataArea, java.lang.String resourceName, java.lang.String urlParamGrpName)
dataArea
- DataObject returned from OAGIS serviceresourceName
- resource nameurlParamGrpName
- URLParmeterGroup name in BOD mapping filepublic java.util.Map<java.lang.String,java.lang.Object> mergeMapsForProvider(java.util.Map<java.lang.String,java.lang.Object> map1, java.util.Map<java.lang.String,java.lang.Object> map2)
map1
- first mapmap2
- second mappublic boolean isRequestInPreviewMode()
isRequestInPreviewMode
in class AbstractBaseResourceHandler
public java.lang.Long getUserId()
public java.lang.String getStoreId()