Class AccommodationSearchController
java.lang.Object
de.hybris.platform.coretravelcommonsocc.controllers.TravelBaseController
de.hybris.platform.coreaccommodationocc.controllers.AccommodationBaseController
de.hybris.platform.coreaccommodationocc.controllers.AccommodationSearchController
@Controller
@RequestMapping("/{baseSiteId}")
public class AccommodationSearchController
extends AccommodationBaseController
Web Service Accommodation Search Controller for accommodation search.
-
Field Summary
Fields inherited from class de.hybris.platform.coreaccommodationocc.controllers.AccommodationBaseController
ADULT, GUESTS_SEPARATOR, MAX_GUESTS_PER_ROOM, MAX_PAGE_LIMIT, MAX_RANGE_OF_STAY, MAX_ROOMS_QTY, QTY_SEPARATOR, ROOMS_SEPARATORFields inherited from class de.hybris.platform.coretravelcommonsocc.controllers.TravelBaseController
BASIC_FIELD_SET, DEFAULT_PAGE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<RoomStayCandidateData>createRoomStayCandidates(String roomGuestOccupancy) CreatesRoomStayCandidateData.org.springframework.http.ResponseEntity<AccommodationSearchResponse>doAccommodationSearch(String salesApplication, String destinationLocation, String checkInDate, String checkOutDate, String roomGuestOccupancy, Integer currentPage, Integer pageSize, String filter, String sort) Searches for all the properties in a given location and gives information about availability and prices.protected List<PropertyData>paginateProperties(List<PropertyData> searchResponseProperties, Integer currentPage, Integer pageSize) Paginates response properties with the currentPage and pageSizeprotected AccommodationSearchRequestpopulateAccommodationSearchRequest(String destinationLocation, String checkInDate, String checkOutDate, String roomGuestOccupancy, Integer pageNumber, Integer pageSize, String sort, String filter) Populate the accommodation search requestprotected PaginationWsDTOpopulatePaginationData(Integer currentPage, Integer pageSize, Integer currentPageSize, Integer totalCount) populatePaginationWsDTOprotected AccommodationSearchRequestDataprepareAccommodationSearchRequestData(AccommodationSearchRequest accommodationSearchRequest) Prepare accommodation search request data accommodation search request data.Methods inherited from class de.hybris.platform.coreaccommodationocc.controllers.AccommodationBaseController
createAccommodationAvailabilityRequestData, createAccommodationAvailabilityRequestData, createCriterionData, createPageableData, createPassengerTypeQuantityData, createRoomStayCandidateData, createStayDateRangeData, findPassengerTypeByCode, getAccommodationOfferingFacade, getConfigurationService, getPassengerTypeDuplicates, getPassengerTypeFacade, parseDate, validateAdultsPerRoom, validatePassengerTypeQuantities, validateRoomStayCandidates, validateStayDurationMethods inherited from class de.hybris.platform.coretravelcommonsocc.controllers.TravelBaseController
getAbsoluteLocationURL, getDataMapper, getErrorCode, getErrorCodeResolver, handleAccessDeniedException, handleMissingRequestHeaderException, handleTravelModelNotFoundException, sanitize, validate, validate
-
Constructor Details
-
AccommodationSearchController
public AccommodationSearchController()
-
-
Method Details
-
doAccommodationSearch
@Secured({"ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/accommodations", method=GET, produces="application/json") @ResponseBody public org.springframework.http.ResponseEntity<AccommodationSearchResponse> doAccommodationSearch(@RequestHeader(name="sap.cx-sales-application") String salesApplication, @RequestParam String destinationLocation, @RequestParam String checkInDate, @RequestParam String checkOutDate, @RequestParam String roomGuestOccupancy, @RequestParam(required=false,defaultValue="1") Integer currentPage, @RequestParam(required=false,defaultValue="10") Integer pageSize, @RequestParam(required=false) String filter, @RequestParam(required=false) String sort) Searches for all the properties in a given location and gives information about availability and prices.Body request
- Returns:
AccommodationSearchResponse
-
populatePaginationData
protected PaginationWsDTO populatePaginationData(Integer currentPage, Integer pageSize, Integer currentPageSize, Integer totalCount) populatePaginationWsDTO- Parameters:
currentPage-pageSize-currentPageSize-totalCount-- Returns:
PaginationWsDTO
-
paginateProperties
protected List<PropertyData> paginateProperties(List<PropertyData> searchResponseProperties, Integer currentPage, Integer pageSize) Paginates response properties with the currentPage and pageSize- Parameters:
searchResponseProperties-currentPage-pageSize-- Returns:
-
populateAccommodationSearchRequest
protected AccommodationSearchRequest populateAccommodationSearchRequest(String destinationLocation, String checkInDate, String checkOutDate, String roomGuestOccupancy, Integer pageNumber, Integer pageSize, String sort, String filter) Populate the accommodation search request- Parameters:
destinationLocation- the destination locationcheckInDate- the check in datecheckOutDate- the check out dateroomGuestOccupancy- room guest occupancypageNumber- page numberpageSize- page sizesort-filter-- Returns:
-
prepareAccommodationSearchRequestData
protected AccommodationSearchRequestData prepareAccommodationSearchRequestData(AccommodationSearchRequest accommodationSearchRequest) Prepare accommodation search request data accommodation search request data.- Parameters:
accommodationSearchRequest- the accommodation search request- Returns:
- the accommodation search request data
-
createRoomStayCandidates
Description copied from class:AccommodationBaseControllerCreatesRoomStayCandidateData.- Overrides:
createRoomStayCandidatesin classAccommodationBaseController- Parameters:
roomGuestOccupancy- the room guest occupancy- Returns:
- a list of
RoomStayCandidateDatabuilt using request parameters
-