use of org.pentaho.di.ui.partition.dialog.PartitionSchemaDialog in project pentaho-kettle by pentaho.
the class RepositoryExplorerDialog method newPartitionSchema.
public void newPartitionSchema() {
try {
PartitionSchema partitionSchema = new PartitionSchema();
PartitionSchemaDialog dd = new PartitionSchemaDialog(shell, partitionSchema, rep.readDatabases(), variableSpace);
if (dd.open()) {
// See if this slave server already exists...
ObjectId idPartitionSchema = rep.getPartitionSchemaID(partitionSchema.getName());
if (idPartitionSchema == null) {
rep.insertLogEntry("Creating new partition schema '" + partitionSchema.getName() + "'");
rep.save(partitionSchema, Const.VERSION_COMMENT_INITIAL_VERSION, null);
} else {
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
mb.setMessage(BaseMessages.getString(PKG, "RepositoryExplorerDialog.PartitionSchema.Create.AlreadyExists.Message"));
mb.setText(BaseMessages.getString(PKG, "RepositoryExplorerDialog.PartitionSchema.Create.AlreadyExists.Title"));
mb.open();
}
// Refresh tree...
refreshTree();
}
} catch (KettleException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.PartitionSchema.Create.UnexpectedError.Title"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.PartitionSchema.Create.UnexpectedError.Message"), e);
}
}
Aggregations