Package org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.templates

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.templates.TemplateCollector


  private void writeLegacyTemplate(final XmlWriter xmlWriter,
                                   final ReportWriterContext writerContext,
                                   final Template template) throws BundleWriterException, IOException
  {

    final TemplateCollector tc = writerContext.getTemplateCollector();

    // the template description of the element template will get the
    // template name as its name.
    final TemplateDescription templateDescription = tc.getDescription(template);

    if (templateDescription == null)
    {
      throw new BundleWriterException("Unknown template type: " + template);
    }
View Full Code Here


    }
    final ElementFactoryCollector elementFactory = new ElementFactoryCollector();
    final StyleKeyFactoryCollector styleKeyFactory = new StyleKeyFactoryCollector();
    final ClassFactoryCollector classFactory = new ClassFactoryCollector();
    final DataSourceCollector dataSourceFactory = new DataSourceCollector();
    final TemplateCollector templateFactory = new TemplateCollector();

    classFactory.configure(getRootHandler().getParserConfiguration());
    dataSourceFactory.configure(getRootHandler().getParserConfiguration());
    templateFactory.configure(getRootHandler().getParserConfiguration());

    getRootHandler().setHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME, report);
    getRootHandler().setHelperObject(ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
    getRootHandler().setHelperObject(ReportDefinitionReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
    getRootHandler().setHelperObject(ReportDefinitionReadHandler.CLASS_FACTORY_KEY, classFactory);
View Full Code Here

      classFactory.addFactory(new ArrayClassFactory());

      final DataSourceCollector dataSourceFactory = new DataSourceCollector();
      dataSourceFactory.addFactory(new DefaultDataSourceFactory());

      final TemplateCollector templateFactory = new TemplateCollector();
      templateFactory.addTemplateCollection(new DefaultTemplateCollection());

      classFactory.configure(rootHandler.getParserConfiguration());
      dataSourceFactory.configure(rootHandler.getParserConfiguration());
      templateFactory.configure(rootHandler.getParserConfiguration());

      rootHandler.setHelperObject(ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.CLASS_FACTORY_KEY, classFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.DATASOURCE_FACTORY_KEY, dataSourceFactory);
View Full Code Here

    if (className == null)
    {
      throw new ParseException("Attribute 'class' is missing.",
          getRootHandler().getDocumentLocator());
    }
    final TemplateCollector fc =
        (TemplateCollector) getRootHandler().getHelperObject
            (ReportDefinitionReadHandler.TEMPLATE_FACTORY_KEY);

    final TemplateCollection factory = (TemplateCollection)
        ObjectUtilities.loadAndInstantiate(className, getClass(), TemplateCollection.class);
    if (factory != null)
    {
      factory.configure(getRootHandler().getParserConfiguration());
      fc.addTemplateCollection(factory);
    }
  }
View Full Code Here

    {
      writeDataSource(element.getDataSource());
      return;
    }

    final TemplateCollector tc = getReportWriter().getTemplateCollector();
    final Template template = (Template) element.getDataSource();

    // the template description of the element template will get the
    // template name as its name.
    final TemplateDescription templateDescription =
        tc.getDescription(template);

    if (templateDescription == null)
    {
      throw new ReportWriterException("Unknown template type: " + template);
    }
View Full Code Here

    dataSourceCollector = new DataSourceCollector();
    elementFactoryCollector = new ElementFactoryCollector();
    classFactoryCollector = new ClassFactoryCollector();
    classFactoryCollector.addFactory(dataSourceCollector);
    styleKeyFactoryCollector = new StyleKeyFactoryCollector();
    templateCollector = new TemplateCollector();

    // configure all factories with the current report configuration ...
    dataSourceCollector.configure(configuration);
    classFactoryCollector.configure(configuration);
    templateCollector.configure(configuration);
View Full Code Here

      dataSourceFactory.configure(rootHandler.getParserConfiguration());
      rootHandler.setHelperObject(ExtSubReportReadHandler.DATASOURCE_FACTORY_KEY, dataSourceFactory);
    }
    if (rootHandler.getHelperObject(ExtSubReportReadHandler.TEMPLATE_FACTORY_KEY) == null)
    {
      final TemplateCollector templateFactory = new TemplateCollector();
      templateFactory.configure(rootHandler.getParserConfiguration());
      rootHandler.setHelperObject(ExtSubReportReadHandler.TEMPLATE_FACTORY_KEY, templateFactory);
    }

    report.setName(attrs.getValue(getUri(), "name"));
View Full Code Here

      classFactory.addFactory(new ArrayClassFactory());

      final DataSourceCollector dataSourceFactory = new DataSourceCollector();
      dataSourceFactory.addFactory(new DefaultDataSourceFactory());

      final TemplateCollector templateFactory = new TemplateCollector();
      templateFactory.addTemplateCollection(new DefaultTemplateCollection());

      classFactory.configure(rootHandler.getParserConfiguration());
      dataSourceFactory.configure(rootHandler.getParserConfiguration());
      templateFactory.configure(rootHandler.getParserConfiguration());

      rootHandler.setHelperObject(ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.CLASS_FACTORY_KEY, classFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.DATASOURCE_FACTORY_KEY, dataSourceFactory);
View Full Code Here

    {
      writeDataSource(element.getDataSource());
      return;
    }

    final TemplateCollector tc = getReportWriter().getTemplateCollector();
    final Template template = (Template) element.getDataSource();

    // the template description of the element template will get the
    // template name as its name.
    final TemplateDescription templateDescription =
        tc.getDescription(template);

    if (templateDescription == null)
    {
      throw new ReportWriterException("Unknown template type: " + template);
    }
View Full Code Here

      classFactory.addFactory(new ArrayClassFactory());

      final DataSourceCollector dataSourceFactory = new DataSourceCollector();
      dataSourceFactory.addFactory(new DefaultDataSourceFactory());

      final TemplateCollector templateFactory = new TemplateCollector();
      templateFactory.addTemplateCollection(new DefaultTemplateCollection());

      classFactory.configure(rootHandler.getParserConfiguration());
      dataSourceFactory.configure(rootHandler.getParserConfiguration());
      templateFactory.configure(rootHandler.getParserConfiguration());

      rootHandler.setHelperObject(ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.CLASS_FACTORY_KEY, classFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.DATASOURCE_FACTORY_KEY, dataSourceFactory);
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.templates.TemplateCollector

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.