use of org.pentaho.di.trans.steps.rssinput.RssInputMeta in project pentaho-kettle by pentaho.
the class RssInputDialog method preview.
// Preview the data
private void preview() {
try {
// Create the XML input step
RssInputMeta oneMeta = new RssInputMeta();
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, "RssInputDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "RssInputDialog.ErrorPreviewingData.DialogMessage"), e);
}
}
use of org.pentaho.di.trans.steps.rssinput.RssInputMeta in project pentaho-kettle by pentaho.
the class RssInputDialog method get.
private void get() {
try {
RssInputMeta meta = new RssInputMeta();
getInfo(meta);
// Check for URL
if (!checkInputURL(meta)) {
return;
}
// Clear Fields Grid
wFields.removeAll();
wFields.add(new String[] { RssInputField.getColumnDesc(0), RssInputField.getColumnDesc(0), "String", "", "", "", "", "", "", "N" });
wFields.add(new String[] { RssInputField.getColumnDesc(1), RssInputField.getColumnDesc(1), "String", "", "", "", "", "", "", "N" });
wFields.add(new String[] { RssInputField.getColumnDesc(2), RssInputField.getColumnDesc(2), "String", "", "", "", "", "", "", "N" });
wFields.add(new String[] { RssInputField.getColumnDesc(3), RssInputField.getColumnDesc(3), "String", "", "", "", "", "", "", "N" });
wFields.add(new String[] { RssInputField.getColumnDesc(4), RssInputField.getColumnDesc(4), "String", "", "", "", "", "", "", "N" });
wFields.add(new String[] { RssInputField.getColumnDesc(5), RssInputField.getColumnDesc(5), "String", "", "", "", "", "", "", "N" });
wFields.add(new String[] { RssInputField.getColumnDesc(6), RssInputField.getColumnDesc(6), "String", "", "", "", "", "", "", "N" });
wFields.removeEmptyRows();
wFields.setRowNums();
wFields.optWidth(true);
} catch (Exception e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "RssInputDialog.ErrorGettingFields.DialogTitle"), BaseMessages.getString(PKG, "getXMLDataDialog.ErrorGettingFields.DialogMessage"), e);
}
}
Aggregations