use of org.apache.hop.ui.pipeline.dialog.PipelinePreviewProgressDialog in project hop by apache.
the class GetSubFoldersDialog method preview.
// Preview the data
private void preview() {
// Create the XML input transform
GetSubFoldersMeta oneMeta = new GetSubFoldersMeta();
getInfo(oneMeta);
PipelineMeta previewMeta = PipelinePreviewFactory.generatePreviewPipeline(pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.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) {
PipelinePreviewProgressDialog progressDialog = new PipelinePreviewProgressDialog(shell, variables, previewMeta, new String[] { wTransformName.getText() }, new int[] { previewSize });
progressDialog.open();
if (!progressDialog.isCancelled()) {
Pipeline pipeline = progressDialog.getPipeline();
String loggingText = progressDialog.getLoggingText();
if (pipeline.getResult() != null && pipeline.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, variables, SWT.NONE, wTransformName.getText(), progressDialog.getPreviewRowsMeta(wTransformName.getText()), progressDialog.getPreviewRows(wTransformName.getText()), loggingText);
prd.open();
}
}
}
use of org.apache.hop.ui.pipeline.dialog.PipelinePreviewProgressDialog in project hop by apache.
the class GetTableNamesDialog method preview.
// Preview the data
private void preview() {
GetTableNamesMeta oneMeta = new GetTableNamesMeta();
getInfo(oneMeta);
if (oneMeta.getDatabase() == null) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "GetTableNamesDialog.InvalidConnection.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "GetTableNamesDialog.InvalidConnection.DialogTitle"));
mb.open();
return;
}
if (!checkUserInput(oneMeta)) {
return;
}
PipelineMeta previewMeta = PipelinePreviewFactory.generatePreviewPipeline(pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "GetTableNamesDialog.PreviewSize.DialogTitle"), BaseMessages.getString(PKG, "GetTableNamesDialog.PreviewSize.DialogMessage"));
int previewSize = numberDialog.open();
if (previewSize > 0) {
PipelinePreviewProgressDialog progressDialog = new PipelinePreviewProgressDialog(shell, variables, previewMeta, new String[] { wTransformName.getText() }, new int[] { previewSize });
progressDialog.open();
if (!progressDialog.isCancelled()) {
Pipeline pipeline = progressDialog.getPipeline();
String loggingText = progressDialog.getLoggingText();
if (pipeline.getResult() != null && pipeline.getResult().getNrErrors() > 0) {
EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "GetTableNamesDialog.ErrorInPreview.DialogMessage"), loggingText, true);
etd.setReadOnly();
etd.open();
}
PreviewRowsDialog prd = new PreviewRowsDialog(shell, variables, SWT.NONE, wTransformName.getText(), progressDialog.getPreviewRowsMeta(wTransformName.getText()), progressDialog.getPreviewRows(wTransformName.getText()), loggingText);
prd.open();
}
}
}
use of org.apache.hop.ui.pipeline.dialog.PipelinePreviewProgressDialog in project hop by apache.
the class GetVariableDialog method preview.
// Preview the data
private void preview() {
try {
// Create the Access input transform
GetVariableMeta oneMeta = new GetVariableMeta();
getInfo(oneMeta);
PipelineMeta previewMeta = PipelinePreviewFactory.generatePreviewPipeline(pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.getText());
// We always just want to preview a single output row
//
PipelinePreviewProgressDialog progressDialog = new PipelinePreviewProgressDialog(shell, variables, previewMeta, new String[] { wTransformName.getText() }, new int[] { 1 });
progressDialog.open();
if (!progressDialog.isCancelled()) {
Pipeline pipeline = progressDialog.getPipeline();
String loggingText = progressDialog.getLoggingText();
if (pipeline.getResult() != null && pipeline.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, variables, SWT.NONE, wTransformName.getText(), progressDialog.getPreviewRowsMeta(wTransformName.getText()), progressDialog.getPreviewRows(wTransformName.getText()), loggingText);
prd.open();
}
} catch (HopException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "GetVariableDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "GetVariableDialog.ErrorPreviewingData.DialogMessage"), e);
}
}
use of org.apache.hop.ui.pipeline.dialog.PipelinePreviewProgressDialog in project hop by apache.
the class TextFileInputDialog method preview.
// Preview the data
private void preview() {
// Create the XML input transform
TextFileInputMeta oneMeta = new TextFileInputMeta();
getInfo(oneMeta, true);
if (oneMeta.inputFiles.acceptingFilenames) {
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;
}
PipelineMeta previewMeta = PipelinePreviewFactory.generatePreviewPipeline(pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.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) {
PipelinePreviewProgressDialog progressDialog = new PipelinePreviewProgressDialog(shell, variables, previewMeta, new String[] { wTransformName.getText() }, new int[] { previewSize });
progressDialog.open();
Pipeline pipeline = progressDialog.getPipeline();
String loggingText = progressDialog.getLoggingText();
if (!progressDialog.isCancelled()) {
if (pipeline.getResult() != null && pipeline.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, variables, SWT.NONE, wTransformName.getText(), progressDialog.getPreviewRowsMeta(wTransformName.getText()), progressDialog.getPreviewRows(wTransformName.getText()), loggingText);
prd.open();
}
}
use of org.apache.hop.ui.pipeline.dialog.PipelinePreviewProgressDialog in project hop by apache.
the class CsvInputDialog method preview.
// Preview the data
private synchronized void preview() {
// Create the XML input transform
CsvInputMeta oneMeta = new CsvInputMeta();
getInfo(oneMeta);
PipelineMeta previewMeta = PipelinePreviewFactory.generatePreviewPipeline(pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "CsvInputDialog.PreviewSize.DialogTitle"), BaseMessages.getString(PKG, "CsvInputDialog.PreviewSize.DialogMessage"));
int previewSize = numberDialog.open();
if (previewSize > 0) {
PipelinePreviewProgressDialog progressDialog = new PipelinePreviewProgressDialog(shell, variables, previewMeta, new String[] { wTransformName.getText() }, new int[] { previewSize });
progressDialog.open();
Pipeline pipeline = progressDialog.getPipeline();
String loggingText = progressDialog.getLoggingText();
if (!progressDialog.isCancelled()) {
if (pipeline.getResult() != null && pipeline.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, variables, SWT.NONE, wTransformName.getText(), progressDialog.getPreviewRowsMeta(wTransformName.getText()), progressDialog.getPreviewRows(wTransformName.getText()), loggingText);
prd.open();
}
}
Aggregations