예제 #1
0
  public String removeFilter() {
    try {
      // ESTRAI "filters" campo testo
      String filters = this.getFilters();

      // Estrai lista properties da testo
      List<Properties> properties = EntitySearchFilterDOM.getPropertiesFilters(filters);

      // ELIMINA
      int filterIndex = this.getFilterIndex();
      properties.remove(filterIndex);

      // Setta Properties
      this.setFiltersProperties(properties);

      // crea nuovo "filters" String
      String newShowletParam = EntitySearchFilterDOM.getShowletParam(properties);
      this.setFilters(newShowletParam);

      // SETTA property FILTERS nella showlet
      this.setFiltersProperties(properties);

    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "removeFilter");
      return FAILURE;
    }
    return SUCCESS;
  }
예제 #2
0
 @Override
 public void validate() {
   super.validate();
   if (this.getActionErrors().size() > 0 || this.getFieldErrors().size() > 0) {
     String filters = this.getFilters();
     List<Properties> properties = EntitySearchFilterDOM.getPropertiesFilters(filters);
     this.setFiltersProperties(properties);
   }
 }
예제 #3
0
  public String moveFilter() {
    try {
      // ESTRAI "filters" campo testo
      String filters = this.getFilters();

      // Estrai lista properties da testo
      List<Properties> properties = EntitySearchFilterDOM.getPropertiesFilters(filters);

      // FAI LO SPOSTAMENTO.
      int filterIndex = this.getFilterIndex();
      Properties element = properties.get(filterIndex);
      if (getMovement().equalsIgnoreCase(IRssAction.MOVEMENT_UP_CODE)) {
        if (filterIndex > 0) {
          properties.remove(filterIndex);
          properties.add(filterIndex - 1, element);
        }
      } else if (getMovement().equalsIgnoreCase(IRssAction.MOVEMENT_DOWN_CODE)) {
        if (filterIndex < properties.size() - 1) {
          properties.remove(filterIndex);
          properties.add(filterIndex + 1, element);
        }
      }
      // Setta Properties
      this.setFiltersProperties(properties);

      // crea nuovo "filters" String
      String newShowletParam = EntitySearchFilterDOM.getShowletParam(properties);
      this.setFilters(newShowletParam);

      // SETTA property FILTERS nella showlet
      this.setFiltersProperties(properties);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "moveFilter");
      return FAILURE;
    }
    return SUCCESS;
  }
예제 #4
0
 public String addFilter() {
   try {
     List<Properties> properties = this.buildFilterProperties();
     Properties newFilter = this.getNewFilter();
     if (null != newFilter) {
       properties.add(newFilter);
     }
     String newShowletParam = EntitySearchFilterDOM.getShowletParam(properties);
     this.setFilters(newShowletParam);
     this.setFiltersProperties(properties);
   } catch (Throwable t) {
     ApsSystemUtils.logThrowable(t, this, "addFilter");
     return FAILURE;
   }
   return SUCCESS;
 }
예제 #5
0
 private List<Properties> buildFilterProperties() {
   String filters = this.getFilters();
   if (null == filters || filters.trim().length() == 0) filters = null;
   List<Properties> properties = EntitySearchFilterDOM.getPropertiesFilters(filters);
   return properties;
 }