Package org.hoteia.qalingo.core.pojo

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


   
    @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


    /**
     * @throws Exception
     *
     */
    protected String getCurrentVelocityPath(HttpServletRequest request) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
        return requestUtil.getCurrentVelocityWebPrefix(requestData);
    }
View Full Code Here

                final MarketArea reloadedMarketArea = marketService.getMarketAreaByCode(marketArea.getCode());
                final Localization defaultLocalization = reloadedMarketArea.getDefaultLocalization();
                final Retailer defaultRetailer = reloadedMarketArea.getDefaultRetailer();
                final CurrencyReferential defaultCurrency = reloadedMarketArea.getDefaultCurrency();

                RequestData requestDataForThisMarketArea = new RequestData();
                BeanUtils.copyProperties(requestData, requestDataForThisMarketArea);
                requestDataForThisMarketArea.setMarketPlace(reloadedMarketPlace);
                requestDataForThisMarketArea.setMarket(reloadedMarket);
                requestDataForThisMarketArea.setMarketArea(reloadedMarketArea);
                requestDataForThisMarketArea.setMarketAreaLocalization(defaultLocalization);
                requestDataForThisMarketArea.setMarketAreaRetailer(defaultRetailer);
                requestDataForThisMarketArea.setMarketAreaCurrency(defaultCurrency);
               
                MarketAreaViewBean marketAreaViewBean = buildViewBeanMarketArea(requestDataForThisMarketArea, marketArea);
                if(marketAreaViewBean.getCode().equalsIgnoreCase(currentMarketArea.getCode())){
                    marketAreaViewBean.setActive(true);
                }
View Full Code Here

        }
        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

            if (currencyReferential.getDateUpdate() != null) {
                currencyReferentialViewBean.setDateUpdate(dateFormat.format(currencyReferential.getDateUpdate()));
            }
           
            // CLONE THE CURRENT REQUEST DATE TO BUILD THE CHANGE CONTEXT URL (MENU)
            RequestData requestDataChangecontext = new RequestData();
            BeanUtils.copyProperties(requestData, requestDataChangecontext);
            requestDataChangecontext.setMarketAreaCurrency(currencyReferential);

            currencyReferentialViewBean.setChangeContextUrl(urlService.buildChangeContextUrl(requestDataChangecontext));
            currencyReferentialViewBean.setHomeUrl(urlService.generateUrl(FoUrls.HOME, requestDataChangecontext));

        }
View Full Code Here

        if (retailer.getDateUpdate() != null) {
            retailerViewBean.setDateUpdate(dateFormat.format(retailer.getDateUpdate()));
        }
       
        // CLONE THE CURRENT REQUEST DATE TO BUILD THE CHANGE CONTEXT URL (MENU)
        RequestData requestDataChangecontext = new RequestData();
        BeanUtils.copyProperties(requestData, requestDataChangecontext);
        requestDataChangecontext.setMarketAreaRetailer(retailer);
       
        retailerViewBean.setChangeContextUrl(urlService.buildChangeContextUrl(requestDataChangecontext));
        retailerViewBean.setHomeUrl(urlService.generateUrl(FoUrls.HOME, requestDataChangecontext));

        retailerViewBean.setDetailsUrl(urlService.generateUrl(FoUrls.RETAILER_DETAILS, requestData, retailer));
View Full Code Here

    /**
     *
     */
    public RequestData getRequestData(final HttpServletRequest request) throws Exception {
        final RequestData requestData = new RequestData();
        requestData.setRequest(request);
       
        String contextPath = "";
        if (request.getRequestURL().toString().contains("localhost") || request.getRequestURL().toString().contains("127.0.0.1")) {
            contextPath = contextPath + request.getContextPath() + "/";
        } else {
            contextPath = "/";
        }
        requestData.setContextPath(contextPath);
        requestData.setContextNameValue(getCurrentContextNameValue(request));

        // SPECIFIC BACKOFFICE
        if (requestData.isBackoffice()) {
            checkEngineBoSession(request);
        } else {
            // SPECIFIC FRONTOFFICE
            checkEngineEcoSession(request);
            requestData.setGeolocData(getCurrentGeolocData(request));
        }
       
        requestData.setVelocityEmailPrefix(getCurrentVelocityEmailPrefix(requestData));

        requestData.setMarketPlace(getCurrentMarketPlace(requestData));
        requestData.setMarket(getCurrentMarket(requestData));
        requestData.setMarketArea(getCurrentMarketArea(requestData));
        requestData.setMarketAreaLocalization(getCurrentMarketAreaLocalization(requestData));
        requestData.setMarketAreaRetailer(getCurrentMarketAreaRetailer(requestData));
        requestData.setMarketAreaCurrency(getCurrentMarketAreaCurrency(requestData));
       
        // SPECIFIC BACKOFFICE
        if (requestData.isBackoffice()) {
            User user = getCurrentUser(request);
            if (user != null) {
                requestData.setUser(user);
            }

            Company company = getCurrentCompany(request);
            if (company != null) {
                requestData.setCompany(company);
            }

            requestData.setBackofficeLocalization(getCurrentBackofficeLocalization(requestData));

        } else {
            // SPECIFIC FRONTOFFICE
            Customer customer = getCurrentCustomer(request);
            if (customer != null) {
                requestData.setCustomer(customer);
            }
           
            requestData.setCart(getCurrentCart(request));
        }

        return requestData;
    }
View Full Code Here

 
    @RequestMapping("/")
    public ModelAndView displayDefaultPage(final HttpServletRequest request, final Model model) throws Exception {
       
        // DEFAULT HOME
        RequestData requestData = requestUtil.getRequestData(request);
        String defaultUrl = backofficeUrlService.generateUrl(BoUrls.HOME, requestData);
       
        return new ModelAndView(new RedirectView(defaultUrl));
    }
View Full Code Here

public class UserController extends AbstractBackofficeQalingoController {

    @RequestMapping(value = BoUrls.USER_LIST_URL, method = RequestMethod.GET)
    public ModelAndView userList(final HttpServletRequest request, final Model model) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.USER_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.USER_LIST.getKey() + "", params);
View Full Code Here

    }
   
    @RequestMapping(value = BoUrls.USER_DETAILS_URL, method = RequestMethod.GET)
    public ModelAndView userDetails(final HttpServletRequest request, final Model model) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.USER_DETAILS.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String userCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_USER_CODE);
        final User user = userService.getUserByCode(userCode);
       
        UserViewBean userViewBean = backofficeViewBeanFactory.buildViewBeanUser(requestData, user);
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.