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

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


    public void doMoveToDetails()
    {
      final XulListbox availableList = (XulListbox) getDocument().getElementById(AVAILABLE_COLUMNS_LIST_ID);
      final int[] selectedIndices = availableList.getSelectedIndices();
      final List<FieldWrapper> details = getDetailFields();
      final DataSchema schema = getEditorModel().getDataSchema().getDataSchema();
      for (final int i : selectedIndices)
      {
        final SourceFieldDefinition field = getSelectableFields().get(i);
        final DetailFieldDefinition xulField = new DefaultDetailFieldDefinition();
        xulField.setField(field.getFieldName());
View Full Code Here


      dataFactory.open();
      try
      {
        final TableModel reportData = queryReportData(parent.getQuery(), parent.getQueryTimeout(), dataFactory);
        final DataSchema dataSchema = dataSchemaCompiler.compile
            (reportData, expressions, parameterRow, parameterDefinitions, masterReport.getReportEnvironment());
        this.columnNames = collectColumnNames(reportData, parameterRow, expressions);
        if (reportData instanceof CloseableTableModel)
        {
          final CloseableTableModel ctm = (CloseableTableModel) reportData;
          ctm.close();
        }
        return dataSchema;
      }
      finally
      {
        dataFactory.close();
      }
    }
    catch (final ReportDataFactoryException rdfe)
    {
      final TableModel reportData = new DefaultTableModel();
      final DataSchema dataSchema = dataSchemaCompiler.compile
          (reportData, expressions, parameterRow, parameterDefinitions, masterReportElement.getReportEnvironment());
      this.columnNames = collectColumnNames(reportData, parameterRow, expressions);
      this.dataFactoryException = rdfe;
      return dataSchema;
    }
    catch (ReportProcessingException e)
    {
      final TableModel reportData = new DefaultTableModel();
      final DataSchema dataSchema = dataSchemaCompiler.compile
          (reportData, expressions, parameterRow, parameterDefinitions, masterReportElement.getReportEnvironment());
      this.columnNames = collectColumnNames(reportData, parameterRow, expressions);
      this.dataFactoryException = e;
      return dataSchema;
    }
View Full Code Here

        {
          processingStack = new FastStack();
        }
        final String[] columnSet = computeColumns(crosstabGroup);
        final ReportStateKey processKey = state.getProcessKey();
        final DataSchema dataSchema = getRuntime().getDataSchema();
        final DataAttributes tableAttributes = dataSchema.getTableAttributes();
        final DataAttributeContext context = new DefaultDataAttributeContext
            (getRuntime().getProcessingContext().getOutputProcessorMetaData(),
                getRuntime().getResourceBundleFactory().getLocale());

        final String mode = (String) tableAttributes.getMetaAttribute
View Full Code Here

 
  public List<SourceFieldDefinition> getSelectableFieldsArray()
  {
    final List<SourceFieldDefinition> sourceFields = new ArrayList<SourceFieldDefinition>();
    final DataSchemaModel localSchemaModel = getDataSchema();
    final DataSchema dataSchema = localSchemaModel.getDataSchema();
    final String[] names = dataSchema.getNames();
    for (int i = 0; i < names.length; i++)
    {
      final String name = names[i];
      final SourceFieldDefinition fieldDefinition =
          new SourceFieldDefinition(name, getDataSchema().getDataSchema());
View Full Code Here

   *
   * @param e the element that should be updated.
   */
  protected boolean evaluateElement(final Element e)
  {
    final DataSchema dataSchema = getRuntime().getDataSchema();

    final Object allowStylingFlag = e.getAttribute(AttributeNames.Wizard.NAMESPACE,
        AttributeNames.Wizard.ALLOW_METADATA_STYLING);
    final Object allowAttributesFlag = e.getAttribute(AttributeNames.Wizard.NAMESPACE,
        AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES);
    if (Boolean.TRUE.equals(allowStylingFlag) == false && Boolean.TRUE.equals(allowAttributesFlag) == false)
    {
      // the element prohibits meta-data styling ..
      return false;
    }

    // a flag indicating whether we are dealing with a field or a label.
    String fieldName = (String) e.getAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR);
    if (fieldName == null)
    {
      fieldName = (String) e.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD);
      if (fieldName == null)
      {
        return false;
      }
    }


    // the element always overrides all properties; properties not defined in the meta-data layer
    // will be removed from the stylesheet or attribute collection.

    final DataAttributes attributes = dataSchema.getAttributes(fieldName);
    if (attributes == null)
    {
      return false;
    }

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

  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];
      fields.add(new DataSchemaFieldDefinition(extraField, new EmptyDataAttributes(), dataAttributeContext));
    }

    for (int i = columnNames.length - 1; i >= 0; i -= 1)
    {
      final String columnName = columnNames[i];
      final DataAttributes attributes = dataSchema.getAttributes(columnName);
      if (attributes == null)
      {
        throw new IllegalStateException("No data-schema for field with name '" + columnName + '\'');
      }
      if (DataSchemaUtility.isFiltered(attributes, dataAttributeContext))
View Full Code Here

  }

  public List<FieldWrapper> getGroupFields()
  {
    final ArrayList<FieldWrapper> groups = new ArrayList<FieldWrapper>();
    final DataSchema schema = getEditorModel().getDataSchema().getDataSchema();
    for (final GroupDefinition group : getEditorModel().getReportSpec().getGroupDefinitions())
    {
      groups.add(new FieldWrapper(group, schema));
    }
    return groups;
View Full Code Here


  public List<FieldWrapper> getDetailFields()
  {
    final ArrayList<FieldWrapper> fields = new ArrayList<FieldWrapper>();
    final DataSchema schema = getEditorModel().getDataSchema().getDataSchema();
    for (final DetailFieldDefinition field : getEditorModel().getReportSpec().getDetailFieldDefinitions())
    {
      fields.add(new FieldWrapper(field, schema));
    }
    return fields;
View Full Code Here

   * @param e the element that should be updated.
   * @return true, if the element can be styled.
   */
  protected boolean evaluateElement(final ReportElement e)
  {
    final DataSchema dataSchema = getRuntime().getDataSchema();

    final Object allowStylingFlag = e.getAttribute(AttributeNames.Wizard.NAMESPACE,
        AttributeNames.Wizard.ALLOW_METADATA_STYLING);
    final Object allowAttributesFlag = e.getAttribute(AttributeNames.Wizard.NAMESPACE,
        AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES);
    if (Boolean.TRUE.equals(allowStylingFlag) == false && Boolean.TRUE.equals(allowAttributesFlag) == false)
    {
      // the element prohibits meta-data styling ..
      return false;
    }

    // a flag indicating whether we are dealing with a field or a label.
    String fieldName = (String) e.getAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR);
    if (fieldName == null)
    {
      fieldName = (String) e.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD);
      if (fieldName == null)
      {
        return false;
      }
    }


    // the element always overrides all properties; properties not defined in the meta-data layer
    // will be removed from the stylesheet or attribute collection.

    final DataAttributes attributes = dataSchema.getAttributes(fieldName);
    if (attributes == null)
    {
      return false;
    }

View Full Code Here

TOP

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

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.