Examples of DefaultDataAttributeContext


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

      pmdDataFactory.setQuery("default", QUERY, null, null);
      final CloseableTableModel tableModel = (CloseableTableModel) pmdDataFactory.queryData("default", new ParameterDataRow());
      try
      {
        final DefaultDataSchemaDefinition def = new DefaultDataSchemaDefinition();
        final DataSchemaCompiler compiler = new DataSchemaCompiler(def, new DefaultDataAttributeContext());
        final DataSchema dataSchema = compiler.compile(tableModel);
        final String[] names = dataSchema.getNames();
        assertEquals(4, names.length);
        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

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

      final CloseableTableModel tableModel = (CloseableTableModel) pmdDataFactory.queryData("default", new ParameterDataRow());
      try
      {
        final DefaultDataSchemaDefinition def = new DefaultDataSchemaDefinition();
        final DataSchemaCompiler compiler = new DataSchemaCompiler(def, new DefaultDataAttributeContext());
        final DataSchema dataSchema = compiler.compile(tableModel);
        final String[] names = dataSchema.getNames();
        assertEquals(3, names.length);
        assertEquals("BC_CUSTOMER_W_TER_TERRITORY", names[0]);
        assertEquals("BC_ORDERDETAILS_QUANTITYORDERED", names[1]);
View Full Code Here

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

  private DataAttributes tableAttributes;
  private DataAttributeContext dataAttributeContext;

  public CachableTableModel(final TableModel model)
  {
    dataAttributeContext = new DefaultDataAttributeContext();
    columnAttributes = new ArrayList<DataAttributes>();
    if (model instanceof MetaTableModel)
    {
      final MetaTableModel metaTableModel = (MetaTableModel) model;
      for (int i = 0; i < model.getColumnCount(); i++)
View Full Code Here

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

    }

    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++)
    {
View Full Code Here

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

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

    final DataAttributeContext attributeContext =
        new DefaultDataAttributeContext(new GenericOutputProcessorMetaData(), Locale.US);

    out.println("Tablemodel contains " + mod.getRowCount() + " rows."); //$NON-NLS-1$ //$NON-NLS-2$
    out.println("Checking the attributes inside"); //$NON-NLS-1$
    for (int rows = 0; rows < mod.getRowCount(); rows++)
    {
View Full Code Here

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

    ArgumentNullException.validate("report", report);

    this.masterReportElement = masterReportElement;
    this.parent = report;
    this.dataSchemaDefinition = createDataSchemaDefinition(masterReportElement);
    this.dataAttributeContext = new DefaultDataAttributeContext();
  }
View Full Code Here

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

        {
          reportData = dataFactory.queryData
              (query, new QueryDataRowWrapper(new StaticDataRow(), queryTimeout, 1, sortConstraints));
        }

        offlineTableModel = new OfflineTableModel(reportData, new DefaultDataAttributeContext());
      }
      finally
      {
        if (reportData instanceof CloseableTableModel)
        {
View Full Code Here

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

      // this metadata layer is not cloneable, so malicious client code may
      // modify metadata objects.
      // We cant solve the problem here, so all we can do is hope and pray.

      final DataAttributeContext context = new DefaultDataAttributeContext();
      for (int i = 0; i < conceptMappers.size(); i++)
      {
        final ConceptQueryMapper conceptMapper = conceptMappers.get(i);
        final Object ivalue = conceptMapper.getValue(value, null, context);
        if (ivalue != null)
View Full Code Here

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

    gmr.expressionDataRow = new ExpressionDataRow(gmr.globalView, gmr, reportContext);
    gmr.schemaDefinition = schemaDefinition;
    gmr.dataFactory = new EmptyDataFactory();
    gmr.resourceBundleFactory = reportContext.getResourceBundleFactory();
    gmr.outputProcessorMetaData = reportContext.getOutputProcessorMetaData();
    final DefaultDataAttributeContext dac = new DefaultDataAttributeContext
        (gmr.outputProcessorMetaData, gmr.getResourceBundleFactory().getLocale());
    gmr.schemaCompiler =
        new ProcessingDataSchemaCompiler(schemaDefinition, dac, reportContext.getResourceManager(), null);
    gmr.dataSchema = null;
    gmr.setEnvironmentDataRow(new ReportEnvironmentDataRow(reportContext.getEnvironment()));
View Full Code Here

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

    if (dataSchemaDefinition == null)
    {
      throw new NullPointerException();
    }

    final DefaultDataAttributeContext dac = new DefaultDataAttributeContext
        (outputProcessorMetaData, resourceBundleFactory.getLocale());
    final GlobalMasterRow gmr = derive();
    gmr.schemaDefinition = dataSchemaDefinition;
    gmr.schemaCompiler = new ProcessingDataSchemaCompiler
        (dataSchemaDefinition, dac, schemaCompiler.getResourceManager(), schemaCompiler.getGlobalDefaults());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.