Class AddConfigToCartController
- java.lang.Object
-
- de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
-
- de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController
-
- de.hybris.platform.sap.productconfig.frontend.controllers.AbstractProductConfigController
-
- de.hybris.platform.sap.productconfig.frontend.controllers.AddConfigToCartController
-
@Controller public class AddConfigToCartController extends AbstractProductConfigController
CPQ Controller for actions that interact with the Cart, such as add to cart or update cart action.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
AbstractController.HttpNotFoundException
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.sap.productconfig.frontend.controllers.AbstractProductConfigController
CMS_PAGE_TYPE, CMS_PC_PAGE_ID, CMS_PC_PAGE_TYPE
-
Fields inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController
CMS_PAGE_MODEL, CMS_PAGE_TITLE, PAGE_ROOT, REDIRECT_TO_LOGIN_FOR_CHECKOUT, REDIRECT_TO_MULTISTEP_CHECKOUT, REGISTRATION_CONSENT_ID, UTF_8
-
Fields inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
FORWARD_PREFIX, REDIRECT_PREFIX, ROOT
-
-
Constructor Summary
Constructors Constructor Description AddConfigToCartController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addConfigToCart(java.lang.String productCodeEncoded, @Valid ConfigurationData configData, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, javax.servlet.http.HttpServletRequest request)
Adds a configuration to the cart, so that a new cart item will be created.java.lang.String
resetConfiguration(java.lang.String productCodeEncoded)
Resets the existing configuration to its's default values and redirects to cartjava.lang.String
updateConfigInCart(@Valid ConfigurationData configData, org.springframework.validation.BindingResult bindingErrors, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, javax.servlet.http.HttpServletRequest request)
Updates a configuration within the cart.-
Methods inherited from class de.hybris.platform.sap.productconfig.frontend.controllers.AbstractProductConfigController
afterReloadConfiguration, cleanUpSessionAttribute, getAbstractOrderEntryLinkStrategy, getBindingResultForConfigAndSaveUiStatus, getBindingResultForConfiguration, getBreadcrumbBuilder, getCartEntryNumber, getCartEntryNumber, getCartFacade, getCartItemByConfigId, getCartItemByProductCode, getConfigCartFacade, getConfigFacade, getConfigurationErrorHandler, getGalleryImages, getOrderEntry, getOrderEntry, getPageId, getPageType, getProductCodeForCartItem, getProductConfigurationConflictChecker, getProductConfigurationValidator, getProductDataForProductCode, getProductFacade, getProductLinkStrategy, getProductService, getSessionAccessFacade, getUiRecorder, getUiStateHandler, getUiStatusForConfig, getUiStatusForConfigId, getUiStatusSync, handleRequestContext, initBinderConfigData, initializeUiStatus, isConfigLinkedToCart, isConfigRemoved, loadNewConfiguration, logConfigurationCheckDeviation, logLoadConfig, logModelmetaData, logRequestMetaData, populateCMSAttributes, populateProductData, populateProductData, populateProductDetailForDisplay, reloadConfigurationById, reloadConfigurationByKBKey, removeNullCstics, removeNullCsticsFromGroup, setAbstractOrderEntryLinkStrategy, setBreadcrumbBuilder, setCartEntryLinks, setCartFacade, setConfigCartFacade, setConfigFacade, setConfigurationErrorHandler, setProductConfigurationConflictChecker, setProductConfigurationValidator, setProductFacade, setProductLinkStrategy, setProductService, setSessionAccessFacade, setUiRecorder, setUiStateHandler, setUiStatusForConfig, setUiStatusSync, updatePageTitle
-
Methods inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController
addRegistrationConsentDataToModel, checkRequestUrl, createMetaElement, decodeWithScheme, getBaseSiteService, getCheckoutRedirectUrl, getCmsPageService, getCmsPreviewService, getCmsSiteService, getConfigurationService, getConsentFacade, getContentPageForLabelOrId, getCurrencies, getCurrentCurrency, getCurrentLanguage, getCustomerFacade, getHostConfigService, getI18nService, getLanguages, getMessageSource, getPageTitleResolver, getRequestContextData, getSessionService, getSiteConfigService, getSiteName, getSiteUid, getStoreSessionFacade, getUser, getUserFacade, getViewForPage, getViewForPage, prepareNotFoundPage, setUpMetaData, setUpMetaDataForContentPage, storeCmsPageInModel, storeContentPageTitleInModel, storeContinueUrl, urlEncode
-
Methods inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
addRequestToModel, getBean
-
-
-
-
Method Detail
-
updateConfigInCart
@RequestMapping(value="cart/{entryNumber}/configur*/addToCart", method=POST) public java.lang.String updateConfigInCart(@ModelAttribute("config") @Valid @Valid ConfigurationData configData, org.springframework.validation.BindingResult bindingErrors, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, javax.servlet.http.HttpServletRequest request)
Updates a configuration within the cart. In case the configuration contains any validation errors, the update cart action is canceled, and the user remains on the configuration page, so he can fix the validation errors.- Parameters:
configData
- runtime configurationbindingErrors
- error storemodel
- view modelredirectModel
- redirect attributesrequest
- http servlet request- Returns:
- redirect URL, either cart if all was OK or configuration page in case validation errors
-
addConfigToCart
@RequestMapping(value="/**/{productCode:.*}/configur*/addToCart", method=POST) public java.lang.String addConfigToCart(@PathVariable("productCode") java.lang.String productCodeEncoded, @ModelAttribute("config") @Valid @Valid ConfigurationData configData, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, javax.servlet.http.HttpServletRequest request)
Adds a configuration to the cart, so that a new cart item will be created. In case the configuration contains any validation errors, the add to cart action is canceled, and the user remains on the configuration page, so he can fix the validation errors.- Parameters:
productCodeEncoded
- code of the product the configuration belongs toconfigData
- runtime configurationbindingResult
- error storemodel
- view modelredirectAttributes
- redirect attributesrequest
- http servlet request- Returns:
- redirect URL, either cart if all was OK or configuration page in case validation errors
-
resetConfiguration
@RequestMapping(method=POST, value="/**/{productCode:.*}/reset") public java.lang.String resetConfiguration(@PathVariable("productCode") java.lang.String productCodeEncoded)
Resets the existing configuration to its's default values and redirects to cart- Parameters:
productCodeEncoded
- code of the product the configuration belongs to- Returns:
- redirect URL
-
-