Package org.hoteia.qalingo.core.web.mvc.viewbean

Examples of org.hoteia.qalingo.core.web.mvc.viewbean.StoreViewBean


        return retailerViewBean;
    }

    @Override
    public StoreViewBean buildViewBeanStore(RequestData requestData, Store store) throws Exception {
        final StoreViewBean storeViewBean = super.buildViewBeanStore(requestData, store);
       
        storeViewBean.setDetailsUrl(backofficeUrlService.generateUrl(BoUrls.STORE_DETAILS, requestData, store));
        storeViewBean.setEditUrl(backofficeUrlService.generateUrl(BoUrls.STORE_EDIT, requestData, store));
       
        return storeViewBean;
    }
View Full Code Here


       
    if(StringUtils.isNotEmpty(storeCode)){
          Store store = retailerService.getStoreByCode(storeCode);
          final List<Store> stores = retailerService.findStores();
          final List<StoreViewBean> otherStoreViewBeans = frontofficeViewBeanFactory.buildListViewBeanStore(requestUtil.getRequestData(request), stores);
          StoreViewBean storeViewBean = frontofficeViewBeanFactory.buildViewBeanStore(requestUtil.getRequestData(request), store);
          StoreBusinessHourViewBean storeBusinessHourViewBean = frontofficeViewBeanFactory.buildViewBeanStoreBusinessHour(store);
          otherStoreViewBeans.remove(storeViewBean);
          model.addAttribute(ModelConstants.STORE_VIEW_BEAN, storeViewBean);
         
          model.addAttribute("otherStores", otherStoreViewBeans);
          model.addAttribute("businessHours", storeBusinessHourViewBean);
         
          model.addAttribute("withMap", true);
         
          Object[] params = {storeViewBean.getI18nName()};
          overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, FoUrls.STORE_DETAILS.getKey(), params);

            // BREADCRUMB
            BreadcrumbViewBean breadcrumbViewBean = new BreadcrumbViewBean();
            breadcrumbViewBean.setName(getSpecificMessage(ScopeWebMessage.HEADER_TITLE, "store_details", params, locale));
View Full Code Here

        Set<Store> stores = retailer.getStores();
        if (Hibernate.isInitialized(stores) &&
                stores != null) {
            for (Iterator<Store> iterator = stores.iterator(); iterator.hasNext();) {
                Store store = (Store) iterator.next();
                StoreViewBean storeViewBean = buildViewBeanStore(requestData, store);
                retailerViewBean.getStores().add(storeViewBean);
            }
        }

        final String contextNameValue = requestUtil.getCurrentContextNameValue(request);
View Full Code Here

     *
     */
    public StoreViewBean buildViewBeanStore(final RequestData requestData, final Store store) throws Exception {
        final Localization localization = requestData.getMarketAreaLocalization();

        final StoreViewBean storeViewBean = new StoreViewBean();
        storeViewBean.setCode(store.getCode());
        storeViewBean.setName(store.getName());
        storeViewBean.setAddress1(store.getAddress1());
        storeViewBean.setAddress2(store.getAddress2());
        storeViewBean.setAddressAdditionalInformation(store.getAddressAdditionalInformation());
        storeViewBean.setPostalCode(store.getPostalCode());

        // I18n values
        storeViewBean.setCity(store.getCity());
        String i18nCityName = store.getI18nCity(localization);
        if(StringUtils.isNotEmpty(i18nCityName)){
            storeViewBean.setCity(i18nCityName);
        }

        storeViewBean.setStateCode(store.getStateCode());
        storeViewBean.setCountry(store.getCountryCode());
        storeViewBean.setCountryCode(store.getCountryCode());
       
        storeViewBean.setEmail(store.getEmail());
        storeViewBean.setPhone(store.getPhone());
        storeViewBean.setFax(store.getFax());
        storeViewBean.setWebsite(store.getWebsite());
       
        storeViewBean.setLongitude(store.getLongitude());
        storeViewBean.setLatitude(store.getLatitude());
       
        final Asset defaultPackshotImage = store.getDefaultPackshotImage(ImageSize.SMALL.name());
        if (defaultPackshotImage != null) {
            final String defaultImage = engineSettingService.getRetailerOrStoreImageWebPath(defaultPackshotImage);
            storeViewBean.setDefaultImage(defaultImage);
        } else {
            storeViewBean.setDefaultImage("");
        }
        final Asset defaultIconImage = store.getDefaultThumbnailImage();
        if (defaultIconImage != null) {
            final String iconImage = engineSettingService.getRetailerOrStoreImageWebPath(defaultIconImage);
            storeViewBean.setIconImage(iconImage);
        } else {
            storeViewBean.setIconImage("");
        }
       
        DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
        if (store.getDateCreate() != null) {
            storeViewBean.setDateCreate(dateFormat.format(store.getDateCreate()));
        }
        if (store.getDateUpdate() != null) {
            storeViewBean.setDateUpdate(dateFormat.format(store.getDateUpdate()));
        }
       
    final List<Asset> assets = store.getSlideShows();
    if(assets != null){
          List<String> sliders = new ArrayList<String>();
          for(Asset asset : assets ){
              final String iconImage = engineSettingService.getRetailerOrStoreImageWebPath(asset);
              sliders.add(iconImage);
          }
          storeViewBean.setSliders(sliders);
    }
        storeViewBean.setDetailsUrl(urlService.generateUrl(FoUrls.STORE_DETAILS, requestData, store));
       
        return storeViewBean;
    }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.mvc.viewbean.StoreViewBean

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.