@Override public List<DatabaseMeta> getObjectsForSyncFromJob( JobMeta job ) { return job.getDatabases(); }
public void widgetSelected( SelectionEvent e ) { CreateDatabaseWizard cdw = new CreateDatabaseWizard(); DatabaseMeta newDBInfo = cdw.createAndRunDatabaseWizard( shell, props, jobMeta.getDatabases() ); if ( newDBInfo != null ) { jobMeta.addDatabase( newDBInfo ); reinitConnectionDropDown( wConnection, newDBInfo.getName() ); } } } );
private void ok() { tableViewFields.removeEmptyRows(); List<String> dimensionNames = new ArrayList<String>(); for ( int i = 0; i < tableViewFields.table.getItemCount(); i++ ) { dimensionNames.add( tableViewFields.table.getItem( i ).getText( 1 ) ); } jobEntry.setName( textStepName.getText() ); jobEntry.setDatabaseMeta( DatabaseMeta.findDatabase( jobMeta.getDatabases(), addConnectionLine.getText() ) ); jobEntry.setCubeName( textCubeName.getText() ); jobEntry.setDimensionNames( dimensionNames ); dispose(); }
if ( privateDatabases != null ) { for ( Iterator<DatabaseMeta> it = jobMeta.getDatabases().iterator(); it.hasNext(); ) { String databaseName = it.next().getName(); if ( !privateDatabases.contains( databaseName ) ) {
private void ok() { jobEntry.setName( textStepName.getText() ); jobEntry.setDatabaseMeta( DatabaseMeta.findDatabase( jobMeta.getDatabases(), addConnectionLine.getText() ) ); jobEntry.setCubeName( comboCubeName.getText() ); dispose(); }
private void doBuildDimensionList() { if ( comboDropDown == null && addConnectionLine.getText() != null ) { DatabaseMeta dbMeta = DatabaseMeta.findDatabase( jobMeta.getDatabases(), addConnectionLine.getText() ); if ( dbMeta != null ) { PaloHelper helper = new PaloHelper( dbMeta, DefaultLogLevel.getLogLevel() ); try { helper.connect(); List<String> dimensionNames = helper.getDimensionsNames(); List<String> dimensions = helper.getDimensionsNames(); Collections.sort( dimensions, new PaloNameComparator() ); comboDropDown = new ColumnInfo( "Field", ColumnInfo.COLUMN_TYPE_CCOMBO, dimensions.toArray( new String[dimensionNames .size()] ), true ); tableViewFields.setColumnInfo( 0, comboDropDown ); } catch ( Exception ex ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "PaloCellOutputDialog.RetreiveCubesErrorTitle" ), BaseMessages.getString( PKG, "PaloCellOutputDialog.RetreiveCubesError" ), ex ); } finally { helper.disconnect(); } } } }
boolean updateMeta = Boolean.FALSE; for ( DatabaseMeta databaseMeta : jobMeta.getDatabases() ) { if ( !databaseNames.contains( databaseMeta.getName() ) ) { if ( databaseMeta.getObjectId() == null || !StringUtils.isEmpty( databaseMeta.getHostname() ) ) {
compatibleJobEntryLoadRep( jobMetaInterface, proxy, null, jobMeta.getDatabases(), jobMeta.getSlaveServers() ); jobMetaInterface.loadRep( proxy, jobMeta.getMetaStore(), null, jobMeta.getDatabases(), jobMeta .getSlaveServers() );
private void doSelectConnection( boolean clearCurrentData ) { try { if ( clearCurrentData ) { comboCubeName.removeAll(); } if ( comboCubeName.getItemCount() > 1 ) { return; } if ( addConnectionLine.getText() != null ) { DatabaseMeta dbMeta = DatabaseMeta.findDatabase( jobMeta.getDatabases(), addConnectionLine.getText() ); if ( dbMeta != null ) { PaloHelper helper = new PaloHelper( dbMeta, DefaultLogLevel.getLogLevel() ); helper.connect(); List<String> cubes = helper.getCubesNames(); Collections.sort( cubes, new PaloNameComparator() ); for ( String cubename : cubes ) { if ( comboCubeName.indexOf( cubename ) == -1 ) { comboCubeName.add( cubename ); } } helper.disconnect(); } } } catch ( Exception ex ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "PaloDimInputFlatDialog.RetreiveDimensionsErrorTitle" ), BaseMessages.getString( PKG, "PaloDimInputFlatDialog.RetreiveDimensionsError" ), ex ); } }
public void saveSharedObjects( final RepositoryElementInterface element, final String versionComment ) throws KettleException { JobMeta jobMeta = (JobMeta) element; // Now store the databases in the job. // Only store if the database has actually changed or doesn't have an object ID (imported) // for ( DatabaseMeta databaseMeta : jobMeta.getDatabases() ) { if ( databaseMeta.hasChanged() || databaseMeta.getObjectId() == null ) { if ( databaseMeta.getObjectId() == null || unifiedRepositoryConnectionAclService.hasAccess( databaseMeta.getObjectId(), RepositoryFilePermission.WRITE ) ) { repo.save( databaseMeta, versionComment, null ); } else { log.logError( BaseMessages.getString( PKG, "PurRepository.ERROR_0004_DATABASE_UPDATE_ACCESS_DENIED", databaseMeta.getName() ) ); } } } // Store the slave server // for ( SlaveServer slaveServer : jobMeta.getSlaveServers() ) { if ( slaveServer.hasChanged() || slaveServer.getObjectId() == null ) { repo.save( slaveServer, versionComment, null ); } } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = jobMeta.getDatabase( connr ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { // wSchemaname.setText(Const.NVL(std.getSchemaName(), "")); wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "JobMysqlBulkFile.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = jobMeta.getDatabase( connr ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "JobEntryWaitForSQL.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = jobMeta.getDatabase( connr ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "JobMssqlBulkLoad.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = jobMeta.getDatabase( connr ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "JobEntryEvalTableContent.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = jobMeta.getDatabase( connr ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "JobMysqlBulkLoad.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = jobMeta.getDatabase( connr ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wSchemaname.setText( Const.NVL( std.getSchemaName(), "" ) ); wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "JobEntryColumnsExist.ConnectionError.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = jobMeta.getDatabase( connr ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wSchemaname.setText( Const.NVL( std.getSchemaName(), "" ) ); wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "System.Dialog.ConnectionError.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } } }
DatabaseMeta conn = ( DatabaseMeta.findDatabase( jobMeta.getDatabases(), new StringObjectId( id ) ) ); jobMeta.getJobLogTable().setConnectionName( conn.getName() ); RepositoryAttributeInterface attributeInterface = new PurRepositoryAttribute( rootNode, jobMeta.getDatabases() ); for ( LogTableInterface logTable : jobMeta.getLogTables() ) { logTable.loadFromRepository( attributeInterface );
JobEntryCopy copy = new JobEntryCopy( entrynode, jobMeta.getDatabases(), jobMeta.getSlaveServers(), spoon.getRepository(), spoon .getMetaStore() ); if ( copy.isStart() && ( jobMeta.findStart() != null ) ) {
private void saveJobDetails( DataNode rootNode, JobMeta jobMeta ) throws KettleException { rootNode.setProperty( PROP_EXTENDED_DESCRIPTION, jobMeta.getExtendedDescription() ); rootNode.setProperty( PROP_JOB_VERSION, jobMeta.getJobversion() ); rootNode.setProperty( PROP_JOB_STATUS, jobMeta.getJobstatus() < 0 ? -1L : jobMeta.getJobstatus() ); if ( jobMeta.getJobLogTable().getDatabaseMeta() != null ) { DataNodeRef ref = new DataNodeRef( jobMeta.getJobLogTable().getDatabaseMeta().getObjectId().getId() ); rootNode.setProperty( PROP_DATABASE_LOG, ref ); } rootNode.setProperty( PROP_TABLE_NAME_LOG, jobMeta.getJobLogTable().getTableName() ); rootNode.setProperty( PROP_CREATED_USER, jobMeta.getCreatedUser() ); rootNode.setProperty( PROP_CREATED_DATE, jobMeta.getCreatedDate() ); rootNode.setProperty( PROP_MODIFIED_USER, jobMeta.getModifiedUser() ); rootNode.setProperty( PROP_MODIFIED_DATE, jobMeta.getModifiedDate() ); rootNode.setProperty( PROP_USE_BATCH_ID, jobMeta.getJobLogTable().isBatchIdUsed() ); rootNode.setProperty( PROP_PASS_BATCH_ID, jobMeta.isBatchIdPassed() ); rootNode.setProperty( PROP_USE_LOGFIELD, jobMeta.getJobLogTable().isLogFieldUsed() ); rootNode.setProperty( PROP_SHARED_FILE, jobMeta.getSharedObjectsFile() ); rootNode.setProperty( PROP_LOG_SIZE_LIMIT, jobMeta.getJobLogTable().getLogSizeLimit() ); // Save the logging tables too.. // RepositoryAttributeInterface attributeInterface = new PurRepositoryAttribute( rootNode, jobMeta.getDatabases() ); for ( LogTableInterface logTable : jobMeta.getLogTables() ) { logTable.saveToRepository( attributeInterface ); } // Load the attributes map // AttributesMapUtil.saveAttributesMap( rootNode, jobMeta ); }