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

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


    initializeFromJob(reportJob, guiContext);
    createParametersPanelContent();

    final FormValidator formValidator = getFormValidator();
    formValidator.setEnabled(false);
    final ModifiableConfiguration repConf = reportJob.getReportConfiguration();
    final boolean inputStorageEnabled = isInputStorageEnabled(repConf);

    final Configuration loadedConfiguration;
    if (inputStorageEnabled)
    {
      loadedConfiguration = loadFromConfigStore(reportJob, repConf);
    }
    else
    {
      loadedConfiguration = repConf;
    }

    setDialogContents(loadedConfiguration);

    formValidator.setEnabled(true);
    formValidator.handleValidate();
    setModal(true);
    SwingUtil.centerDialogInParent(this);
    setVisible(true);
    if (isConfirmed() == false)
    {
      this.guiContext = defaultContext;
      return false;
    }

    formValidator.setEnabled(false);

    final Configuration fullDialogContents = grabDialogContents(true);
    final Enumeration configProperties =
        fullDialogContents.getConfigProperties();
    while (configProperties.hasMoreElements())
    {
      final String key = (String) configProperties.nextElement();
      repConf.setConfigProperty(key, fullDialogContents.getConfigProperty(key));
    }

    if (inputStorageEnabled)
    {
      saveToConfigStore(reportJob, repConf);
View Full Code Here


        {
          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

   * @param full
   * @return
   */
  protected Configuration grabDialogContents(final boolean full)
  {
    final ModifiableConfiguration config = new DefaultConfiguration();
    config.setConfigProperty(CSVProcessor.CSV_SEPARATOR, getSeparatorString());
    config.setConfigProperty(CSVProcessor.CSV_DATAROWNAME, String.valueOf(isColumnNamesAsFirstRow()));
    config.setConfigProperty(CSVProcessor.CSV_ENCODING, getEncoding());

    config.setConfigProperty(CSVProcessor.CSV_ENABLE_GROUPFOOTERS, String.valueOf(isEnableGroupFooter()));
    config.setConfigProperty(CSVProcessor.CSV_ENABLE_GROUPHEADERS, String.valueOf(isEnableGroupHeader()));
    config.setConfigProperty(CSVProcessor.CSV_ENABLE_ITEMBANDS, String.valueOf(isEnableItembands()));
    config.setConfigProperty(CSVProcessor.CSV_ENABLE_REPORTFOOTER, String.valueOf(isEnableReportFooter()));
    config.setConfigProperty(CSVProcessor.CSV_ENABLE_REPORTHEADER, String.valueOf(isEnableReportHeader()));

    config.setConfigProperty
        ("org.pentaho.reporting.engine.classic.core.modules.gui.csv.FileName", getFilename()); //$NON-NLS-1$
    config.setConfigProperty(CSVProcessor.CSV_WRITE_STATECOLUMNS, "false"); //$NON-NLS-1$

    return config;
  }
View Full Code Here

  }

  public static void printDirectly(final MasterReport report, final ReportProgressListener progressListener)
      throws PrinterException, ReportProcessingException
  {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();
    final String jobName = reportConfiguration.getConfigProperty
        (PRINTER_JOB_NAME_KEY, report.getTitle());

    final PrinterJob printerJob = PrinterJob.getPrinterJob();
    if (jobName != null)
    {
View Full Code Here

  }

  public static boolean print(final MasterReport report, final ReportProgressListener progressListener)
      throws PrinterException, ReportProcessingException
  {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();
    final String jobName = reportConfiguration.getConfigProperty(PRINTER_JOB_NAME_KEY, report.getTitle());

    final PrinterJob printerJob = PrinterJob.getPrinterJob();
    if (jobName != null)
    {
      printerJob.setJobName(jobName);
View Full Code Here

    {
      throw new NullPointerException();
    }

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

   * @param full
   * @return
   */
  protected Configuration grabDialogContents(final boolean full)
  {
    final ModifiableConfiguration config = new DefaultConfiguration();
    config.setConfigProperty(CSVProcessor.CSV_SEPARATOR, getSeparatorString());
    config.setConfigProperty(CSVTableModule.SEPARATOR, getSeparatorString());
    config.setConfigProperty(CSVTableModule.STRICT_LAYOUT + ".StrictLayout", //$NON-NLS-1$
        String.valueOf(isStrictLayout()));
    config.setConfigProperty(CSVTableModule.ENCODING, getEncoding());

    config.setConfigProperty
        ("org.pentaho.reporting.engine.classic.core.modules.gui.csv.FileName", getFilename()); //$NON-NLS-1$
    config.setConfigProperty(CSVProcessor.CSV_WRITE_STATECOLUMNS, "false"); //$NON-NLS-1$

    return config;
  }
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

   * @param report the report for which to create the writer configuration.
   * @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

TOP

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

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.