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.travelacceleratorstorefront.controllers.pages.QuoteController
@Controller
@RequestMapping("/quote")
public class QuoteController
extends AbstractCartPageController
This controller was copied from the yacceleratorstorefront extension to prevent spring context failing during server start.
Please refer to jira issue ACCX-7048.
Controller 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_8Fields inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
FORWARD_PREFIX, REDIRECT_PREFIX, ROOT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String>addQuoteComment(String comment, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) Add a quote comment to a given quote.org.springframework.http.ResponseEntity<String>addQuoteEntryComment(long entryNumber, String comment, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) applyDiscountAction(String quoteCode, @Valid QuoteDiscountForm form, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) Adds discount to an existing quote.approveQuote(String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) Approve a quote from the sales representativecancelQuote(String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) createQuote(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 DategetExpirationDateFromString(String expirationTime) protected StringgetFormattedPriceValue(double value) Get formatted monetary value with currency symbolprotected de.hybris.platform.commercefacades.order.QuoteFacadeprotected ResourceBreadcrumbBuilderprotected de.hybris.platform.commercefacades.voucher.VoucherFacadehandleEditModeSubmitQuote(String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) handleIllegalQuoteStateException(de.hybris.platform.commerceservices.order.exceptions.IllegalQuoteStateException exception, javax.servlet.http.HttpServletRequest request) protected voidloadCommentsShown(org.springframework.ui.Model model) newCart(String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) placeOrder(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) rejectQuote(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.requote(String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) protected voidsetAllowedActions(org.springframework.ui.Model model, String quoteCode) Set allowed actions for a given quote on model.protected voidsetExpirationTimeAttributes(org.springframework.ui.Model model) org.springframework.http.ResponseEntity<String>setQuoteExpiration(String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult) org.springframework.http.ResponseEntity<String>setQuoteMetadata(String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult) Update quote name and descriptionprotected voidsetUpdatable(org.springframework.ui.Model model, CartData cartData, boolean updatable) showQuoteEdit(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, String quoteCode) Loads quote edit page.protected voidsortComments(CartData cartData) submitQuote(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, validateCartMethods 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, urlEncodeMethods inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
addRequestToModel, getBean
-
Constructor Details
-
QuoteController
public QuoteController()
-
-
Method Details
-
createQuote
@RequestMapping(value="/create", method=GET) public 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 String applyDiscountAction(@PathVariable("quoteCode") 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 String showQuoteEdit(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, @PathVariable("quoteCode") String quoteCode) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException Loads quote edit page.- Parameters:
model-redirectModel-quoteCode-- Returns:
- Mapping to edit page.
- Throws:
de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
-
fillQuoteForm
-
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
-
submitQuote
@RequestMapping(value="/{quoteCode}/submit", method=POST) public String submitQuote(@PathVariable("quoteCode") 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 String approveQuote(@PathVariable("quoteCode") 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 String rejectQuote(@PathVariable("quoteCode") 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
-
handleEditModeSubmitQuote
-
newCart
@RequestMapping(value="/{quoteCode}/newcart", method=GET) public String newCart(@PathVariable("quoteCode") String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException - Throws:
de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
-
placeOrder
@RequestMapping(value="/{quoteCode}/checkout", method=POST) public String placeOrder(@PathVariable("quoteCode") 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
-
setQuoteMetadata
@ResponseBody @RequestMapping(value="/{quoteCode}/metadata", method=POST) public org.springframework.http.ResponseEntity<String> setQuoteMetadata(@PathVariable("quoteCode") String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult) Update quote name and description- Parameters:
quoteCode-quoteForm-bindingResult-- Returns:
- response entity
-
getExpirationDateFromString
-
addQuoteComment
@RequestMapping(value="/comment", method=POST) public org.springframework.http.ResponseEntity<String> addQuoteComment(@RequestParam("comment") 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
-
sortComments
-
loadCommentsShown
protected void loadCommentsShown(org.springframework.ui.Model model) -
setAllowedActions
Set allowed actions for a given quote on model.- Parameters:
model- the MVC modelquoteCode- the quote to be checked.
-
handleIllegalQuoteStateException
@ExceptionHandler(de.hybris.platform.commerceservices.order.exceptions.IllegalQuoteStateException.class) public String handleIllegalQuoteStateException(de.hybris.platform.commerceservices.order.exceptions.IllegalQuoteStateException exception, javax.servlet.http.HttpServletRequest request) -
getFormattedPriceValue
Get formatted monetary value with currency symbol- Parameters:
value- the value to be formatted- Returns:
- formatted threshold string
-
getResourceBreadcrumbBuilder
-
getQuoteFacade
protected de.hybris.platform.commercefacades.order.QuoteFacade getQuoteFacade() -
getVoucherFacade
protected de.hybris.platform.commercefacades.voucher.VoucherFacade getVoucherFacade()
-