Package org.hoteia.qalingo.core.web.util

Examples of org.hoteia.qalingo.core.web.util.RequestUtil


    }

    private void initPlatformTheme(HttpServletRequest request) {
        final ServletContext context = getServletContext();
        final ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
        final RequestUtil requestUtil = (RequestUtil) ctx.getBean("requestUtil");

        // THEME
        try {
            final RequestData requestData = requestUtil.getRequestData(request);
            final MarketArea marketArea = requestData.getMarketArea();
            if (marketArea != null && StringUtils.isNotEmpty(marketArea.getTheme())) {
                String themeFolder = marketArea.getTheme();
                requestUtil.updateCurrentTheme(request, themeFolder);
            } else {
                final Market market = requestData.getMarket();
                if (market != null && StringUtils.isNotEmpty(market.getTheme())) {
                    String themeFolder = market.getTheme();
                    requestUtil.updateCurrentTheme(request, themeFolder);
                } else {
                    final MarketPlace marketPlace = requestData.getMarketPlace();
                    if (marketPlace != null && StringUtils.isNotEmpty(marketPlace.getTheme())) {
                        String themeFolder = marketPlace.getTheme();
                        requestUtil.updateCurrentTheme(request, themeFolder);
                    }
                }
            }

        } catch (Exception e) {
View Full Code Here


    }

    private void initPlatformDevice(HttpServletRequest request) {
        final ServletContext context = getServletContext();
        final ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
        final RequestUtil requestUtil = (RequestUtil) ctx.getBean("requestUtil");

        // DEVICE
        try {
            final RequestData requestData = requestUtil.getRequestData(request);

            final WURFLHolder wurfl = (WURFLHolder) ctx.getBean("wurflHolder");
            final WURFLManager manager = wurfl.getWURFLManager();
            Device device = manager.getDeviceForRequest(request);
            String deviceFolder = "default";
            if (device != null) {
                boolean isSmartPhone = BooleanUtils.toBoolean(device.getVirtualCapability("is_smartphone"));
                boolean isIPhoneOs = BooleanUtils.toBoolean(device.getVirtualCapability("is_iphone_os"));
                boolean isAndroid = BooleanUtils.toBoolean(device.getVirtualCapability("is_android"));
                if (isSmartPhone || isIPhoneOs || isAndroid) {
                    deviceFolder = "mobile";
                }
            }
            requestUtil.updateCurrentDevice(requestData, deviceFolder);

        } catch (Exception e) {
            logger.error("", e);
        }
    }
View Full Code Here

  }

  private void initPlatformTheme(HttpServletRequest request){
    final ServletContext context = getServletContext();
    final ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
    final RequestUtil requestUtil = (RequestUtil) ctx.getBean("requestUtil");

    // THEME
    try {
        final RequestData requestData = requestUtil.getRequestData(request);
      User user = requestData.getUser();
      if(user !=null){
        final Company company = user.getCompany();
        if(company != null
            && StringUtils.isNotEmpty(company.getTheme())){
          String themeFolder = company.getTheme();
          requestUtil.updateCurrentTheme(request, themeFolder);
        }
      }
     
    } catch (Exception e) {
      logger.error("", e);
View Full Code Here

  }
 
  private void initPlatformDevice(HttpServletRequest request){
    final ServletContext context = getServletContext();
    final ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
    final RequestUtil requestUtil = (RequestUtil) ctx.getBean("requestUtil");

    // DEVICE
    try {
      final WURFLHolder wurfl = (WURFLHolder) ctx.getBean("wurflHolder");
          final WURFLManager manager = wurfl.getWURFLManager();
          Device device = manager.getDeviceForRequest(request);
      String deviceFolder = "default";
      if(device != null){
        boolean isSmartPhone = BooleanUtils.toBoolean(device.getVirtualCapability("is_smartphone"));
        boolean isIPhoneOs = BooleanUtils.toBoolean(device.getVirtualCapability("is_iphone_os"));
        boolean isAndroid = BooleanUtils.toBoolean(device.getVirtualCapability("is_android"));
        if(isSmartPhone
            || isIPhoneOs
            || isAndroid){
          deviceFolder = "mobile";
        }
      }
      requestUtil.updateCurrentDevice(requestUtil.getRequestData(request), deviceFolder);
     
    } catch (Exception e) {
      logger.error("", e);
    }
  }
View Full Code Here

     * @throws ServletException If an error occurs
     */
    public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain chain) throws IOException, ServletException {
      final HttpServletRequest  httpServletRequest = (HttpServletRequest) servletRequest;
   
      RequestUtil requestUtil = (RequestUtil) ctx.getBean("requestUtil");
     
      try {
      requestUtil.handleBackofficeUrlParameters(httpServletRequest);
    } catch (Exception e) {
      logger.error("UrlParams Filter & HandleUrlParameters failed, e");
    }
   
        // pass the servletRequest on
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.util.RequestUtil

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.