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

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


        return marketAreaViewBean;
    }
   
    @Override
    public LocalizationViewBean buildViewBeanLocalization(final RequestData requestData, final Localization localization) throws Exception {
        LocalizationViewBean localizationViewBean = super.buildViewBeanLocalization(requestData, localization);
       
        RequestData requestDataChangecontext = new RequestData();
        BeanUtils.copyProperties(requestData, requestDataChangecontext);
        requestDataChangecontext.setContextNameValue(PropertiesUtil.getWebappContextKey("FO_MCOMMERCE"));
       
        localizationViewBean.setHomeUrl(urlService.buildAbsoluteUrl(requestDataChangecontext, urlService.generateUrl(FoUrls.HOME, requestDataChangecontext)));
        return localizationViewBean;
    }
View Full Code Here


        RequestData requestDataChangecontext = new RequestData();
        BeanUtils.copyProperties(requestData, requestDataChangecontext);
        requestDataChangecontext.setMarketAreaLocalization(localization);

        final LocalizationViewBean localizationViewBean = new LocalizationViewBean();

        if (StringUtils.isNotEmpty(localeCodeNavigation) && localeCodeNavigation.length() == 2) {
            localizationViewBean.setName(getReferenceData(ScopeReferenceDataMessage.LANGUAGE, localeCodeNavigation.toLowerCase(), locale));
        } else {
            localizationViewBean.setName(getReferenceData(ScopeReferenceDataMessage.LANGUAGE, localeCodeNavigation, locale));
        }

        localizationViewBean.setChangeContextUrl(backofficeUrlService.buildChangeContextUrl(requestDataChangecontext));

        return localizationViewBean;
    }
View Full Code Here

        for (Iterator<Localization> iterator = translationAvailables.iterator(); iterator.hasNext();) {
            final Localization localizationAvailable = (Localization) iterator.next();
            localizationViewBeans.add(buildViewBeanLocalization(requestData, localizationAvailable));
        }
        for (Iterator<LocalizationViewBean> iterator = localizationViewBeans.iterator(); iterator.hasNext();) {
            final LocalizationViewBean localizationViewBean = (LocalizationViewBean) iterator.next();
            localizationViewBean.setActive(false);
            if (localizationViewBean.getCode().equals(currentLocalization.getCode())) {
                localizationViewBean.setActive(true);
            }
        }
        return localizationViewBeans;
    }
View Full Code Here

     */
    public LocalizationViewBean buildViewBeanLocalization(final RequestData requestData, final Localization localization) throws Exception {
        final Locale locale = requestData.getLocale();
        final String localizationCodeNavigation = localization.getCode();

        final LocalizationViewBean localizationViewBean = new LocalizationViewBean();
        localizationViewBean.setCode(localizationCodeNavigation);
        localizationViewBean.setDescription(localization.getDescription());
        localizationViewBean.setCountry(localization.getCountry());
        localizationViewBean.setLanguage(localization.getLanguage());

        localizationViewBean.setName(localization.getName());
        String localizationCodeTranslation = localizationCodeNavigation;
        if(localizationCodeTranslation.contains("-")){
            String[] split = localizationCodeTranslation.split("-");
            localizationCodeTranslation = split[0] + "-" + split[1].toUpperCase();
            localizationViewBean.setName(getReferenceData(ScopeReferenceDataMessage.LANGUAGE, localizationCodeTranslation, locale));
        } else {
            localizationViewBean.setName(getReferenceData(ScopeReferenceDataMessage.LANGUAGE, localizationCodeTranslation.toLowerCase(), locale));
        }

        if (localization.getLocale().equals(locale)) {
            localizationViewBean.setActive(true);
        }

        DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
        if (localization.getDateCreate() != null) {
            localizationViewBean.setDateCreate(dateFormat.format(localization.getDateCreate()));
        }
        if (localization.getDateUpdate() != null) {
            localizationViewBean.setDateUpdate(dateFormat.format(localization.getDateUpdate()));
        }
       
        RequestData requestDataChangecontext = new RequestData();
        BeanUtils.copyProperties(requestData, requestDataChangecontext);
        requestDataChangecontext.setMarketAreaLocalization(localization);
        localizationViewBean.setChangeContextUrl(urlService.buildChangeLanguageUrl(requestDataChangecontext));
        localizationViewBean.setChangeBackofficeLanguageUrl(urlService.buildChangeBackofficeLanguageUrl(requestDataChangecontext, localization));
        localizationViewBean.setHomeUrl(urlService.generateUrl(FoUrls.HOME, requestDataChangecontext));

        return localizationViewBean;
    }
View Full Code Here

TOP

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

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.