Package org.hoteia.qalingo.core.pojo

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


    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response,
                           Object handler, ModelAndView modelAndView) throws Exception {
       
        try {
            final RequestData requestData = requestUtil.getRequestData(request);
            modelAndView.getModelMap().put(ModelConstants.COMMON_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanCommon(requestData));
           
            final MarketPlace currentMarketPlace = requestData.getMarketPlace();
            final Market currentMarket = requestData.getMarket();
            final MarketArea currentMarketArea = requestData.getMarketArea();
            final Localization currentLocalization = requestData.getMarketAreaLocalization();
            final User user = requestData.getUser();
            final Company company = requestData.getCompany();
           
            if(user != null){
                modelAndView.getModelMap().put(ModelConstants.AUTHENTICATED_USER_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanUser(requestData, user));
            }
           
View Full Code Here


  /**
   *
   */
  @ModelAttribute
  protected void initDefaultSeo(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();

    String seoPageMetaAuthor = getCommonMessage(ScopeCommonMessage.SEO, FoMessageKey.SEO_META_AUTHOR, locale);
        model.addAttribute(ModelConstants.SEO_PAGE_META_AUTHOR, seoPageMetaAuthor);

    String seoPageMetaKeywords = getCommonMessage(ScopeCommonMessage.SEO, FoMessageKey.SEO_META_KEYWORDS, locale);
View Full Code Here

   
    /**
     *
     */
    protected void overrideDefaultSeoPageTitleAndMainContentTitle(final HttpServletRequest request, final ModelAndView modelAndView, final String titleKey, Object[] params) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
        String pageTitleKey = titleKey;
        String headerTitle = "";
        if(params != null){
            headerTitle = getSpecificMessage(ScopeWebMessage.HEADER_TITLE, pageTitleKey, params, locale);
        } else {
View Full Code Here

    }
   
  @RequestMapping(FoUrls.CATEGORY_AS_LINE_URL)
  public ModelAndView productLine(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_LINE.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final Cart currentCart = requestData.getCart();
       
    final CatalogCategoryVirtual catalogCategory = catalogCategoryService.getVirtualCatalogCategoryByCode(categoryCode, requestData.getVirtualCatalogCode(), requestData.getMasterCatalogCode(), new FetchPlan(categoryVirtualFetchPlans));
   
    if(catalogCategory != null){
        final CatalogCategoryViewBean catalogCategoryViewBean = frontofficeViewBeanFactory.buildViewBeanVirtualCatalogCategory(requestUtil.getRequestData(request), catalogCategory,
                                                                                           new FetchPlan(categoryVirtualFetchPlans), new FetchPlan(productMarketingFetchPlans), new FetchPlan(productSkuFetchPlans));
   
View Full Code Here

    protected ServerService serverService;
 
  @RequestMapping(BoUrls.MONITORING_URL)
  public ModelAndView searchMonitoring(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.MONITORING.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
       
    List<ServerStatus> severList = serverService.findServerList();
    modelAndView.addObject("severList", severList);
   
    List<ServerStatus> severStatusList = serverService.findServerStatus();
View Full Code Here

    }
   
  @RequestMapping(value = FoUrls.STORE_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.STORE_SEARCH.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
       
    if (StringUtils.isEmpty(searchForm.getText())
            && searchForm.getPage() == 0) {
      return displaySearch(request, model);
    }

    String url = requestUtil.getCurrentRequestUrl(request);
   
    String sessionKeyPagedListHolder = "Search_Store_PagedListHolder_" + request.getSession().getId();
        String sessionKeyFacet = "Search_Store_Facet_" + request.getSession().getId();
        int page = searchForm.getPage() - 1;
        String mode = request.getParameter(Constants.PAGE_VIEW_MODE);
        String cities = request.getParameter("cities");
        String countries = request.getParameter("countries");
       
        List<String> cityList = new ArrayList<String>();
        if (StringUtils.isEmpty(cities)) {
          cityList = null;
    } else{
      String[] arr = cities.split(",");
      cityList = Arrays.asList(arr);
    }      
        List<String> countryList = new ArrayList<String>();
        if (StringUtils.isEmpty(countries)) {
          countryList = null;
    } else{
      String[] arr = countries.split(",");
      countryList = Arrays.asList(arr);
    }
       
        String sortBy = searchForm.getSortBy();
        String order = searchForm.getOrder();
   
    try {
            PagedListHolder<SearchStoreItemViewBean> storesViewBeanPagedListHolder;
      if(searchForm.getPage() == 0){
              StoreResponseBean storeResponseBean = null;
              List<String> facetFields = Arrays.asList(StoreResponseBean.STORE_DEFAULT_FACET_FIELD,StoreResponseBean.STORE_SECOND_FACET_FIELD);
              storeResponseBean = storeSolrService.searchStore(StoreResponseBean.STORE_DEFAULT_SEARCH_FIELD, searchForm.getText(), facetFields, cityList,countryList);
              StoreResponseBean storeResponBeanNonFilter = storeSolrService.searchStore(StoreResponseBean.STORE_DEFAULT_SEARCH_FIELD, searchForm.getText(), facetFields);
                storesViewBeanPagedListHolder = initList(request, sessionKeyPagedListHolder, storeResponseBean, new PagedListHolder<SearchStoreItemViewBean>(), searchForm);
             
              // FACETS
                List<SearchFacetViewBean> facets = frontofficeViewBeanFactory.buildListViewBeanStoreSearchFacet(requestData, storeResponBeanNonFilter);
              modelAndView.addObject(AbstractSolrService.SEARCH_FACET_FIELD_LIST, facets);
              request.getSession().setAttribute(sessionKeyFacet, facets);
         
      } else {
          storesViewBeanPagedListHolder = (PagedListHolder<SearchStoreItemViewBean>) request.getSession().getAttribute(sessionKeyPagedListHolder);
         
          // FACETS
                List<SearchFacetViewBean> facets = (List<SearchFacetViewBean>) request.getSession().getAttribute(sessionKeyFacet);
                modelAndView.addObject(AbstractSolrService.SEARCH_FACET_FIELD_LIST, facets);
      }
         
          int pageCurrent = storesViewBeanPagedListHolder.getPage();
          if (pageCurrent < page) {
            for (int i = pageCurrent; i < page; i++) {
              storesViewBeanPagedListHolder.nextPage();
        }
          } else if (pageCurrent > page) {
            for (int i = page; i < pageCurrent; i++) {
              storesViewBeanPagedListHolder.previousPage();
        }
          }
         
      modelAndView.addObject(Constants.PAGINATION_PAGE_URL, url);
      modelAndView.addObject(Constants.PAGINATION_PAGE_PAGED_LIST_HOLDER, storesViewBeanPagedListHolder);
      modelAndView.addObject(Constants.SEARCH_TEXT, searchForm.getText());
      modelAndView.addObject(Constants.PAGINATION_PAGE_SIZE, storesViewBeanPagedListHolder.getPageSize());
      modelAndView.addObject(Constants.PAGINATION_SORT_BY, sortBy);
      modelAndView.addObject(Constants.PAGINATION_ORDER, order);
      modelAndView.addObject(Constants.STORE_CITY_PARAMETER, cities);
      modelAndView.addObject(Constants.STORE_COUNTRY_PARAMETER, countries);
     
    } 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.STORE_SEARCH.getKey());
View Full Code Here

        return modelAndView;
  }

    protected ModelAndView displaySearch(final HttpServletRequest request, final Model model) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.STORE_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

    protected MarketService marketService;
   
    @RequestMapping(value = BoUrls.PAYMENT_GATEWAY_LIST_URL, method = RequestMethod.GET)
    public ModelAndView paymentGatewayList(final HttpServletRequest request, final Model model) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.PAYMENT_GATEWAY_LIST.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea marketArea = requestData.getMarketArea();
       
        displayList(request, model, requestData);
       
        Object[] params = {marketArea.getName() + " (" + marketArea.getCode() + ")"};
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.PAYMENT_GATEWAY_LIST.getKey(), params);
View Full Code Here

    /**
     *
     */
    @ModelAttribute("searchForm")
    protected SearchForm getSearchForm(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        return formFactory.buildSearchForm(requestData);
    }
View Full Code Here

    }
   
    @RequestMapping(value = BoUrls.PAYMENT_GATEWAY_DETAILS_URL, method = RequestMethod.GET)
    public ModelAndView paymentGatewayDetails(final HttpServletRequest request, final Model model) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.PAYMENT_GATEWAY_DETAILS.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String currentPaymentGatewayCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_PAYMENT_GATEWAY_CODE);
       
        // SANITY CHECK
        if(StringUtils.isEmpty(currentPaymentGatewayCode)){
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.