Package org.hoteia.qalingo.core.domain

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


   
    /**
     *
     */
    public void buildAndSaveNewOrderConfirmationMail(final RequestData requestData, final Customer customer, final OrderCustomer order) throws Exception {
        final MarketArea marketArea = requestData.getMarketArea();
        final String contextNameValue = requestData.getContextNameValue();
        final String velocityPath = requestData.getVelocityEmailPrefix();

        final OrderConfirmationEmailBean orderConfirmationEmailBean = new OrderConfirmationEmailBean();
        orderConfirmationEmailBean.setFromAddress(marketArea.getEmailFromAddress(contextNameValue, Email.EMAIl_TYPE_RESET_PASSWORD_CONFIRMATION));
        orderConfirmationEmailBean.setFromName(marketArea.getEmailFromName(contextNameValue, Email.EMAIl_TYPE_RESET_PASSWORD_CONFIRMATION));
        orderConfirmationEmailBean.setReplyToEmail(marketArea.getEmailFromAddress(contextNameValue, Email.EMAIl_TYPE_RESET_PASSWORD_CONFIRMATION));
        orderConfirmationEmailBean.setToEmail(customer.getEmail());
       
        if (order != null) {
            orderConfirmationEmailBean.setOrderNumber(order.getOrderNum());
           
View Full Code Here


       
        emailService.buildAndSaveNewOrderConfirmationMail(requestData, customer, velocityPath, orderConfirmationEmailBean);
    }
   
    protected Customer checkCustomerMarketArea(final RequestData requestData, Customer customer) throws Exception{
        final MarketArea marketArea = requestData.getMarketArea();
        CustomerMarketArea customerMarketArea = customer.getCurrentCustomerMarketArea(marketArea.getId());
        if(customerMarketArea == null){
            // Create a CustomerMarketArea for this MarketArea
            customerMarketArea = new CustomerMarketArea();
            customerMarketArea.setMarketAreaId(marketArea.getId());
            customer.getCustomerMarketAreas().add(customerMarketArea);
            customerService.saveOrUpdateCustomer(customer);
            if(StringUtils.isNotEmpty(customer.getEmail())){
                customer = customerService.getCustomerByLoginOrEmail(customer.getEmail());
            }
View Full Code Here

   
    /**
     *
     */
    public void buildAndSaveUserNewAccountMail(final RequestData requestData, final UserForm userForm) throws Exception {
        final MarketArea marketArea = requestData.getMarketArea();
        final String contextNameValue = requestData.getContextNameValue();

        final UserNewAccountConfirmationEmailBean userNewAccountConfirmationEmailBean = new UserNewAccountConfirmationEmailBean();
        BeanUtils.copyProperties(userForm, userNewAccountConfirmationEmailBean);
        userNewAccountConfirmationEmailBean.setFromAddress(marketArea.getEmailFromAddress(contextNameValue, Email.EMAIl_TYPE_NEW_ACCOUNT_CONFIRMATION));
        userNewAccountConfirmationEmailBean.setFromName(marketArea.getEmailFromName(contextNameValue, Email.EMAIl_TYPE_NEW_ACCOUNT_CONFIRMATION));
        userNewAccountConfirmationEmailBean.setReplyToEmail(marketArea.getEmailFromAddress(contextNameValue, Email.EMAIl_TYPE_NEW_ACCOUNT_CONFIRMATION));
        userNewAccountConfirmationEmailBean.setToEmail(userForm.getEmail());

        userNewAccountConfirmationEmailBean.setTitle(userForm.getTitle());
        userNewAccountConfirmationEmailBean.setFirstname(userForm.getFirstname());
        userNewAccountConfirmationEmailBean.setLastname(userForm.getLastname());
View Full Code Here

    @RequestMapping(value = BoUrls.TAX_LIST_URL, method = RequestMethod.GET)
    public ModelAndView taxList(final HttpServletRequest request, final Model model) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.TAX_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.TAX_LIST.getKey() + ".by.market.area", params);

        model.addAttribute(ModelConstants.URL_ADD, backofficeUrlService.generateUrl(BoUrls.TAX_ADD, requestData));

        return modelAndView;
View Full Code Here

        model.addAttribute(Constants.PAGINATION_PAGE_URL, url);
        model.addAttribute(Constants.PAGINATION_PAGE_PAGED_LIST_HOLDER, taxViewBeanPagedListHolder);
    }
   
    protected PagedListHolder<TaxViewBean> initList(final HttpServletRequest request, String sessionKey, final RequestData requestData) throws Exception {
        final MarketArea marketArea = requestData.getMarketArea();
        List<Tax> taxs = taxService.findTaxesByMarketAreaId(marketArea.getId());

        PagedListHolder<TaxViewBean> TaxViewBeanPagedListHolder = new PagedListHolder<TaxViewBean>();
       
        final List<TaxViewBean> TaxViewBeans = new ArrayList<TaxViewBean>();
        for (Iterator<Tax> iterator = taxs.iterator(); iterator.hasNext();) {
View Full Code Here

  protected final Logger logger = LoggerFactory.getLogger(getClass());
 
  public String buildChangeLanguageUrl(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_LANGUAGE.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

  }
 
  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

   
    public List<Retailer> findRetailersByMarketAreaCode(final String marketAreaCode, Object... params) {
        Criteria criteria = createDefaultCriteria(MarketArea.class);
       
        criteria.add(Restrictions.eq("code", handleCodeValue(marketAreaCode)));
        MarketArea marketArea = (MarketArea) criteria.uniqueResult();

        List<Retailer> retailers = new ArrayList<Retailer>(marketArea.getRetailers());
        return retailers;
  }
View Full Code Here

  @RequestMapping(value = FoUrls.RETAILER_CONTACT_URL, method = RequestMethod.GET)
  public ModelAndView displayContactForm(final HttpServletRequest request, @PathVariable(RequestConstants.URL_PATTERN_RETAILER_CODE) final String retailerCode,
                       Model model, @ModelAttribute("retailerContactForm") RetailerContactForm retailerContactForm) throws Exception {
    ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.RETAILER_CONTACT.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
        final MarketArea currentMarketArea = requestData.getMarketArea();
        final Retailer currentRetailer = requestData.getMarketAreaRetailer();
   
    modelAndView.addObject(ModelConstants.URL_BACK, urlService.generateUrl(FoUrls.HOME, requestUtil.getRequestData(request)));
   
    Retailer retailer = retailerService.getRetailerByCode(currentMarketArea.getId(), currentRetailer.getId(), retailerCode);

    // SANITY CHECK
    if(retailer.getDefaultAddress() == null
        || StringUtils.isEmpty(retailer.getDefaultAddress().getEmail())){
      final String url = urlService.generateUrl(FoUrls.RETAILER_DETAILS, requestUtil.getRequestData(request), retailer);
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();
   
    Retailer retailer = retailerService.getRetailerByCode(currentMarketArea.getId(), currentRetailer.getId(), retailerCode);
   
    if(retailerCommentForm == null
          || retailerCommentForm.equals(new RetailerCommentForm())){
      retailerCommentForm = formFactory.buildRetailerCommentForm(requestData, retailer);
      model.addAttribute("retailerContactForm", retailerCommentForm);
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.