Server fix. Update still not working

This commit is contained in:
Alexander Nozik 2017-05-22 18:54:31 +03:00
parent 802993c620
commit 52e488697f
3 changed files with 36 additions and 4 deletions

View File

@ -4,9 +4,9 @@ import hep.dataforge.context.Context
import hep.dataforge.exceptions.StorageException import hep.dataforge.exceptions.StorageException
import hep.dataforge.meta.Meta import hep.dataforge.meta.Meta
import hep.dataforge.server.ServerManager import hep.dataforge.server.ServerManager
import hep.dataforge.server.storage.StorageServeUtils
import hep.dataforge.storage.commons.StorageFactory import hep.dataforge.storage.commons.StorageFactory
import inr.numass.client.ClientUtils import inr.numass.client.ClientUtils
import inr.numass.server.NumassStorageServerObject
import javafx.beans.property.SimpleObjectProperty import javafx.beans.property.SimpleObjectProperty
import javafx.event.EventHandler import javafx.event.EventHandler
import javafx.scene.control.Hyperlink import javafx.scene.control.Hyperlink
@ -40,7 +40,7 @@ class ServerView() : View("Numass server controller") {
} }
} }
} }
label = hyperlink{ label = hyperlink {
action { action {
hostServices.showDocument(serverManager.link); hostServices.showDocument(serverManager.link);
} }
@ -78,7 +78,7 @@ class ServerView() : View("Numass server controller") {
} }
} }
StorageServeUtils.addStorage(serverManager,storage,"numass-storage") serverManager.bind(NumassStorageServerObject(serverManager, storage, "numass-storage"));
} }
} }
} }

View File

@ -75,7 +75,9 @@ public class NumassStorageHandler extends StorageRatpackHandler {
@Override @Override
protected MetaBuilder pointLoaderPlotOptions(PointLoader loader) { protected MetaBuilder pointLoaderPlotOptions(PointLoader loader) {
MetaBuilder builder = super.pointLoaderPlotOptions(loader); MetaBuilder builder = super.pointLoaderPlotOptions(loader);
if (loader.getName().startsWith("msp") || loader.getName().startsWith("vac") || loader.getName().startsWith("cryotemp")) { if (loader.getName().startsWith("msp")
|| loader.getName().startsWith("vac")
|| loader.getName().startsWith("cryotemp")) {
builder.putValue("legend.position", "bottom"); builder.putValue("legend.position", "bottom");
builder.putValue("title", "\"" + loader.getName() + "\""); builder.putValue("title", "\"" + loader.getName() + "\"");
builder.putNode(new MetaBuilder("vAxis") builder.putNode(new MetaBuilder("vAxis")

View File

@ -0,0 +1,30 @@
package inr.numass.server;
import hep.dataforge.server.ServerManager;
import hep.dataforge.server.ServerObject;
import hep.dataforge.server.storage.StorageServerObject;
import hep.dataforge.storage.api.Storage;
import ratpack.handling.Handler;
/**
* Created by darksnake on 22-May-17.
*/
public class NumassStorageServerObject extends StorageServerObject {
public NumassStorageServerObject(ServerManager manager, Storage storage, String path) {
super(manager, storage, path);
}
public NumassStorageServerObject(ServerObject parent, Storage storage) {
super(parent, storage);
}
@Override
protected Handler buildHandler(Storage storage) {
return new NumassStorageHandler(getManager(), storage);
}
@Override
protected StorageServerObject buildChildStorageObject(Storage shelf) {
return new NumassStorageServerObject(this, shelf);
}
}