Class AccommodationSearchController
java.lang.Object
de.hybris.platform.coreairlinecommonsocc.controllers.AirlineBaseController
de.hybris.platform.coreairlineaccommodationocc.controllers.AccommodationSearchController
@Controller
@RequestMapping("/{baseSiteId}")
public class AccommodationSearchController
extends AirlineBaseController
Web Service Accommodation Search Controller for accommodation search.
-
Field Summary
Fields inherited from class de.hybris.platform.coreairlinecommonsocc.controllers.AirlineBaseController
BASIC_FIELD_SET, DEFAULT_PAGE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<RoomStayCandidateData>createRoomStayCandidates(String roomGuestOccupancy) 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 PaginationWsDTOpopulatePaginationDate(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.coreairlinecommonsocc.controllers.AirlineBaseController
createPaginationData, 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
-
populatePaginationDate
protected PaginationWsDTO populatePaginationDate(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 size- 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
- Parameters:
roomGuestOccupancy- the room guest occupancy- Returns:
- a list of
RoomStayCandidateDatabuilt using request parameters
-