- if (node.isNodeType(SLC_EXECUTION_FLOW)) {
- List<String> paths = new ArrayList<String>();
- paths.add(node.getPath());
- PlatformUI
- .getWorkbench()
- .getActiveWorkbenchWindow()
- .getActivePage()
- .openEditor(
- new ProcessEditorInput(paths, true),
- ProcessEditor.ID);
+ if (node.isNodeType(SLC_EXECUTION_MODULE)) {
+ String name = node.getProperty(SLC_NAME).getString();
+ String version = node.getProperty(SLC_VERSION)
+ .getString();
+ NameVersion nameVersion = new BasicNameVersion(name,
+ version);
+ Boolean started = node.getProperty(SLC_STARTED)
+ .getBoolean();
+ if (started) {
+ modulesManager.stop(nameVersion);
+ } else {
+ modulesManager.start(nameVersion);
+ }
+ } else {
+ String path = node.getPath();
+ // TODO factorize with editor
+ QueryManager qm = node.getSession().getWorkspace()
+ .getQueryManager();
+ String statement = "SELECT * FROM ["
+ + SlcTypes.SLC_EXECUTION_FLOW
+ + "] WHERE ISDESCENDANTNODE(['" + path
+ + "']) OR ISSAMENODE(['" + path + "'])";
+ // log.debug(statement);
+ Query query = qm.createQuery(statement, Query.JCR_SQL2);
+
+ // order paths
+ SortedSet<String> paths = new TreeSet<String>();
+ for (NodeIterator nit = query.execute().getNodes(); nit
+ .hasNext();) {
+ paths.add(nit.nextNode().getPath());
+ }
+
+ // List<String> paths = new ArrayList<String>();
+ // paths.add(node.getPath());
+ IWorkbenchPage activePage = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ activePage.openEditor(new ProcessEditorInput(
+ new ArrayList<String>(paths), true),
+ ProcessEditor.ID);