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

Examples of org.hoteia.qalingo.core.web.servlet.ModelAndViewThemeDevice


  @Autowired
  protected CurrencyReferentialService currencyReferentialService;

  @RequestMapping(BoUrls.REFERENCE_DATAS_URL)
  public ModelAndView searchReferenceDatas(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.REFERENCE_DATAS.getVelocityPage());

      // CURRENCY REFERENTIAL
        List<AttributeDefinition> attributeDefinitions = attributeService.findAttributeDefinitions();
        List<AttributeDefinitionViewBean> attributeDefinitionViewBeans = backofficeViewBeanFactory.buildListViewBeanAttributeDefinition(requestUtil.getRequestData(request), attributeDefinitions);
        modelAndView.addObject("attributeDefinitions", attributeDefinitionViewBeans);

    // CURRENCY REFERENTIAL
    List<CurrencyReferential> currencyReferentials = currencyReferentialService.findCurrencyReferentials();
    List<CurrencyReferentialViewBean> currencyReferentialViewBeans = backofficeViewBeanFactory.buildListViewBeanCurrencyReferential(requestUtil.getRequestData(request), currencyReferentials);
    modelAndView.addObject("currencyReferentials", currencyReferentialViewBeans);
   
    // LOCALIZATION
    List<Localization> localizations = localizationService.findLocalizations();
    List<LocalizationViewBean> localizationViewBeans = backofficeViewBeanFactory.buildListViewBeanLocalization(requestUtil.getRequestData(request), localizations);
    modelAndView.addObject("localizations", localizationViewBeans);
   
        return modelAndView;
  }
View Full Code Here


        return modelAndView;
  }
 
  @RequestMapping(value = BoUrls.BATCH_URL, method = RequestMethod.GET)
  public ModelAndView batchSuccessAndError(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.BATCH.getVelocityPage());
   
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
   
    List<BatchProcessObject> batchProcessObjects = batchProcessObjectService.findBatchProcessObjects();//batchProcessObjectService.findBatchProcessObjectsByTypeObject(BatchProcessObjectType.Customer);
    initPaginationResult(request, modelAndView, batchProcessObjects);
    initLinks(request, modelAndView, locale);
   
    EngineSetting springBatchUrlEngineSetting = engineSettingService.getEngineSettingByCode(EngineSettingService.ENGINE_SETTING_CODE_SPRING_BATCH_URL);
    String springBatchUrl = springBatchUrlEngineSetting.getEngineSettingValue(EngineSettingService.ENGINE_SETTING_CONTEXT_CRM).getValue();
    modelAndView.addObject("springBatchUrl", springBatchUrl);
   
    String tab =  request.getParameter(RequestConstants.REQUEST_PARAMETER_TAB);
    /**
     * Save the user selected Tab page, when reset, still stuck in this tag page
     * so that the user experience better. That is, when user can click
     * one time mouse to complete an action, do not let user more than a few
     * mouse clicks to complete the action
     * */
    if(null == tab){
      tab = "0";
    }
    modelAndView.addObject("tab", tab);
   
        return modelAndView;
  }
View Full Code Here

        return batchSuccessAndError(request,model);
  }
 
  @RequestMapping(value = "/batch-customer.html*", method = RequestMethod.GET)
  public ModelAndView batchCustomer(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.BATCH.getVelocityPage());
   
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
   
    List<BatchProcessObject> batchProcessObjects = batchProcessObjectService.findBatchProcessObjects();//batchProcessObjectService.findBatchProcessObjectsByTypeObject(BatchProcessObjectType.Customer);
    initPaginationResult(request, modelAndView, batchProcessObjects);
    initLinks(request, modelAndView, locale);
   
    EngineSetting springBatchUrlEngineSetting = engineSettingService.getEngineSettingByCode(EngineSettingService.ENGINE_SETTING_CODE_SPRING_BATCH_URL);
    String springBatchUrl = springBatchUrlEngineSetting.getEngineSettingValue(EngineSettingService.ENGINE_SETTING_CONTEXT_CRM).getValue();
    modelAndView.addObject("springBatchUrl", springBatchUrl);
   
        return modelAndView;
  }
View Full Code Here

        categoryVirtualFetchPlans.add(new SpecificFetchMode(CatalogCategoryVirtual_.assets.getName()));
    }
   
  @RequestMapping(FoUrls.CATEGORY_AS_AXE_URL)
  public ModelAndView productAxe(final HttpServletRequest request, final Model model, @PathVariable(RequestConstants.URL_PATTERN_CATEGORY_CODE) final String categoryCode) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.CATEGORY_AS_AXE.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);

        final CatalogCategoryVirtual catalogCategory = catalogCategoryService.getVirtualCatalogCategoryByCode(categoryCode, requestData.getVirtualCatalogCode(), requestData.getMasterCatalogCode(), new FetchPlan(categoryVirtualFetchPlans));

        if(catalogCategory != null){
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = "/batch-order.html*", method = RequestMethod.GET)
  public ModelAndView batchOrder(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.BATCH.getVelocityPage());
   
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
   
    List<BatchProcessObject> batchProcessObjects = batchProcessObjectService.findBatchProcessObjectsByTypeObject(BatchProcessObjectType.Order);
    initPaginationResult(request, modelAndView, batchProcessObjects);
    initLinks(request, modelAndView, locale);
   
    EngineSetting springBatchUrlEngineSetting = engineSettingService.getEngineSettingByCode(EngineSettingService.ENGINE_SETTING_CODE_SPRING_BATCH_URL);
    String springBatchUrl = springBatchUrlEngineSetting.getEngineSettingValue(EngineSettingService.ENGINE_SETTING_CONTEXT_CRM).getValue();
    modelAndView.addObject("springBatchUrl", springBatchUrl);
   
        return modelAndView;
  }
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = "/batch-email.html*", method = RequestMethod.GET)
  public ModelAndView batchEmail(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.BATCH.getVelocityPage());
   
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
   
    List<BatchProcessObject> batchProcessObjects = batchProcessObjectService.findBatchProcessObjectsByTypeObject(BatchProcessObjectType.Email);
    initPaginationResult(request, modelAndView, batchProcessObjects);
    initLinks(request, modelAndView, locale);
   
    EngineSetting springBatchUrlEngineSetting = engineSettingService.getEngineSettingByCode(EngineSettingService.ENGINE_SETTING_CODE_SPRING_BATCH_URL);
    String springBatchUrl = springBatchUrlEngineSetting.getEngineSettingValue(EngineSettingService.ENGINE_SETTING_CONTEXT_NOTIFICATION).getValue();
    modelAndView.addObject("springBatchUrl", springBatchUrl);
   
        return modelAndView;
  }
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = "/batch-cms.html*", method = RequestMethod.GET)
  public ModelAndView batchCms(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.BATCH.getVelocityPage());
   
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
   
    List<BatchProcessObject> batchProcessObjects = batchProcessObjectService.findBatchProcessObjectsByTypeObject(BatchProcessObjectType.Cms);
    initPaginationResult(request, modelAndView, batchProcessObjects);
    initLinks(request, modelAndView, locale);
   
    EngineSetting springBatchUrlEngineSetting = engineSettingService.getEngineSettingByCode(EngineSettingService.ENGINE_SETTING_CODE_SPRING_BATCH_URL);
    String springBatchUrl = springBatchUrlEngineSetting.getEngineSettingValue(EngineSettingService.ENGINE_SETTING_CONTEXT_CMS).getValue();
    modelAndView.addObject("springBatchUrl", springBatchUrl);
   
        return modelAndView;
  }
View Full Code Here

        return modelAndView;
  }
 
  @RequestMapping(value = "/batch-stock.html*", method = RequestMethod.GET)
  public ModelAndView batchStock(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.BATCH.getVelocityPage());
   
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
   
    List<BatchProcessObject> batchProcessObjects = batchProcessObjectService.findBatchProcessObjectsByTypeObject(BatchProcessObjectType.Stock);
    initPaginationResult(request, modelAndView, batchProcessObjects);
    initLinks(request, modelAndView, locale);
   
    EngineSetting springBatchUrlEngineSetting = engineSettingService.getEngineSettingByCode(EngineSettingService.ENGINE_SETTING_CODE_SPRING_BATCH_URL);
    String springBatchUrl = springBatchUrlEngineSetting.getEngineSettingValue(EngineSettingService.ENGINE_SETTING_CONTEXT_ERP).getValue();
    modelAndView.addObject("springBatchUrl", springBatchUrl);
   
        return modelAndView;
  }
View Full Code Here

    }
   
  @RequestMapping(value = FoUrls.CATALOG_SEARCH_URL, method = RequestMethod.GET)
  public ModelAndView search(final HttpServletRequest request, final Model model, @Valid SearchForm searchForm) throws Exception {
   
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.CATALOG_SEARCH.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);

        if (StringUtils.isEmpty(searchForm.getText())
                && searchForm.getPage() == 0) {
            return displaySearch(request, model);
        }
       
    String url = requestUtil.getCurrentRequestUrl(request);
   
    String sessionKeyPagedListHolder = "Search_ProductMarketing_PagedListHolder_" + request.getSession().getId();
        String sessionKeyFacet = "Search_ProductMarketing_Facet_" + request.getSession().getId();
        int page = searchForm.getPage() - 1;
        String mode = request.getParameter(Constants.PAGE_VIEW_MODE);
        String sortBy = searchForm.getSortBy();
        String order = searchForm.getOrder();
   
    try {
            PagedListHolder<SearchProductItemViewBean> productsViewBeanPagedListHolder;
        if(searchForm.getPage() == 0){
              ProductMarketingResponseBean productMarketingResponseBean = null;
              if(searchForm.getPrice() != null){
                  productMarketingResponseBean = productMarketingSolrService.searchProductMarketing(ProductMarketingResponseBean.PRODUCT_MARKETING_DEFAULT_SEARCH_FIELD,
                          searchForm.getText(), ProductMarketingResponseBean.PRODUCT_MARKETING_DEFAULT_FACET_FIELD, searchForm.getPrice().getStartValue(), searchForm.getPrice().getEndValue(),
                          searchForm.getCatalogCategoryList());
                  productMarketingResponseBean = productMarketingSolrService.searchProductMarketing(ProductMarketingResponseBean.PRODUCT_MARKETING_DEFAULT_SEARCH_FIELD,
                          searchForm.getText(), ProductMarketingResponseBean.PRODUCT_MARKETING_DEFAULT_FACET_FIELD, searchForm.getPrice().getStartValue(), searchForm.getPrice().getEndValue());
                 
              } else {
                  productMarketingResponseBean = productMarketingSolrService.searchProductMarketing(ProductMarketingResponseBean.PRODUCT_MARKETING_DEFAULT_SEARCH_FIELD,
                                                          searchForm.getText(), ProductMarketingResponseBean.PRODUCT_MARKETING_DEFAULT_FACET_FIELD);
              }
             
              productsViewBeanPagedListHolder = initList(request, sessionKeyPagedListHolder, productMarketingResponseBean, new PagedListHolder<SearchProductItemViewBean>(), searchForm);

              // FACETS
                List<SearchFacetViewBean> facets = frontofficeViewBeanFactory.buildListViewBeanCatalogSearchFacet(requestData, productMarketingResponseBean);
                modelAndView.addObject(AbstractSolrService.SEARCH_FACET_FIELD_LIST, facets);
                request.getSession().setAttribute(sessionKeyFacet, facets);

        } else {
            productsViewBeanPagedListHolder = (PagedListHolder<SearchProductItemViewBean>) request.getSession().getAttribute(sessionKeyPagedListHolder);
           
            // FACETS
                List<SearchFacetViewBean> facets = (List<SearchFacetViewBean>) request.getSession().getAttribute(sessionKeyFacet);
                modelAndView.addObject(AbstractSolrService.SEARCH_FACET_FIELD_LIST, facets);
        }
     
          int pageCurrent = productsViewBeanPagedListHolder.getPage();
          if (pageCurrent < page) {
            for (int i = pageCurrent; i < page; i++) {
              productsViewBeanPagedListHolder.nextPage();
        }
          } else if (pageCurrent > page) {
            for (int i = page; i < pageCurrent; i++) {
              productsViewBeanPagedListHolder.previousPage();
        }
          }
         
      modelAndView.addObject(Constants.PAGINATION_PAGE_URL, url);
      modelAndView.addObject(Constants.PAGINATION_PAGE_PAGED_LIST_HOLDER, productsViewBeanPagedListHolder);
      modelAndView.addObject(Constants.SEARCH_TEXT, searchForm.getText());
      modelAndView.addObject(Constants.PAGINATION_PAGE_SIZE, productsViewBeanPagedListHolder.getPageSize());
      modelAndView.addObject(Constants.PAGINATION_SORT_BY, sortBy);
      modelAndView.addObject(Constants.PAGINATION_ORDER, order);
      modelAndView.addObject(Constants.PRICE_RANGE_PARAMETER, searchForm.getPrice());
      modelAndView.addObject(Constants.CATALOG_CATEGORIES_PARAMETER, searchForm.getCategoriesFilter());
     
    } catch (Exception e) {
      logger.error("SOLR Error", e);
      return displaySearch(request, model);
    }
   
    loadRecentProducts(request, requestData, model, new FetchPlan(categoryVirtualFetchPlans), new FetchPlan(productMarketingFetchPlans), new FetchPlan(productSkuFetchPlans));
       
        final Cart currentCart = requestData.getCart();
        final CartViewBean cartViewBean = frontofficeViewBeanFactory.buildViewBeanCart(requestUtil.getRequestData(request), currentCart);
        modelAndView.addObject(ModelConstants.CART_VIEW_BEAN, cartViewBean);
   
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, FoUrls.CATALOG_SEARCH.getKey());

        return modelAndView;
  }
View Full Code Here

        return modelAndView;
  }
 
    protected ModelAndView displaySearch(final HttpServletRequest request, final Model model) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.CATALOG_SEARCH.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);

        modelAndView.addObject(ModelConstants.SEARCH_FORM, formFactory.buildSearchForm(requestData));

        loadRecentProducts(request, requestData, model, new FetchPlan(categoryVirtualFetchPlans), new FetchPlan(productMarketingFetchPlans), new FetchPlan(productSkuFetchPlans));

        final Cart currentCart = requestData.getCart();
        final CartViewBean cartViewBean = frontofficeViewBeanFactory.buildViewBeanCart(requestUtil.getRequestData(request), currentCart);
        modelAndView.addObject(ModelConstants.CART_VIEW_BEAN, cartViewBean);

        return modelAndView;
    }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.servlet.ModelAndViewThemeDevice

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.