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

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


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


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

    if (staticConfig != null)
    {
      final PropertyFileConfiguration rootProperty = new PropertyFileConfiguration();
      rootProperty.load(staticConfig, source);
      globalConfig.insertConfiguration(rootProperty);
      globalConfig.insertConfiguration(getPackageManager().getPackageConfiguration());
    }

    if (userConfig != null)
    {
      final String userConfigStripped;
      if (userConfig.charAt(0) == '/')
      {
        userConfigStripped = userConfig.substring(1);
      }
      else
      {
        userConfigStripped = userConfig;
      }

      try
      {
        final Enumeration userConfigs = ObjectUtilities.getClassLoader(source).getResources(userConfigStripped);
        final ArrayList<PropertyFileConfiguration> configs = new ArrayList<PropertyFileConfiguration>();
        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);
          }
        }

        final PropertyFileConfiguration compressedUserConfig = new PropertyFileConfiguration();
        for (int i = configs.size() - 1; i >= 0; i--)
        {
          final PropertyFileConfiguration baseProperty = configs.get(i);
          compressedUserConfig.addAll(baseProperty);
        }
        globalConfig.insertConfiguration(compressedUserConfig);
      }
      catch (IOException e)
View Full Code Here

   */
  protected Configuration loadConfiguration ()
  {
    final HierarchicalConfiguration globalConfig = new HierarchicalConfiguration();

    final PropertyFileConfiguration rootProperty = new PropertyFileConfiguration();
    rootProperty.load("/org/jfree/layouting/layout.properties");
    globalConfig.insertConfiguration(rootProperty);
    globalConfig.insertConfiguration(getPackageManager().getPackageConfiguration());

    final PropertyFileConfiguration baseProperty = new PropertyFileConfiguration();
    baseProperty.load("/layout.properties");
    globalConfig.insertConfiguration(baseProperty);

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

   */
  protected Configuration loadConfiguration ()
  {
    HierarchicalConfiguration globalConfig = new HierarchicalConfiguration();

    final PropertyFileConfiguration rootProperty = new PropertyFileConfiguration();
    rootProperty.load("/org/jfree/report/jfreereport.properties");
    rootProperty.load("/org/jfree/report/ext/jfreereport-ext.properties");
    globalConfig.insertConfiguration(rootProperty);
    globalConfig.insertConfiguration(JFreeReportBoot.getInstance().getPackageManager()
            .getPackageConfiguration());

    final PropertyFileConfiguration baseProperty = new PropertyFileConfiguration();
    baseProperty.load("/jfreereport.properties");
    globalConfig.insertConfiguration(baseProperty);

    globalConfig.insertConfiguration(configWrapper);

    final SystemPropertyConfiguration systemConfig = new SystemPropertyConfiguration();
View Full Code Here

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

    if (staticConfig != null)
    {
      final PropertyFileConfiguration rootProperty = new PropertyFileConfiguration();
      rootProperty.load(staticConfig, source);
      globalConfig.insertConfiguration(rootProperty);
      globalConfig.insertConfiguration(getPackageManager().getPackageConfiguration());
    }

    if (userConfig != null)
    {
      final String userConfigStripped;
      if (userConfig.charAt(0) == '/')
      {
        userConfigStripped = userConfig.substring(1);
      }
      else
      {
        userConfigStripped = userConfig;
      }

      try
      {
        final Enumeration userConfigs = ObjectUtilities.getClassLoader(source).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);
          }
        }

        for (int i = configs.size() - 1; i >= 0; i--)
        {
          final PropertyFileConfiguration baseProperty = (PropertyFileConfiguration) configs.get(i);
          globalConfig.insertConfiguration(baseProperty);
        }
      }
      catch (IOException e)
      {
View Full Code Here

TOP

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

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.