Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected ModelAndView onSubmit( final HttpServletRequest request,
- final HttpServletResponse response, final Object command,
- final BindException errors ) {
- final PlannerInfoFormBean plannerinfoFormbean = (PlannerInfoFormBean)command;
- String rfp = null;
- // try {
- validateObject( plannerinfoFormbean, ErrorCodes.SYSTEM_NOT_AVAILABLE.getCode() );
- rfp = request.getParameter( "rfp" );
- final EmailOptions emailOpt = new EmailOptions();
- final Guest guest = plannerinfoFormbean.getGuest();
- String phoneNumber = guest.getPhone().getNumber();
- phoneNumber = removeSpecialCharacters( phoneNumber );
- guest.getPhone().setNumber( phoneNumber );
- validateObject( guest, ErrorCodes.SYSTEM_NOT_AVAILABLE.getCode() );
- guest.setEmailOptions( emailOpt );
- //Get the country code and search Country object and set the Display name
- Map<String, BasePopulator> populatorMap = this.getPopulators();
- BasePopulator countryPopulator = populatorMap.get("countryPopulator");
- List<Country> countries = countryPopulator.getPopulator(request);
- for(Country country : countries) {
- if(country.getCode().equals(plannerinfoFormbean.getSelectedCountryCode())) {
- guest.getAddress().getCountry().setCode(country.getCode());
- guest.getAddress().getCountry().setIsoCode(country.getIsoCode());
- guest.getAddress().getCountry().setName(country.getName());
- break;
- }
- }
- if ( StringUtils.isSet( plannerinfoFormbean.getProvince() )
- && guest.getAddress() != null && guest.getAddress().getState() != null ) {
- guest.getAddress().getState().setName( plannerinfoFormbean.getProvince() );
- }
- final ReservationDTO reservationDTO = (ReservationDTO)request.getSession()
- .getAttribute( EasyMeetingsConstants.RESERVATION_DTO );
- //TODO
- request.getSession().setAttribute("bookingPersonalInfoSessionAttr","bookingPersonalInfoSessionAttrValue");
- validateObject( reservationDTO, ErrorCodes.SESSION_EXPIRED.getCode() );
- if ( LOGGER.isDebugEnabled() ) {
- LOGGER.debug( "Booking Personal Info Controller...ReservationDTO....."
- + reservationDTO );
- }
- reservationDTO.setGuest( guest );
- reservationDTO.setEventName( plannerinfoFormbean.getEventName() );
- reservationDTO.setCompanyName( plannerinfoFormbean.getCompany() );
- request.getSession().setAttribute(
- EasyMeetingsConstants.RESERVATION_DTO, reservationDTO );
- String spReq = plannerinfoFormbean.getSpecialReq();
- spReq = spReq.replaceAll( "\r", "\\\\r" );
- spReq = spReq.replaceAll( "\n", "\\\\n" );
- request.getSession().setAttribute( EasyMeetingsConstants.SPECIAL_REQ, spReq );
- // } catch( final Exception ex ) {
- // LOGGER.error( "Exception in Booking personal information page.", ex );
- // plannerinfoFormbean.setErrorCode( ErrorCodes.INPUT_INVALID_ERROR.getCode() );
- // final Map<String, Object> modelMap = new HashMap<String, Object>();
- // modelMap.put( "plannerinfoFormBean", plannerinfoFormbean );
- // view = this.getFormView();
- //
- // ModelAndView modelAndView = new ModelAndView( view ).addAllObjects( modelMap );
- // try {
- // modelAndView = showForm( request, response, errors ).addAllObjects( modelMap );
- // } catch( Exception e ) {
- // LOGGER.error( "Error binder not found .", e );
- // }
- // return modelAndView;
- // }
- String successView = null;
- if ( rfp != null ) {
- successView = UrlGeneratorUtils.generateSecureUrl(
- request, "rfpsleeping?hotelMnemonic=ATLDC" );
- } else {
- successView = UrlGeneratorUtils.generateSecureUrl(
- request, "bookingpaymentcontroller" );
- }
- request.getSession().setAttribute("workDamnit", "foo");
- //TODO
- return new ModelAndView( new RedirectView( successView ) );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement