diff --git a/numass-server/build.gradle b/numass-server/build.gradle index c203ec7c..c955374c 100644 --- a/numass-server/build.gradle +++ b/numass-server/build.gradle @@ -35,6 +35,4 @@ task runServer(dependsOn: classes, type: JavaExec){ workingDir "D:\\Temp\\test\\" standardInput = System.in standardOutput = System.out -} - -ratpack.baseDir = file('ratpack') \ No newline at end of file +} \ No newline at end of file diff --git a/numass-server/src/main/java/inr/numass/server/ServerRunner.java b/numass-server/src/main/java/inr/numass/server/ServerRunner.java index a9f38c90..2c1a180f 100644 --- a/numass-server/src/main/java/inr/numass/server/ServerRunner.java +++ b/numass-server/src/main/java/inr/numass/server/ServerRunner.java @@ -3,7 +3,7 @@ package inr.numass.server; import hep.dataforge.io.MetaFileReader; import hep.dataforge.meta.Meta; import hep.dataforge.meta.SimpleConfigurable; -import hep.dataforge.storage.filestorage.FileStorage; +import inr.numass.storage.NumassStorage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +20,7 @@ public class ServerRunner extends SimpleConfigurable implements AutoCloseable { private static final String LISTENER_ELEMENT = "listener"; private static final String NUMASS_REPO_PATH_PROPERTY = "numass.repository.path"; private final static Logger logger = LoggerFactory.getLogger("NUMASS-SERVER"); - FileStorage root; + NumassStorage root; NumassServer listener; public ServerRunner() throws IOException, ParseException { @@ -52,12 +52,12 @@ public class ServerRunner extends SimpleConfigurable implements AutoCloseable { public ServerRunner start() throws Exception { String repoPath = meta().getString(NUMASS_REPO_PATH_PROPERTY, "."); - Meta repoConfig = null; - if (meta().hasMeta(NUMASS_REPO_ELEMENT)) { - repoConfig = meta().getMeta(NUMASS_REPO_ELEMENT); - } +// Meta repoConfig = null; +// if (meta().hasMeta(NUMASS_REPO_ELEMENT)) { +// repoConfig = meta().getMeta(NUMASS_REPO_ELEMENT); +// } logger.info("Initializing file storage in {}", repoPath); - root = FileStorage.in(new File(repoPath), repoConfig); + root = NumassStorage.buildLocalNumassRoot(new File(repoPath),true);//in(new File(repoPath), repoConfig); logger.info("Starting numass server"); if (root != null) { @@ -88,7 +88,6 @@ public class ServerRunner extends SimpleConfigurable implements AutoCloseable { } } - if (root != null) { try { root.close(); diff --git a/numass-server/src/main/resources/templates/NumassRoot.ftl b/numass-server/src/main/resources/templates/NumassRoot.ftl index 4e20c725..6714525b 100644 --- a/numass-server/src/main/resources/templates/NumassRoot.ftl +++ b/numass-server/src/main/resources/templates/NumassRoot.ftl @@ -30,7 +30,7 @@
<#if serverRootState??>
-

Current root state:

+

Server root state:

${serverRootState}
@@ -38,7 +38,7 @@
<#if runPresent> -

Current run configuration

+<#--

Current run configuration

<#if runMeta??>

Run metadata:

@@ -47,6 +47,7 @@
+--> <#if runState?? >

Current run state: