Package org.hoteia.qalingo.core.web.servlet.view

Examples of org.hoteia.qalingo.core.web.servlet.view.RedirectView


       
    // SANITY CHECK: Customer logged
        final Customer currentCustomer = requestData.getCustomer();
    if(currentCustomer != null){
      final String url = urlService.generateUrl(FoUrls.PERSONAL_DETAILS, requestUtil.getRequestData(request));
      return new ModelAndView(new RedirectView(url));
    }
   
    final List<String> excludedPatterns = new ArrayList<String>();
        excludedPatterns.add(FoUrls.CUSTOMER_CREATE_ACCOUNT.getUrlWithoutWildcard());
    final String lastUrl = requestUtil.getLastRequestUrl(request, excludedPatterns, urlService.generateUrl(FoUrls.HOME, requestUtil.getRequestData(request)));
View Full Code Here


    webManagementService.cancelCustomerCredentialToken(requestData, customer);
    // ADD INFO/WARNING MESSAGE
    request.getSession().setAttribute(Constants.INFO_MESSAGE, getSpecificMessage(ScopeWebMessage.AUTH, "reset_password_is_cancel", locale));
   
    final String urlRedirect = urlService.generateUrl(FoUrls.LOGIN, requestUtil.getRequestData(request));
        return new ModelAndView(new RedirectView(urlRedirect));
  }
View Full Code Here

    // SANITY CHECK: Customer logged
        final Customer currentCustomer = requestData.getCustomer();
    if(currentCustomer != null){
      final String url = urlService.generateUrl(FoUrls.PERSONAL_DETAILS,requestUtil.getRequestData(request));
      return new ModelAndView(new RedirectView(url));
    }
   
    // "customer.create.account";
   
    if (result.hasErrors()) {
      return displayCustomerCreateAccount(request, model, createAccountForm);
    }
   
    final String email = createAccountForm.getEmail();
    final Customer customer = customerService.getCustomerByLoginOrEmail(email);
    if(customer != null){
      final String forgottenPasswordUrl = urlService.generateUrl(FoUrls.FORGOTTEN_PASSWORD, requestUtil.getRequestData(request));
      final Object[] objects = {forgottenPasswordUrl};
      result.rejectValue("email", "fo.customer.error_form_create_account_account_already_exist", objects,"This email customer account already exist! Go on this <a href=\"forgotten-password.html\" alt=\"\">page</a> to get a new password.");
      return displayCustomerCreateAccount(request, model, createAccountForm);
    }

    // Save the new customer
    final Customer newCustomer = webManagementService.buildAndSaveNewCustomer(requestData, currentMarket, currentMarketArea, createAccountForm);

    // Save the email confirmation
    webManagementService.buildAndSaveCustomerNewAccountMail(requestData, createAccountForm);

    // Login the new customer
    securityUtil.authenticationCustomer(request, newCustomer);
   
    final String urlRedirect = urlService.generateUrl(FoUrls.PERSONAL_DETAILS, requestData);
        return new ModelAndView(new RedirectView(urlRedirect));
  }
View Full Code Here

        final RequestData requestData = requestUtil.getRequestData(request);
        // SANITY CHECK: Customer logged
        final Customer currentCustomer = requestData.getCustomer();
        if(currentCustomer != null){
            final String url = urlService.generateUrl(FoUrls.CART_DELIVERY, requestUtil.getRequestData(request));
            return new ModelAndView(new RedirectView(url));
        }
       
        final List<String> excludedPatterns = new ArrayList<String>();
        excludedPatterns.add(FoUrls.CUSTOMER_CREATE_ACCOUNT.getUrlWithoutWildcard());
        final String lastUrl = requestUtil.getLastRequestUrl(request, excludedPatterns, urlService.generateUrl(FoUrls.HOME, requestUtil.getRequestData(request)));
View Full Code Here

        // SANITY CHECK: Customer logged
        final Customer currentCustomer = requestData.getCustomer();
        if(currentCustomer != null){
            final String url = urlService.generateUrl(FoUrls.CART_DELIVERY,requestUtil.getRequestData(request));
            return new ModelAndView(new RedirectView(url));
        }
       
        // "customer.create.account";
       
        if (result.hasErrors()) {
            return displayCustomerCreateAccount(request, model, createAccountForm);
        }
       
        final String email = createAccountForm.getEmail();
        final Customer customer = customerService.getCustomerByLoginOrEmail(email);
        if(customer != null){
            final String forgottenPasswordUrl = urlService.generateUrl(FoUrls.FORGOTTEN_PASSWORD, requestData);
            final Object[] objects = {forgottenPasswordUrl};
            result.rejectValue("email", "error.form.create.account.account.already.exist", objects,"This email customer account already exist! Go on this <a href=\"${0}\" alt=\"\">page</a> to get a new password.");
        }

        // Save the new customer
        final Customer newCustomer = webManagementService.buildAndSaveNewCustomer(requestData, currentMarket, currentMarketArea, createAccountForm);

        // Save the email confirmation
        webManagementService.buildAndSaveCustomerNewAccountMail(requestData, createAccountForm);

        // Login the new customer
        securityUtil.authenticationCustomer(request, newCustomer);
       
        final String urlRedirect = urlService.generateUrl(FoUrls.CART_DELIVERY, requestData);
        return new ModelAndView(new RedirectView(urlRedirect));
    }
View Full Code Here

  @RequestMapping(FoUrls.CHANGE_LANGUAGE_URL)
  public ModelAndView changeLanguage(final HttpServletRequest request) throws Exception {
      final RequestData requestData = requestUtil.getRequestData(request);
        String redirectUrl = urlService.generateUrl(getTargetUrl(requestData), true, requestData);
        RedirectView redirectView = new RedirectView(redirectUrl);
        redirectView.setExposeModelAttributes(false);
        return new ModelAndView(redirectView);
  }
View Full Code Here

 
  @RequestMapping(FoUrls.CHANGE_CONTEXT_URL)
  public ModelAndView changeContext(final HttpServletRequest request) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        String redirectUrl = urlService.generateUrl(getTargetUrl(requestData), true, requestData);
        RedirectView redirectView = new RedirectView(redirectUrl);
        redirectView.setExposeModelAttributes(false);
        return new ModelAndView(redirectView);
  }
View Full Code Here

         
          return modelAndView;
    }
   
        final String urlRedirect = urlService.generateUrl(FoUrls.STORE_LOCATION, requestData);
        return new ModelAndView(new RedirectView(urlRedirect));
  }
View Full Code Here

   
    if(orderCustomer != null){
          modelAndView.addObject(ModelConstants.ORDER_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanOrder(requestUtil.getRequestData(request), orderCustomer));
    } else {
      final String url = requestUtil.getLastRequestUrl(request);
      return new ModelAndView(new RedirectView(url));
    }
   
        model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.ORDER_LIST, requestData));
       
        Object[] params = {orderCustomer.getOrderNum()};
View Full Code Here

            webBackofficeService.createOrUpdateProductMarketing(productMarketing, productMarketingForm);
           
            if (productMarketing == null) {
                addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.PRODUCT_MARKETING, "create_success_message", locale));
                final String urlRedirect = backofficeUrlService.generateUrl(BoUrls.VIRTUAL_CATALOG, requestData);
                return new ModelAndView(new RedirectView(urlRedirect));
            } else {
                addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.PRODUCT_MARKETING, "update_success_message", locale));
                final String urlRedirect = backofficeUrlService.generateUrl(BoUrls.PRODUCT_MARKETING_DETAILS, requestData, productMarketing);
                return new ModelAndView(new RedirectView(urlRedirect));
            }
           
        } catch (Exception e) {
            addMessageError(result, null, "code", "code", getSpecificMessage(ScopeWebMessage.PRODUCT_MARKETING, "create_or_update_message", locale));
            logger.error("Can't save or update ProductMarketing:" + productMarketingForm.getId() + "/" + productMarketingForm.getCode(), e);
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.servlet.view.RedirectView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.