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

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


  }

  private boolean isFilteredField(final DataSchema dataSchema, final String fieldName)
  {
    final DefaultDataAttributeContext dac = new DefaultDataAttributeContext();
    final DataAttributes attributes = dataSchema.getAttributes(fieldName);
    final Object source = attributes.getMetaAttribute
        (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.SOURCE, String.class, dac);
    if (MetaAttributeNames.Core.SOURCE_VALUE_ENVIRONMENT.equals(source))
    {
      return true;
    }
    if (MetaAttributeNames.Core.SOURCE_VALUE_PARAMETER.equals(source))
    {
      return true;
    }

    final Object indexColumn = attributes.getMetaAttribute
        (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.INDEXED_COLUMN, Boolean.class, dac);
    if (Boolean.TRUE.equals(indexColumn))
    {
      return true;
    }
View Full Code Here


      final Object labelFor = element.getAttribute
          (AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR);
      if (labelFor instanceof String)
      {
        final String labelForText = (String) labelFor;
        final DataAttributes attributes = runtime.getDataSchema().getAttributes(labelForText);
        if (attributes != null)
        {
          final DefaultDataAttributeContext context = new DefaultDataAttributeContext
              (runtime.getProcessingContext().getOutputProcessorMetaData(),
                  runtime.getResourceBundleFactory().getLocale());
          final Object o = attributes.getMetaAttribute
              (MetaAttributeNames.Formatting.NAMESPACE, MetaAttributeNames.Formatting.LABEL, String.class, context);
          if (o != null)
          {
            return o;
          }
View Full Code Here

    {
      throw new NullPointerException();
    }
    this.groupDefinition = groupDefinition;

    final DataAttributes attributes = dataSchema.getAttributes(this.groupDefinition.getField());
    if (attributes != null)
    {
      final DefaultDataAttributeContext dataAttributeContext = new DefaultDataAttributeContext();

      if (groupDefinition.getHorizontalAlignment() == null)
      {
        metaDataHorizontalAlignment = (ElementAlignment) attributes.getMetaAttribute
            (MetaAttributeNames.Style.NAMESPACE, MetaAttributeNames.Style.HORIZONTAL_ALIGNMENT,
                ElementAlignment.class, dataAttributeContext);
      }

      if (groupDefinition.getDisplayName() == null)
      {
        metaDataDisplayName = (String) attributes.getMetaAttribute
            (MetaAttributeNames.Formatting.NAMESPACE, MetaAttributeNames.Formatting.LABEL,
                String.class, dataAttributeContext);
        setDisplayName(metaDataDisplayName);
      }
    }
View Full Code Here

      throw new NullPointerException();
    }
    this.parent = parent;


    final DataAttributes attributes = dataSchema.getAttributes(this.parent.getField());
    if (attributes != null)
    {
      final DefaultDataAttributeContext dataAttributeContext = new DefaultDataAttributeContext();

      if (parent.getHorizontalAlignment() == null)
      {
        metaDataHorizontalAlignment = (ElementAlignment) attributes.getMetaAttribute
            (MetaAttributeNames.Style.NAMESPACE, MetaAttributeNames.Style.HORIZONTAL_ALIGNMENT,
                ElementAlignment.class, dataAttributeContext);
      }

      if (parent.getDisplayName() == null)
      {
        metaDataDisplayName = (String) attributes.getMetaAttribute
            (MetaAttributeNames.Formatting.NAMESPACE, MetaAttributeNames.Formatting.LABEL,
                String.class, dataAttributeContext);
      }

      if (parent.getDataFormat() == null)
      {
        metaDataDataFormat = (String) attributes.getMetaAttribute
            (MetaAttributeNames.Formatting.NAMESPACE, MetaAttributeNames.Formatting.FORMAT,
                String.class, dataAttributeContext);
      }
    }
  }
View Full Code Here

      throw new NullPointerException();
    }

    this.fieldDefinition = fieldDefinition;

    final DataAttributes attributes = dataSchema.getAttributes(fieldDefinition.getField());
    if (attributes != null)
    {
      final DefaultDataAttributeContext dataAttributeContext = new DefaultDataAttributeContext();
      displayName = (String) attributes.getMetaAttribute
          (MetaAttributeNames.Formatting.NAMESPACE, MetaAttributeNames.Formatting.LABEL,
              String.class, dataAttributeContext);
      if (displayName != null)
      {
        final Object indexColumn = attributes.getMetaAttribute
            (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.INDEXED_COLUMN, Boolean.class, dataAttributeContext);
        if (Boolean.TRUE.equals(indexColumn))
        {
          displayName += (" (" + fieldDefinition.getField() + ")");
        }
View Full Code Here

        assertEquals("BC_EMPLOYEES_FIRSTNAME", names[0]);
        assertEquals("BC_EMPLOYEES_LASTNAME", names[1]);
        assertEquals("BC_EMPLOYEES_EMPLOYEENUMBER", names[2]);
        assertEquals("BC_EMPLOYEES_EMAIL", names[3]);

        final DataAttributes attributes = dataSchema.getAttributes(names[2]);
        // assert that formatting-label is not a default mapper
        final ConceptQueryMapper mapper = attributes.getMetaAttributeMapper(MetaAttributeNames.Formatting.NAMESPACE,
            MetaAttributeNames.Formatting.LABEL);
        if (mapper instanceof DefaultConceptQueryMapper)
        {
          fail("Formatting::label should be a LocalizedString instead of a default-mapper");
        }

        final Object value = attributes.getMetaAttribute(MetaAttributeNames.Formatting.NAMESPACE,
            MetaAttributeNames.Formatting.LABEL, null, new DefaultDataAttributeContext());
        if (value instanceof LocalizedString == false)
        {
          fail("Formatting::label should be a LocalizedString");
        }

        final Object label = attributes.getMetaAttribute(MetaAttributeNames.Formatting.NAMESPACE,
            MetaAttributeNames.Formatting.LABEL, String.class, new DefaultDataAttributeContext(Locale.US));
        if (label instanceof String == false)
        {
          fail("Formatting::label should be a String");
        }

        final Object elementAlignment = attributes.getMetaAttribute(MetaAttributeNames.Style.NAMESPACE,
            MetaAttributeNames.Style.HORIZONTAL_ALIGNMENT, null, new DefaultDataAttributeContext(Locale.US));
        if ("right".equals(elementAlignment) == false)
        {
          fail("Style::horizontal-alignment should be a String of value 'right'");
        }

        final DataAttributes attributes2 = dataSchema.getAttributes(names[0]);
        final Object elementAlignment2 = attributes2.getMetaAttribute(MetaAttributeNames.Style.NAMESPACE,
            MetaAttributeNames.Style.HORIZONTAL_ALIGNMENT, null, new DefaultDataAttributeContext(Locale.US));
        if ("left".equals(elementAlignment2) == false)
        {
          fail("Style::horizontal-alignment should be a String of value 'right'");
        }
View Full Code Here

  }

  public String getColumnName(final int column)
  {
    final DataAttributes attributes = columnAttributes.get(column);
    return (String) attributes.getMetaAttribute
        (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.NAME, String.class, dataAttributeContext);
  }
View Full Code Here

        (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.NAME, String.class, dataAttributeContext);
  }

  public Class getColumnClass(final int columnIndex)
  {
    final DataAttributes attributes = columnAttributes.get(columnIndex);
    return (Class) attributes.getMetaAttribute
        (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.TYPE, Class.class, dataAttributeContext);
  }
View Full Code Here

  {
    final ElementType targetType;
    if (dataSchemaModel != null)
    {
      final DataAttributeContext context = dataSchemaModel.getDataAttributeContext();
      final DataAttributes attributes = dataSchemaModel.getDataSchema().getAttributes(fieldName);
      targetType = AutoGeneratorUtility.createFieldType(attributes, context);
    }
    else
    {
      targetType = TextFieldType.INSTANCE;
View Full Code Here

      out.println("TableModel has no meta-data.");
      return;
    }

    final MetaTableModel metaTableModel = (MetaTableModel) mod;
    final DataAttributes tableAttributes = metaTableModel.getTableAttributes();
    final DataAttributeContext attributeContext =
        new DefaultDataAttributeContext(new GenericOutputProcessorMetaData(), Locale.US);

    final String[] tableAttrDomains = tableAttributes.getMetaAttributeDomains();
    Arrays.sort(tableAttrDomains);
    for (int i = 0; i < tableAttrDomains.length; i++)
    {
      final String tableAttrDomain = tableAttrDomains[i];
      final String[] attributeNames = tableAttributes.getMetaAttributeNames(tableAttrDomain);
      Arrays.sort(attributeNames);
      for (int j = 0; j < attributeNames.length; j++)
      {
        final String attributeName = attributeNames[j];
        final Object o =
            tableAttributes.getMetaAttribute(tableAttrDomain, attributeName, Object.class, attributeContext);

        out.println("TableAttribute [" + tableAttrDomain + ':' + attributeName + "]=" + format(o));
      }
    }

    for (int column = 0; column < mod.getColumnCount(); column++)
    {
      final DataAttributes columnAttributes = metaTableModel.getColumnAttributes(column);
      final String[] columnAttributeDomains = columnAttributes.getMetaAttributeDomains();
      Arrays.sort(columnAttributeDomains);
      for (int i = 0; i < columnAttributeDomains.length; i++)
      {
        final String colAttrDomain = columnAttributeDomains[i];
        final String[] attributeNames = columnAttributes.getMetaAttributeNames(colAttrDomain);
        Arrays.sort(attributeNames);
        for (int j = 0; j < attributeNames.length; j++)
        {
          final String attributeName = attributeNames[j];
          final Object o =
              columnAttributes.getMetaAttribute(colAttrDomain, attributeName, Object.class, attributeContext);

          out.println("ColumnAttribute(" + column + ") [" + colAttrDomain + ':' + attributeName + "]=" + format(o));
        }
      }
    }
View Full Code Here

TOP

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

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.