use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class DefaultRunConfigurationProviderTest method testLoadNullName.
@Test
public void testLoadNullName() {
RunConfiguration defaultRunConfiguration = defaultRunConfigurationProvider.load(null);
assertEquals(defaultRunConfiguration.getType(), "Pentaho");
}
use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationDelegate method edit.
public void edit(RunConfiguration runConfiguration) {
final String key = runConfiguration.getName();
RunConfigurationDialog dialog = new RunConfigurationDialog(spoonSupplier.get().getShell(), configurationManager, runConfiguration);
RunConfiguration savedRunConfiguration = dialog.open();
if (savedRunConfiguration != null) {
configurationManager.delete(key);
configurationManager.save(savedRunConfiguration);
spoonSupplier.get().refreshTree();
updateLoadedJobs(key, savedRunConfiguration);
}
}
use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationDelegate method create.
public void create() {
List<String> names = configurationManager.getNames();
String name = BaseMessages.getString(PKG, "RunConfigurationPopupMenuExtension.Configuration.Default") + " ";
int index = 1;
while (names.contains(name + String.valueOf(index))) {
index++;
}
name = name + String.valueOf(index);
DefaultRunConfiguration defaultRunConfiguration = new DefaultRunConfiguration();
defaultRunConfiguration.setName(name);
RunConfigurationDialog dialog = new RunConfigurationDialog(spoonSupplier.get().getShell(), configurationManager, defaultRunConfiguration);
RunConfiguration savedRunConfiguration = dialog.open();
if (savedRunConfiguration != null) {
configurationManager.save(savedRunConfiguration);
spoonSupplier.get().refreshTree();
}
}
use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationPopupMenuExtension method callExtensionPoint.
@Override
public void callExtensionPoint(LogChannelInterface logChannelInterface, Object extension) throws KettleException {
Menu popupMenu = null;
Tree selectionTree = (Tree) extension;
TreeSelection[] objects = spoonSupplier.get().getTreeObjects(selectionTree);
TreeSelection object = objects[0];
Object selection = object.getSelection();
if (selection == RunConfiguration.class) {
popupMenu = createRootPopupMenu(selectionTree);
} else if (selection instanceof RunConfiguration) {
runConfiguration = (RunConfiguration) selection;
if (runConfiguration.isReadOnly()) {
return;
}
popupMenu = createItemPopupMenu(selectionTree);
}
if (popupMenu != null) {
ConstUI.displayMenu(popupMenu, selectionTree);
} else {
selectionTree.setMenu(null);
}
}
use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationManager method load.
@Override
public List<RunConfiguration> load() {
List<RunConfiguration> runConfigurations = new ArrayList<>();
for (RunConfigurationProvider runConfigurationProvider : getRunConfigurationProviders()) {
runConfigurations.addAll(runConfigurationProvider.load());
}
Collections.sort(runConfigurations, (o1, o2) -> {
if (o2.getName().equals(DefaultRunConfigurationProvider.DEFAULT_CONFIG_NAME)) {
return 1;
}
return o1.getName().compareToIgnoreCase(o2.getName());
});
return runConfigurations;
}
Aggregations