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

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


    clear();
    initializeFromJob(reportJob, guiContext);

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

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

    setDialogContents(loadedConfiguration);

    formValidator.setEnabled(true);
    formValidator.handleValidate();
    setModal(true);
    setVisible(true);
    if (isConfirmed() == false)
    {
      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


     */
    public void setConfigProperty (final String key, final String value)
    {
      if (wrappedConfiguration instanceof ModifiableConfiguration)
      {
        final ModifiableConfiguration modConfiguration =
                (ModifiableConfiguration) wrappedConfiguration;
        modConfiguration.setConfigProperty(key, value);
      }
    }
View Full Code Here

     */
    public Enumeration getConfigProperties ()
    {
      if (wrappedConfiguration instanceof ModifiableConfiguration)
      {
        final ModifiableConfiguration modConfiguration =
                (ModifiableConfiguration) wrappedConfiguration;
        return modConfiguration.getConfigProperties();
      }
      return super.getConfigProperties();
    }
View Full Code Here

      final InputStream in = new BufferedInputStream(new FileInputStream(
              target));
      properties.load(in);
      in.close();

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

    return "org.jfree.report.modules.gui.common.html.file.";
  }

  protected Configuration grabDialogContents(boolean full)
  {
    ModifiableConfiguration conf = new DefaultConfiguration();
    if (full)
    {
      conf.setConfigProperty
          ("org.jfree.report.modules.gui.common.html.file.TargetFileName", filenameField.getText());
      conf.setConfigProperty
          ("org.jfree.report.modules.gui.common.html.file.DataDirectory", dataDirField.getText());
    }
    conf.setConfigProperty
        ("org.jfree.report.modules.gui.common.html.file.ExportMethod", getExportMethod());

    return conf;
  }
View Full Code Here

  public JFreeReportPreviewSwingComponent() {
  }

  @Override
  protected boolean performExport( final MasterReport report ) {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();

    final boolean progressBar =
        getInputBooleanValue(
            AbstractJFreeReportComponent.REPORTSWING_PROGRESSBAR,
            "true".equals( reportConfiguration.getConfigProperty(
              JFreeReportPreviewSwingComponent.PROGRESS_BAR_ENABLED_KEY ) ) ); //$NON-NLS-1$
    final boolean progressDialog =
        getInputBooleanValue(
            AbstractJFreeReportComponent.REPORTSWING_PROGRESSDIALOG,
            "true".equals( reportConfiguration.getConfigProperty(
              JFreeReportPreviewSwingComponent.PROGRESS_DIALOG_ENABLED_KEY ) ) ); //$NON-NLS-1$
    reportConfiguration.setConfigProperty( JFreeReportPreviewSwingComponent.PROGRESS_DIALOG_ENABLED_KEY, String
        .valueOf( progressDialog ) );
    reportConfiguration.setConfigProperty( JFreeReportPreviewSwingComponent.PROGRESS_BAR_ENABLED_KEY, String
        .valueOf( progressBar ) );

    final PreviewDialog dialog = createDialog( report );
    final ReportController reportController = getReportController();
    if ( reportController != null ) {
View Full Code Here

  }

  private void setReportConfigParameters( final MasterReport report, final Map values ) {
    Map.Entry ent;
    ModifiableConfiguration config = report.getReportConfiguration();
    Iterator it = values.entrySet().iterator();
    while ( it.hasNext() ) {
      ent = (Map.Entry) it.next();
      if ( ( ent.getKey() != null ) && ( ent.getValue() != null ) ) {
        config.setConfigProperty( ent.getKey().toString(), applyInputsToFormat( ent.getValue().toString() ) );
      }
    }
  }
View Full Code Here

  }

  private void setReportConfigParameters( final MasterReport report, final IPentahoResultSet values ) {
    int rowCount = values.getRowCount();
    int colCount = values.getColumnCount();
    ModifiableConfiguration config = report.getReportConfiguration();
    if ( colCount >= 2 ) {
      IPentahoMetaData md = values.getMetaData();
      int nameIdx = md.getColumnIndex( "name" ); //$NON-NLS-1$
      int valIdx = md.getColumnIndex( "value" ); //$NON-NLS-1$
      if ( nameIdx < 0 ) {
        nameIdx = 0;
      }
      if ( valIdx < 0 ) {
        valIdx = 1;
      }
      for ( int i = 0; i < rowCount; i++ ) {
        Object[] aRow = values.getDataRow( i );
        if ( ( aRow[nameIdx] != null ) && ( aRow[valIdx] != null ) ) {
          config.setConfigProperty( aRow[nameIdx].toString(), applyInputsToFormat( aRow[valIdx].toString() ) );
        }
      }
    } else {
      error( Messages.getInstance().getErrorString( "JFreeReport.ERROR_0025_INVALID_REPORT_CONFIGURATION_PARAMETERS" ) ); //$NON-NLS-1$
    }
View Full Code Here

    }
    return result;
  }

  protected boolean writeSwingPreview( final MasterReport report ) {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();

    final boolean progressBar =
        getInputBooleanValue( AbstractJFreeReportComponent.REPORTSWING_PROGRESSBAR,
            "true".equals( reportConfiguration.getConfigProperty( JFreeReportComponent.PROGRESS_BAR_ENABLED_KEY ) ) ); //$NON-NLS-1$
    final boolean progressDialog =
        getInputBooleanValue( AbstractJFreeReportComponent.REPORTSWING_PROGRESSDIALOG,
            "true".equals( reportConfiguration.getConfigProperty( JFreeReportComponent.PROGRESS_DIALOG_ENABLED_KEY ) ) ); //$NON-NLS-1$
    reportConfiguration.setConfigProperty( JFreeReportComponent.PROGRESS_DIALOG_ENABLED_KEY, String
        .valueOf( progressDialog ) );
    reportConfiguration
        .setConfigProperty( JFreeReportComponent.PROGRESS_BAR_ENABLED_KEY, String.valueOf( progressBar ) );

    final PreviewDialog dialog = createDialog( report );
    final ReportController reportController = getReportController();
    if ( reportController != null ) {
View Full Code Here

  }

  private void setReportConfigParameters( final MasterReport report, final Map values ) {
    Map.Entry ent;
    ModifiableConfiguration config = report.getReportConfiguration();
    Iterator it = values.entrySet().iterator();
    while ( it.hasNext() ) {
      ent = (Map.Entry) it.next();
      if ( ( ent.getKey() != null ) && ( ent.getValue() != null ) ) {
        config.setConfigProperty( ent.getKey().toString(), applyInputsToFormat( ent.getValue().toString() ) );
      }
    }
  }
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.