Java Code Examples for org.pentaho.di.trans.Trans#getResult()
The following examples show how to use
org.pentaho.di.trans.Trans#getResult() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetaInject.java From pentaho-kettle with Apache License 2.0 | 5 votes |
private void copyResult( Trans trans ) { Result result = trans.getResult(); setLinesInput( result.getNrLinesInput() ); setLinesOutput( result.getNrLinesOutput() ); setLinesRead( result.getNrLinesRead() ); setLinesWritten( result.getNrLinesWritten() ); setLinesUpdated( result.getNrLinesUpdated() ); setLinesRejected( result.getNrLinesRejected() ); setErrors( result.getNrErrors() ); }
Example 2
Source File: OlapInputDialog.java From pentaho-kettle with Apache License 2.0 | 5 votes |
/** * Preview the data generated by this step. This generates a transformation using this step & a dummy and previews it. * */ private void preview() { // Create the table input reader step... OlapInputMeta oneMeta = new OlapInputMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "OlapInputDialog.EnterPreviewSize" ), BaseMessages.getString( PKG, "OlapDialog.NumberOfRowsToPreview" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( !progressDialog.isCancelled() ) { if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } }
Example 3
Source File: GetSubFoldersDialog.java From pentaho-kettle with Apache License 2.0 | 5 votes |
private void preview() { // Create the XML input step GetSubFoldersMeta oneMeta = new GetSubFoldersMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "GetSubFoldersDialog.PreviewSize.DialogTitle" ), BaseMessages.getString( PKG, "GetSubFoldersDialog.PreviewSize.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages .getString( PKG, "GetSubFoldersDialog.ErrorInPreview.DialogMessage" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } }
Example 4
Source File: XMLInputStreamDialog.java From pentaho-kettle with Apache License 2.0 | 5 votes |
private void preview() { // execute a complete preview transformation in the background. // This is how we do it... // XMLInputStreamMeta oneMeta = new XMLInputStreamMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "XMLInputStreamDialog.Dialog.EnterPreviewSize.Title" ), BaseMessages.getString( PKG, "XMLInputStreamDialog.Dialog.EnterPreviewSize.Message" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( !progressDialog.isCancelled() ) { if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages.getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog .getPreviewRowsMeta( wStepname.getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } }
Example 5
Source File: ParGzipCsvInputDialog.java From pentaho-kettle with Apache License 2.0 | 5 votes |
private void preview() { // Create the XML input step ParGzipCsvInputMeta oneMeta = new ParGzipCsvInputMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "ParGzipCsvInputDialog.PreviewSize.DialogTitle" ), BaseMessages.getString( PKG, "ParGzipCsvInputDialog.PreviewSize.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( !progressDialog.isCancelled() ) { if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } }
Example 6
Source File: OpenERPObjectInputDialog.java From pentaho-kettle with Apache License 2.0 | 5 votes |
private void preview() { OpenERPObjectInputMeta testMeta = new OpenERPObjectInputMeta(); if ( !SaveToMeta( testMeta ) ) { return; } TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, testMeta, textStepName.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, 500, BaseMessages.getString( "System.Dialog.EnterPreviewSize.Title" ), BaseMessages.getString( "System.Dialog.EnterPreviewSize.Message" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[]{ textStepName.getText() }, new int[]{ previewSize } ); progressDialog.open(); Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( !progressDialog.isCancelled() ) { if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( "System.Dialog.PreviewError.Title" ), BaseMessages .getString( "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, textStepName.getText(), progressDialog .getPreviewRowsMeta( textStepName.getText() ), progressDialog.getPreviewRows( textStepName.getText() ), loggingText ); prd.open(); } }
Example 7
Source File: CypherDialog.java From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 | 5 votes |
private synchronized void preview() { CypherMeta oneMeta = new CypherMeta(); this.getInfo(oneMeta); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(this.transMeta, oneMeta, this.wStepname.getText()); this.transMeta.getVariable("Internal.Transformation.Filename.Directory"); previewMeta.getVariable("Internal.Transformation.Filename.Directory"); EnterNumberDialog numberDialog = new EnterNumberDialog(this.shell, this.props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "CypherDialog.PreviewSize.DialogTitle"), BaseMessages.getString(PKG, "CypherDialog.PreviewSize.DialogMessage") ); int previewSize = numberDialog.open(); if (previewSize > 0) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(this.shell, previewMeta, new String[]{this.wStepname.getText()}, new int[]{previewSize}); progressDialog.open(); Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if (!progressDialog.isCancelled() && trans.getResult() != null && trans.getResult().getNrErrors() > 0L) { EnterTextDialog etd = new EnterTextDialog(this.shell, BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title", new String[0]), BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message", new String[0]), loggingText, true); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog(this.shell, this.transMeta, 0, this.wStepname.getText(), progressDialog.getPreviewRowsMeta(this.wStepname.getText()), progressDialog.getPreviewRows(this.wStepname.getText()), loggingText); prd.open(); } }
Example 8
Source File: XMLInputDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { try { // Create the XML input step XMLInputMeta oneMeta = new XMLInputMeta(); getInfo( oneMeta ); // check if the path is given if ( !checkInputPositionsFilled( oneMeta ) ) { return; } TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "XMLInputDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG, "XMLInputDialog.NumberRows.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } } catch ( KettleException e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "XMLInputDialog.ErrorPreviewingData.DialogTitle" ), BaseMessages .getString( PKG, "XMLInputDialog.ErrorPreviewingData.DialogMessage" ), e ); } }
Example 9
Source File: MailInputDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { try { MailInputMeta oneMeta = new MailInputMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "MailInputDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG, "MailInputDialog.NumberRows.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages.getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } } catch ( KettleException e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "MailInputDialog.ErrorPreviewingData.DialogTitle" ), BaseMessages .getString( PKG, "MailInputDialog.ErrorPreviewingData.DialogMessage" ), e ); } }
Example 10
Source File: ExcelInputDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
/** * Preview the data generated by this step. This generates a transformation using this step & a dummy and previews * it. */ private void preview() { // Create the excel reader step... ExcelInputMeta oneMeta = new ExcelInputMeta(); getInfo( oneMeta ); if ( oneMeta.isAcceptingFilenames() ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION ); mb.setMessage( BaseMessages.getString( PKG, "ExcelInputDialog.Dialog.SpecifyASampleFile.Message" ) ); // Nothing // found // that // matches // your // criteria mb.setText( BaseMessages.getString( PKG, "ExcelInputDialog.Dialog.SpecifyASampleFile.Title" ) ); // Sorry! mb.open(); return; } TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "ExcelInputDialog.PreviewSize.DialogTitle" ), BaseMessages.getString( PKG, "ExcelInputDialog.PreviewSize.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( !progressDialog.isCancelled() ) { if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } }
Example 11
Source File: SecretKeyGeneratorDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { try { // Create the SecretKeyGeneratorMeta input step SecretKeyGeneratorMeta oneMeta = new SecretKeyGeneratorMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "SecretKeyGeneratorDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG, "SecretKeyGeneratorDialog.NumberRows.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } } catch ( KettleException e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "SecretKeyGeneratorDialog.ErrorPreviewingData.DialogTitle" ), BaseMessages.getString( PKG, "SecretKeyGeneratorDialog.ErrorPreviewingData.DialogMessage" ), e ); } }
Example 12
Source File: LDIFInputDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { try { // Create the LDIF input step LDIFInputMeta oneMeta = new LDIFInputMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "LDIFInputDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG, "LDIFInputDialog.NumberRows.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } } catch ( KettleException e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "LDIFInputDialog.ErrorPreviewingData.DialogTitle" ), BaseMessages .getString( PKG, "LDIFInputDialog.ErrorPreviewingData.DialogMessage" ), e ); } }
Example 13
Source File: XulDatabaseExplorerController.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public void dataProfile() { if ( model.getTable() == null ) { return; } Shell dbShell = (Shell) dbExplorerDialog.getRootObject(); try { TransProfileFactory profileFactory = new TransProfileFactory( this.model.getDatabaseMeta(), getSchemaAndTable( this.model ) ); TransMeta transMeta = profileFactory.generateTransformation( new LoggingObject( model.getTable() ) ); TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( dbShell, transMeta, new String[] { TransProfileFactory.RESULT_STEP_NAME, }, new int[] { 25000, } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( dbShell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( dbShell, transMeta, SWT.NONE, TransProfileFactory.RESULT_STEP_NAME, progressDialog .getPreviewRowsMeta( TransProfileFactory.RESULT_STEP_NAME ), progressDialog .getPreviewRows( TransProfileFactory.RESULT_STEP_NAME ), loggingText ); prd.open(); } } catch ( Exception e ) { new ErrorDialog( this.dbExplorerDialog.getShell(), BaseMessages.getString( PKG, "DatabaseExplorerDialog.UnexpectedProfilingError.Title" ), BaseMessages.getString( PKG, "DatabaseExplorerDialog.UnexpectedProfilingError.Message" ), e ); } }
Example 14
Source File: YamlInputDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { try { // Create the XML input step YamlInputMeta oneMeta = new YamlInputMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "YamlInputDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG, "YamlInputDialog.NumberRows.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } } catch ( KettleException e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "YamlInputDialog.ErrorPreviewingData.DialogTitle" ), BaseMessages .getString( PKG, "YamlInputDialog.ErrorPreviewingData.DialogMessage" ), e ); } }
Example 15
Source File: GetFilesRowsCountDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { try { GetFilesRowsCountMeta oneMeta = new GetFilesRowsCountMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "GetFilesRowsCountDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG, "GetFilesRowsCountDialog.NumberRows.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } } catch ( KettleException e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "GetFilesRowsCountDialog.ErrorPreviewingData.DialogTitle" ), BaseMessages.getString( PKG, "GetFilesRowsCountDialog.ErrorPreviewingData.DialogMessage" ), e ); } }
Example 16
Source File: LoadFileInputDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { try { // Create the XML input step LoadFileInputMeta oneMeta = new LoadFileInputMeta(); getInfo( oneMeta ); TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "LoadFileInputDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG, "LoadFileInputDialog.NumberRows.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages .getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } } catch ( KettleException e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "LoadFileInputDialog.ErrorPreviewingData.DialogTitle" ), BaseMessages.getString( PKG, "LoadFileInputDialog.ErrorPreviewingData.DialogMessage" ), e ); } }
Example 17
Source File: TextFileInputDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { // Create the XML input step TextFileInputMeta oneMeta = new TextFileInputMeta(); getInfo( oneMeta ); if ( oneMeta.isAcceptingFilenames() ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION ); mb.setMessage( BaseMessages.getString( PKG, "TextFileInputDialog.Dialog.SpecifyASampleFile.Message" ) ); mb.setText( BaseMessages.getString( PKG, "TextFileInputDialog.Dialog.SpecifyASampleFile.Title" ) ); mb.open(); return; } TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "TextFileInputDialog.PreviewSize.DialogTitle" ), BaseMessages.getString( PKG, "TextFileInputDialog.PreviewSize.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( !progressDialog.isCancelled() ) { if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages.getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog .getPreviewRowsMeta( wStepname.getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } }
Example 18
Source File: CommonStepDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { // given that the preview button is disabled in the absence of fields, this should never occur, but we check, for // good measure if ( !fieldsExist() ) { openNoFieldsDialog(); return; } // Create the XML meta step final StepMetaType populatedMeta = (StepMetaType) getPopulatedMeta(); final TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, populatedMeta, wStepname.getText() ); final EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "CommonStepDialog.PreviewSize.DialogTitle" ), //$NON-NLS-1$ BaseMessages.getString( PKG, "CommonStepDialog.PreviewSize.DialogMessage" ) ); //$NON-NLS-1$ final int previewSize = numberDialog.open(); if ( previewSize > 0 ) { final TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open( false ); final Trans trans = progressDialog.getTrans(); final String loggingText = progressDialog.getLoggingText(); if ( !progressDialog.isCancelled() ) { if ( trans.getResult() != null ) { if ( trans.getResult().getNrErrors() > 0 ) { openPreviewError(); // there are errors - return return; } } } final List previewRows = progressDialog.getPreviewRows( wStepname.getText() ); if ( previewRows == null || previewRows.size() == 0 ) { openNoRowsToPreviewError(); } else { final PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta( wStepname .getText() ), previewRows, loggingText ); prd.open(); } } }
Example 19
Source File: TransExecutor.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void executeTransformation( List<String> incomingFieldValues ) throws KettleException { TransExecutorData transExecutorData = getData(); // If we got 0 rows on input we don't really want to execute the transformation if ( transExecutorData.groupBuffer.isEmpty() ) { return; } transExecutorData.groupTimeStart = System.currentTimeMillis(); if ( first ) { discardLogLines( transExecutorData ); } Trans executorTrans = createInternalTrans(); transExecutorData.setExecutorTrans( executorTrans ); if ( incomingFieldValues != null ) { // Pass parameter values passParametersToTrans( incomingFieldValues ); } else { List<String> lastIncomingFieldValues = getLastIncomingFieldValues(); // incomingFieldValues == null- There are no more rows - Last Case - pass previous values if exists // If not still pass the null parameter values passParametersToTrans( lastIncomingFieldValues != null && !lastIncomingFieldValues.isEmpty() ? lastIncomingFieldValues : incomingFieldValues ); } // keep track for drill down in Spoon... getTrans().addActiveSubTransformation( getStepname(), executorTrans ); Result result = new Result(); result.setRows( transExecutorData.groupBuffer ); executorTrans.setPreviousResult( result ); try { executorTrans.prepareExecution( getTrans().getArguments() ); // run transformation executorTrans.startThreads(); // Inform the parent transformation we started something here... for ( DelegationListener delegationListener : getTrans().getDelegationListeners() ) { // TODO: copy some settings in the transformation execution configuration, not strictly needed // but the execution configuration information is useful in case of a transformation re-start on Carte delegationListener.transformationDelegationStarted( executorTrans, new TransExecutionConfiguration() ); } // Wait a while until we're done with the transformation executorTrans.waitUntilFinished(); result = executorTrans.getResult(); } catch ( KettleException e ) { log.logError( "An error occurred executing the transformation: ", e ); result.setResult( false ); result.setNrErrors( 1 ); } if ( result.isSafeStop() ) { getTrans().safeStop(); } collectTransResults( result ); collectExecutionResults( result ); collectExecutionResultFiles( result ); transExecutorData.groupBuffer.clear(); }
Example 20
Source File: GetXMLDataDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void preview() { try { // Create the XML input step GetXMLDataMeta oneMeta = new GetXMLDataMeta(); getInfo( oneMeta ); // check if the path is given if ( !checkLoopXPath( oneMeta ) ) { return; } TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() ); EnterNumberDialog numberDialog = new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG, "GetXMLDataDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG, "GetXMLDataDialog.NumberRows.DialogMessage" ) ); int previewSize = numberDialog.open(); if ( previewSize > 0 ) { TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } ); progressDialog.open(); if ( !progressDialog.isCancelled() ) { Trans trans = progressDialog.getTrans(); String loggingText = progressDialog.getLoggingText(); if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) { EnterTextDialog etd = new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ), BaseMessages.getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true ); etd.setReadOnly(); etd.open(); } PreviewRowsDialog prd = new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog .getPreviewRowsMeta( wStepname.getText() ), progressDialog.getPreviewRows( wStepname.getText() ), loggingText ); prd.open(); } } } catch ( KettleException e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "GetXMLDataDialog.ErrorPreviewingData.DialogTitle" ), BaseMessages.getString( PKG, "GetXMLDataDialog.ErrorPreviewingData.DialogMessage" ), e ); } }