Commit 8a07ae12 authored by Jörg Richter's avatar Jörg Richter

Fix: create Topicmaps Messenger early in preInstall() (#384)

See also dmx-intern/it-operations#204
parent 3ce0035c
Pipeline #10640 passed with stages
in 8 minutes and 36 seconds
......@@ -8,7 +8,7 @@
</div>
<div class="field">
<div class="field-label">Released</div>
Jul 27, 2020
Jul 28, 2020
</div>
<div class="field">
<div class="field-label">License</div>
......
......@@ -61,17 +61,6 @@ public class TopicmapsPlugin extends PluginActivator implements TopicmapsService
public TopicmapsPlugin() {
// Note: registering the default topicmap type in the init() hook would be too late.
// The topicmap type is already needed at install-in-DB time ### Still true? Use preInstall() hook?
registerTopicmapType(new DefaultTopicmapType());
//
registerViewmodelCustomizer(this);
// ### FIXME: unregister is missing
}
// ************************
// *** TopicmapsService ***
// ************************
......@@ -463,7 +452,12 @@ public class TopicmapsPlugin extends PluginActivator implements TopicmapsService
@Override
public void init() {
public void preInstall() {
// Note: topicmaps are created early at install-in-DB time.
// So we set up the required facilities here in preInstall() (init() on the other hand would be too late).
registerTopicmapType(new DefaultTopicmapType());
registerViewmodelCustomizer(this); // ### FIXME: unregister is missing
//
me = new Messenger(dmx.getWebSocketService());
}
......
......@@ -9,7 +9,7 @@ import extraElementUI from './element-ui'
import 'font-awesome/css/font-awesome.css'
import './websocket'
console.log('[DMX] 2020/07/27')
console.log('[DMX] 2020/07/28')
// 1) Init dm5 library
// The dm5 library must be inited *before* the dm5-webclient component is instantiated.
......
......@@ -101,8 +101,8 @@ public class WorkspacesPlugin extends PluginActivator implements WorkspacesServi
@Override
public Topic createWorkspace(@QueryParam("name") final String name, @QueryParam("uri") final String uri,
@QueryParam("sharingModeUri") final SharingMode sharingMode) {
final String operation = "Creating workspace \"" + name + "\" ";
final String info = "(uri=" + uri + ", sharingMode=" + sharingMode + ")";
final String operation = "Creating workspace \"" + name + "\"";
final String info = ", uri=" + uri + ", sharingMode=" + sharingMode;
try {
// We suppress standard workspace assignment here as 1) a workspace itself gets no assignment at all,
// and 2) the workspace's default topicmap requires a special assignment. See step 2) below.
......@@ -134,7 +134,7 @@ public class WorkspacesPlugin extends PluginActivator implements WorkspacesServi
me.newWorkspace(workspace); // FIXME: broadcast to eligible users only
return workspace;
} catch (Exception e) {
throw new RuntimeException(operation + "failed " + info, e);
throw new RuntimeException(operation + " failed" + info, e);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment