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

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


    final DataFactory dataFactory = abstractReportDefinition.getDataFactory();
    if (dataFactory instanceof CompoundDataFactory == false)
    {
      throw new IllegalStateException();
    }
    final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
    if (newElement != null)
    {
      cdf.remove(position);
      abstractReportDefinition.notifyNodeChildRemoved(newElement);
    }
    if (oldElement != null)
    {
      cdf.add(position, oldElement);
      abstractReportDefinition.notifyNodeChildAdded(oldElement);
    }
  }
View Full Code Here


    final DataFactory dataFactory = abstractReportDefinition.getDataFactory();
    if (dataFactory instanceof CompoundDataFactory == false)
    {
      throw new IllegalStateException();
    }
    final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
    if (oldElement != null)
    {
      cdf.remove(position);
      abstractReportDefinition.notifyNodeChildRemoved(oldElement);
    }
    if (newElement != null)
    {
      cdf.add(position, newElement);
      abstractReportDefinition.notifyNodeChildAdded(newElement);
    }
  }
View Full Code Here

  public void testSampleReport() throws Exception
  {
    URL resource = getClass().getResource("Prd-4843.prpt");
    MasterReport report = (MasterReport)
        new ResourceManager().createDirectly(resource, MasterReport.class).getResource();
    CompoundDataFactory dataFactory = (CompoundDataFactory) report.getDataFactory();
    SQLReportDataFactory dataFactory1 = (SQLReportDataFactory) dataFactory.get(0);
    DriverConnectionProvider conProv1 = (DriverConnectionProvider) dataFactory1.getConnectionProvider();
    Assert.assertEquals("abcdefghijk", conProv1.getProperty("user"));
    Assert.assertEquals("abcdefghijk", conProv1.getProperty("password"));
    SQLReportDataFactory dataFactory2 = (SQLReportDataFactory) dataFactory.get(1);
    DriverConnectionProvider conProv2 = (DriverConnectionProvider) dataFactory2.getConnectionProvider();
    Assert.assertEquals("abcdefghijkl", conProv2.getProperty("user"));
    Assert.assertEquals("abcdefghijkl", conProv2.getProperty("password"));
  }
View Full Code Here

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

    final CompoundDataFactory compoundDataFactory = (CompoundDataFactory) dataFactory;

    final AttributeList rootAttrs = new AttributeList();
    if (xmlWriter.isNamespaceDefined(CompoundDataFactoryModule.NAMESPACE) == false)
    {
      rootAttrs.addNamespaceDeclaration("data", CompoundDataFactoryModule.NAMESPACE);
    }
    xmlWriter.writeTag(SQLDataFactoryModule.NAMESPACE, "sql-datasource", rootAttrs, XmlWriterSupport.OPEN);
    xmlWriter.writeTag(CompoundDataFactoryModule.NAMESPACE, "compound-datasource", rootAttrs, XmlWriterSupport.OPEN);

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

  }

  public void testValidTable() 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");
    assertEquals(10, sequence.getParameter("limit"));

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
View Full Code Here

    ClassicEngineBoot.getInstance().getEditableConfig().setConfigProperty
        ("org.pentaho.reporting.engine.classic.core.layout.process.EnableCountBoxesStep", "true");
    ClassicEngineBoot.getInstance().getEditableConfig().setConfigProperty
        ("org.pentaho.reporting.engine.classic.core.layout.ParanoidChecks", "false");
    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);

    StopWatch sw = StopWatch.startNew();
    DebugReportRunner.createXmlFlow(report);
View Full Code Here

    ClassicEngineBoot.getInstance().getEditableConfig().setConfigProperty
        ("org.pentaho.reporting.engine.classic.core.layout.process.EnableCountBoxesStep", "true");
    ClassicEngineBoot.getInstance().getEditableConfig().setConfigProperty
        ("org.pentaho.reporting.engine.classic.core.layout.ParanoidChecks", "false");
    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);

    // ModelPrinter.INSTANCE.print(DebugReportRunner.layoutPage(report, 0));
View Full Code Here

    ClassicEngineBoot.getInstance().getEditableConfig().setConfigProperty
        ("org.pentaho.reporting.engine.classic.core.layout.ParanoidChecks", "false");
    MasterReport report = DebugReportRunner.parseGoldenSampleReport("Prd-4606-0003.prpt");
    report.setPageDefinition(new SimplePageDefinition(new PageSize(500, 100)));

    CompoundDataFactory dataFactory = (CompoundDataFactory) report.getDataFactory();
    SequenceDataFactory sequenceDf = (SequenceDataFactory) dataFactory.getReference(0);
    PerformanceTestSequence sequence = (PerformanceTestSequence) sequenceDf.getSequence("Query 1");
    sequence.setParameter("limit", 10);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 1);
  }
View Full Code Here

    ClassicEngineBoot.getInstance().start();
  }

  public void testCascadingAndCaching() throws ReportDataFactoryException
  {
    final CompoundDataFactory cdf = new CompoundDataFactory();
    cdf.add(new TableDataFactory("static", new DefaultTableModel()));

    final CachingDataFactory caDf = new CachingDataFactory(cdf, true);

    final CompoundDataFactory ccdf = new CascadingDataFactory();
    ccdf.add(caDf);
    ccdf.add(new StaticDataFactory());

    assertTrue(ccdf.isQueryExecutable("static", new StaticDataRow()));
    assertNotNull(ccdf.queryData("static", new StaticDataRow()));
  }
View Full Code Here

  {
    this.parameterDefinition = new DefaultParameterDefinition();
    this.resourceBundleFactory = new DefaultResourceBundleFactory();
    this.resourceManager = new ResourceManager();
    this.parameterValues = new ReportParameterValues();
    this.dataFactory = new CompoundDataFactory();
    this.headers = new ArrayList();
    this.attachmentReports = new ArrayList();
    this.attachmentTypes = new ArrayList();
    this.sessionProperties = new Properties();
    this.reportEnvironment = new DefaultReportEnvironment(ClassicEngineBoot.getInstance().getGlobalConfig());
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.