+ // Parse the received String, paths are separated with a carriage
+ // return
+ String[] paths = data.toString().split(new String("\n"));
+ SortedSet<String> resultPaths = new TreeSet<String>();
+ for (String path : paths) {
+ try {
+ // either a node or a whole directory can have been dragged
+ QueryManager qm = processNode.getSession().getWorkspace()
+ .getQueryManager();
+ String statement = "SELECT * FROM ["
+ + SlcTypes.SLC_EXECUTION_FLOW
+ + "] WHERE ISDESCENDANTNODE(['" + path
+ + "']) OR ISSAMENODE(['" + path + "'])";
+ Query query = qm.createQuery(statement, Query.JCR_SQL2);
+
+ // order paths
+ for (NodeIterator nit = query.execute().getNodes(); nit
+ .hasNext();) {
+ String currPath = nit.nextNode().getPath();
+ // do not add twice a same flow
+ if (!resultPaths.contains(currPath))
+ resultPaths.add(currPath);
+ }
+ } catch (RepositoryException e) {
+ throw new SlcException("Cannot query flows under " + path,
+ e);