@Controller @RequestMapping("/quote") public class QuoteController extends AbstractCartPageController
Controller for Quotes
  • 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 CMSItemNotFoundException
      Loads 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 String cancelQuote(@PathVariable("quoteCode") String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
    • 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

      @RequestMapping(value="/{quoteCode}/requote", method=POST) public String requote(@PathVariable("quoteCode") String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
    • handleEditModeSubmitQuote

      protected Optional<String> handleEditModeSubmitQuote(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 String newCart(@PathVariable("quoteCode") String quoteCode, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) throws CMSItemNotFoundException
      Throws:
      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

      @ResponseBody @RequestMapping(value="/{quoteCode}/expiration", method=POST) public org.springframework.http.ResponseEntity<String> setQuoteExpiration(@PathVariable("quoteCode") String quoteCode, QuoteForm quoteForm, org.springframework.validation.BindingResult bindingResult)
    • 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

      protected Date getExpirationDateFromString(String expirationTime)
    • 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

      @RequestMapping(value="/entry/comment", method=POST) public org.springframework.http.ResponseEntity<String> addQuoteEntryComment(@RequestParam("entryNumber") long entryNumber, @RequestParam("comment") 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, String quoteCode)
      Set allowed actions for a given quote on model.
      Parameters:
      model - the MVC model
      quoteCode - the quote to be checked.
    • handleIllegalQuoteStateException

      @ExceptionHandler(IllegalQuoteStateException.class) public String handleIllegalQuoteStateException(IllegalQuoteStateException exception, javax.servlet.http.HttpServletRequest request)
    • getFormattedPriceValue

      protected 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()