Package org.hoteia.qalingo.core.pojo

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


    @Autowired
    private CatalogCategoryService catalogCategoryService;
   
    @RequestMapping(value = "/**/search-load-catalog-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();
        final Retailer retailer = requestData.getMarketAreaRetailer();

        List<ProductMarketing> products = productService.findProductMarketings();
        for (Iterator<ProductMarketing> iteratorProductMarketing = products.iterator(); iteratorProductMarketing.hasNext();) {
            ProductMarketing productMarketing = (ProductMarketing) iteratorProductMarketing.next();
            for (Iterator<ProductSku> iteratorProductSku = productMarketing.getProductSkus().iterator(); iteratorProductSku.hasNext();) {
View Full Code Here


  public ModelAndView productDetails(final HttpServletRequest request, final HttpServletResponse response ,final Model model, @PathVariable(RequestConstants.URL_PATTERN_CATEGORY_CODE) final String categoryCode,
                      @PathVariable(RequestConstants.URL_PATTERN_PRODUCT_MARKETING_CODE) final String productMarketingCode,
                      @PathVariable(RequestConstants.URL_PATTERN_PRODUCT_SKU_CODE) final String productSkuCode,
                      @ModelAttribute(ModelConstants.PRODUCT_COMMENT_FORM) ProductCommentForm productCommentForm) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.PRODUCT_DETAILS.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);

    CatalogCategoryVirtual catalogCategory = catalogCategoryService.getVirtualCatalogCategoryByCode(categoryCode, requestData.getVirtualCatalogCode(), requestData.getMasterCatalogCode());
    ProductMarketing productMarketing = productService.getProductMarketingByCode(productMarketingCode, new FetchPlan(productMarketingFetchPlans));
        ProductSku productSku = productService.getProductSkuByCode(productSkuCode, new FetchPlan(productSkuFetchPlans));
   
    final CatalogCategoryViewBean catalogCategoryViewBean = frontofficeViewBeanFactory.buildViewBeanVirtualCatalogCategory(requestUtil.getRequestData(request), catalogCategory,
                                                                                       new FetchPlan(categoryVirtualFetchPlans), new FetchPlan(productMarketingFetchPlans), new FetchPlan(productSkuFetchPlans));
    model.addAttribute(ModelConstants.CATALOG_CATEGORY_VIEW_BEAN, catalogCategoryViewBean);

        final ProductMarketingViewBean productMarketingViewBean = frontofficeViewBeanFactory.buildViewBeanProductMarketing(requestUtil.getRequestData(request), catalogCategory, productMarketing, productSku);
        model.addAttribute(ModelConstants.PRODUCT_MARKETING_VIEW_BEAN, productMarketingViewBean);
       
        final CatalogBreadcrumbViewBean catalogBreadcrumbViewBean = frontofficeViewBeanFactory.buildViewBeanCatalogBreadcrumb(requestUtil.getRequestData(request) , catalogCategory);
    model.addAttribute(ModelConstants.CATALOG_BREADCRUMB_VIEW_BEAN, catalogBreadcrumbViewBean);

        //for now, get the featured products in same category
        //TODO: define related products
        final List<ProductMarketingViewBean> relatedProducts = catalogCategoryViewBean.getFeaturedProductMarketings();
        model.addAttribute(ModelConstants.RELATED_PPRODUCT_MARKETING_VIEW_BEAN, relatedProducts);
       
        final CustomerProductRatesViewBean customerProductRatesViewBean = productService.getProductMarketingCustomerRateDetails(productMarketing.getId());
        model.addAttribute(ModelConstants.CUSTOMER_PRODUCT_RATES_VIEW_BEAN, customerProductRatesViewBean);
       
        //Check if has authorized user
        if(requestData.getCustomer() != null){
          productCommentForm = formFactory.buildProductCommentForm(requestData, productMarketing);
          model.addAttribute(ModelConstants.PRODUCT_COMMENT_FORM, productCommentForm);
          model.addAttribute(ModelConstants.PRODUCT_COMMENT_SUBMIT_URL, urlService.generateUrl(FoUrls.PRODUCT_COMMENT, requestData, productMarketing));
        }
       
View Full Code Here

    @Autowired
    protected DocumentService documentService;

    @RequestMapping(value = "/documents/**", method = RequestMethod.GET)
    public ResponseEntity<byte[]> customerDetails(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final String requestURL = request.getRequestURL().toString();
        final Customer customer = requestData.getCustomer();

        if (customer != null) {
            final List<OrderCustomer> orders = orderCustomerService.findOrdersByCustomerId(customer.getId().toString());
            for (Iterator<OrderCustomer> iterator = orders.iterator(); iterator.hasNext();) {
                OrderCustomer order = (OrderCustomer) iterator.next();
View Full Code Here

public class CustomerProductCommentController extends AbstractCustomerController {

  @RequestMapping(FoUrls.PERSONAL_PRODUCT_COMMENT_LIST_URL)
  public ModelAndView customerProductComments(final HttpServletRequest request, final Model model) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.PERSONAL_PRODUCT_COMMENT_LIST.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

    @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, frontofficeViewBeanFactory.buildViewBeanCommon(requestData));
           
            final Customer customer = requestData.getCustomer();
            if(customer != null){
                modelAndView.getModelMap().put(ModelConstants.CUSTOMER_VIEW_BEAN, frontofficeViewBeanFactory.buildViewBeanCustomer(requestData, customer));
            }
           
            modelAndView.getModelMap().put(ModelConstants.LEGAl_TERMS_VIEW_BEAN, frontofficeViewBeanFactory.buildViewBeanLegalTerms(requestData));
View Full Code Here

            final Market reloadedMarket = marketService.getMarketById(marketPlaceNavigation.getDefaultMarket().getId().toString());
            final MarketArea defaultMarketArea = marketService.getMarketAreaByCode(reloadedMarket.getDefaultMarketArea().getCode());
            final Localization defaultLocalization = defaultMarketArea.getDefaultLocalization();
            final Retailer defaultRetailer = defaultMarketArea.getDefaultRetailer();
           
            RequestData requestDataForThisMarketPlace = new RequestData();
            BeanUtils.copyProperties(requestData, requestDataForThisMarketPlace);
            requestDataForThisMarketPlace.setMarketPlace(marketPlaceNavigation);
            requestDataForThisMarketPlace.setMarket(reloadedMarket);
            requestDataForThisMarketPlace.setMarketArea(defaultMarketArea);
            requestDataForThisMarketPlace.setMarketAreaLocalization(defaultLocalization);
            requestDataForThisMarketPlace.setMarketAreaRetailer(defaultRetailer);
           
            marketPlaceViewBeans.add(buildViewBeanMarketPlace(requestDataForThisMarketPlace, marketPlaceNavigation));
        }
        return marketPlaceViewBeans;
    }
View Full Code Here

                // RELOAD THE MARKET TO KEEP AN ENTITY WITH RIGHT FETCHS
                final MarketArea defaultMarketArea = marketService.getMarketAreaByCode(marketNavigationReloaded.getDefaultMarketArea().getCode());
                final Localization defaultLocalization = defaultMarketArea.getDefaultLocalization();
                final Retailer defaultRetailer = defaultMarketArea.getDefaultRetailer();

                RequestData requestDataForThisMarket = new RequestData();
                BeanUtils.copyProperties(requestData, requestDataForThisMarket);
                requestDataForThisMarket.setMarket(marketNavigationReloaded);
                requestDataForThisMarket.setMarketArea(defaultMarketArea);
                requestDataForThisMarket.setMarketAreaLocalization(defaultLocalization);
                requestDataForThisMarket.setMarketAreaRetailer(defaultRetailer);

                marketViewBeans.add(buildViewBeanMarket(requestDataForThisMarket, marketNavigationReloaded));
               
            } else {
                logger.warn("This market, " + marketNavigation.getCode() + ", doesn't have a default MarketArea! This a mandatory value!");
View Full Code Here

public class LegalTermsController extends AbstractBackofficeQalingoController {

  @RequestMapping(BoUrls.LEGAL_TERMS_URL)
  public ModelAndView legalTerms(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.LEGAL_TERMS.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final Locale locale = requestData.getLocale();
   
    final String pageKey = BoUrls.LEGAL_TERMS_KEY;
    final String title = getSpecificMessage(ScopeWebMessage.SEO, getMessageTitleKey(pageKey), locale);
    overrideSeoTitle(request, modelAndView, title);
   
View Full Code Here

@Controller("changeContextController")
public class ChangeContextController extends AbstractBackofficeQalingoController {

  @RequestMapping(BoUrls.CHANGE_LANGUAGE_URL)
  public ModelAndView changeLanguage(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        String redirectUrl = backofficeUrlService.generateUrl(getTargetUrl(requestData), true, requestData);
        RedirectView redirectView = new RedirectView(redirectUrl);
        redirectView.setExposeModelAttributes(false);
        return new ModelAndView(redirectView);
  }
View Full Code Here

        return new ModelAndView(redirectView);
  }
 
  @RequestMapping(BoUrls.CHANGE_CONTEXT_URL)
  public ModelAndView changeContext(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        String redirectUrl = backofficeUrlService.generateUrl(getTargetUrl(requestData), true, requestData);
        RedirectView redirectView = new RedirectView(redirectUrl);
        redirectView.setExposeModelAttributes(false);
        return new ModelAndView(redirectView);
  }
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.