Class QuoteController
- java.lang.Object
-
- de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
-
- de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController
-
- de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractCartPageController
-
- de.hybris.platform.yacceleratorstorefront.controllers.pages.QuoteController
-
@Controller @RequestMapping("/quote") public class QuoteController extends AbstractCartPageControllerController for Quotes
-
-
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.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 QuoteController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<java.lang.String>addQuoteComment(java.lang.String comment, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Add a quote comment to a given quote.org.springframework.http.ResponseEntity<java.lang.String>addQuoteEntryComment(long entryNumber, java.lang.String comment, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)java.lang.StringapplyDiscountAction(java.lang.String quoteCode, @Valid QuoteDiscountForm form, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Adds discount to an existing quote.java.lang.StringapproveQuote(java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Approve a quote from the sales representativejava.lang.StringcancelQuote(java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)java.lang.StringcreateQuote(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Creates a new quote based on session cart.protected voidfillQuoteForm(org.springframework.ui.Model model, AbstractOrderData data)protected voidfillVouchers(org.springframework.ui.Model model)protected java.util.DategetExpirationDateFromString(java.lang.String expirationTime)protected java.lang.StringgetFormattedPriceValue(double value)Get formatted monetary value with currency symbolprotected QuoteFacadegetQuoteFacade()protected ResourceBreadcrumbBuildergetResourceBreadcrumbBuilder()protected VoucherFacadegetVoucherFacade()protected java.util.Optional<java.lang.String>handleEditModeSubmitQuote(java.lang.String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)java.lang.StringhandleIllegalQuoteStateException(IllegalQuoteStateException exception, javax.servlet.http.HttpServletRequest request)protected voidloadCommentsShown(org.springframework.ui.Model model)java.lang.StringnewCart(java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)java.lang.StringplaceOrder(java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Place an order for the given quote.protected voidprepareQuotePageElements(org.springframework.ui.Model model, CartData cartData, boolean updatable)java.lang.StringrejectQuote(java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Reject a quote from the sales representativeprotected voidremoveCoupons(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Removes all coupons from the client cart.java.lang.Stringrequote(java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)protected voidsetAllowedActions(org.springframework.ui.Model model, java.lang.String quoteCode)Set allowed actions for a given quote on model.protected voidsetExpirationTimeAttributes(org.springframework.ui.Model model)org.springframework.http.ResponseEntity<java.lang.String>setQuoteExpiration(java.lang.String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult)org.springframework.http.ResponseEntity<java.lang.String>setQuoteMetadata(java.lang.String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult)Update quote name and descriptionprotected voidsetUpdatable(org.springframework.ui.Model model, CartData cartData, boolean updatable)java.lang.StringshowQuoteEdit(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, java.lang.String quoteCode)Loads quote edit page.protected voidsortComments(CartData cartData)java.lang.StringsubmitQuote(java.lang.String quoteCode, boolean editMode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Submit quote to next responsible in the workflow (e.g.-
Methods inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractCartPageController
clearSessionRestorationData, continueUrl, createProductEntryList, createProductList, getCartFacade, getCheckoutFacade, getSessionService, getSiteConfigService, prepareDataForPage, setupCartPageRestorationData, validateCart
-
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, 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
-
createQuote
@RequestMapping(value="/create", method=GET) public java.lang.String createQuote(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Creates a new quote based on session cart.- Parameters:
redirectModel-- Returns:
- Mapping to quote page.
-
removeCoupons
protected void removeCoupons(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
Removes all coupons from the client cart. To be updated in a future release.- Parameters:
redirectModel-
-
applyDiscountAction
@RequestMapping(value="{quoteCode}/discount/apply", method=POST) public java.lang.String applyDiscountAction(@PathVariable("quoteCode") java.lang.String quoteCode, @Valid @Valid QuoteDiscountForm form, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Adds discount to an existing quote.- Parameters:
quoteCode- Quote to have discounts applied.form- Discount info.redirectModel-- Returns:
- Mapping redirect to quote page.
-
showQuoteEdit
@RequestMapping(value="/{quoteCode}/edit", method=GET) public java.lang.String showQuoteEdit(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, @PathVariable("quoteCode") java.lang.String quoteCode) throws CMSItemNotFoundExceptionLoads quote edit page.- Parameters:
model-redirectModel-quoteCode-- Returns:
- Mapping to edit page.
- Throws:
CMSItemNotFoundException
-
fillQuoteForm
protected void fillQuoteForm(org.springframework.ui.Model model, AbstractOrderData data)
-
fillVouchers
protected void fillVouchers(org.springframework.ui.Model model)
-
setUpdatable
protected void setUpdatable(org.springframework.ui.Model model, CartData cartData, boolean updatable)
-
setExpirationTimeAttributes
protected void setExpirationTimeAttributes(org.springframework.ui.Model model)
-
prepareQuotePageElements
protected void prepareQuotePageElements(org.springframework.ui.Model model, CartData cartData, boolean updatable)
-
cancelQuote
@RequestMapping(value="/{quoteCode}/cancel", method=POST) public java.lang.String cancelQuote(@PathVariable("quoteCode") java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
-
submitQuote
@RequestMapping(value="/{quoteCode}/submit", method=POST) public java.lang.String submitQuote(@PathVariable("quoteCode") java.lang.String quoteCode, @RequestParam(value="editMode",defaultValue="false") boolean editMode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Submit quote to next responsible in the workflow (e.g. from buyer to seller, from sales representative to sales approver).- Parameters:
quoteCode-redirectModel-- Returns:
- Mapping of redirect to the quote details page.
-
approveQuote
@RequestMapping(value="/{quoteCode}/approve", method=POST) public java.lang.String approveQuote(@PathVariable("quoteCode") java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Approve a quote from the sales representative- Parameters:
quoteCode-redirectModel-- Returns:
- Mapping of redirect to the quote details page.
-
rejectQuote
@RequestMapping(value="/{quoteCode}/reject", method=POST) public java.lang.String rejectQuote(@PathVariable("quoteCode") java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Reject a quote from the sales representative- Parameters:
quoteCode-redirectModel-- Returns:
- Mapping of redirect to the quote details page.
-
requote
@RequestMapping(value="/{quoteCode}/requote", method=POST) public java.lang.String requote(@PathVariable("quoteCode") java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
-
handleEditModeSubmitQuote
protected java.util.Optional<java.lang.String> handleEditModeSubmitQuote(java.lang.String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
-
newCart
@RequestMapping(value="/{quoteCode}/newcart", method=GET) public java.lang.String newCart(@PathVariable("quoteCode") java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
placeOrder
@RequestMapping(value="/{quoteCode}/checkout", method=POST) public java.lang.String placeOrder(@PathVariable("quoteCode") java.lang.String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Place an order for the given quote.- Parameters:
quoteCode-redirectModel-- Returns:
- Mapping of redirect to the checkout page.
-
setQuoteExpiration
@ResponseBody @RequestMapping(value="/{quoteCode}/expiration", method=POST) public org.springframework.http.ResponseEntity<java.lang.String> setQuoteExpiration(@PathVariable("quoteCode") java.lang.String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult)
-
setQuoteMetadata
@ResponseBody @RequestMapping(value="/{quoteCode}/metadata", method=POST) public org.springframework.http.ResponseEntity<java.lang.String> setQuoteMetadata(@PathVariable("quoteCode") java.lang.String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult)Update quote name and description- Parameters:
quoteCode-quoteForm-bindingResult-- Returns:
- response entity
-
getExpirationDateFromString
protected java.util.Date getExpirationDateFromString(java.lang.String expirationTime)
-
addQuoteComment
@RequestMapping(value="/comment", method=POST) public org.springframework.http.ResponseEntity<java.lang.String> addQuoteComment(@RequestParam("comment") java.lang.String comment, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)Add a quote comment to a given quote.- Parameters:
comment-redirectModel-- Returns:
- Mapping of redirect to the quote details page.
-
addQuoteEntryComment
@RequestMapping(value="/entry/comment", method=POST) public org.springframework.http.ResponseEntity<java.lang.String> addQuoteEntryComment(@RequestParam("entryNumber") long entryNumber, @RequestParam("comment") java.lang.String comment, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
-
sortComments
protected void sortComments(CartData cartData)
-
loadCommentsShown
protected void loadCommentsShown(org.springframework.ui.Model model)
-
setAllowedActions
protected void setAllowedActions(org.springframework.ui.Model model, java.lang.String quoteCode)Set allowed actions for a given quote on model.- Parameters:
model- the MVC modelquoteCode- the quote to be checked.
-
handleIllegalQuoteStateException
@ExceptionHandler(IllegalQuoteStateException.class) public java.lang.String handleIllegalQuoteStateException(IllegalQuoteStateException exception, javax.servlet.http.HttpServletRequest request)
-
getFormattedPriceValue
protected java.lang.String getFormattedPriceValue(double value)
Get formatted monetary value with currency symbol- Parameters:
value- the value to be formatted- Returns:
- formatted threshold string
-
getResourceBreadcrumbBuilder
protected ResourceBreadcrumbBuilder getResourceBreadcrumbBuilder()
-
getQuoteFacade
protected QuoteFacade getQuoteFacade()
-
getVoucherFacade
protected VoucherFacade getVoucherFacade()
-
-