Class FareFinderComponentController

java.lang.Object
de.hybris.platform.addonsupport.controllers.AbstractAddOnController
de.hybris.platform.addonsupport.controllers.cms.AbstractCMSAddOnComponentController<T>

@Controller("FareFinderComponentController") @RequestMapping("/view/FareFinderComponentController") public class FareFinderComponentController extends AbstractFinderComponentController
Fare Finder Controller for handling requests for the Fare Finder Component.
  • Field Details

  • Constructor Details

    • FareFinderComponentController

      public FareFinderComponentController()
  • Method Details

    • fillModel

      protected void fillModel(javax.servlet.http.HttpServletRequest request, org.springframework.ui.Model model, AbstractFinderComponentModel component)
      Method responsible for populating the data model with initial data for the component
      Specified by:
      fillModel in class de.hybris.platform.addonsupport.controllers.cms.AbstractCMSAddOnComponentController<AbstractFinderComponentModel>
    • checkIfAdditionalTravellersArePresent

      protected boolean checkIfAdditionalTravellersArePresent(FareFinderForm fareFinderForm)
      Method check to see if there are any additional travelers other than Adults traveling on this trip.
      Parameters:
      fareFinderForm -
    • validateFareFinderForm

      @RequestMapping(value="/validate-fare-finder-form", method=POST) @ResponseBody public FormErrorResponseData validateFareFinderForm(@Valid @Valid FareFinderForm fareFinderForm, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model)
      Request handler for any search requests from the Fare Finder Component. This method will first perform JSR303 validation on the fareFinderForm bean before performing any custom validation.
      Parameters:
      fareFinderForm -
      bindingResult -
      model -
      Returns:
      the location of the JSON tag used to render the errors in the front-end
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
    • getFormErrorResponseData

      protected FormErrorResponseData getFormErrorResponseData(org.springframework.validation.BindingResult bindingResult, boolean hasErrorFlag)
      Overrides:
      getFormErrorResponseData in class AbstractFinderComponentController
    • performSearch

      @RequestMapping(value="/search", method=POST) public String performSearch(@Valid @Valid FareFinderForm fareFinderForm, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, org.springframework.validation.BindingResult bindingResult)
      The method is called when the form doesn't have any binding errors. It does a redirect to the FareSelection page
      Parameters:
      fareFinderForm - as the input FareFinderForm
      redirectModel -
      bindingResult -
      Returns:
      a string representing the redirect to the FareSelection page
    • populateInitialData

      protected void populateInitialData(org.springframework.ui.Model model)
    • buildUrlParameters

      protected String buildUrlParameters(FareFinderForm fareFinderForm)
    • initializeFareFinderForm

      protected void initializeFareFinderForm(FareFinderForm fareFinderForm)
    • getMaxGuestQuantity

      protected int getMaxGuestQuantity()
      Specified by:
      getMaxGuestQuantity in class AbstractFinderComponentController