Package org.pentaho.reporting.designer.core.model

Examples of org.pentaho.reporting.designer.core.model.ReportDataSchemaModel


    }
    if (parent == reportEnvironmentDataRow)
    {
      final String[] columnNames = reportEnvironmentDataRow.getColumnNames();
      final String name = columnNames[index];
      final ReportDataSchemaModel model = getContext().getReportDataSchemaModel();
      final Class targetClass = reportEnvironmentDataRow.isRolesArray(name) ? String[].class : String.class;
      return new ReportFieldNode(model, name, targetClass);
    }
    if (parent == reportFunctionNode)
    {
      return getExpressions().getExpression(index);
    }
    if (parent instanceof DataFactory)
    {
      final DataFactory dataFactory = (DataFactory) parent;
      final String[] queryNames = dataFactory.getQueryNames();
      return new ReportQueryNode(dataFactory, queryNames[index], true);
    }
    if (parent instanceof ReportQueryNode)
    {
      final ReportQueryNode queryNode = (ReportQueryNode) parent;
      final DataFactory dataFactory = queryNode.getDataFactory();
      final ReportDataSchemaModel model = context.getReportDataSchemaModel();
      if (model.isSelectedDataSource(dataFactory, queryNode.getQueryName()))
      {
        final String[] names = getDataFactoryColumns();
        final String name = names[index];
        final DataAttributes attributes = model.getDataSchema().getAttributes(name);
        final Class type = (Class) attributes.getMetaAttribute
            (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.TYPE, Class.class, model.getDataAttributeContext());
        return new ReportFieldNode(model, dataFactory, name, type);
      }

      throw new IndexOutOfBoundsException();
    }
View Full Code Here


    return null;
  }

  private String[] getDataFactoryColumns()
  {
    final ReportDataSchemaModel model = context.getReportDataSchemaModel();
    final String[] columnNames = model.getColumnNames();
    final ArrayList<String> targetCols = new ArrayList<String>(columnNames.length);
    for (int i = 0; i < columnNames.length; i++)
    {
      final String columnName = columnNames[i];
      final DataAttributes attributes = model.getDataSchema().getAttributes(columnName);
      if (attributes == null)
      {
        // if in doubt, then do not add.
        continue;
      }
      if (ReportDataSchemaModel.isFiltered(attributes, model.getDataAttributeContext()))
      {
        continue;
      }

      if ("table".equals(attributes.getMetaAttribute
          (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.SOURCE,
              String.class, model.getDataAttributeContext())))
      {
        targetCols.add(columnName);
      }

    }
View Full Code Here

    }
    if (parent instanceof ReportQueryNode)
    {
      final ReportQueryNode queryNode = (ReportQueryNode) parent;
      final DataFactory dataFactory = queryNode.getDataFactory();
      final ReportDataSchemaModel model = context.getReportDataSchemaModel();
      if (model.isSelectedDataSource(dataFactory, queryNode.getQueryName()))
      {
        return getDataFactoryColumns().length;
      }
      return 0;
    }
View Full Code Here

    if (node instanceof ReportQueryNode)
    {
      final ReportQueryNode queryNode = (ReportQueryNode) node;
      final DataFactory dataFactory = queryNode.getDataFactory();
      final ReportDataSchemaModel model = context.getReportDataSchemaModel();
      if (model.isSelectedDataSource(dataFactory, queryNode.getQueryName()))
      {
        return false;
      }
      return true;
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.model.ReportDataSchemaModel

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.