use of org.pentaho.di.trans.TransMeta in project pentaho-kettle by pentaho.
the class GetVariableDialog method preview.
// Preview the data
private void preview() {
try {
// Create the Access input step
GetVariableMeta oneMeta = new GetVariableMeta();
getInfo(oneMeta);
TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
// EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(),
// BaseMessages.getString(PKG, "GetVariableDialog.NumberRows.DialogTitle"), BaseMessages.getString(PKG,
// "GetVariableDialog.NumberRows.DialogMessage"));
// numberDialog.open();
int previewSize = 1;
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, "GetVariableDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "GetVariableDialog.ErrorPreviewingData.DialogMessage"), e);
}
}
use of org.pentaho.di.trans.TransMeta in project pentaho-kettle by pentaho.
the class LDAPInputDialog method preview.
// Preview the data
private void preview() {
try {
// Create the XML input step
LDAPInputMeta oneMeta = new LDAPInputMeta();
getInfo(oneMeta);
TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "LDAPInputDialog.NumberRows.DialogTitle"), BaseMessages.getString(PKG, "LDAPInputDialog.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, "LDAPInputDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "LDAPInputDialog.ErrorPreviewingData.DialogMessage"), e);
}
}
use of org.pentaho.di.trans.TransMeta in project pentaho-kettle by pentaho.
the class GetSubFoldersDialog method preview.
// Preview the data
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();
}
}
}
use of org.pentaho.di.trans.TransMeta in project pentaho-kettle by pentaho.
the class Spoon method dupeStep.
public void dupeStep() {
final TransMeta transMeta = (TransMeta) selectionObjectParent;
final StepMeta stepMeta = (StepMeta) selectionObject;
delegates.steps.dupeStep(transMeta, stepMeta);
}
use of org.pentaho.di.trans.TransMeta in project pentaho-kettle by pentaho.
the class Spoon method loadObjectFromRepository.
public void loadObjectFromRepository(ObjectId objectId, RepositoryObjectType objectType, String revision) throws Exception {
// Try to open the selected transformation.
if (objectType.equals(RepositoryObjectType.TRANSFORMATION)) {
try {
TransLoadProgressDialog progressDialog = new TransLoadProgressDialog(shell, rep, objectId, revision);
TransMeta transMeta = progressDialog.open();
transMeta.clearChanged();
if (transMeta != null) {
if (log.isDetailed()) {
log.logDetailed(BaseMessages.getString(PKG, "Spoon.Log.LoadToTransformation", transMeta.getName(), transMeta.getRepositoryDirectory().getName()));
}
props.addLastFile(LastUsedFile.FILE_TYPE_TRANSFORMATION, transMeta.getName(), transMeta.getRepositoryDirectory().getPath(), true, rep.getName(), getUsername(), null);
addMenuLast();
addTransGraph(transMeta);
}
refreshTree();
refreshGraph();
} catch (Exception e) {
if (KettleRepositoryLostException.lookupStackStrace(e) == null) {
new ErrorDialog(((Spoon) SpoonFactory.getInstance()).getShell(), BaseMessages.getString(Spoon.class, "Spoon.Dialog.ErrorOpeningById.Message", objectId), e.getMessage(), e);
} else {
throw e;
}
}
} else if (objectType.equals(RepositoryObjectType.JOB)) {
try {
JobLoadProgressDialog progressDialog = new JobLoadProgressDialog(shell, rep, objectId, revision);
JobMeta jobMeta = progressDialog.open();
jobMeta.clearChanged();
if (jobMeta != null) {
props.addLastFile(LastUsedFile.FILE_TYPE_JOB, jobMeta.getName(), jobMeta.getRepositoryDirectory().getPath(), true, rep.getName(), getUsername(), null);
saveSettings();
addMenuLast();
addJobGraph(jobMeta);
}
refreshTree();
refreshGraph();
} catch (Exception e) {
if (KettleRepositoryLostException.lookupStackStrace(e) == null) {
new ErrorDialog(((Spoon) SpoonFactory.getInstance()).getShell(), BaseMessages.getString(Spoon.class, "Spoon.Dialog.ErrorOpeningById.Message", objectId), e.getMessage(), e);
} else {
throw e;
}
}
}
}
Aggregations