Class PackageListingPageController
java.lang.Object
de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController
de.hybris.platform.travelacceleratorstorefront.controllers.pages.TravelAbstractPageController
de.hybris.platform.accommodationaddon.controllers.pages.AbstractAccommodationPageController
de.hybris.platform.travelcommons.controllers.page.AbstractPackagePageController
de.hybris.platform.travelcommons.controllers.page.PackageListingPageController
@Controller
@RequestMapping("/package-listing")
public class PackageListingPageController
extends AbstractPackagePageController
Controller for Accommodation Search page
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
AbstractController.HttpNotFoundException -
Field Summary
FieldsFields inherited from class de.hybris.platform.accommodationaddon.controllers.pages.AbstractAccommodationPageController
AND_SIGN, CHECK_IN_DATE_TIME, CHECK_OUT_DATE_TIME, EQUAL_SIGN, ERROR_AMEND_BOOKING_CART, ERROR_AMEND_BOOKING_DATES, ERROR_AMEND_BOOKING_DATES_PARSE, ERROR_AMEND_BOOKING_EMPTY, ERROR_AMEND_BOOKING_ORDER_ID, ERROR_AMEND_BOOKING_ORDER_PRICE_CALCULATION, MAX_PAGE_LIMIT, PART_HOTEL_STAY, TOTAL_NUMBER_OF_REVIEWSFields inherited from class de.hybris.platform.travelacceleratorstorefront.controllers.pages.TravelAbstractPageController
FIFTY_NINE, TEN, TWENTY_THREEFields 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, ROOT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendParameter(StringBuilder urlParameters, String parameter, String value) protected StringbuildPackageDetailsPageUrlParameters(AccommodationFinderForm accommodationFinderForm, FareFinderForm fareFinderForm) Build package details page url parameters string.displayView(org.springframework.ui.Model model, String resultsViewType, Integer pageNumber, String priceRange, javax.servlet.http.HttpServletRequest request) Display method to return the properties to mark on Map.protected CriterionDatagetCriterionData(AccommodationFinderForm accommodationFinderForm, javax.servlet.http.HttpServletRequest request, String propertyName, String query, String sortCode) Prepare accommodation search request data accommodation search request data.protected StringgetModifiedQueryString(javax.servlet.http.HttpServletRequest request) Below method clears the q and propertyName request parameters from the query string as they are supposed to be cleared on currency changegetPackageListingPage(AccommodationFinderForm accommodationFinderForm, org.springframework.validation.BindingResult accommodationBindingResult, FareFinderForm fareFinderForm, org.springframework.validation.BindingResult fareBindingResult, String propertyName, String query, String sortCode, Integer pageNumber, String resultsViewType, String priceRange, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request) Gets accommodation search page.protected intgetPackageSearchResultsPageSize(String resultsViewType) Gets the package search results page size.protected PackageSearchResponseDatagetPackageSearchWithAppliedPriceRange(String priceRange) Gets the package search with applied price range.getPriceRangeFilteredPackages(String priceRange, String resultsViewType, Integer pageNumber, org.springframework.ui.Model model) Gets the price range filtered packages.protected StringgetResultViewType(String resultViewType) Gets the result view type.protected voidinitializeForms(FareFinderForm fareFinderForm, AccommodationFinderForm accommodationFinderForm, javax.servlet.http.HttpServletRequest request) Initialize forms.protected voidpopulateCommonModelAttributes(int startIndex, int pageNumber, String resultsViewType, PackageSearchResponseData packageSearchResponseData, org.springframework.ui.Model model) Populate common model attributes.protected voidpopulateModelWithPackagePriceRange(PackageSearchResponseData packageSearchResponseData, org.springframework.ui.Model model, String priceRange) Update criterion data for price range filter.prepareCustomerReviewData(String accommodationOfferingCode, org.springframework.ui.Model model) Prepare customer review data json response.protected voidresolveDestinationLocation(String arrivalLocation, String arrivalLocationSuggestionType, AccommodationFinderForm accommodationFinderForm) This method resolves the destination location fields for accommodationFinderForm.protected voidresolveLocationFields(FareFinderForm fareFinderForm) Resolve location name fields for fareFinderForm.showMore(int pageNumber, String resultsViewType, String priceRange, org.springframework.ui.Model model) Show more method to return lazy loaded properties.protected voidvalidateAccommodationFinderForm(AbstractTravelValidator accommodationFinderValidator, AccommodationFinderForm accommodationFinderForm, org.springframework.validation.BindingResult bindingResult, String formName) Validate accommodation finder form.protected voidvalidateFareFinderForm(AbstractTravelValidator fareFinderValidator, FareFinderForm fareFinderForm, org.springframework.validation.BindingResult bindingResult, String formName) Validate fare finder form.protected BooleanvalidateFieldPattern(String attribute, String pattern) Validate field pattern boolean.Methods inherited from class de.hybris.platform.travelcommons.controllers.page.AbstractPackagePageController
clonePassengerTypeQuantityData, countJourneyOptions, createOriginDestinationInfos, createPassengerTypeQuantityData, createSearchProcessingInfo, createTransportOfferingPreferences, createTravelPreferences, getLocationName, populateFareSearchResponseInModel, prepareFareSearchRequestData, sortFareSelectionDataMethods inherited from class de.hybris.platform.accommodationaddon.controllers.pages.AbstractAccommodationPageController
adjustSessionBookingJourney, checkDatesAndGetNewQueryString, createPageableData, createRoomStayCandidate, createRoomStayCandidates, createRoomStayCandidates, createRoomStayCandidatesForSearchPage, getAccommodationOfferingCustomerReviewFacade, getAccommodationOfferingFacade, getBookingFacade, getPagedAccommodationOfferingCustomerReviews, prepareAccommodationSearchRequestData, setAccommodationOfferingCustomerReviewFacade, setAccommodationOfferingFacadeMethods inherited from class de.hybris.platform.travelacceleratorstorefront.controllers.pages.TravelAbstractPageController
getConfigurationService, getDisableCurrencySelector, getJson, getReservationCode, getSiteUid, getTravelCartFacade, getTravelCustomerFacade, populateHours, populateMinutesMethods inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController
addRegistrationConsentDataToModel, checkRequestUrl, createMetaElement, decodeWithScheme, getBaseSiteService, getCheckoutRedirectUrl, getCmsPageService, getCmsPreviewService, getCmsSiteService, getConsentFacade, getContentPageForLabelOrId, getCurrencies, getCurrentCurrency, getCurrentLanguage, getCustomerFacade, getHostConfigService, getI18nService, getLanguages, getMessageSource, getPageTitleResolver, getRequestContextData, getSessionService, getSiteConfigService, getSiteName, 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
-
REDIRECT_PREFIX
- See Also:
-
fareFinderValidator
-
-
Constructor Details
-
PackageListingPageController
public PackageListingPageController()
-
-
Method Details
-
getPackageListingPage
@RequestMapping(method=GET) public String getPackageListingPage(@ModelAttribute("accommodationFinderForm") AccommodationFinderForm accommodationFinderForm, org.springframework.validation.BindingResult accommodationBindingResult, @ModelAttribute("fareFinderForm") FareFinderForm fareFinderForm, org.springframework.validation.BindingResult fareBindingResult, @RequestParam(value="propertyName",required=false) String propertyName, @RequestParam(value="q",required=false) String query, @RequestParam(value="sort",required=false) String sortCode, @RequestParam(value="pageNum",required=false,defaultValue="1") Integer pageNumber, @RequestParam(value="resultsViewType",required=false,defaultValue="listView") String resultsViewType, @RequestParam(value="priceRange",required=false) String priceRange, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException Gets accommodation search page.- Parameters:
accommodationFinderForm- the accommodation finder formpropertyName- the property namequery- the querysortCode- the sort codepageNumber- the page numberbindingResult- the binding resultmodel- the modelrequest- the request- Returns:
- the accommodation search page
- Throws:
de.hybris.platform.cms2.exceptions.CMSItemNotFoundException- the cms item not found exception
-
initializeForms
protected void initializeForms(FareFinderForm fareFinderForm, AccommodationFinderForm accommodationFinderForm, javax.servlet.http.HttpServletRequest request) throws NumberFormatException Initialize forms.- Parameters:
fareFinderForm- the fare finder formaccommodationFinderForm- the accommodation finder formrequest- the request- Throws:
NumberFormatException
-
resolveLocationFields
Resolve location name fields for fareFinderForm.- Parameters:
fareFinderForm- the fare finder form
-
resolveDestinationLocation
protected void resolveDestinationLocation(String arrivalLocation, String arrivalLocationSuggestionType, AccommodationFinderForm accommodationFinderForm) This method resolves the destination location fields for accommodationFinderForm. It tries to resolve the location from the transport facility, if no result is found we fall back to Google search and use geographic coordinates- Parameters:
arrivalLocation-arrivalLocationSuggestionType-accommodationFinderForm-
-
getResultViewType
Gets the result view type.- Parameters:
resultViewType- the result view type- Returns:
- the result view type
-
getCriterionData
protected CriterionData getCriterionData(AccommodationFinderForm accommodationFinderForm, javax.servlet.http.HttpServletRequest request, String propertyName, String query, String sortCode) Prepare accommodation search request data accommodation search request data.- Parameters:
accommodationFinderForm- the accommodation finder formrequest- the requestpropertyName- the property namequery- the querysortCode- the sort code- Returns:
- the accommodation search request data
-
buildPackageDetailsPageUrlParameters
protected String buildPackageDetailsPageUrlParameters(AccommodationFinderForm accommodationFinderForm, FareFinderForm fareFinderForm) Build package details page url parameters string.- Parameters:
accommodationFinderForm- accommodationFinderFormfareFinderForm- fareFinderForm- Returns:
- the string
-
appendParameter
-
populateModelWithPackagePriceRange
protected void populateModelWithPackagePriceRange(PackageSearchResponseData packageSearchResponseData, org.springframework.ui.Model model, String priceRange) Update criterion data for price range filter.- Parameters:
packageSearchResponseData- the package search response datamodel- the modellowerPriceRange- the lower price rangeupperPriceRange- the upper price range
-
prepareCustomerReviewData
@RequestMapping("/customer-review/{accommodationOfferingCode}") public String prepareCustomerReviewData(@PathVariable String accommodationOfferingCode, org.springframework.ui.Model model) Prepare customer review data json response.- Parameters:
accommodationOfferingCode- the accommodation offering codemodel- the model- Returns:
- the string
-
displayView
@RequestMapping("/display-view") public String displayView(org.springframework.ui.Model model, @RequestParam(value="resultsViewType",required=false,defaultValue="listView") String resultsViewType, @RequestParam(value="pageNum",required=false,defaultValue="1") Integer pageNumber, @RequestParam(value="priceRange",required=false) String priceRange, javax.servlet.http.HttpServletRequest request) Display method to return the properties to mark on Map.- Returns:
- the string
-
showMore
@RequestMapping("/show-more") public String showMore(@RequestParam(value="pageNumber",required=false) int pageNumber, @RequestParam(value="resultsViewType",required=false,defaultValue="listView") String resultsViewType, @RequestParam(value="priceRange",required=false) String priceRange, org.springframework.ui.Model model) Show more method to return lazy loaded properties.- Parameters:
pageNumber- the page numbermodel- the model- Returns:
- the string
-
getPackageSearchResultsPageSize
Gets the package search results page size.- Parameters:
resultsViewType- the results view type- Returns:
- the package search results page size
-
populateCommonModelAttributes
protected void populateCommonModelAttributes(int startIndex, int pageNumber, String resultsViewType, PackageSearchResponseData packageSearchResponseData, org.springframework.ui.Model model) Populate common model attributes.- Parameters:
pageNumber- the page numberresultsViewType- the results view typepackageSearchResponseData- the package search response datamodel- the model
-
getModifiedQueryString
Below method clears the q and propertyName request parameters from the query string as they are supposed to be cleared on currency change- Parameters:
request-- Returns:
-
getPriceRangeFilteredPackages
@RequestMapping("/filter-price-range") public String getPriceRangeFilteredPackages(@RequestParam(value="priceRange",required=false) String priceRange, @RequestParam(value="resultsViewType",required=false,defaultValue="listView") String resultsViewType, @RequestParam(value="pageNum",required=false,defaultValue="1") Integer pageNumber, org.springframework.ui.Model model) Gets the price range filtered packages.- Parameters:
lowerPriceRange- the lower price rangeupperPriceRange- the upper price rangeresultsViewType- the results view typepageNumber- the page numbermodel- the model- Returns:
- the price range filtered packages
-
getPackageSearchWithAppliedPriceRange
Gets the package search with applied price range.- Parameters:
priceRange- the price range- Returns:
- the package search with applied price range
-
validateFieldPattern
Validate field pattern boolean.- Parameters:
attribute- the attributepattern- the pattern- Returns:
- the boolean
-
validateAccommodationFinderForm
protected void validateAccommodationFinderForm(AbstractTravelValidator accommodationFinderValidator, AccommodationFinderForm accommodationFinderForm, org.springframework.validation.BindingResult bindingResult, String formName) Validate accommodation finder form.- Parameters:
accommodationFinderValidator- the accommodation finder validatoraccommodationFinderForm- the accommodation finder formbindingResult- the binding resultformName- the form name
-
validateFareFinderForm
protected void validateFareFinderForm(AbstractTravelValidator fareFinderValidator, FareFinderForm fareFinderForm, org.springframework.validation.BindingResult bindingResult, String formName) Validate fare finder form.- Parameters:
fareFinderValidator- the fare finder validatorfareFinderForm- the fare finder formbindingResult- the binding resultformName- the form name
-