Package com.extjs.gxt.ui.client.data

Examples of com.extjs.gxt.ui.client.data.BaseFilterConfig


    Collection filters = (Collection) params.get(FILTERS);
    if (filters!=null){
      Iterator it = filters.iterator();
      while (it.hasNext()) {
        queryText.append(AND);
        BaseFilterConfig filter = (BaseFilterConfig) it.next();
        if (!"asignado".equals(filter.getField())){
          queryText.append(" T." + filter.getField());
          String operator = (String)operatorOnWhere.get(filter.getClass().getName());
          if (operator !=null){
            queryText.append(operator);
          } else {
            if (filter instanceof BaseDateFilterConfig) {
              BaseDateFilterConfig dateFilter = (BaseDateFilterConfig) filter;
              if ("before".equals(dateFilter.getComparison())){
                queryText.append(" < ");
              } else if ("after".equals(dateFilter.getComparison())){
                queryText.append(" > ");
              } else {
                queryText.append(EQUAL);   
              }
            } else {
              queryText.append(EQUAL);
            }
           
          }
          queryText.append(QUESTION_SYMBOL);
        } else {

          HttpServletRequest request = (HttpServletRequest) params.get(ParamsConst.REQUEST);
          User user = null;
          if (request != null) {
            user = (User) request.getSession().getAttribute(ParamsConst.USER);
          }
          Map<String, User> users = null;
          if (user != null) {
            try {
              users = LDAPUtils.getUsersMap(user.getId(), user.getPassword());
            } catch (Exception e) {
              logger.error(Tools.getStackTrace(e));
            }
            if ((users!=null)&&(users.size()>0)){
              queryText.append(" T.id_usuario");
              queryText.append(" IN ( ");
             
              Collection values = users.values();
              Iterator itValues = values.iterator();
              queryText.append("''");
              while (itValues.hasNext()) {
                User actual = (User) itValues.next();
                if (actual.getName().indexOf((String)filter.getValue())>=0){
                  queryText.append(",'"+actual.getId()+"'");
                }
              }
             
              queryText.append(" )");
View Full Code Here


    }
  }
 
  public void setFiltersValuesInQuery(Map params, Query query) {
    Collection filters = (Collection) params.get(FILTERS);
    BaseFilterConfig filter = null;
    Boolean encontrado = Boolean.FALSE;
    if (filters!=null){
      int index = 0;
      Iterator it = filters.iterator();
      while (it.hasNext()) {
        filter = (BaseFilterConfig) it.next();
        if ("asignado".equals(filter.getField())){
          encontrado=!encontrado;
          break;
        }
      }
    }
View Full Code Here

    Collection filters = (Collection) params.get(FILTERS);
    if (filters!=null){
      int index = 0;
      Iterator it = filters.iterator();
      while (it.hasNext()) {
        BaseFilterConfig filter = (BaseFilterConfig) it.next();
        Wrapper wrapper = FiltersWrapperFactory.getInstance().getWrapper(filter);
        if (wrapper!=null){
          wrapper.setValueOnQuery(query, index);
        } else {
          if (filter instanceof BaseDateFilterConfig) {
            query.setDate(index, (Date)filter.getValue());
          } else if (filter instanceof BaseNumericFilterConfig) {
            query.setDouble(index, (Double)filter.getValue());
          }
        }
        index++;
      }
    }
View Full Code Here

    Collection filters = (Collection) params.get(FILTERS);
    if (filters!=null){
      Iterator it = filters.iterator();
      while (it.hasNext()) {
        queryText.append(AND);
        BaseFilterConfig filter = (BaseFilterConfig) it.next();
        queryText.append(filter.getField());
        String operator = (String)operatorOnWhere.get(filter.getClass().getName());
        if (operator !=null){
          queryText.append(operator);
        } else {
          if (filter instanceof BaseDateFilterConfig) {
            BaseDateFilterConfig dateFilter = (BaseDateFilterConfig) filter;
View Full Code Here

    Collection filters = (Collection) params.get(FILTERS);
    if (filters!=null){
      Iterator it = filters.iterator();
      while (it.hasNext()) {
        queryText.append(AND);
        BaseFilterConfig filter = (BaseFilterConfig) it.next();
        if (!"asignado".equals(filter.getField())){
          queryText.append(" T." + filter.getField());
          String operator = (String)operatorOnWhere.get(filter.getClass().getName());
          if (operator !=null){
            queryText.append(operator);
          } else {
            if (filter instanceof BaseDateFilterConfig) {
              BaseDateFilterConfig dateFilter = (BaseDateFilterConfig) filter;
              if ("before".equals(dateFilter.getComparison())){
                queryText.append(" < ");
              } else if ("after".equals(dateFilter.getComparison())){
                queryText.append(" > ");
              } else {
                queryText.append(EQUAL);   
              }
            } else {
              queryText.append(EQUAL);
            }
           
          }
          queryText.append(QUESTION_SYMBOL);
        } else {

          HttpServletRequest request = (HttpServletRequest) params.get(ParamsConst.REQUEST);
          User user = null;
          if (request != null) {
            user = (User) request.getSession().getAttribute(ParamsConst.USER);
          }
          Map<String, User> users = null;
          if (user != null) {
            try {
              users = LDAPUtils.getUsersMap(user.getId(), user.getPassword());
            } catch (Exception e) {
              logger.error(Tools.getStackTrace(e));
            }
            if ((users!=null)&&(users.size()>0)){
              queryText.append(" T.id_usuario");
              queryText.append(" IN ( ");
             
              Collection values = users.values();
              Iterator itValues = values.iterator();
              queryText.append("''");
              while (itValues.hasNext()) {
                User actual = (User) itValues.next();
                if (actual.getName().indexOf((String)filter.getValue())>=0){
                  queryText.append(",'"+actual.getId()+"'");
                }
              }
             
              queryText.append(" )");
View Full Code Here

    }
  }
 
  public void setFiltersValuesInQuery(Map params, Query query) {
    Collection filters = (Collection) params.get(FILTERS);
    BaseFilterConfig filter = null;
    Boolean encontrado = Boolean.FALSE;
    if (filters!=null){
      int index = 0;
      Iterator it = filters.iterator();
      while (it.hasNext()) {
        filter = (BaseFilterConfig) it.next();
        if ("asignado".equals(filter.getField())){
          encontrado=!encontrado;
          break;
        }
      }
    }
View Full Code Here

  }

  @Override
  public List<FilterConfig> getSerialArgs() {
    List<FilterConfig> configs = new ArrayList<FilterConfig>();
    BaseFilterConfig c = new BaseStringFilterConfig("string", getValue());
    configs.add(c);
    return configs;
  }
View Full Code Here

  }

  @Override
  public List<FilterConfig> getSerialArgs() {
    List<FilterConfig> configs = new ArrayList<FilterConfig>();
    BaseFilterConfig c = new BaseStringFilterConfig("string", getValue());
    configs.add(c);
    return configs;
  }
View Full Code Here

  }

  @Override
  public List<FilterConfig> getSerialArgs() {
    List<FilterConfig> configs = new ArrayList<FilterConfig>();
    BaseFilterConfig c = new BaseStringFilterConfig("string", getValue());
    configs.add(c);
    return configs;
  }
View Full Code Here

  }

  @Override
  public List<FilterConfig> getSerialArgs() {
    List<FilterConfig> configs = new ArrayList<FilterConfig>();
    BaseFilterConfig c = new BaseStringFilterConfig("string", getValue());
    configs.add(c);
    return configs;
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.data.BaseFilterConfig

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.