Package org.pentaho.reporting.libraries.base.config

Examples of org.pentaho.reporting.libraries.base.config.HierarchicalConfiguration


        {
          props.setProperty(key, value);
        }
      }

      final ModifiableConfiguration config = new HierarchicalConfiguration(defaults);
      final Iterator keys = props.keySet().iterator();
      while (keys.hasNext())
      {
        final String key = (String) keys.next();
        config.setConfigProperty(key, props.getProperty(key));
      }
      return config;
    }
    catch (BackingStoreException be)
    {
View Full Code Here


    final Resource resource = resourceManager.createDirectly(url, ValidationSequence.class);
    final ValidationSequence sequence = (ValidationSequence) resource.getResource();

    final TestRuntime runtime = new TestRuntime(sequence);

    final HierarchicalConfiguration config = new HierarchicalConfiguration(
        ClassicEngineBoot.getInstance().getGlobalConfig());
    config.setConfigProperty("org.pentaho.reporting.engine.classic.core.modules.output.table.base.StrictLayout",
        "false");
    final OutputProcessorMetaData metaData = new HtmlOutputProcessorMetaData(config,
        HtmlOutputProcessorMetaData.PAGINATION_NONE);
    runtime.run(metaData);
  }
View Full Code Here

    final MasterReport report = state.getMasterReport();
    final ModifiableConfiguration rawConfig = report.getReportConfiguration();
    if (rawConfig instanceof HierarchicalConfiguration)
    {
      writer.writeTag(BundleNamespaces.SETTINGS, "configuration", XmlWriterSupport.OPEN);
      final HierarchicalConfiguration configuration = (HierarchicalConfiguration) rawConfig;
      final Enumeration keys = configuration.getConfigProperties();
      while (keys.hasMoreElements())
      {
        final String key = (String) keys.nextElement();
        final String value = configuration.getConfigProperty(key);
        if (value != null && configuration.isLocallyDefined(key))
        {
          writer.writeTag(BundleNamespaces.SETTINGS, "property", "name", key, XmlWriterSupport.OPEN);
          writer.writeTextNormalized(value, true);
          writer.writeCloseTag();
        }
View Full Code Here

    if (contentBase == null)
    {
      throw new NullPointerException("ContentBase is null");
    }
    final ModifiableConfiguration config =
        new HierarchicalConfiguration(report.getReportConfiguration());
    config.setConfigProperty(AbstractXmlResourceFactory.CONTENTBASE_KEY, contentBase.toExternalForm());

    final ReportWriter writer = new ReportWriter(report, encoding, config);
    writer.addClassFactoryFactory(new URLClassFactory());
    writer.addClassFactoryFactory(new DefaultClassFactory());
    writer.addClassFactoryFactory(new BandLayoutClassFactory());
View Full Code Here

   * @return the generated configuration.
   */
  public static Configuration createDefaultConfiguration(final MasterReport report)
  {
    final ModifiableConfiguration repConf =
        new HierarchicalConfiguration(report.getReportConfiguration());
    final ResourceKey contentBase = report.getContentBase();
    if (contentBase != null)
    {
      final ResourceManager resourceManager = report.getResourceManager();
      final URL value = resourceManager.toURL(contentBase);
      if (value != null)
      {
        repConf.setConfigProperty
            (AbstractXmlResourceFactory.CONTENTBASE_KEY, value.toExternalForm());
      }
    }

    return repConf;
View Full Code Here

  }

  private ReportWriter createWriter()
  {
    final MasterReport report = new MasterReport();
    final ModifiableConfiguration repConf = new HierarchicalConfiguration(report.getReportConfiguration());
    repConf.setConfigProperty
        (AbstractXmlResourceFactory.CONTENTBASE_KEY, "file://tmp/");

    final ReportWriter writer = new ReportWriter(report, "UTF-16", repConf);
    writer.addClassFactoryFactory(new URLClassFactory());
    writer.addClassFactoryFactory(new DefaultClassFactory());
View Full Code Here

  public MasterReport()
  {
    setElementType(new MasterReportType());
    setResourceBundleFactory(new LibLoaderResourceBundleFactory());

    this.reportConfiguration = new HierarchicalConfiguration
        (ClassicEngineBoot.getInstance().getGlobalConfig());
    this.parameterValues = new ReportParameterValues();

    setPageDefinition(null);
View Full Code Here

   * @return The configuration.
   */
  protected Configuration loadConfiguration()
  {

    final HierarchicalConfiguration globalConfig = new HierarchicalConfiguration(getClass());

    final PropertyFileConfiguration rootProperty = new PropertyFileConfiguration();
    rootProperty.load("/org/pentaho/reporting/engine/classic/core/classic-engine.properties", ClassicEngineBoot.class); // NON-NLS
    globalConfig.insertConfiguration(rootProperty);
    globalConfig.insertConfiguration(getPackageManager().getPackageConfiguration());

    try
    {
      final String userConfigStripped = "classic-engine.properties"; // NON-NLS
      final Enumeration userConfigs = ObjectUtilities.getClassLoader(ClassicEngineBoot.class).getResources(
          userConfigStripped);
      final ArrayList configs = new ArrayList();
      while (userConfigs.hasMoreElements())
      {
        final URL url = (URL) userConfigs.nextElement();
        try
        {
          final PropertyFileConfiguration baseProperty = new PropertyFileConfiguration();
          final InputStream in = url.openStream();
          try
          {
            baseProperty.load(in);
          }
          finally
          {
            in.close();
          }
          configs.add(baseProperty);
        }
        catch (IOException ioe)
        {
          logger.warn("Failed to load the user configuration at " + url, ioe); // NON-NLS
        }
      }

      for (int i = configs.size() - 1; i >= 0; i--)
      {
        final PropertyFileConfiguration baseProperty = (PropertyFileConfiguration) configs.get(i);
        globalConfig.insertConfiguration(baseProperty);
      }
    }
    catch (IOException e)
    {
      logger.warn("Failed to lookup the user configurations.", e); // NON-NLS
    }

    globalConfig.insertConfiguration(ClassicEngineBoot.configWrapper);

    final SystemPropertyConfiguration systemConfig = new SystemPropertyConfiguration();
    globalConfig.insertConfiguration(systemConfig);
    return globalConfig;
  }
View Full Code Here

  private HierarchicalConfiguration configuration;
  private ConfigEditorPane editorPane;

  public ConfigEditor() throws ConfigTreeModelException
  {
    this(new HierarchicalConfiguration(ConfigEditorBoot.getInstance().getGlobalConfig()),
        ConfigEditorBoot.getInstance().getPackageManager());
  }
View Full Code Here

      finally
      {
        in.close();
      }

      final ModifiableConfiguration config = new HierarchicalConfiguration(defaults);
      final Iterator keys = properties.keySet().iterator();
      while (keys.hasNext())
      {
        final String key = (String) keys.next();
        config.setConfigProperty(key, properties.getProperty(key));
      }
      return config;
    }
    catch (Exception e)
    {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.base.config.HierarchicalConfiguration

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.