Package net.baguajie.vo

Examples of net.baguajie.vo.FilterElementVo


    } catch (UnsupportedEncodingException e) {
      logger.warn(e.getMessage(), e);
    }
    Collection<FilterElementVo> filters = new ArrayList<FilterElementVo>();
    StringBuilder sb = new StringBuilder();
    FilterElementVo filter = null;

    // set city filter
    filter = new FilterElementVo();
    filter.setType("city");
    filter.setTypeLabel("城市");
    filter.setValue("");
    filter.setLabel("全国");
    if (StringUtils.hasText(city)) {
      CityMeta cityMeta = cityMetaRepository.getByPinyin(city
          .toLowerCase());
      if (cityMeta == null) {
        cityMeta = cityMetaRepository
            .getByPinyin(ApplicationConfig.defaultCityPinyin);
      }
      if (cityMeta != null) {
        filter.setLabel(cityMeta.getName());
        filter.setValue(cityMeta.getPinyin());
      }
    }
    filters.add(filter);
    sb.append("city=").append(filter.getValue()).append("&");

    // set category filter
    filter = new FilterElementVo();
    filter.setType("category");
    filter.setTypeLabel("分类");
    filter.setValue("");
    filter.setLabel("全部");
    if (StringUtils.hasText(category)) {
      filter.setLabel(category);
      filter.setValue(category);
    }
    filters.add(filter);
    sb.append("category=").append(filter.getValue()).append("&");

    // set keyword filter
    filter = new FilterElementVo();
    filter.setType("keyword");
    filter.setTypeLabel("关键词");
    filter.setValue("");
    filter.setLabel("未选择");
    if (StringUtils.hasText(keyword)) {
      filter.setLabel(keyword);
      filter.setValue(keyword);
    }
    filters.add(filter);
    sb.append("keyword=").append(filter.getValue()).append("&");

    model.addAttribute("filters", filters);
    model.addAttribute("qStr", sb.toString());
    return "home";
  }
View Full Code Here


    } catch (UnsupportedEncodingException e) {
      logger.warn(e.getMessage(), e);
    }
    Collection<FilterElementVo> filters = new ArrayList<FilterElementVo>();
    StringBuilder sb = new StringBuilder();
    FilterElementVo filter = null;
    // add city filter
    filter = new FilterElementVo();
    filter.setType("city");
    filter.setTypeLabel("城市");
    filter.setValue("");
    filter.setLabel("全国");
    if (StringUtils.hasText(city)) {
      CityMeta cityMeta = cityMetaRepository.getByPinyin(city
          .toLowerCase());
      if (cityMeta == null) {
        cityMeta = cityMetaRepository
            .getByPinyin(ApplicationConfig.defaultCityPinyin);
      }
      if (cityMeta != null) {
        filter.setLabel(cityMeta.getName());
        filter.setValue(cityMeta.getPinyin());
      }
    }
    filters.add(filter);
    sb.append(filter.getType()).append("=").append(filter.getValue())
        .append("&");

    // add gender filter
    filter = new FilterElementVo();
    filter.setType("gender");
    filter.setTypeLabel("性别");
    filter.setValue("");
    filter.setLabel("无所谓");
    if (StringUtils.hasText(gender)) {
      try {
        Gender g = Gender.valueOf(gender.toUpperCase());
        filter.setLabel(DomainObjectUtil.getGender(g));
        filter.setValue(gender);
      } catch (RuntimeException re) {

      }
    }
    filters.add(filter);
    sb.append(filter.getType()).append("=").append(filter.getValue())
        .append("&");

    // add keyword filter
    filter = new FilterElementVo();
    filter.setType("keyword");
    filter.setTypeLabel("关键词");
    filter.setValue("");
    filter.setLabel("未选择");
    if (StringUtils.hasText(keyword)) {
      filter.setLabel(keyword);
      filter.setValue(keyword);
    }
    filters.add(filter);
    sb.append(filter.getType()).append("=").append(filter.getValue())
        .append("&");

    model.addAttribute("filters", filters);
    model.addAttribute("qStr", sb.toString());
    return "profiles";
View Full Code Here

    }
    String category = request.getParameter("category");
    String keyword = request.getParameter("keyword");
    Collection<FilterElementVo> filters = new ArrayList<FilterElementVo>();
    StringBuilder sb = new StringBuilder();
    FilterElementVo filter = null;
   
    // set city filter
    filter = new FilterElementVo();
    filter.setType("city");
    filter.setTypeLabel("城市");
    filter.setValue("");
    filter.setLabel("全国");
    if(StringUtils.hasText(city)){
      CityMeta cityMeta = cityMetaRepository
        .getByPinyin(city.toLowerCase());
      if(cityMeta==null){
        cityMeta = cityMetaRepository.getByPinyin(
          ApplicationConfig.defaultCityPinyin);
      }
      if(cityMeta!=null){
        filter.setLabel(cityMeta.getName());
        filter.setValue(cityMeta.getPinyin());
      }
    }
    filters.add(filter);
    sb.append("city=").append(filter.getValue()).append("&");
   
    // set category filter
    filter = new FilterElementVo();
    filter.setType("category");
    filter.setTypeLabel("分类");
    filter.setValue("");
    filter.setLabel("全部");
    if(StringUtils.hasText(category)){
      filter.setLabel(category);
      filter.setValue(category);
    }
    filters.add(filter);
    sb.append("category=").append(filter.getValue()).append("&");
   
    // set keyword filter
    filter = new FilterElementVo();
    filter.setType("keyword");
    filter.setTypeLabel("关键词");
    filter.setValue("");
    filter.setLabel("未选择");
    if(StringUtils.hasText(keyword)){
      filter.setLabel(keyword);
      filter.setValue(keyword);
    }
    filters.add(filter);
    sb.append("keyword=").append(filter.getValue()).append("&");
   
    model.addAttribute("filters", filters);
    model.addAttribute("qStr", sb.toString());
    return "map";
  }
View Full Code Here

TOP

Related Classes of net.baguajie.vo.FilterElementVo

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.