Class TmaBaseController
java.lang.Object
de.hybris.platform.b2ctelcotmfwebservices.v3.controller.TmaBaseController
- Direct Known Subclasses:
TmaGeographicAddressApiController,TmaGeographicAddressValidationApiController,TmaProductApiController,TmaProductOfferingApiController,TmaProductOfferingPriceApiController,TmaProductOrderApiController,TmaProductSpecificationApiController,TmaRecommendationApiController
Abstract Base Controller defining common methods and fields to be used by other API controllers.
- Since:
- 2007
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringaddDefaultFields(String fields) Retrieves the attributes that the user wants to receive in responseprotected static Stringprotected Stringprotected org.springframework.security.core.AuthenticationRetrieves the authentication informationprotected de.hybris.platform.webservicescommons.mapping.DataMapperprotected com.fasterxml.jackson.databind.ObjectMapperprotected StringgetQueryStringWithoutOffsetAndLimit(javax.servlet.http.HttpServletRequest request) protected StringgetRequestUrl(javax.servlet.http.HttpServletRequest request) protected TmaCatalogVersionFacadeprotected org.springframework.http.ResponseEntitygetUnsuccessfulResponse(String errorMessage, Exception e, org.springframework.http.HttpStatus httpStatus) protected org.springframework.http.ResponseEntitygetUnsuccessfulResponse(String message, org.springframework.http.HttpStatus httpStatus) protected org.springframework.http.ResponseEntitygetUnsuccessfulResponseWithErrorRepresentation(String errorMessage, Exception e, int errorCode, String reason, org.springframework.http.HttpStatus httpStatus) protected StringRetrieves the current user which is represented by relatedPartyId, if is not empty, or the user for which the authentication token was obtainedprotected ErrorhandleInternalError(String message) protected org.springframework.http.ResponseEntity<Object>voidinit()protected Stringprotected StringsanitizeQueryString(String queryString) protected booleansetCatalogVersion(String baseSiteId, String catalogId, String catalogVersion)
-
Constructor Details
-
TmaBaseController
public TmaBaseController()
-
-
Method Details
-
init
@PostConstruct public void init() -
handleModelNotFoundException
-
getAuthentication
protected org.springframework.security.core.Authentication getAuthentication()Retrieves the authentication information- Returns:
- the authentication object for current spring context
-
getUser
protected String getUser(org.springframework.security.core.Authentication authentication, String relatedPartyId) Retrieves the current user which is represented by relatedPartyId, if is not empty, or the user for which the authentication token was obtained- Parameters:
authentication- the authentication objectrelatedPartyId- the related party id- Returns:
- the id of current user null, if no user can be obtained
-
getUnsuccessfulResponse
-
getUnsuccessfulResponse
protected org.springframework.http.ResponseEntity getUnsuccessfulResponse(String message, org.springframework.http.HttpStatus httpStatus) -
getUnsuccessfulResponseWithErrorRepresentation
-
handleInternalError
-
getRequestUrl
-
encodeUrl
-
getQueryStringWithoutOffsetAndLimit
-
handleTmaApiErrorInternal
-
sanitizeQueryString
-
filter
-
setCatalogVersion
-
addDefaultFields
Retrieves the attributes that the user wants to receive in response- Parameters:
fields- a string representing attributes we want to receive in response- Returns:
- a string consisting of default fields id,href and fields given by the user in request null, if user didn't provide any value for fields attribute
-
sanitize
-
getDataMapper
protected de.hybris.platform.webservicescommons.mapping.DataMapper getDataMapper() -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getTmaCatalogVersionFacade
-