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

Examples of org.pentaho.reporting.engine.classic.core.CompoundDataFactory


    this.currentRow = currentRow;
    this.dataRow = dataRow;
    this.configuration = this.processingContext.getConfiguration();
    this.resourceBundleFactory = processingContext.getResourceBundleFactory();
    this.dataSchema = new DefaultDataSchema();
    this.dataFactory = new CompoundDataFactory();
  }
View Full Code Here


      wizardController.getEditorModel().setReportDefinition(original, true);
    }
    else
    {
      final MasterReport report = new MasterReport();
      report.setDataFactory(new CompoundDataFactory());
      report.setQuery(null);
      report.setAutoSort(Boolean.TRUE);
      wizardController.getEditorModel().setReportDefinition(report, false);
    }
View Full Code Here

  private static MasterReport createDefaultReport()
  {
    final MasterReport report = new MasterReport();
    report.setAutoSort(Boolean.TRUE);
    report.setDataFactory(new CompoundDataFactory());
    report.setQuery(null);
    return report;
  }
View Full Code Here

  }

  public void testSequenceDataSourceInsulation() throws Exception
  {
    MasterReport report = DebugReportRunner.parseGoldenSampleReport("Prd-4606-0001.prpt");
    CompoundDataFactory dataFactory = (CompoundDataFactory) report.getDataFactory();
    SequenceDataFactory sequenceDf = (SequenceDataFactory) dataFactory.getReference(0);
    PerformanceTestSequence sequence = (PerformanceTestSequence) sequenceDf.getSequence("Query 1");
    sequence.setParameter("limit", 20000);

    MasterReport reportV = DebugReportRunner.parseGoldenSampleReport("Prd-4606-0001.prpt");
    CompoundDataFactory dataFactoryV = (CompoundDataFactory) reportV.getDataFactory();
    SequenceDataFactory sequenceDfV = (SequenceDataFactory) dataFactoryV.getReference(0);
    PerformanceTestSequence sequenceV = (PerformanceTestSequence) sequenceDfV.getSequence("Query 1");

    assertEquals(10, sequenceV.getParameter("limit"));
  }
View Full Code Here

    {
      throw new NullPointerException();
    }


    final CompoundDataFactory compoundDataFactory = (CompoundDataFactory) dataFactory;

    final String fileName = BundleUtilities.getUniqueName(bundle, state.getFileName(),
        "datasources/compound-ds{0}.xml");
    if (fileName == null)
    {
      throw new IOException("Unable to generate unique name for Inline-Data-Source");
    }

    final OutputStream outputStream = bundle.createEntry(fileName, "text/xml");
    final DefaultTagDescription tagDescription = new DefaultTagDescription();
    tagDescription.setDefaultNamespace(CompoundDataFactoryModule.NAMESPACE);
    tagDescription.setNamespaceHasCData(CompoundDataFactoryModule.NAMESPACE, false);
    final XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), tagDescription, "  ",
        "\n");
    final AttributeList rootAttrs = new AttributeList();
    rootAttrs.addNamespaceDeclaration("data", CompoundDataFactoryModule.NAMESPACE);
    xmlWriter.writeTag(CompoundDataFactoryModule.NAMESPACE, "compound-datasource", rootAttrs, XmlWriterSupport.OPEN);

    for (int i = 0; i < compoundDataFactory.size(); i++)
    {
      final DataFactory df = compoundDataFactory.get(i);
      final BundleDataFactoryWriterHandler writerHandler = BundleWriterUtilities.lookupWriteHandler(df);
      if (writerHandler == null)
      {
        throw new BundleWriterException("Unable to find writer-handler for data-factory " + df.getClass());
      }
View Full Code Here

   *
   * @throws SAXException if there is a parsing error.
   */
  protected void doneParsing() throws SAXException
  {
    final CompoundDataFactory srdf = new CompoundDataFactory();
    for (int i = 0; i < dataFactories.size(); i++)
    {
      final DataFactoryReadHandler handler = dataFactories.get(i);
      srdf.add(handler.getDataFactory());
    }

    dataFactory = srdf;
  }
View Full Code Here

        final ParameterDefinitionEntry entry = entries[i];
        inspectParameter(reportDefinition, parameters, entry);
      }
    }

    final CompoundDataFactory dataFactory = CompoundDataFactory.normalize(reportDefinition.getDataFactory(), false);
    final int size = dataFactory.size();
    for (int i = 0; i < size; i++)
    {
      inspectDataSource(reportDefinition, dataFactory.getReference(i));
    }

    final ExpressionCollection expressions = reportDefinition.getExpressions();
    final Expression[] expressionsArray = expressions.getExpressions();
    for (int i = 0; i < expressionsArray.length; i++)
View Full Code Here

    while (reportDefinition != null)
    {
      final DataFactory reportDataFactory = reportDefinition.getDataFactory();
      if (reportDataFactory instanceof CompoundDataFactory)
      {
        final CompoundDataFactory compoundDataFactory = (CompoundDataFactory) reportDataFactory;
        for (int i = 0; i < compoundDataFactory.size(); i++)
        {
          final DataFactory df = compoundDataFactory.getReference(i);
          for (final String query : df.getQueryNames())
          {
            if (!query.equals(queryName))
            {
              continue;
View Full Code Here

    ClassicEngineBoot.getInstance().start();
  }

  public void testDataFactoryInspection()
  {
    CompoundDataFactory cdf = new CompoundDataFactory();
    cdf.add(new TableDataFactory("query1", new DefaultTableModel()));
    cdf.add(new TableDataFactory("query2", new DefaultTableModel()));
    MasterReport report = new MasterReport();
    report.setDataFactory(cdf);

    final int[] callCount = new int[1];
    final TestStructureVisitor v = new TestStructureVisitor(callCount);
View Full Code Here

      reportDataFactory = masterReport.getDataFactory();
      resourceManager = masterReport.getResourceManager();
      resourceBundleFactory = masterReport.getResourceBundleFactory();
    }

    final CompoundDataFactory compoundDataFactory = new CompoundDataFactory();
    compoundDataFactory.add(dataFactory);
    for (int i = 0; i < additionalDataFactories.length; i++)
    {
      compoundDataFactory.add(additionalDataFactories[i]);
    }
    if (reportDataFactory != null)
    {
      compoundDataFactory.add(reportDataFactory);
    }

    final DesignTimeDataFactoryContext dataFactoryContext = new DesignTimeDataFactoryContext(configuration,
        resourceManager, contentBase, MasterReport.computeAndInitResourceBundleFactory
        (resourceBundleFactory, reportEnvironment), compoundDataFactory);
    dataFactory.initialize(dataFactoryContext);
    compoundDataFactory.initialize(dataFactoryContext);
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.CompoundDataFactory

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.