@VisibleForTesting String showDbDialogUnlessCancelledOrValid( DatabaseMeta changing, DatabaseMeta origin ) { changing.shareVariablesWith( jobMeta ); DatabaseDialog cid = getDatabaseDialog(); cid.setDatabaseMeta( changing ); cid.setModalDialog( true ); String name = null; boolean repeat = true; while ( repeat ) { name = cid.open(); if ( name == null ) { // Cancel was pressed repeat = false; } else { name = name.trim(); DatabaseMeta same = jobMeta.findDatabase( name ); if ( same == null || same == origin ) { // OK was pressed and input is valid repeat = false; } else { showDbExistsDialog( changing ); } } } return name; }
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ) ); mb.open(); return; } jobEntry.setName( wName.getText() ); jobEntry.setSQL( wSQL.getText() ); jobEntry.setUseVariableSubstitution( wUseSubs.getSelection() ); jobEntry.setSQLFromFile( wSQLFromFile.getSelection() ); jobEntry.setSQLFilename( wFilename.getText() ); jobEntry.setSendOneStatement( wSendOneStatement.getSelection() ); jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); dispose(); } }
public void widgetSelected( SelectionEvent e ) { DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { // cloning to avoid spoiling data on cancel or incorrect input DatabaseMeta clone = (DatabaseMeta) databaseMeta.clone(); String connectionName = showDbDialogUnlessCancelledOrValid( clone, databaseMeta ); if ( connectionName != null ) { // need to replace the old connection with a new one jobMeta.removeDatabase( jobMeta.indexOfDatabase( databaseMeta ) ); jobMeta.addDatabase( clone ); reinitConnectionDropDown( wConnection, connectionName ); } } } }
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( "Please give this job entry a name." ); mb.setText( "Enter the name of the job entry" ); mb.open(); return; } jobEntry.setName( wName.getText() ); jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); jobEntry.schemaname = wSchemaname.getText(); jobEntry.tablename = wTablename.getText(); jobEntry.successCondition = JobEntryWaitForSQL.getSuccessConditionByDesc( wSuccessCondition.getText() ); jobEntry.rowsCountValue = wRowsCountValue.getText(); jobEntry.iscustomSQL = wcustomSQL.getSelection(); jobEntry.isUseVars = wUseSubs.getSelection(); jobEntry.isAddRowsResult = wAddRowsToResult.getSelection(); jobEntry.isClearResultList = wClearResultList.getSelection(); jobEntry.customSQL = wSQL.getText(); jobEntry.setMaximumTimeout( wMaximumTimeout.getText() ); jobEntry.setCheckCycleTime( wCheckCycleTime.getText() ); jobEntry.setSuccessOnTimeout( wSuccesOnTimeout.getSelection() ); dispose(); }
/** * Insert all the databases from the repository into the JobMeta object, overwriting optionally * * @param jobMeta * The transformation to load into. * @param overWriteShared * if an object with the same name exists, overwrite */ protected void readDatabases( JobMeta jobMeta, boolean overWriteShared, List<DatabaseMeta> databaseMetas ) { for ( DatabaseMeta databaseMeta : databaseMetas ) { if ( overWriteShared || jobMeta.findDatabase( databaseMeta.getName() ) == null ) { if ( databaseMeta.getName() != null ) { databaseMeta.shareVariablesWith( jobMeta ); jobMeta.addOrReplaceDatabase( databaseMeta ); if ( !overWriteShared ) { databaseMeta.setChanged( false ); } } } } jobMeta.clearChanged(); }
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ) ); mb.open(); return; } jobEntry.setName( wName.getText() ); jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); jobEntry.setTablename( wTablename.getText() ); jobEntry.setSchemaname( wSchemaname.getText() ); dispose(); }
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( "Please give this job entry a name." ); mb.setText( "Enter the name of the job entry" ); mb.open(); return; } jobEntry.setName( wName.getText() ); jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); jobEntry.setSchemaname( wSchemaname.getText() ); jobEntry.setTablename( wTablename.getText() ); jobEntry.setSuccessCondition( JobEntryEvalTableContent.getSuccessConditionByDesc( wSuccessCondition.getText() ) ); jobEntry.setLimit( wLimit.getText() ); jobEntry.setUseCustomSQL( wcustomSQL.getSelection() ); jobEntry.setUseVars( wUseSubs.getSelection() ); jobEntry.setAddRowsResult( wAddRowsToResult.getSelection() ); jobEntry.setClearResultList( wClearResultList.getSelection() ); jobEntry.setCustomSQL( wSQL.getText() ); dispose(); }
jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); jobEntry.argFromPrevious = wPrevious.getSelection();
jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); jobEntry.setTablename( wTablename.getText() ); jobEntry.setSchemaname( wSchemaname.getText() );
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ) ); mb.open(); return; } jobEntry.setName( wName.getText() ); jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); jobEntry.setSchemaname( wSchemaname.getText() ); jobEntry.setTablename( wTablename.getText() ); jobEntry.setFilename( wFilename.getText() ); jobEntry.setSeparator( wSeparator.getText() ); jobEntry.setEnclosed( wEnclosed.getText() ); jobEntry.setOptionEnclosed( wOptionEnclosed.getSelection() ); jobEntry.setLineterminated( wLineterminated.getText() ); jobEntry.setLimitlines( wLimitlines.getText() ); jobEntry.setListColumn( wListColumn.getText() ); jobEntry.outdumpvalue = wOutDumpValue.getSelectionIndex(); jobEntry.setHighPriority( wHighPriority.getSelection() ); jobEntry.iffileexists = wIfFileExists.getSelectionIndex(); jobEntry.setAddFileToResult( wAddFileToResult.getSelection() ); dispose(); }
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ) ); mb.open(); return; } jobEntry.setName( wName.getText() ); jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); jobEntry.setSchemaname( wSchemaname.getText() ); jobEntry.setTablename( wTablename.getText() ); jobEntry.setFilename( wFilename.getText() ); jobEntry.setSeparator( wSeparator.getText() ); jobEntry.setEnclosed( wEnclosed.getText() ); jobEntry.setEscaped( wEscaped.getText() ); jobEntry.setLineterminated( wLineterminated.getText() ); jobEntry.setLinestarted( wLinestarted.getText() ); jobEntry.setReplacedata( wReplacedata.getSelection() ); jobEntry.setIgnorelines( wIgnorelines.getText() ); jobEntry.setListattribut( wListattribut.getText() ); jobEntry.prorityvalue = wProrityValue.getSelectionIndex(); jobEntry.setLocalInfile( wLocalInfile.getSelection() ); jobEntry.setAddFileToResult( wAddFileToResult.getSelection() ); dispose(); }
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ) ); mb.open(); return; } jobEntry.setName( wName.getText() ); int nritems = wFields.nrNonEmpty(); DatabaseMeta[] connections = new DatabaseMeta[nritems]; String[] waitfors = new String[nritems]; int[] waittimes = new int[nritems]; for ( int i = 0; i < nritems; i++ ) { String arg = wFields.getNonEmpty( i ).getText( 1 ); DatabaseMeta dbMeta = jobMeta.findDatabase( arg ); if ( dbMeta != null ) { connections[i] = dbMeta; waitfors[i] = "" + Const.toInt( wFields.getNonEmpty( i ).getText( 2 ), 0 ); waittimes[i] = JobEntryCheckDbConnections.getWaitTimeByDesc( wFields.getNonEmpty( i ).getText( 3 ) ); } } jobEntry.setConnections( connections ); jobEntry.setWaitfors( waitfors ); jobEntry.setWaittimes( waittimes ); dispose(); }
jobEntry.setDatabase( jobMeta.findDatabase( wConnection.getText() ) ); jobEntry.setSchemaname( wSchemaname.getText() ); jobEntry.setTablename( wTablename.getText() );
DatabaseMeta check = jobMeta.findDatabase( databaseMeta.getName() );
private void getTableName() { DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database database = new Database( loggingObject, databaseMeta );
return; DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database database = new Database( loggingObject, databaseMeta );
return; DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database database = new Database( loggingObject, databaseMeta );
DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database database = new Database( loggingObject, databaseMeta );
DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database database = new Database( loggingObject, databaseMeta );
DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database database = new Database( loggingObject, databaseMeta );