Package org.hoteia.qalingo.core.domain

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


  public String buildChangeContextUrl(final RequestData requestData) throws Exception {
    final MarketPlace marketPlace = requestData.getMarketPlace();
    final Market market = requestData.getMarket();
    final MarketArea marketArea = requestData.getMarketArea();
    final Localization localization = requestData.getMarketAreaLocalization();
    final Retailer retailer = requestData.getMarketAreaRetailer();
   
    String url = buildDefaultPrefix(requestData) + BoUrls.CHANGE_CONTEXT.getUrlWithoutWildcard() + "?";
    url = url + RequestConstants.REQUEST_PARAMETER_MARKET_PLACE_CODE + "=" + handleParamValue(marketPlace.getCode());
    url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_CODE + "=" + handleParamValue(market.getCode());
    url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_CODE + "=" + handleParamValue(marketArea.getCode());
    url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_RETAILER_CODE + "=" + handleParamValue(retailer.getCode());
        url = url + "&" + RequestConstants.REQUEST_PARAMETER_MARKET_AREA_LANGUAGE + "=" + handleParamValue(localization.getCode());
    return url;
  }
View Full Code Here


                            && !urlWithoutWildcard.equals(BoUrls.PERSONAL_DETAILS.getUrlWithoutWildcard()) && !urlWithoutWildcard.equals(BoUrls.PERSONAL_EDIT.getUrlWithoutWildcard())) {
                        User user = (User) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_USER_CODE, handleParamValue(user.getLogin()));
                        break;
                    } else if (param instanceof Retailer){
                      Retailer retailer = (Retailer) param;
                      getParams.put(RequestConstants.REQUEST_PARAMETER_RETAILER_CODE, handleParamValue(retailer.getCode()));
                      break;
                    } else if (param instanceof Store){
                        Store store = (Store) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_STORE_CODE, handleParamValue(store.getCode()));
                        break;
View Full Code Here

        if (StringUtils.isEmpty(retailerCode)) {
            final String urlRedirect = backofficeUrlService.generateUrl(BoUrls.RETAILER_LIST, requestData);
            return new ModelAndView(new RedirectView(urlRedirect));
        }

        final Retailer retailer = retailerService.getRetailerByCode(retailerCode);

        displayList(request, model, requestData, null);

        Object[] params = {retailer.getName() + " (" + retailer.getCode() + ")"};
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.STORE_LIST.getKey() + ".by.retailer", params);

        model.addAttribute(ModelConstants.URL_ADD, backofficeUrlService.generateUrl(BoUrls.STORE_ADD, requestData, retailer));
        model.addAttribute(ModelConstants.URL_RETAILER_VIEW, backofficeUrlService.generateUrl(BoUrls.RETAILER_DETAILS, requestData, retailer));
View Full Code Here

        if(StringUtils.isNotEmpty(storeForm.getId())){
            store = retailerService.getStoreById(storeForm.getId());
        }

        final String retailerCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_RETAILER_CODE);
        Retailer retailer = null;
        if(StringUtils.isNotEmpty(retailerCode)){
            retailer = retailerService.getRetailerByCode(retailerCode, FetchPlanGraphRetailer.fullStoreFetchPlan());
        }

        try {
View Full Code Here

      List<ValueBean> retailerValues = new ArrayList<ValueBean>();
      try {
        List<Retailer> retailers = retailerService.findAllRetailers();
          if(retailers != null){
            for (Iterator<Retailer> iterator = retailers.iterator(); iterator.hasNext();) {
              Retailer retailerIt = (Retailer) iterator.next();
                final String retailerId = retailerIt.getId().toString();
                retailerValues.add(new ValueBean(retailerId, retailerIt.getName()));
            }
            Collections.sort(retailerValues, new Comparator<ValueBean>() {
          @Override
          public int compare(ValueBean o1, ValueBean o2) {
            return o1.getValue().compareTo(o2.getValue());
View Full Code Here

        if (StringUtils.isEmpty(retailerCode)) {
            final String urlRedirect = backofficeUrlService.generateUrl(BoUrls.RETAILER_LIST, requestData);
            return new ModelAndView(new RedirectView(urlRedirect));
        }

        final Retailer retailer = retailerService.getRetailerByCode(retailerCode, FetchPlanGraphRetailer.fullRetailerFetchPlan());

        // SANITY CHECK
        if (retailer != null) {
            modelAndView.addObject(ModelConstants.RETAILER_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanRetailer(requestData, retailer));
        } else {
            final String url = requestUtil.getLastRequestUrl(request);
            return new ModelAndView(new RedirectView(url));
        }

        model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.RETAILER_LIST, requestData));

        Object[] params = { retailer.getName() + " (" + retailer.getCode() + ")" };
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.RETAILER_DETAILS.getKey(), params);

        return modelAndView;
  }
View Full Code Here

        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String retailerCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_RETAILER_CODE);
        if(StringUtils.isNotEmpty(retailerCode)){
            // EDIT MODE
            final Retailer retailer = retailerService.getRetailerByCode(retailerCode, FetchPlanGraphRetailer.fullRetailerFetchPlan());

            // SANITY CHECK
            if (retailer != null) {
                modelAndView.addObject(ModelConstants.RETAILER_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanRetailer(requestData, retailer));
            } else {
                final String url = requestUtil.getLastRequestUrl(request);
                return new ModelAndView(new RedirectView(url));
            }
           
            model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.RETAILER_DETAILS, requestData, retailer));

            Object[] params = { retailer.getName() + " (" + retailer.getCode() + ")" };
            overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.RETAILER_DETAILS.getKey(), params);

        } else {
            // ADD MODE
View Full Code Here

       
        if (result.hasErrors()) {
            return retailerEdit(request, model, retailerForm);
        }
       
        Retailer retailer = null;
        if(StringUtils.isNotEmpty(retailerForm.getId())){
            retailer = retailerService.getRetailerById(retailerForm.getId());
        }
       
        try {
            // CREATE OR UPDATE RETAILER
            Retailer savedRetailer = webBackofficeService.createOrUpdateRetailer(retailer, retailerForm);
           
            if(retailer == null){
                addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.RETAILER, "create_success_message", locale));
               
            } else {
View Full Code Here

        }
  }

  private void displayList(final HttpServletRequest request, final Model model, final RequestData requestData, List<Retailer> retailers) throws Exception{
    final MarketArea marketArea = requestData.getMarketArea();
    final Retailer retailer = requestData.getMarketAreaRetailer();
   
    String url = request.getRequestURI();
    String page = request.getParameter(Constants.PAGINATION_PAGE_PARAMETER);
   
    PagedListHolder<RetailerViewBean> retailerViewBeanPagedListHolder = new PagedListHolder<RetailerViewBean>();

         if(retailers == null){
        retailers = retailerService.findRetailers(marketArea.getId(), retailer.getId());
      }
        
        if(StringUtils.isEmpty(page)){
          retailerViewBeanPagedListHolder = initList(request, SESSION_KEY, requestData, retailers);
       
View Full Code Here

  private PagedListHolder<RetailerViewBean> initList(final HttpServletRequest request, String sessionKey, final RequestData requestData, final List<Retailer> retailers) throws Exception {
    PagedListHolder<RetailerViewBean> retailerViewBeanPagedListHolder = new PagedListHolder<RetailerViewBean>();
   
    final List<RetailerViewBean> RetailerViewBeans = new ArrayList<RetailerViewBean>();
    for (Iterator<Retailer> iterator = retailers.iterator(); iterator.hasNext();) {
      Retailer retailerIt = (Retailer) iterator.next();
      RetailerViewBeans.add(backofficeViewBeanFactory.buildViewBeanRetailer(requestData, retailerIt));
    }
    retailerViewBeanPagedListHolder = new PagedListHolder<RetailerViewBean>(RetailerViewBeans);
    retailerViewBeanPagedListHolder.setPageSize(Constants.PAGE_SIZE);
        request.getSession().setAttribute(sessionKey, retailerViewBeanPagedListHolder);
View Full Code Here

TOP

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

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.