use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.
the class XMLInputSaxDialog method preview.
// Preview the data
private void preview() {
try {
// Create the XML input step
XMLInputSaxMeta oneMeta = new XMLInputSaxMeta();
getInfo(oneMeta);
TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "XMLInputSaxDialog.Dialog.EnterPreviewSize.Title"), BaseMessages.getString(PKG, "XMLInputSaxDialog.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();
if (!progressDialog.isCancelled()) {
PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta(wStepname.getText()), progressDialog.getPreviewRows(wStepname.getText()));
prd.open();
}
}
} catch (KettleException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "XMLInputSaxDialog.Dialog.ErrorDisplayingPreviewData.Title"), BaseMessages.getString(PKG, "XMLInputSaxDialog.Dialog.ErrorDisplayingPreviewData.Message"), e);
}
}
use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.
the class OpenERPObjectInputDialog method preview.
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();
}
}
use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.
the class PaloCellInputDialog method preview.
private void preview() {
PaloCellInputMeta oneMeta = new PaloCellInputMeta();
try {
getInfo(oneMeta);
if (oneMeta.getFields() == null || oneMeta.getFields().size() == 0) {
throw new KettleException("Fields must be defined to do a preview");
} else {
for (DimensionField field : oneMeta.getFields()) {
if (Utils.isEmpty(field.getFieldType())) {
throw new KettleException("All fields must have an output type to do the preview");
}
}
}
} catch (KettleException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Title"), BaseMessages.getString(PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Message"), e);
return;
}
TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, textStepName.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, 500, BaseMessages.getString(PKG, "System.Dialog.EnterPreviewSize.Title"), BaseMessages.getString(PKG, "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(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, textStepName.getText(), progressDialog.getPreviewRowsMeta(textStepName.getText()), progressDialog.getPreviewRows(textStepName.getText()), loggingText);
prd.open();
}
}
use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-kettle by pentaho.
the class AccessInputDialog method preview.
// Preview the data
private void preview() {
try {
// Create the Access input step
AccessInputMeta oneMeta = new AccessInputMeta();
getInfo(oneMeta);
// check if the path is given
if (!checkInputTableName(oneMeta)) {
return;
}
TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "AccessInputDialog.NumberRows.DialogTitle"), BaseMessages.getString(PKG, "AccessInputDialog.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, "AccessInputDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "AccessInputDialog.ErrorPreviewingData.DialogMessage"), e);
}
}
use of org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog in project pentaho-cassandra-plugin by pentaho.
the class CassandraInputDialog method preview.
private void preview() {
CassandraInputMeta oneMeta = new CassandraInputMeta();
getInfo(oneMeta);
// Turn off execute for each incoming row (if set). Query is still going to
// be stuffed if the user has specified field replacement (i.e. ?{...}) in
// the query string
oneMeta.setExecuteForEachIncomingRow(false);
if (!checkForUnresolved(oneMeta, BaseMessages.getString(PKG, "CassandraInputDialog.Warning.Message.CassandraQueryContainsUnresolvedVarsFieldSubs.PreviewTitle"))) {
return;
}
TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, m_stepnameText.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, // $NON-NLS-1$
"CassandraInputDialog.PreviewSize.DialogTitle"), // $NON-NLS-1$
BaseMessages.getString(PKG, "CassandraInputDialog.PreviewSize.DialogMessage"));
int previewSize = numberDialog.open();
if (previewSize > 0) {
TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { m_stepnameText.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 // $NON-NLS-1$
EnterTextDialog(// $NON-NLS-1$
shell, // $NON-NLS-1$
BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"), // $NON-NLS-1$
BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"), loggingText, true);
etd.setReadOnly();
etd.open();
}
}
PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, m_stepnameText.getText(), progressDialog.getPreviewRowsMeta(m_stepnameText.getText()), progressDialog.getPreviewRows(m_stepnameText.getText()), loggingText);
prd.open();
}
}
Aggregations