コード例 #1
0
  public DashboardFilterProperty[] getAllPropertiesForCurrentFilter() {
    List results = new ArrayList();
    try {
      // Static properties.
      DashboardFilterProperty[] staticProps = getStaticPropertiesForCurrentFilter();
      if (staticProps != null) results.addAll(Arrays.asList(staticProps));

      // Dynamic properties.
      Iterator it = getDashboard().getDataProviders().iterator();
      while (it.hasNext()) {
        DataProvider dataProvider = (DataProvider) it.next();
        DataProperty[] allProperties = dataProvider.getDataSet().getProperties();
        for (int i = 0; i < allProperties.length; i++) {
          DataProperty property = allProperties[i];
          DashboardFilterProperty prop =
              getDashboardFilterPropertyForCurrentFilter(
                  dataProvider.getCode(), property.getPropertyId());
          if (prop == null)
            prop =
                new DashboardFilterProperty(
                    dataProvider.getCode(), property.getPropertyId(), getFilter(), null, false);
          results.add(prop);
        }
      }
    } catch (Exception e) {
      log.error("Cannot get data provider results.", e);
    }
    return (DashboardFilterProperty[]) results.toArray(new DashboardFilterProperty[results.size()]);
  }
コード例 #2
0
 public CommandResponse actionApplyLink(CommandRequest request) throws Exception {
   AbstractChartDisplayer abstractChartDisplayer = (AbstractChartDisplayer) getDataDisplayer();
   DataProperty property = abstractChartDisplayer.getDomainProperty();
   Integer series = Integer.decode(request.getRequestObject().getParameter(PARAM_NSERIE));
   DataSet dataSet = abstractChartDisplayer.buildXYDataSet();
   Interval interval = (Interval) dataSet.getValueAt(series, 0);
   Dashboard dashboard = DashboardHandler.lookup().getCurrentDashboard();
   if (dashboard.filter(property.getPropertyId(), interval, FilterByCriteria.ALLOW_ANY)) {
     return new ShowCurrentScreenResponse();
   }
   return null;
 }