Class BaseController
- java.lang.Object
-
- de.hybris.platform.ycommercewebservices.v2.controller.BaseController
-
- Direct Known Subclasses:
BaseCommerceController,BaseSitesController,BaseStoresController,CatalogsController,CustomerGroupsController,ExportController,FeedsController,ForgottenPasswordsController,MiscsController,PaymentModesController,ProductsController,PromotionsController,StoresController,VouchersController
@Controller public class BaseController extends java.lang.ObjectBase Controller. It defines the exception handler to be used by all controllers. Extending controllers can add or overwrite the exception handler if needed.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringBASIC_FIELD_SETprotected static java.lang.StringDEFAULT_CURRENT_PAGEprotected static java.lang.StringDEFAULT_FIELD_SETprotected static java.lang.StringDEFAULT_PAGE_SIZEprotected static java.lang.StringHEADER_TOTAL_COUNTprotected static java.lang.StringINVALID_REQUEST_BODY_ERROR_MESSAGE
-
Constructor Summary
Constructors Constructor Description BaseController()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringaddPaginationField(java.lang.String fields)Adds pagination field to the 'fields' parameterprotected DataMappergetDataMapper()ErrorListWsDTOhandleDuplicateUidException(DuplicateUidException ex)protected ErrorListWsDTOhandleErrorInternal(java.lang.String type, java.lang.String message)ErrorListWsDTOhandleHttpMessageNotReadableException(java.lang.Exception ex)ErrorListWsDTOhandleModelNotFoundException(java.lang.Exception ex)protected static java.lang.StringlogParam(java.lang.String paramName, java.lang.Long paramValue)protected static java.lang.StringlogParam(java.lang.String paramName, java.lang.String paramValue)protected static java.lang.StringlogValue(java.lang.String paramValue)protected static java.lang.Stringsanitize(java.lang.String input)protected voidsetDataMapper(DataMapper dataMapper)protected voidsetTotalCountHeader(javax.servlet.http.HttpServletResponse response, PaginationData paginationDto)protected voidsetTotalCountHeader(javax.servlet.http.HttpServletResponse response, PaginationWsDTO paginationDto)protected voidvalidate(java.lang.Object object, java.lang.String objectName, org.springframework.validation.Validator validator)
-
-
-
Field Detail
-
DEFAULT_PAGE_SIZE
protected static final java.lang.String DEFAULT_PAGE_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_CURRENT_PAGE
protected static final java.lang.String DEFAULT_CURRENT_PAGE
- See Also:
- Constant Field Values
-
BASIC_FIELD_SET
protected static final java.lang.String BASIC_FIELD_SET
- See Also:
- Constant Field Values
-
DEFAULT_FIELD_SET
protected static final java.lang.String DEFAULT_FIELD_SET
- See Also:
- Constant Field Values
-
HEADER_TOTAL_COUNT
protected static final java.lang.String HEADER_TOTAL_COUNT
- See Also:
- Constant Field Values
-
INVALID_REQUEST_BODY_ERROR_MESSAGE
protected static final java.lang.String INVALID_REQUEST_BODY_ERROR_MESSAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
logParam
protected static java.lang.String logParam(java.lang.String paramName, java.lang.Long paramValue)
-
logParam
protected static java.lang.String logParam(java.lang.String paramName, java.lang.String paramValue)
-
logValue
protected static java.lang.String logValue(java.lang.String paramValue)
-
sanitize
protected static java.lang.String sanitize(java.lang.String input)
-
handleModelNotFoundException
@ResponseStatus(BAD_REQUEST) @ResponseBody @ExceptionHandler(ModelNotFoundException.class) public ErrorListWsDTO handleModelNotFoundException(java.lang.Exception ex)
-
handleErrorInternal
protected ErrorListWsDTO handleErrorInternal(java.lang.String type, java.lang.String message)
-
validate
protected void validate(java.lang.Object object, java.lang.String objectName, org.springframework.validation.Validator validator)
-
addPaginationField
protected java.lang.String addPaginationField(java.lang.String fields)
Adds pagination field to the 'fields' parameter- Parameters:
fields-- Returns:
- fields with pagination
-
setTotalCountHeader
protected void setTotalCountHeader(javax.servlet.http.HttpServletResponse response, PaginationWsDTO paginationDto)
-
setTotalCountHeader
protected void setTotalCountHeader(javax.servlet.http.HttpServletResponse response, PaginationData paginationDto)
-
getDataMapper
protected DataMapper getDataMapper()
-
setDataMapper
protected void setDataMapper(DataMapper dataMapper)
-
handleDuplicateUidException
@ResponseStatus(BAD_REQUEST) @ResponseBody @ExceptionHandler(DuplicateUidException.class) public ErrorListWsDTO handleDuplicateUidException(DuplicateUidException ex)
-
handleHttpMessageNotReadableException
@ResponseStatus(BAD_REQUEST) @ResponseBody @ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class) public ErrorListWsDTO handleHttpMessageNotReadableException(java.lang.Exception ex)
-
-