Package org.hoteia.qalingo.core.pojo

Examples of org.hoteia.qalingo.core.pojo.RequestData


    @Autowired
    public RetailerService retailerService;

    @RequestMapping(value = "/**/search-load-store-index.html", method = RequestMethod.GET)
    public ModelAndView loadIndex(final HttpServletRequest request, final HttpServletResponse response, ModelMap modelMap) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea marketArea = requestData.getMarketArea();

        List<Retailer> retailers = retailerService.findAllRetailers();;
       
        for (Retailer retailer : retailers) {
            List<Store> stores = retailerService.findStoresByRetailerId(retailer.getId());
View Full Code Here


    }
   
    @RequestMapping(value = BoUrls.PAYMENT_GATEWAY_EDIT_URL, method = RequestMethod.GET)
    public ModelAndView paymentGatewayEdit(final HttpServletRequest request, final Model model, @ModelAttribute(ModelConstants.PAYMENT_GATEWAY_FORM) PaymentGatewayForm paymentGatewayForm) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.PAYMENT_GATEWAY_EDIT.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String paymentGatewayCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_PAYMENT_GATEWAY_CODE);
        if(StringUtils.isNotEmpty(paymentGatewayCode)){
            // EDIT MODE
            final AbstractPaymentGateway paymentGateway = paymentGatewayService.getPaymentGatewayByCode(paymentGatewayCode, FetchPlanGraphCommon.defaultPaymentGatewayFetchPlan());
View Full Code Here

    }
   
    @RequestMapping(value = BoUrls.PAYMENT_GATEWAY_EDIT_URL, method = RequestMethod.POST)
    public ModelAndView submitAbstractPaymentGatewayEdit(final HttpServletRequest request, final Model model, @Valid @ModelAttribute(ModelConstants.PAYMENT_GATEWAY_FORM) PaymentGatewayForm paymentGatewayForm,
                                                 BindingResult result) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();

        if (result.hasErrors()) {
            return paymentGatewayEdit(request, model, paymentGatewayForm);
        }

        AbstractPaymentGateway paymentGateway = null;
        if(StringUtils.isNotEmpty(paymentGatewayForm.getId())){
            paymentGateway = paymentGatewayService.getPaymentGatewayById(paymentGatewayForm.getId(), FetchPlanGraphCommon.fullPaymentGatewayFetchPlan());
        }

        try {
            // CREATE OR UPDATE PAYMENT GATEWAY
            webBackofficeService.createOrUpdatePaymentGateway(requestData.getMarketArea(), paymentGateway, paymentGatewayForm);
           
            if (paymentGateway == null) {
                addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.PAYMENT_GATEWAY, "create_success_message", locale));
                final String urlRedirect = backofficeUrlService.generateUrl(BoUrls.PAYMENT_GATEWAY_LIST, requestUtil.getRequestData(request));
                return new ModelAndView(new RedirectView(urlRedirect));
View Full Code Here

    /**
     *
     */
    @ModelAttribute(ModelConstants.PAYMENT_GATEWAY_FORM)
    protected PaymentGatewayForm initPaymentGatewayForm(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea marketArea = marketService.getMarketAreaByCode(requestData.getMarketArea().getCode(), FetchPlanGraphMarket.fullMarketAreaFetchPlan());
        final String paymentGatewayCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_PAYMENT_GATEWAY_CODE);
        if(StringUtils.isNotEmpty(paymentGatewayCode)){
            final AbstractPaymentGateway paymentGateway = paymentGatewayService.getPaymentGatewayByCode(paymentGatewayCode, FetchPlanGraphCommon.fullPaymentGatewayFetchPlan());
            return backofficeFormFactory.buildPaymentGatewayForm(marketArea, paymentGateway);
        }
View Full Code Here

  }
 
  @RequestMapping(value = FoUrls.PERSONAL_DETAILS_URL, method = RequestMethod.GET)
  public ModelAndView personalDetails(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.PERSONAL_DETAILS.getVelocityPage());
    final RequestData requestData = requestUtil.getRequestData(request);
        final Customer currentCustomer = requestData.getCustomer();
   
    // Customer is already set by the abstract

    Object[] params = { currentCustomer.getLastname(), currentCustomer.getFirstname() };
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, FoUrls.PERSONAL_DETAILS.getKey(), params);
View Full Code Here

  }
 
  @RequestMapping(value = FoUrls.PERSONAL_EDIT_URL, method = RequestMethod.GET)
  public ModelAndView displayPersonalEdit(final HttpServletRequest request, final Model model, @ModelAttribute("customerEditForm") CustomerEditForm customerEditForm) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.PERSONAL_EDIT.getVelocityPage());
    final RequestData requestData = requestUtil.getRequestData(request);
        final Customer currentCustomer = requestData.getCustomer();
   
    // WE RELOAD THE CUSTOMER FOR THE PERSISTANCE PROXY FILTER
    // IT AVOIDS LazyInitializationException: could not initialize proxy - no Session
    final Customer reloadedCustomer = customerService.getCustomerByLoginOrEmail(currentCustomer.getLogin());
       
View Full Code Here

  }
 
  @RequestMapping(value = FoUrls.PERSONAL_EDIT_URL, method = RequestMethod.POST)
  public ModelAndView submitPersonalEdit(final HttpServletRequest request, @Valid @ModelAttribute("customerEditForm") CustomerEditForm customerEditForm,
                BindingResult result, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final Market currentMarket = requestData.getMarket();
        final MarketArea currentMarketArea = requestData.getMarketArea();
   
    if (result.hasErrors()) {
      return displayPersonalEdit(request, model, customerEditForm);
    }
   
    final String newEmail = customerEditForm.getEmail();
        final Customer currentCustomer = requestData.getCustomer();
    final Customer checkCustomer = customerService.getCustomerByLoginOrEmail(newEmail);
    if(checkCustomer != null
        && !currentCustomer.getEmail().equalsIgnoreCase(newEmail)) {
      final String forgottenPasswordUrl = urlService.generateUrl(FoUrls.FORGOTTEN_PASSWORD, requestData);
      final Object[] objects = {forgottenPasswordUrl};
View Full Code Here

 
    @ModelAttribute(ModelConstants.TITLES)
    public List<ValueBean> getTitles(HttpServletRequest request) throws Exception {
    List<ValueBean> titlesValues = new ArrayList<ValueBean>();
    try {
          final RequestData requestData = requestUtil.getRequestData(request);
          final Locale locale = requestData.getLocale();
         
      final Map<String, String> titles = referentialDataService.getTitlesByLocale(locale);
      if(titles != null){
        Set<String> titlesKey = titles.keySet();
        for (Iterator<String> iterator = titlesKey.iterator(); iterator.hasNext();) {
View Full Code Here

   
    @ModelAttribute(ModelConstants.COUNTRIES)
    public List<ValueBean> getCountries(HttpServletRequest request) throws Exception {
    List<ValueBean> countriesValues = new ArrayList<ValueBean>();
    try {
          final RequestData requestData = requestUtil.getRequestData(request);
          final Locale locale = requestData.getLocale();
         
      final Map<String, String> countries = referentialDataService.getCountriesByLocale(locale);
      if(countries != null){
        Set<String> countriesKey = countries.keySet();
        for (Iterator<String> iterator = countriesKey.iterator(); iterator.hasNext();) {
View Full Code Here

    protected MarketService marketService;
 
  @RequestMapping(value = FoUrls.FOLLOW_US_URL, method = RequestMethod.GET)
  public ModelAndView displayFollowUs(final HttpServletRequest request, final Model model, @ModelAttribute("followUsForm") FollowUsForm followUsForm) throws Exception{
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.FOLLOW_US.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
       
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, FoUrls.FOLLOW_US.getKey());

        // BREADCRUMB
        BreadcrumbViewBean breadcrumbViewBean = new BreadcrumbViewBean();
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.pojo.RequestData

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.