Class UpdateConfigureProductController
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.UpdateConfigureProductController
@Controller
@RequestMapping
public class UpdateConfigureProductController
extends AbstractProductConfigController
Controller for updating the dynamic product configuration content page.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
AbstractController.HttpNotFoundException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class de.hybris.platform.sap.productconfig.frontend.controllers.AbstractProductConfigController
CMS_PAGE_TYPE, CMS_PC_PAGE_ID, CMS_PC_PAGE_TYPEFields 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_8Fields inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
FORWARD_PREFIX, REDIRECT_PREFIX, ROOT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterUpdate(UpdateDataHolder updateData, org.springframework.ui.Model model) protected voidbeforeUpdate(UpdateDataHolder updateData) protected voidcheckAutoExpandMode(CPQActionType action, UpdateDataHolder updateData) protected voidcheckAutoExpandModeOnValueChange(ConfigurationData configData, String firstErrorCsticId) protected voidexecuteUpdate(UpdateDataHolder updateData) protected intfindCurrentGroupIndex(String currentGroupId, List<UiGroupData> csticGroupsFlat) protected UiGroupDatafindFirstConflictGroupForCsticId(List<UiGroupData> uiGroups, String csticId) protected UiGroupDatafindFirstGroupForCsticId(List<UiGroupData> uiGroups, String csticId) protected StringgetCsticKeyForFocusIdPath(ConfigurationData configData) protected StringgetGroupIdForPrevNextButtonClick(CPQActionType prevNextButtonClicked, String currentGroupId, List<UiGroupData> csticGroupsFlat, int currentGroupIndex) protected StringgetNextGroupId(String currentGroupId, List<UiGroupData> csticGroupsFlat, int currentGroupPosition) protected StringgetPreviousGroupId(String currentGroupId, List<UiGroupData> csticGroupsFlat, int currentGroupPosition) protected voidhandleAutoExpand(UpdateDataHolder updateData, ConfigurationData configData) protected voidhandleAutoExpandAndSyncUIStatus(UpdateDataHolder updateData, ConfigurationData configData) protected voidhandleCPQAction(UpdateDataHolder updateData) protected voidhandleCPQActionBeforeUpdate(UpdateDataHolder updateData) protected voidhandleGroupIdToDisplayForNavigationLinks(CPQActionType action, UpdateDataHolder updateData) protected voidhandleGroupIdToDisplayWhenSolvingConflicts(CPQActionType action, UpdateDataHolder updateData) protected voidhandleShowExtendedMessageFlag(CPQActionType action, UpdateDataHolder updateData) protected voidhandleShowFullLongTextFlag(CPQActionType action, UpdateDataHolder updateData) This method handles the show long text flag consistently for all occurrences of a cstic.
The same cstic can appear in several groups (e.g.protected voidhandleToggleImageGallery(CPQActionType action, UpdateDataHolder updateData) protected voididentifyPrevNextGroup(CPQActionType action, UpdateDataHolder updateData) Checks if previous or next button has been clicked and tries to identify the previous or next group respectively.protected UpdateDataHolderinitUpdateData(ConfigurationData configData, org.springframework.validation.BindingResult bindingResult, javax.servlet.http.HttpServletRequest request) protected booleanisCsticPartOfGroup(UiGroupData uiGroup, String csticId) protected booleanisFirstErrorCurrentFocusCstic(String firstErrorCsticId, String focusId) protected booleanisFocusIdSet(String focusId) protected booleanisOutdatedValidationError(Map.Entry<String, org.springframework.validation.FieldError> entry, List<String> csticsDisplayed) removeOutdatedValidationErrors(UpdateDataHolder updateData) protected org.springframework.web.servlet.ModelAndViewrender(org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, UpdateDataHolder updateData) protected voidresetCPQActionType(ConfigurationData configData) protected voidupdateConfiguration(UpdateDataHolder updateData, org.springframework.ui.Model model) org.springframework.web.servlet.ModelAndViewupdateConfigureProduct(@Valid ConfigurationData configData, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request) Updates a configuration based on the user inputs and renders back the changes.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, getSessionId, 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, updatePageTitleMethods 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, urlEncodeMethods inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
addRequestToModel, getBean
-
Field Details
-
EXPECTED_NUMBER_OF_MESSAGE_ELEMENTS
public static final int EXPECTED_NUMBER_OF_MESSAGE_ELEMENTS- See Also:
-
CSTIC_ID_BEGIN_INDEX
public static final int CSTIC_ID_BEGIN_INDEX- See Also:
-
MESSAGE_KEY_ELEMENT_INDEX
public static final int MESSAGE_KEY_ELEMENT_INDEX- See Also:
-
-
Constructor Details
-
UpdateConfigureProductController
public UpdateConfigureProductController()
-
-
Method Details
-
updateConfigureProduct
@RequestMapping(value="/cpq/config", method=POST) @ResponseBody public org.springframework.web.servlet.ModelAndView updateConfigureProduct(@ModelAttribute("config") @Valid @Valid ConfigurationData configData, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request) throws BusinessException Updates a configuration based on the user inputs and renders back the changes.- Parameters:
configData- current configurationbindingResult- error message storemodel- view modelrequest- HTTP-Request- Returns:
- view name
- Throws:
BusinessException
-
render
protected org.springframework.web.servlet.ModelAndView render(org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, UpdateDataHolder updateData) throws CMSItemNotFoundException - Throws:
CMSItemNotFoundException
-
updateConfiguration
-
afterUpdate
-
handleCPQAction
-
handleShowExtendedMessageFlag
-
handleCPQActionBeforeUpdate
-
checkAutoExpandMode
-
checkAutoExpandModeOnValueChange
protected void checkAutoExpandModeOnValueChange(ConfigurationData configData, String firstErrorCsticId) -
isFirstErrorCurrentFocusCstic
-
getCsticKeyForFocusIdPath
-
handleToggleImageGallery
-
handleGroupIdToDisplayWhenSolvingConflicts
protected void handleGroupIdToDisplayWhenSolvingConflicts(CPQActionType action, UpdateDataHolder updateData) -
handleShowFullLongTextFlag
This method handles the show long text flag consistently for all occurrences of a cstic.
The same cstic can appear in several groups (e.g. in conflict groups and in normal cstic groups). The user clicks "show long text" for one occurence of a cstic. This should trigger the display/hide of the long text for all occurences of this cstic not only for the one where it was clicked.
Therefore the value of the show long text flag has to be propagated to all occurences of the same cstic in all groups.- Parameters:
updateData-action-
-
resetCPQActionType
-
identifyPrevNextGroup
Checks if previous or next button has been clicked and tries to identify the previous or next group respectively.
The identified groupId is changed in UIStatus so that this group will be displayed next.
The groupId is not changed if the previous button has been clicked on first group or if the next button has been clicked on the last group.- Parameters:
action-updateData-
-
getGroupIdForPrevNextButtonClick
protected String getGroupIdForPrevNextButtonClick(CPQActionType prevNextButtonClicked, String currentGroupId, List<UiGroupData> csticGroupsFlat, int currentGroupIndex) -
findCurrentGroupIndex
-
getNextGroupId
protected String getNextGroupId(String currentGroupId, List<UiGroupData> csticGroupsFlat, int currentGroupPosition) -
getPreviousGroupId
protected String getPreviousGroupId(String currentGroupId, List<UiGroupData> csticGroupsFlat, int currentGroupPosition) -
handleAutoExpand
-
findFirstConflictGroupForCsticId
-
isFocusIdSet
-
handleAutoExpandAndSyncUIStatus
protected void handleAutoExpandAndSyncUIStatus(UpdateDataHolder updateData, ConfigurationData configData) -
executeUpdate
-
beforeUpdate
-
initUpdateData
protected UpdateDataHolder initUpdateData(ConfigurationData configData, org.springframework.validation.BindingResult bindingResult, javax.servlet.http.HttpServletRequest request) -
removeOutdatedValidationErrors
protected Map<String,org.springframework.validation.FieldError> removeOutdatedValidationErrors(UpdateDataHolder updateData) -
getCsticKeysForExpandedSingleLevelGroups
-
isOutdatedValidationError
-
findFirstGroupForCsticId
-
isCsticPartOfGroup
-