public JobDialog( Shell parent, int style, JobMeta jobMeta, Repository rep ) { super( parent, style ); this.jobMeta = jobMeta; this.props = PropsUI.getInstance(); this.rep = rep; this.newDirectory = null; directoryChangeAllowed = true; logTables = new ArrayList<LogTableInterface>(); logTableUserInterfaces = new ArrayList<LogTableUserInterface>(); for ( LogTableInterface logTable : jobMeta.getLogTables() ) { logTables.add( (LogTableInterface) logTable.clone() ); } }
public void export( ProgressMonitorListener monitor, List<RepositoryFile> files, OutputStreamWriter writer ) throws KettleException { List<JobMeta> jobs = repository.loadJobs( monitor, log, files, true ); Iterator<JobMeta> jobsMeta = jobs.iterator(); Iterator<RepositoryFile> filesIter = files.iterator(); while ( ( monitor == null || !monitor.isCanceled() ) && jobsMeta.hasNext() ) { JobMeta meta = jobsMeta.next(); setGlobalVariablesOfLogTablesNull( meta.getLogTables() ); RepositoryFile file = filesIter.next(); try { // Validate against the import rules first! if ( toExport( meta ) ) { writer.write( meta.getXML() + Const.CR ); } } catch ( Exception ex ) { // if exception while writing one item is occurred logging it and continue looping log.logError( BaseMessages.getString( PKG, "PurRepositoryExporter.ERROR_SAVE_JOB", meta.getName(), file .getPath() ), ex ); //$NON-NLS-1$ } } } }
private void addLogTableTabs() { // Create a nested tab folder in the tab item, on the history composite... // tabFolder = new CTabFolder( jobHistoryComposite, SWT.MULTI ); spoon.props.setLook( tabFolder, Props.WIDGET_STYLE_TAB ); FormData fdTabFolder = new FormData(); fdTabFolder.left = new FormAttachment( 0, 0 ); // First one in the left top corner fdTabFolder.top = new FormAttachment( (Control) toolbar.getManagedObject(), 0 ); fdTabFolder.right = new FormAttachment( 100, 0 ); fdTabFolder.bottom = new FormAttachment( 100, 0 ); tabFolder.setLayoutData( fdTabFolder ); models = new JobHistoryLogTab[jobMeta.getLogTables().size()]; for ( int i = 0; i < models.length; i++ ) { models[i] = new JobHistoryLogTab( tabFolder, jobMeta.getLogTables().get( i ) ); } }
for ( LogTableInterface logTable : getLogTables() ) { retval.append( logTable.getXML() );
public static String getLogging( ReportSubjectLocation filename ) throws KettleException { List<LogTableInterface> logTables; if ( filename.isTransformation() ) { TransMeta transMeta = TransformationInformation.getInstance().getTransMeta( filename ); logTables = transMeta.getLogTables(); } else { JobMeta jobMeta = JobInformation.getInstance().getJobMeta( filename ); logTables = jobMeta.getLogTables(); } String logging = ""; for ( Iterator<LogTableInterface> iterator = logTables.iterator(); iterator.hasNext(); ) { LogTableInterface logTableInterface = iterator.next(); if ( logTableInterface.getDatabaseMeta() != null && !Utils.isEmpty( logTableInterface.getTableName() ) ) { if ( logging.length() > 0 ) { logging += ", "; } logging += logTableInterface.getTableName() + "@" + logTableInterface.getDatabaseMeta().getName(); } } return logging; }
jobMeta.getLogTables().get( i ).replaceMeta( logTables.get( i ) );
for ( LogTableInterface logTable : jobMeta.getLogTables() ) { logTable.loadFromRepository( attributeInterface );
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 ); }
for ( LogTableInterface logTable : jobMeta.getLogTables() ) { logTable.loadFromRepository( attributeInterface );
for ( LogTableInterface logTable : jobMeta.getLogTables() ) { logTable.saveToRepository( attributeInterface );