use of org.pentaho.di.core.logging.LogTableField in project pentaho-kettle by pentaho.
the class JobDialog method getJobEntryLogTableOptions.
private void getJobEntryLogTableOptions(JobEntryLogTable jobEntryLogTable) {
// The connection...
//
jobEntryLogTable.setConnectionName(wLogconnection.getText());
jobEntryLogTable.setSchemaName(wLogSchema.getText());
jobEntryLogTable.setTableName(wLogTable.getText());
jobEntryLogTable.setTimeoutInDays(wLogTimeout.getText());
for (int i = 0; i < jobEntryLogTable.getFields().size(); i++) {
TableItem item = wOptionFields.table.getItem(i);
LogTableField field = jobEntryLogTable.getFields().get(i);
field.setEnabled(item.getChecked());
field.setFieldName(item.getText(1));
}
}
use of org.pentaho.di.core.logging.LogTableField in project pentaho-kettle by pentaho.
the class JobDialog method getJobLogTableOptions.
private void getJobLogTableOptions(JobLogTable jobLogTable) {
// The connection...
//
jobLogTable.setConnectionName(wLogconnection.getText());
jobLogTable.setSchemaName(wLogSchema.getText());
jobLogTable.setTableName(wLogTable.getText());
jobLogTable.setLogInterval(wLogInterval.getText());
jobLogTable.setLogSizeLimit(wLogSizeLimit.getText());
jobLogTable.setTimeoutInDays(wLogTimeout.getText());
for (int i = 0; i < jobLogTable.getFields().size(); i++) {
TableItem item = wOptionFields.table.getItem(i);
LogTableField field = jobLogTable.getFields().get(i);
field.setEnabled(item.getChecked());
field.setFieldName(item.getText(1));
}
}
use of org.pentaho.di.core.logging.LogTableField in project pentaho-kettle by pentaho.
the class JobDialog method getChannelLogTableOptions.
private void getChannelLogTableOptions(ChannelLogTable channelLogTable) {
// The connection...
//
channelLogTable.setConnectionName(wLogconnection.getText());
channelLogTable.setSchemaName(wLogSchema.getText());
channelLogTable.setTableName(wLogTable.getText());
channelLogTable.setTimeoutInDays(wLogTimeout.getText());
for (int i = 0; i < channelLogTable.getFields().size(); i++) {
TableItem item = wOptionFields.table.getItem(i);
LogTableField field = channelLogTable.getFields().get(i);
field.setEnabled(item.getChecked());
field.setFieldName(item.getText(1));
}
}
use of org.pentaho.di.core.logging.LogTableField in project pentaho-kettle by pentaho.
the class TransHistoryDelegate method showLogEntry.
private void showLogEntry() {
TransHistoryLogTab model = models[tabFolder.getSelectionIndex()];
Text text = model.logDisplayText;
if (text == null || text.isDisposed()) {
return;
}
List<Object[]> list = model.rows;
if (list == null || list.size() == 0) {
String message;
if (model.logTable.isDefined()) {
message = BaseMessages.getString(PKG, "TransHistory.PleaseRefresh.Message");
} else {
message = BaseMessages.getString(PKG, "TransHistory.HistoryConfiguration.Message");
}
text.setText(message);
return;
}
// grab the selected line in the table:
int nr = model.logDisplayTableView.table.getSelectionIndex();
if (nr >= 0 && nr < list.size()) {
// OK, grab this one from the buffer...
Object[] row = list.get(nr);
// What is the name of the log field?
//
LogTableField logField = model.logTable.getLogField();
if (logField != null) {
int index = model.logTableFields.indexOf(logField);
if (index >= 0) {
String logText = row[index].toString();
text.setText(Const.NVL(logText, ""));
text.setSelection(text.getText().length());
text.showSelection();
} else {
text.setText(BaseMessages.getString(PKG, "TransHistory.HistoryConfiguration.NoLoggingFieldDefined"));
}
}
}
}
use of org.pentaho.di.core.logging.LogTableField in project pentaho-kettle by pentaho.
the class TransHistoryDelegate method displayHistoryData.
private void displayHistoryData(final int index) {
TransHistoryLogTab model = models[index];
ColumnInfo[] colinf = model.logDisplayTableView.getColumns();
//
if (model.logDisplayTableView == null || model.logDisplayTableView.isDisposed()) {
return;
}
int selectionIndex = model.logDisplayTableView.getSelectionIndex();
model.logDisplayTableView.table.clearAll();
List<Object[]> rows = model.rows;
if (rows != null && rows.size() > 0) {
//
for (Object[] rowData : rows) {
TableItem item = new TableItem(model.logDisplayTableView.table, SWT.NONE);
for (int c = 0; c < colinf.length; c++) {
ColumnInfo column = colinf[c];
ValueMetaInterface valueMeta = column.getValueMeta();
String string = null;
try {
string = valueMeta.getString(rowData[c]);
} catch (KettleValueException e) {
log.logError("history data conversion issue", e);
}
item.setText(c + 1, Const.NVL(string, ""));
}
// Add some color
//
Long errors = null;
LogStatus status = null;
LogTableField errorsField = model.logTable.getErrorsField();
if (errorsField != null) {
int index1 = model.logTableFields.indexOf(errorsField);
try {
errors = colinf[index1].getValueMeta().getInteger(rowData[index1]);
} catch (KettleValueException e) {
log.logError("history data conversion issue", e);
}
}
LogTableField statusField = model.logTable.getStatusField();
if (statusField != null) {
int index1 = model.logTableFields.indexOf(statusField);
String statusString = null;
try {
statusString = colinf[index1].getValueMeta().getString(rowData[index1]);
} catch (KettleValueException e) {
log.logError("history data conversion issue", e);
}
if (statusString != null) {
status = LogStatus.findStatus(statusString);
}
}
if (errors != null && errors > 0L) {
item.setBackground(GUIResource.getInstance().getColorRed());
} else if (status != null && LogStatus.STOP.equals(status)) {
item.setBackground(GUIResource.getInstance().getColorYellow());
}
}
model.logDisplayTableView.removeEmptyRows();
model.logDisplayTableView.setRowNums();
model.logDisplayTableView.optWidth(true);
} else {
model.logDisplayTableView.clearAll(false);
// new TableItem(wFields.get(tabIndex).table, SWT.NONE); // Give it an item to prevent errors on various
// platforms.
}
if (selectionIndex >= 0 && selectionIndex < model.logDisplayTableView.getItemCount()) {
model.logDisplayTableView.table.select(selectionIndex);
showLogEntry();
}
}
Aggregations