Commit c815fb66 authored by Jörg Richter's avatar Jörg Richter

Core API: add more constants (PLUGIN, ...) (#360)

parent 524aefac
Pipeline #9380 failed with stages
in 10 seconds
......@@ -17,6 +17,11 @@ public class Constants {
public static final String CARDINALITY = "dmx.core.cardinality";
public static final String IDENTITY_ATTR = "dmx.core.identity_attr";
public static final String INCLUDE_IN_LABEL = "dmx.core.include_in_label";
//
public static final String PLUGIN = "dmx.core.plugin";
public static final String PLUGIN_NAME = "dmx.core.plugin_name";
public static final String PLUGIN_SYMBOLIC_NAME = "dmx.core.plugin_symbolic_name";
public static final String PLUGIN_MIGRATION_NR = "dmx.core.plugin_migration_nr";
// assoc types
public static final String ASSOCIATION = "dmx.core.association";
......
......@@ -49,7 +49,7 @@ class MigrationManager {
* Determines the migrations to be run for the specified plugin, and runs them.
*/
void runPluginMigrations(PluginImpl plugin, boolean isCleanInstall) {
int installedModelVersion = plugin.getPluginTopic().getChildTopics().getTopic("dmx.core.plugin_migration_nr")
int installedModelVersion = plugin.getPluginTopic().getChildTopics().getTopic(PLUGIN_MIGRATION_NR)
.getSimpleValue().intValue();
int requiredModelVersion = Integer.parseInt(plugin.getConfigProperty("dmx.plugin.model_version", "0"));
int migrationsToRun = requiredModelVersion - installedModelVersion;
......
......@@ -239,7 +239,7 @@ public class PluginImpl implements Plugin, EventHandler {
}
void setMigrationNr(int migrationNr) {
pluginTopic.getChildTopics().set("dmx.core.plugin_migration_nr", migrationNr);
pluginTopic.getChildTopics().set(PLUGIN_MIGRATION_NR, migrationNr);
}
// ---
......@@ -579,10 +579,10 @@ public class PluginImpl implements Plugin, EventHandler {
* A Plugin topic represents an installed plugin and is used to track its version.
*/
private Topic createPluginTopic() {
return dmx.createTopic(mf.newTopicModel(pluginUri, "dmx.core.plugin", mf.newChildTopicsModel()
.put("dmx.core.plugin_name", pluginName())
.put("dmx.core.plugin_symbolic_name", pluginUri)
.put("dmx.core.plugin_migration_nr", 0)
return dmx.createTopic(mf.newTopicModel(pluginUri, PLUGIN, mf.newChildTopicsModel()
.put(PLUGIN_NAME, pluginName())
.put(PLUGIN_SYMBOLIC_NAME, pluginUri)
.put(PLUGIN_MIGRATION_NR, 0)
));
}
......
......@@ -8,7 +8,7 @@
</div>
<div class="field">
<div class="field-label">Released</div>
Mar 22, 2020
Mar 23, 2020
</div>
<div class="field">
<div class="field-label">License</div>
......
......@@ -22,7 +22,7 @@ public class Migration2 extends Migration {
addIconToTopicType(TOPIC_TYPE, "\uf10c"); // fa-circle-o
addIconToTopicType(ASSOC_TYPE, "\uf192"); // fa-dot-circle-o
addIconToTopicType(ROLE_TYPE, "\uf04b"); // fa-play
addIconToTopicType("dmx.core.plugin", "\uf12e"); // fa-puzzle-piece
addIconToTopicType(PLUGIN, "\uf12e"); // fa-puzzle-piece
// colors match dm5-color-picker
// Note: color values are not aligned by extra spaces. Cytoscape style parsing would fail.
addColorToAssocType(ASSOCIATION, "hsl(0, 0%, 80%)");
......
......@@ -9,7 +9,7 @@ import extraElementUI from './element-ui'
import 'font-awesome/css/font-awesome.css'
import './websocket'
console.log('[DMX] 2020/03/22')
console.log('[DMX] 2020/03/23')
// 1) Init dm5 library
// The dm5 library must be inited *before* the dm5-webclient component is instantiated.
......
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