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

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


  public void inspect(final ReportDesignerContext designerContext,
                      final ReportDocumentContext reportRenderContext,
                      final InspectionResultListener resultHandler) throws ReportDataFactoryException
  {
    final AbstractReportDefinition reportDefinition = reportRenderContext.getReportDefinition();
    final ContextAwareDataSchemaModel model = reportRenderContext.getReportDataSchemaModel();
    final String[] columnNames = model.getColumnNames();

    if (reportDefinition instanceof MasterReport)
    {
      final MasterReport mr = (MasterReport) reportDefinition;
      final ReportParameterDefinition parameters = mr.getParameterDefinition();
View Full Code Here


    return availableFieldsModel;
  }

  public void dataModelChanged(final ReportDocumentContext context)
  {
    final ContextAwareDataSchemaModel dataSchemaModel = context.getReportDataSchemaModel();
    final String[] columnNames = filterDatabaseColumn(dataSchemaModel);

    final DefaultBulkListModel availableFieldsModel = getAvailableFieldsModel();
    availableFieldsModel.setBulkData(columnNames);
View Full Code Here

                Messages.getString("InvalidQueryNameReferenceInspection.QueryNotRecognized", query),
                queryLocation));
      }
    }

    final ContextAwareDataSchemaModel dataSchemaModel = reportRenderContext.getReportDataSchemaModel();
    if (dataSchemaModel.isValid() == false)
    {
      final Throwable throwable = dataSchemaModel.getDataFactoryException();
      if (throwable != null)
      {
        final DataFactory dataFactory = reportRenderContext.getContextRoot().getDataFactory();
        final LocationInfo queryLocation;
        if (dataFactory instanceof CompoundDataFactory)
View Full Code Here

  }

  private ElementMetaData createMetaData(final String fieldName)
  {

    final ContextAwareDataSchemaModel model = editorContext.getRenderContext().getReportDataSchemaModel();
    final DataSchema dataSchema = model.getDataSchema();
    final DataAttributes attributes = dataSchema.getAttributes(fieldName);
    final DataAttributeContext dataAttributeContext = new DefaultDataAttributeContext();
    if (attributes == null)
    {
      return null;
View Full Code Here

    return getFields(reportContext, extraFields);
  }

  public static FieldDefinition[] getFields(final ReportDocumentContext reportContext, final String[] extraFields)
  {
    final ContextAwareDataSchemaModel model = reportContext.getReportDataSchemaModel();
    final String[] columnNames = model.getColumnNames();
    final ArrayList<FieldDefinition> fields = new ArrayList<FieldDefinition>(columnNames.length + extraFields.length);
    final DataSchema dataSchema = model.getDataSchema();
    final DefaultDataAttributeContext dataAttributeContext = new DefaultDataAttributeContext();

    for (int i = 0; i < extraFields.length; i++)
    {
      final String extraField = extraFields[i];
View Full Code Here

      setIcon(IconLoader.getInstance().getParameterIcon());
    }
    else if (value instanceof ReportFieldNode)
    {
      final ReportFieldNode fieldNode = (ReportFieldNode) value;
      final ContextAwareDataSchemaModel model = fieldNode.getDataSchemaModel();
      final DataAttributes attributes = model.getDataSchema().getAttributes(fieldNode.getFieldName());
      setToolTipText(fieldNode.getFieldClass().getSimpleName());
      if (attributes == null)
      {
        setText(fieldNode.toString());
      }
      else
      {
        final String displayName = (String) attributes.getMetaAttribute
            (MetaAttributeNames.Formatting.NAMESPACE, MetaAttributeNames.Formatting.LABEL,
                String.class, model.getDataAttributeContext());
        setText(formatFieldType(displayName, fieldNode.getFieldName(), fieldNode.getFieldClass()));
      }
    }
    else if (value instanceof ReportQueryNode)
    {
View Full Code Here

      final ReportQueryNode queryNode = (ReportQueryNode) parent;
      if (isSelectedDataSource(queryNode))
      {
        final String[] names = getDataFactoryColumns();
        final String name = names[index];
        final ContextAwareDataSchemaModel model = context.getReportDataSchemaModel();
        final DataAttributes attributes = model.getDataSchema().getAttributes(name);
        final Class type = (Class) attributes.getMetaAttribute
            (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.TYPE, Class.class, model.getDataAttributeContext());
        final DataFactory dataFactory = queryNode.getDataFactory();
        return new ReportFieldNode(context, dataFactory, name, type);
      }

      throw new IndexOutOfBoundsException();
View Full Code Here

    return DesignTimeUtil.isSelectedDataSource(reportDefinition, queryNode.getDataFactory(), queryNode.getQueryName());
  }

  private String[] getDataFactoryColumns()
  {
    final ContextAwareDataSchemaModel 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 (DataSchemaUtility.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 (value instanceof ReportFieldNode == false)
    {
      return this;
    }
    final ReportFieldNode fieldNode = (ReportFieldNode) value;
    final ContextAwareDataSchemaModel model = fieldNode.getDataSchemaModel();
    final DataAttributes attributes = model.getDataSchema().getAttributes(fieldNode.getFieldName());
    setToolTipText(fieldNode.getFieldClass().getSimpleName());
    if (attributes == null)
    {
      setText(fieldNode.toString());
      setIcon(IconLoader.getInstance().getBlankDocumentIcon());
View Full Code Here

public class QueryMetaDataActorImpl implements QueryMetaDataActor
{
  public Future<ContextAwareDataSchemaModel> retrieve(final MasterReport master, final AbstractReportDefinition report)
  {
    ContextAwareDataSchemaModel model = new ReportDataSchemaModel(master, report);
    // trigger the actual query while still being on the actor thread.
    model.getDataSchema();
    return Futures.successful(model);
  }
View Full Code Here

TOP

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

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.