Package org.pentaho.reporting.engine.classic.core.wizard

Examples of org.pentaho.reporting.engine.classic.core.wizard.DefaultDataSchema


    final ExpressionDataRow expressionsRow = masterRow.getExpressionDataRow();
    final ReportDataRow massDataRow = masterRow.getReportDataRow();
    // imported data has been compiled in the subreport ...
    final ImportedVariablesDataRow importedDataRow = masterRow.getImportedDataRow();

    final DefaultDataSchema defaultDataSchema = new DefaultDataSchema();

    if (parameters != null)
    {
      final MasterDataRow parentRow = masterRow.getParentDataRow();
      if (parentRow == null)
      {
        processParameters(parameters, null, reportEnvironment,
            globalAttributes, indirectRules, directRules, defaultDataSchema);
      }
      else
      {
        // import the parameters that have been computed already ..
        final String[] parameterNames = parameters.getParentNames();
        final String[] innerNames = parameters.getColumnNames();
        for (int i = 0; i < parameterNames.length; i++)
        {
          final String name = parameterNames[i];
          final DataAttributes attributes = parentRow.getDataSchema().getAttributes(name);
          defaultDataSchema.setAttributes(innerNames[i], attributes);
        }
      }
    }

    // expressions
    final Expression[] expressions = expressionsRow.getExpressions();
    for (int i = 0; i < expressions.length; i++)
    {
      final Expression expression = expressions[i];
      final String name = expression.getName();
      if (name == null)
      {
        continue;
      }
      final DefaultDataAttributes computedParameterDataAttributes = new DefaultDataAttributes();
      computedParameterDataAttributes.merge(globalAttributes, context);
      computedParameterDataAttributes.merge(new ExpressionsDataAttributes(expression), context);

      applyRules(indirectRules, directRules, computedParameterDataAttributes);
      defaultDataSchema.setAttributes(name, computedParameterDataAttributes);
    }

    // massdata
    if (massDataRow != null)
    {
      final GenericDataAttributes parameterDataAttributes = getTableDataAttributes();
      final TableModel data = massDataRow.getReportData();
      if (data instanceof MetaTableModel == false)
      {
        final int count = data.getColumnCount();
        for (int i = 0; i < count; i++)
        {
          final String colName = data.getColumnName(i);
          parameterDataAttributes.setup(colName, data.getColumnClass(i), "table", globalAttributes);

          final DefaultDataAttributes computedParameterDataAttributes = new DefaultDataAttributes();
          computedParameterDataAttributes.merge(parameterDataAttributes, context);
          applyRules(indirectRules, directRules, computedParameterDataAttributes);
          defaultDataSchema.setAttributes(colName, computedParameterDataAttributes);
        }
      }
      else
      {
        final MetaTableModel mt = (MetaTableModel) data;

        final DefaultDataAttributes tableGlobalAttributes = new DefaultDataAttributes();
        tableGlobalAttributes.merge(globalAttributes, context);
        tableGlobalAttributes.merge(mt.getTableAttributes(), context);
        try
        {
          defaultDataSchema.setTableAttributes(tableGlobalAttributes);
        }
        catch (CloneNotSupportedException e)
        {
          logger.warn("Unable to copy global data-attributes", e);
        }

        final int count = data.getColumnCount();
        for (int i = 0; i < count; i++)
        {
          final String colName = data.getColumnName(i);
          final DefaultDataAttributes computedParameterDataAttributes = new DefaultDataAttributes();
          computedParameterDataAttributes.merge(tableGlobalAttributes, context);
          computedParameterDataAttributes.merge(mt.getColumnAttributes(i), context);

          parameterDataAttributes.setup(colName, data.getColumnClass(i), "table", EmptyDataAttributes.INSTANCE);
          computedParameterDataAttributes.merge(parameterDataAttributes, context);

          applyRules(indirectRules, directRules, computedParameterDataAttributes);
          defaultDataSchema.setAttributes(colName, computedParameterDataAttributes);
        }
      }
    }

    // imported values ...
    if (importedDataRow != null)
    {
      final String[] columnNames = importedDataRow.getColumnNames();
      for (int i = 0; i < columnNames.length; i++)
      {
        final String columnName = columnNames[i];
        defaultDataSchema.setAttributes(columnName, importedDataRow.getAttributes(columnName));
      }
    }
    return defaultDataSchema;
  }
View Full Code Here


        this.dataSchema = buildDataSchema();
      }
      catch (Throwable e)
      {
        handleError(e);
        this.dataSchema = new DefaultDataSchema();
        this.dataFactoryException = e;
      }

      updateChangeTrackers();
    }
View Full Code Here

      throw new NullPointerException();
    }

    this.dataFactory = parameterContext.getDataFactory();
    this.model = new EmptyTableModel();
    this.dataSchema = new DefaultDataSchema();
    this.dataRow = dataRow;
    this.processingContext = new DefaultProcessingContext
        (parameterContext.getResourceBundleFactory(),
            parameterContext.getConfiguration(),
            parameterContext.getResourceManager(),
View Full Code Here

    this.data = data;
    this.currentRow = currentRow;
    dataRow = new DataRowConnector();
    configuration = new DefaultConfiguration();
    resourceBundleFactory = new DefaultResourceBundleFactory();
    dataSchema = new DefaultDataSchema();
  }
View Full Code Here

  {
    this.processingContext = processingContext;
    this.data = data;
    this.currentRow = currentRow;
    dataRow = new StaticDataRow(new String[0], new Object[0]);
    dataSchema = new DefaultDataSchema();
    configuration = new DefaultConfiguration();
    resourceBundleFactory = new DefaultResourceBundleFactory();
    dataFactory = new CompoundDataFactory();
  }
View Full Code Here

    this.data = data;
    this.currentRow = currentRow;
    this.dataRow = dataRow;
    this.configuration = this.processingContext.getConfiguration();
    this.resourceBundleFactory = processingContext.getResourceBundleFactory();
    this.dataSchema = new DefaultDataSchema();
    this.dataFactory = new CompoundDataFactory();
  }
View Full Code Here

            (reportData, expressions, parameterRow, parameterDefinitions, reportEnvironment);

      }
      catch (final ReportDataFactoryException e)
      {
        dataSchema = new DefaultDataSchema();
      }
    }

    return dataSchema;
  }
View Full Code Here

    this.data = data;
    this.currentRow = currentRow;
    this.dataRow = dataRow;
    this.configuration = this.processingContext.getConfiguration();
    this.resourceBundleFactory = processingContext.getResourceBundleFactory();
    this.dataSchema = new DefaultDataSchema();
    this.dataFactory = new CompoundDataFactory();
  }
View Full Code Here

      }
      catch (final Throwable e)
      {
        handleError(e);
        this.dataFactoryException = e;
        this.dataSchema = new DefaultDataSchema();
      }
      changeTracker.updateChangeTrackers();
    }
  }
View Full Code Here

      throw new NullPointerException();
    }

    this.dataFactory = parameterContext.getDataFactory();
    this.model = new EmptyTableModel();
    this.dataSchema = new DefaultDataSchema();
    this.dataRow = dataRow;
    this.processingContext = new DefaultProcessingContext
        (new GenericOutputProcessorMetaData(),
            parameterContext.getResourceBundleFactory(),
            parameterContext.getConfiguration(),
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.wizard.DefaultDataSchema

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.