X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FDebugSupportImpl.java;fp=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FDebugSupportImpl.java;h=ca5eb0825a3c6462676dcee91124d4b2384b2021;hp=3b05bcba6d67baabc0ee5afcf48557f522f3b384;hb=e460fd6f0af60314e2ca28391ef7ff2043016d97;hpb=fe29fd8956c3881e261ec4eee1cdd2ac27bc0554 diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DebugSupportImpl.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DebugSupportImpl.java index 3b05bcba6..ca5eb0825 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DebugSupportImpl.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DebugSupportImpl.java @@ -45,6 +45,7 @@ import org.simantics.scl.runtime.function.FunctionImpl2; import org.simantics.scl.runtime.function.FunctionImpl3; import org.simantics.utils.Development; import org.simantics.utils.FileUtils; +import org.slf4j.LoggerFactory; import gnu.trove.map.hash.TIntIntHashMap; import gnu.trove.procedure.TIntIntProcedure; @@ -53,6 +54,8 @@ import gnu.trove.set.hash.TIntHashSet; public class DebugSupportImpl implements DebugSupport { + private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(DebugSupportImpl.class); + final private Map> getCommands = new HashMap>(); final private Map> listCommands = new HashMap>(); final private Map> execCommands = new HashMap>(); @@ -106,6 +109,21 @@ public class DebugSupportImpl implements DebugSupport { }); + listCommands.put("queryData", new FunctionImpl3() { + + @Override + public String apply(WriteGraph graph, File file, String args) { + try { + getSession(graph).queryProvider2.save(); + return "Saved queries"; + } catch (IOException e) { + LOGGER.error("Error while saving queries", e); + return e.getMessage(); + } + } + + }); + listCommands.put("queryActivity", new FunctionImpl3() { @Override