/** * Returns a new (and not connected to the default config from the job) configuration containing all properties from * the dialog. * * @param full * @return */ protected Configuration grabDialogContents( final boolean full ) { final DefaultConfiguration p = new DefaultConfiguration(); if ( full ) { p.setProperty( "org.pentaho.reporting.engine.classic.core.modules.gui.xls.FileName", getFilename() ); //$NON-NLS-1$ } p.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.table.xls.StrictLayout", String .valueOf( isStrictLayout() ) ); //$NON-NLS-1$ return p; }
private void generateEncodingEntry( final Properties props, final String prefix ) { final String className = propertySet.getConfigProperty( prefix + "ClassName" ); final String encoding = propertySet.getConfigProperty( prefix + "Encoding" ); if ( className == null ) { logger.info( "Not generating Encoding: " + prefix + ": ClassName missing" ); return; } if ( encoding == null ) { logger.info( "Not generating Encoding: " + prefix + ": Encoding missing" ); return; } props.setProperty( encoding, className + ".ser" ); }
public Configuration getConfiguration() { return (Configuration) configuration.clone(); }
/** * Sets the value of a configuration property. * * @param key the property key. * @param value the property value. */ public void setConfigProperty( final String key, final String value ) { if ( value == null ) { remove( key ); } else { setProperty( key, value ); } } }
/** * Returns a new (and not connected to the default config from the job) configuration containing all properties from * the dialog. * * @param full * @return */ protected Configuration grabDialogContents( final boolean full ) { final DefaultConfiguration p = new DefaultConfiguration(); if ( full ) { p.setProperty( "org.pentaho.reporting.engine.classic.core.modules.gui.rtf.FileName", getFilename() ); //$NON-NLS-1$ } p.setProperty( "org.pentaho.reporting.engine.classic.core.modules.output.table.rtf.StrictLayout", //$NON-NLS-1$ String.valueOf( isStrictLayout() ) ); return p; }
final DefaultConfiguration props = new DefaultConfiguration(); props.load( in ); final Iterator<String> keys = props.findPropertyKeys( "dependency." ); while ( keys.hasNext() ) { final String key = keys.next(); final String moduleHandle = key.substring( 0, key.length() - ".dependency-type".length() ); final DefaultModuleInfo module = readExternalModule( props, moduleHandle ); if ( "optional".equals( props.getConfigProperty( key ) ) ) { optionalModules.add( module ); } else {
/** * Creates a new configuration. */ public HierarchicalConfiguration() { this.configuration = new DefaultConfiguration(); }
final DefaultConfiguration config = new DefaultConfiguration(); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Keywords", //$NON-NLS-1$ txKeywords.getText() ); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Description", //$NON-NLS-1$ txDescription.getText() ); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Author", //$NON-NLS-1$ txAuthor.getText() ); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Title", //$NON-NLS-1$ txTitle.getText() ); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.gui.pdf.TargetFileName", //$NON-NLS-1$ txFilename.getText() ); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Encoding", //$NON-NLS-1$ encodingModel.getSelectedEncoding() ); config.getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PrintLevel", //$NON-NLS-1$ getPrintLevel() ); config.getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Encryption", //$NON-NLS-1$ getEncryptionValue() ); config.getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.UserPassword", //$NON-NLS-1$ txUserPassword.getText() ); config.getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.OwnerPassword", //$NON-NLS-1$ txOwnerPassword.getText() ); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.AllowAssembly", //$NON-NLS-1$ String.valueOf( cxAllowAssembly.isSelected() ) ); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.AllowCopy", //$NON-NLS-1$ String.valueOf( cxAllowCopy.isSelected() ) ); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.AllowFillIn", //$NON-NLS-1$
public BundleSettings( final Configuration configuration ) { if ( configuration == null ) { throw new NullPointerException(); } final DefaultConfiguration defConf = new DefaultConfiguration(); final Enumeration configProperties = configuration.getConfigProperties(); while ( configProperties.hasMoreElements() ) { final String key = (String) configProperties.nextElement(); final String value = configuration.getConfigProperty( key ); if ( value != null ) { defConf.setConfigProperty( key, value ); } } this.configuration = defConf; }
propertySet = new DefaultConfiguration(); try { propertySet.load( propIn ); } finally { propIn.close();
protected PrinterEncoding[] loadEncodings( final DefaultConfiguration encodingConfig ) { final Iterator it = encodingConfig.findPropertyKeys( PropertyPrinterSpecificationLoader.ENCODING_PREFIX ); while ( it.hasNext() ) { final String name = (String) it.next(); final String encodingKey = (String) encIt.next(); final String encodingName = encodingConfig.getProperty( PropertyPrinterSpecificationLoader.ENCODING_PREFIX + encodingKey + PropertyPrinterSpecificationLoader.ENCODING_NAME ); final String encodingCharset = encodingConfig.getProperty( PropertyPrinterSpecificationLoader.ENCODING_PREFIX + encodingKey + PropertyPrinterSpecificationLoader.ENCODING_CHARSET ); final String encodingBytes = encodingConfig.getProperty( PropertyPrinterSpecificationLoader.ENCODING_PREFIX + encodingKey + PropertyPrinterSpecificationLoader.ENCODING_BYTES ); final byte[] encodingCode = parseBytes( encodingBytes );
public void addAll( final Configuration config ) { final Enumeration<String> configProperties = config.getConfigProperties(); while ( configProperties.hasMoreElements() ) { final String key = configProperties.nextElement(); configuration.setConfigProperty( key, config.getConfigProperty( key ) ); } } }
/** * Returns the configuration property with the specified key. * * @param key the property key. * @return the property value. */ public String getConfigProperty( final String key ) { return getProperty( key ); }
/** * Checks, whether the given key is localy defined in this instance or whether the key's value is inherited. * * @param key the key that should be checked. * @return true, if the key is defined locally, false otherwise. */ public boolean isLocallyDefined( final String key ) { return this.configuration.containsKey( key ); }
final DefaultConfiguration props = new DefaultConfiguration(); props.load(in); final Iterator<String> keys = props.findPropertyKeys("dependency."); while (keys.hasNext()) if ("optional".equals(props.getConfigProperty(key)))
/** * Creates a new configuration. */ public HierarchicalConfiguration() { this.configuration = new DefaultConfiguration(); }
final DefaultConfiguration config = new DefaultConfiguration(); config.setConfigProperty( PlainTextPageableModule.ENCODING, getEncoding() ); config.setConfigProperty( PlainTextPageableModule.CHARS_PER_INCH, String.valueOf( getCharsPerInch() ) ); config.setConfigProperty( PlainTextPageableModule.LINES_PER_INCH, String.valueOf( getLinesPerInch() ) ); config.setConfigProperty( Epson9PinPrinterDriver.EPSON_9PIN_PRINTER_TYPE, getSelected9PinPrinterModel() ); config.setConfigProperty( Epson24PinPrinterDriver.EPSON_24PIN_PRINTER_TYPE, getSelected24PinPrinterModel() ); config.setConfigProperty( EXPORT_TYPE_CONFIG_KEY, "24pin" ); //$NON-NLS-1$ //$NON-NLS-2$ break; config.setConfigProperty( EXPORT_TYPE_CONFIG_KEY, "9pin" ); //$NON-NLS-1$ //$NON-NLS-2$ break; config.setConfigProperty( EXPORT_TYPE_CONFIG_KEY, "ibm" ); //$NON-NLS-1$ //$NON-NLS-2$ break; config.setConfigProperty( EXPORT_TYPE_CONFIG_KEY, "plain" ); //$NON-NLS-1$ //$NON-NLS-2$ break; throw new IllegalStateException(); config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.gui.plaintext.FileName", getFilename() ); //$NON-NLS-1$
public void load( final InputStream in ) throws IOException { if ( in == null ) { throw new NullPointerException(); } final DefaultConfiguration encodingConfig = new DefaultConfiguration(); encodingConfig.load( in ); final PropertyPrinterSpecificationLoader loader = new PropertyPrinterSpecificationLoader(); final PrinterEncoding[] encodings = loader.loadEncodings( encodingConfig ); final PrinterSpecification[] printers = loader.loadPrinters( encodingConfig, encodings ); // if there is a valid printer definition available, we do not // need a generic "Generic" printer. If one is required, it will // be defined by the specification file. if ( printers.length > 0 ) { printerModels.remove( PrinterSpecificationManager.getGenericPrinter().getName() ); } for ( int i = 0; i < printers.length; i++ ) { addPrinter( printers[i] ); } }
/** * Sets the value of a configuration property. * * @param key the property key. * @param value the property value. */ public void setConfigProperty(final String key, final String value) { if (value == null) { remove(key); } else { setProperty(key, value); } } }
final Iterator it = printerConfig.findPropertyKeys( PropertyPrinterSpecificationLoader.PRINTER_PREFIX ); while ( it.hasNext() ) { final String name = (String) it.next(); final String printerKey = (String) printerIt.next(); final String printerName = printerConfig.getProperty( PropertyPrinterSpecificationLoader.PRINTER_PREFIX + printerKey + PropertyPrinterSpecificationLoader.PRINTER_NAME ); final String printerCharsets = printerConfig.getProperty( PropertyPrinterSpecificationLoader.PRINTER_PREFIX + printerKey + PropertyPrinterSpecificationLoader.PRINTER_ENCODINGS );