/** * Looks up the user's home directory (or KETTLE_HOME) for every invocation. This is no longer a static property so * the value may be set after this class is loaded. * * @return The path to the users home directory, or the System property {@code KETTLE_HOME} if set. */ public static String getUserHomeDirectory() { return NVL( System.getenv( "KETTLE_HOME" ), NVL( System.getProperty( "KETTLE_HOME" ), System.getProperty( "user.home" ) ) ); }
public static int getBackoffIncrements() { try { return Integer.parseInt( Const.NVL( System.getProperty( "KETTLE_CARTE_RETRY_BACKOFF_INCREMENTS" ), "1000" ) ); } catch ( Exception e ) { return 1000; } }
private void getData() { wStep.setSelection( searchingSteps ); wDB.setSelection( searchingDatabases ); wNote.setSelection( searchingNotes ); wFilter.setText( Const.NVL( filterString, "" ) ); wFilter.setFocus(); }
/** * Sets the internal name kettle variable. * * @param var * the new internal name kettle variable */ @Override protected void setInternalNameKettleVariable( VariableSpace var ) { // The name of the transformation // variables.setVariable( Const.INTERNAL_VARIABLE_TRANSFORMATION_NAME, Const.NVL( name, "" ) ); }
/** * Sets the internal name kettle variable. * * @param var the new internal name kettle variable */ @Override protected void setInternalNameKettleVariable( VariableSpace var ) { // The name of the job variables.setVariable( Const.INTERNAL_VARIABLE_JOB_NAME, Const.NVL( name, "" ) ); }
public WebResult removeJob( String jobName, String carteObjectId ) throws Exception { String xml = execService( RemoveJobServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( jobName, "UTF-8" ) + "&id=" + Const.NVL( carteObjectId, "" ) + "&xml=Y" ); return WebResult.fromXMLString( xml ); }
public WebResult deAllocateServerSockets( String transName, String clusteredRunId ) throws Exception { String xml = execService( CleanupTransServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( transName, "UTF-8" ) + "&id=" + Const.NVL( clusteredRunId, "" ) + "&xml=Y&sockets=Y" ); return WebResult.fromXMLString( xml ); }
public WebResult stopTransformation( String transName, String carteObjectId ) throws Exception { String xml = execService( StopTransServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( transName, "UTF-8" ) + "&id=" + Const.NVL( carteObjectId, "" ) + "&xml=Y" ); return WebResult.fromXMLString( xml ); }
public void setParametersAsVariablesInUI( NamedParams namedParameters, VariableSpace space ) { for ( String param : namedParameters.listParameters() ) { try { space.setVariable( param, Const.NVL( namedParameters.getParameterValue( param ), Const.NVL( namedParameters.getParameterDefault( param ), Const.NVL( space.getVariable( param ), "" ) ) ) ); } catch ( Exception e ) { // ignore this } } }
protected void executeSql( String query ) throws Exception { if ( this.meta == null ) { throw new KettleException( "No metadata available to determine connection information from." ); } DatabaseMeta dm = meta.getDatabaseMeta(); String hostname = environmentSubstitute( Const.NVL( dm.getHostname(), "" ) ); String portnum = environmentSubstitute( Const.NVL( dm.getDatabasePortNumberString(), "" ) ); String user = environmentSubstitute( Const.NVL( dm.getUsername(), "" ) ); String password = environmentSubstitute( Const.NVL( dm.getPassword(), "" ) ); String db = environmentSubstitute( Const.NVL( dm.getDatabaseName(), "" ) ); executeSql( query, hostname, Integer.valueOf( portnum ), user, password, db ); }
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { wName.setText( Const.NVL( jobEntry.getName(), "" ) ); wName.getTextWidget().selectAll(); wServer.setText( Const.NVL( jobEntry.getServer(), "" ) ); wPort.setText( Const.NVL( jobEntry.getPort(), "" ) ); wVariable.setText( Const.NVL( jobEntry.getVariableName(), "" ) ); }
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { logDebug( BaseMessages.getString( PKG, "GetSequenceDialog.Log.GettingKeyInfo" ) ); wValuename.setText( Const.NVL( input.getValuename(), "" ) ); wSlaveServer.setText( Const.NVL( input.getSlaveServerName(), "" ) ); wSeqname.setText( Const.NVL( input.getSequenceName(), "" ) ); wIncrement.setText( Const.NVL( input.getIncrement(), "" ) ); wStepname.selectAll(); wStepname.setFocus(); }
/** * Copy information from the meta-data currentMeta to the dialog fields. */ public void getData() { List<StreamInterface> targetStreams = input.getStepIOMeta().getTargetStreams(); wTrueTo.setText( Const.NVL( targetStreams.get( 0 ).getStepname(), "" ) ); wFalseTo.setText( Const.NVL( targetStreams.get( 1 ).getStepname(), "" ) ); wCondition.setText( Const.NVL( input.getCondition(), "" ) ); wStepname.selectAll(); wStepname.setFocus(); }
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { List<StreamInterface> targetStreams = input.getStepIOMeta().getTargetStreams(); wTrueTo.setText( Const.NVL( targetStreams.get( 0 ).getStepname(), "" ) ); wFalseTo.setText( Const.NVL( targetStreams.get( 1 ).getStepname(), "" ) ); wStepname.selectAll(); wStepname.setFocus(); }
private static void setCredentials( BasicDataSource ds, DatabaseMeta databaseMeta, String partitionId ) throws KettleDatabaseException { String userName = databaseMeta.environmentSubstitute( databaseMeta.getUsername() ); String password = databaseMeta.environmentSubstitute( databaseMeta.getPassword() ); password = Encr.decryptPasswordOptionallyEncrypted( password ); ds.addConnectionProperty( "user", Const.NVL( userName, "" ) ); ds.addConnectionProperty( "password", Const.NVL( password, "" ) ); }
public void dataNodeToElement( DataNode rootNode, RepositoryElementInterface element ) throws KettleException { PartitionSchema partitionSchema = (PartitionSchema) element; partitionSchema.setDynamicallyDefined( rootNode.getProperty( PROP_DYNAMIC_DEFINITION ).getBoolean() ); partitionSchema.setNumberOfPartitionsPerSlave( getString( rootNode, PROP_PARTITIONS_PER_SLAVE ) ); // Also, load all the properties we can find... DataNode attrNode = rootNode.getNode( NODE_ATTRIBUTES ); long partitionSchemaSize = attrNode.getProperty( PROP_NB_PARTITION_SCHEMA ).getLong(); for ( int i = 0; i < partitionSchemaSize; i++ ) { DataProperty property = attrNode.getProperty( String.valueOf( i ) ); partitionSchema.getPartitionIDs().add( Const.NVL( property.getString(), "" ) ); } }
public static String getModification( ReportSubjectLocation filename ) throws KettleException { Date date = null; String user = null; if ( filename.isTransformation() ) { date = TransformationInformation.getInstance().getTransMeta( filename ).getModifiedDate(); user = TransformationInformation.getInstance().getTransMeta( filename ).getModifiedUser(); } else { date = JobInformation.getInstance().getJobMeta( filename ).getModifiedDate(); user = JobInformation.getInstance().getJobMeta( filename ).getModifiedUser(); } return Const.NVL( XMLHandler.date2string( date ), "-" ) + " by " + Const.NVL( user, "-" ); }
@BeforeClass public static void beforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init(); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }
@BeforeClass public static void beforeClass() throws KettleException { PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() ); PluginRegistry.init(); String passwordEncoderPluginID = Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" ); Encr.init( passwordEncoderPluginID ); }