Class AbstractPageRedirectSupplier
java.lang.Object
de.hybris.platform.cmsocc.redirect.suppliers.impl.AbstractPageRedirectSupplier
- All Implemented Interfaces:
PageRedirectSupplier
- Direct Known Subclasses:
CategoryPageRedirectSupplier,ContentPageRedirectSupplier,EmailPageRedirectSupplier,ProductPageRedirectSupplier
Abstract implementation of
PageRedirectSupplier providing common functionalities for other supplier
implementations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RequestParamDatabuildRequestParamData(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData) Creates aRequestParamDataobject to store query and path parameters information which are used to build the redirect URL.Predicate to test if a given page model matches the page type supplier.protected abstract StringgetPreviewCode(PreviewDataModel previewData) Retrieves the category or product code from preview data.getRedirectUrl(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData) Constructs the redirect url given the http servlet request and the preview data.protected abstract voidpopulateParams(PreviewDataModel previewData, RequestParamData paramData) Populates the request parameters to make the request to redirect.voidsetPagePredicate(Predicate<ItemModel> pagePredicate) voidsetTypeCodePredicate(Predicate<String> typeCodePredicate) protected booleanshouldNotRedirect(javax.servlet.http.HttpServletRequest request) booleanshouldRedirect(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData) Determines whether to redirect the request depending upon the logic in supplier.
-
Constructor Details
-
AbstractPageRedirectSupplier
public AbstractPageRedirectSupplier()
-
-
Method Details
-
populateParams
Populates the request parameters to make the request to redirect.- Parameters:
previewData- - the preview dataparamData- - the request path and query parameters
-
getPreviewCode
Retrieves the category or product code from preview data.- Parameters:
previewData- - the preview data- Returns:
- the category code; can be
NULL
-
getConstrainedBy
Description copied from interface:PageRedirectSupplierPredicate to test if a given page model matches the page type supplier.- Specified by:
getConstrainedByin interfacePageRedirectSupplier- Returns:
trueif the supplier exists;falseotherwise.
-
shouldNotRedirect
protected boolean shouldNotRedirect(javax.servlet.http.HttpServletRequest request) -
shouldRedirect
public boolean shouldRedirect(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData) Description copied from interface:PageRedirectSupplierDetermines whether to redirect the request depending upon the logic in supplier.- Specified by:
shouldRedirectin interfacePageRedirectSupplier- Parameters:
request- - the http requestpreviewData- - the preview data- Returns:
trueif it needs to redirect the request;falseotherwise.
-
buildRequestParamData
protected RequestParamData buildRequestParamData(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData) Creates aRequestParamDataobject to store query and path parameters information which are used to build the redirect URL.- Parameters:
request- - the http requestpreviewData- - the preview data- Returns:
- a
RequestParamDataobject
-
getRedirectUrl
public String getRedirectUrl(javax.servlet.http.HttpServletRequest request, PreviewDataModel previewData) Description copied from interface:PageRedirectSupplierConstructs the redirect url given the http servlet request and the preview data.- Specified by:
getRedirectUrlin interfacePageRedirectSupplier- Parameters:
request- - the http servlet requestpreviewData- - the preview data- Returns:
- the redirect url
-
getPagePredicate
-
setPagePredicate
-
getTypeCodePredicate
-
setTypeCodePredicate
-