Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.Customer


                    } else if (param instanceof OrderCustomer) {
                        OrderCustomer order = (OrderCustomer) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_ORDER_NUM, handleParamValue(order.getOrderNum().toString()));
                        break;
                    } else if (param instanceof Customer) {
                        Customer customer = (Customer) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_CUSTOMER_CODE, handleParamValue(customer.getCode().toString()));
                        break;
                    } else if (param instanceof EngineSetting) {
                        EngineSetting engineSetting = (EngineSetting) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_ENGINE_SETTING_CODE, handleParamValue(engineSetting.getCode().toString()));
                        break;
View Full Code Here


  public ModelAndView customerDetails(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.CUSTOMER_DETAILS.getVelocityPage());
    final RequestData requestData = requestUtil.getRequestData(request);
   
    final String customerCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_CUSTOMER_CODE);
    final Customer customer = customerService.getCustomerByCode(customerCode);
   
    if(customer != null){
          modelAndView.addObject(ModelConstants.CUSTOMER_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanCustomer(requestUtil.getRequestData(request), customer));
    } else {
      final String url = requestUtil.getLastRequestUrl(request);
      return new ModelAndView(new RedirectView(url));
    }

    modelAndView.addObject(ModelConstants.CUSTOMER_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanCustomer(requestData, customer));
   
        model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.CUSTOMER_LIST, requestData));
   
        Object[] params = {customer.getLastname() + " " + customer.getFirstname()};
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.CUSTOMER_DETAILS.getKey(), params);

        return modelAndView;
  }
View Full Code Here

    final RequestData requestData = requestUtil.getRequestData(request);
   
        final String customerCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_CUSTOMER_CODE);
        if(StringUtils.isNotEmpty(customerCode)){
            // EDIT MODE
            final Customer customer = customerService.getCustomerByCode(customerCode);

            CustomerViewBean customerViewBean = backofficeViewBeanFactory.buildViewBeanCustomer(requestData, customer);
            request.setAttribute(ModelConstants.CUSTOMER_VIEW_BEAN, customerViewBean);

            Object[] params = {customer.getLastname() + " " + customer.getFirstname()};
            overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView,  BoUrls.CUSTOMER_EDIT.getKey(), params);

            model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.CUSTOMER_DETAILS, requestData, customer));
        } else {
            // ADD MODE
View Full Code Here

       
    if (result.hasErrors()) {
      return customerEdit(request, model, customerForm);
    }
   
    Customer customer = null;
        if(StringUtils.isNotEmpty(customerForm.getId())){
            customer = customerService.getCustomerById(customerForm.getId());
        }
   
        try {
            // CREATE OR UPDATE CUSTOMER
            Customer savedCustomer = webBackofficeService.createOrUpdateCustomer(customer, customerForm);
           
            if(customer == null){
                addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.CUSTOMER, "create_success_message", locale));
               
            } else {
View Full Code Here

    protected CustomerForm initCustomerForm(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String customerCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_CUSTOMER_CODE);
        if(StringUtils.isNotEmpty(customerCode)){
            final Customer customerEdit = customerService.getCustomerByCode(customerCode);
            return backofficeFormFactory.buildCustomerForm(requestData, customerEdit);
        }
       
        return backofficeFormFactory.buildCustomerForm(requestData, null);
    }
View Full Code Here

  @RequestMapping(FoUrls.PERSONAL_WISHLIST_URL)
  public ModelAndView customerWishList(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.PERSONAL_WISHLIST.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);

    final Customer customer = requestData.getCustomer();
   
    // WE RELOAD THE CUSTOMER FOR THE PERSISTANCE PROXY FILTER
    // IT AVOIDS LazyInitializationException: could not initialize proxy - no Session
    final Customer reloadedCustomer = customerService.getCustomerByCode(customer.getCode());
   
    final CustomerWishlistViewBean customerWishListViewBean = frontofficeViewBeanFactory.buildViewBeanCustomerWishlist(requestUtil.getRequestData(request), reloadedCustomer);
    model.addAttribute(ModelConstants.CUSTOMER_WISHLIST_VIEW_BEAN, customerWishListViewBean);

        Object[] params = { customer.getLastname(), customer.getFirstname() };
View Full Code Here

        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.LOGIN.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();

        // 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));
        }
View Full Code Here

        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.LOGIN.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();

        // 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));
        }
View Full Code Here

    @RequestMapping(FoUrls.LOGIN_CHECK_URL)
    public ModelAndView loginCheck(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        ModelAndView modelAndView = new ModelAndView(FoUrls.LOGIN.getVelocityPage());

        final Customer currentCustomer = requestData.getCustomer();
        if (currentCustomer != null) {
            final String urlRedirect = urlService.generateUrl(FoUrls.HOME, requestUtil.getRequestData(request));
            return new ModelAndView(new RedirectView(urlRedirect));
        }
View Full Code Here

  @RequestMapping(FoUrls.TIMEOUT_URL)
  public ModelAndView timeout(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.TIMEOUT.getVelocityPage());
    final RequestData requestData = requestUtil.getRequestData(request);
    final Customer currentCustomer = requestData.getCustomer();
    if(currentCustomer != null){
      final String urlRedirect = urlService.generateUrl(FoUrls.HOME, requestUtil.getRequestData(request));
          return new ModelAndView(new RedirectView(urlRedirect));
    }
   
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.Customer

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.