Package org.hoteia.qalingo.core.domain

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


     *
     */
    @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_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);
    }
   
View Full Code Here

        } catch (Exception e) {
        model.addAttribute(ModelConstants.PRICE_SCORE_MAX, 5);
        }
   
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea currentMarketArea = requestData.getMarketArea();
        final Retailer currentRetailer = requestData.getMarketAreaRetailer();
       
    ProductMarketing productMarketing = productService.getProductMarketingByCode(productCode);
   
    if(productCommentForm == null
View Full Code Here

  @RequestMapping(value = FoUrls.PRODUCT_COMMENT_URL, method = RequestMethod.POST)
  public ModelAndView submitProductComment(final HttpServletRequest request, @PathVariable(RequestConstants.URL_PATTERN_PRODUCT_MARKETING_CODE) final String productCode,
                       @Valid @ModelAttribute(ModelConstants.PRODUCT_COMMENT_FORM) ProductCommentForm productCommentForm,
                BindingResult result, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea currentMarketArea = requestData.getMarketArea();
        final Retailer currentRetailer = requestData.getMarketAreaRetailer();
        final Locale locale = requestData.getLocale();
       
        //binding form
        bindProductCommentForm(request, productCommentForm);
View Full Code Here

  @RequestMapping(value = FoUrls.PERSONAL_ADD_ADDRESS_URL, method = RequestMethod.POST)
  public ModelAndView submitCustomerAddAddress(final HttpServletRequest request, @Valid @ModelAttribute("customerAddressForm") CustomerAddressForm customerAddressForm,
                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 displayCustomerAddAddress(request, model, customerAddressForm);
    }
   
View Full Code Here

  @RequestMapping(value = FoUrls.PERSONAL_EDIT_ADDRESS_URL, method = RequestMethod.POST)
  public ModelAndView submitCustomerEditAddress(final HttpServletRequest request, @Valid @ModelAttribute("customerAddressForm") CustomerAddressForm customerAddressForm,
                          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 displayCustomerEditAddress(request, model, customerAddressForm);
    }
   
View Full Code Here

 
  @RequestMapping(FoUrls.BRAND_LINE_URL)
  public ModelAndView brandLine(final HttpServletRequest request, final Model model, @PathVariable(RequestConstants.URL_PATTERN_BRAND_CODE) final String brandCode) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.BRAND_LINE.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea currentMarketArea = requestData.getMarketArea();
       
    final ProductBrand productBrand = productService.getProductBrandByCode(brandCode);
   
    List<ProductMarketing>  productMarketings = productService.findProductMarketingsByBrandId(currentMarketArea.getId(), productBrand.getId());
    final ProductBrandViewBean productBrandViewBean = frontofficeViewBeanFactory.buildViewBeanProductBrand(requestUtil.getRequestData(request), productBrand, productMarketings);
    model.addAttribute("productBrand", productBrandViewBean);
   
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, FoUrls.BRAND_LINE.getKey());
View Full Code Here

  @RequestMapping(value = FoUrls.CUSTOMER_CREATE_ACCOUNT_URL, method = RequestMethod.POST)
  public ModelAndView customerCreateAccount(final HttpServletRequest request, final Model model, @Valid @ModelAttribute(ModelConstants.FRONTOFFICE_CREATE_ACCOUNT_FORM) CreateAccountForm createAccountForm,
                BindingResult result) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final Market currentMarket = requestData.getMarket();
        final MarketArea currentMarketArea = requestData.getMarketArea();

    // SANITY CHECK: Customer logged
        final Customer currentCustomer = requestData.getCustomer();
    if(currentCustomer != null){
      final String url = urlService.generateUrl(FoUrls.PERSONAL_DETAILS,requestUtil.getRequestData(request));
View Full Code Here

    @RequestMapping(value = FoUrls.CART_CREATE_ACCOUNT_URL, method = RequestMethod.POST)
    public ModelAndView checkoutCreateAccount(final HttpServletRequest request, final Model model, @Valid @ModelAttribute(ModelConstants.FRONTOFFICE_CREATE_ACCOUNT_FORM) CreateAccountForm createAccountForm,
                                BindingResult result) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        final Market currentMarket = requestData.getMarket();
        final MarketArea currentMarketArea = requestData.getMarketArea();

        // SANITY CHECK: Customer logged
        final Customer currentCustomer = requestData.getCustomer();
        if(currentCustomer != null){
            final String url = urlService.generateUrl(FoUrls.CART_DELIVERY,requestUtil.getRequestData(request));
View Full Code Here

                // INJECT BACKOFFICE URLS
                CartItem cartItem = (CartItem) event.getSourceObject();
                FoCartItemPojo cartItemPojo = (FoCartItemPojo) event.getDestinationObject();
                try {
                    final RequestData requestData = requestUtil.getRequestData(httpServletRequest);
                    final MarketArea marketArea = requestData.getMarketArea();
                    final Retailer retailer = requestData.getMarketAreaRetailer();
                    final Localization localization = requestData.getMarketAreaLocalization();
                    final String localizationCode = localization.getCode();
                   
                    final Asset defaultPackshotImage = cartItem.getProductSku().getDefaultPackshotImage(ImageSize.SMALL.name());
                    if (defaultPackshotImage != null) {
                        String summaryImage = engineSettingService.getProductMarketingImageWebPath(defaultPackshotImage);
                        cartItemPojo.setSummaryImage(summaryImage);
                    } else {
                        cartItemPojo.setSummaryImage("");
                    }
                   
                    cartItemPojo.setI18nName(cartItem.getProductSku().getI18nName(localizationCode));
                   
                    cartItemPojo.setProductDetailsUrl(urlService.generateUrl(FoUrls.PRODUCT_DETAILS, requestData, cartItem.getCatalogCategory(), cartItem.getProductMarketing(), cartItem.getProductSku()));

                    cartItemPojo.setPriceWithStandardCurrencySign(cartItem.getPriceWithStandardCurrencySign(marketArea.getId(), retailer.getId()));
                    cartItemPojo.setTotalAmountWithStandardCurrencySign(cartItem.getTotalAmountWithStandardCurrencySign(marketArea.getId(), retailer.getId()));

                } catch (Exception e) {
                    logger.error("postWritingDestinationValue error with FoCartItemPojo", e);
                }
            }
        } else if(event.getDestinationObject() instanceof ProductSkuPojo){
            if(event.getFieldMap().getDestFieldName().equals("code")){
                // INJECT BACKOFFICE URLS
                ProductSku productSku = (ProductSku) event.getSourceObject();
                ProductSkuPojo productSkuPojo = (ProductSkuPojo) event.getDestinationObject();
                try {
                    final RequestData requestData = requestUtil.getRequestData(httpServletRequest);
                    final MarketArea marketArea = requestData.getMarketArea();
                    final Retailer retailer = requestData.getMarketAreaRetailer();
                    final Localization localization = requestData.getMarketAreaLocalization();
                    final String localizationCode = localization.getCode();
                   
                    final Asset defaultPackshotImage = productSku.getDefaultPackshotImage(ImageSize.SMALL.name());
                    if (defaultPackshotImage != null) {
                        String summaryImage = engineSettingService.getProductMarketingImageWebPath(defaultPackshotImage);
                        productSkuPojo.setDefaultPackshotImage(summaryImage);
                    } else {
                        productSkuPojo.setDefaultPackshotImage("");
                    }
                   
                    productSkuPojo.setI18nName(productSku.getI18nName(localizationCode));
                   
                    ProductSkuPrice price = productSku.getPrice(marketArea.getId(), retailer.getId());
                    if(price != null){
                        productSkuPojo.setPriceWithStandardCurrencySign(price.getPriceWithStandardCurrencySign());
                    }

                } catch (Exception e) {
View Full Code Here

TOP

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

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.