Commit 79aba1ce authored by Jörg Richter's avatar Jörg Richter

Consolidate Workspaces migrations

parent 6af71d98
Pipeline #6635 passed with stages
in 3 minutes and 45 seconds
......@@ -13,10 +13,10 @@ import systems.dmx.core.service.Migration;
* Create "System" and "Administration" workspaces.
* Set owner of "System", "Administration", and "DMX" workspaces.
* <p>
* Part of DMX 5.0
* Part of DMX 5.0-beta-3
* Runs ALWAYS
* <p>
* Note: the "admin" user account is created in migration 4. At this moment both must exist, the "Login enabled"
* Note: the "admin" user account is created in migration 3. At this moment both must exist, the "Login enabled"
* config topic type (created in migration 1), and the "Administration" workspace (created here).
*/
public class Migration2 extends Migration {
......@@ -33,11 +33,10 @@ public class Migration2 extends Migration {
@Override
public void run() {
// Note 1: at migration running time our plugin listeners are not yet registered (furthermore there is no user
// logged in). So we set the workspace owner manually here.
// Note 2: we don't set a particular creator/modifier here as we don't want suggest the workspaces have been
// created by the "admin" user. Instead the creator/modifier of the workspaces remain undefined as the
// workspaces are actually created by the system itself.
// Note 1: at migration time our plugin listeners are not yet registered (furthermore no user is logged in).
// We set the workspace owners manually.
// Note 2: we don't set a creator/modifier; we don't want suggest the workspaces have been created by the
// "admin" user. Instead creator/modifier remain undefined as the workspaces are created by the system itself.
//
// "System"
Topic systemWorkspace = wsService.createWorkspace(
......
......@@ -11,7 +11,7 @@ import systems.dmx.core.service.accesscontrol.Credentials;
/**
* Create "admin" user account.
* <p>
* Part of DMX 5.0
* Part of DMX 5.0-beta-3
* Runs ALWAYS
* <p>
* Note: both must exist already, the "Login enabled" config topic type (created in migration 1), and the
......
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
{
"topic_types": [
......
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
{
"topic_types": [
......
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
{
"assoc_types": [
"assoc_types": [
{
"value": "Configuration",
"uri": "dmx.config.configuration",
"dataTypeUri": "dmx.core.text",
"viewConfigTopics": [
{
"value": "Configuration",
"uri": "dmx.config.configuration",
"dataTypeUri": "dmx.core.text",
"viewConfigTopics": [
{
"typeUri": "dmx.webclient.view_config",
"childs": {
"dmx.webclient.color": "hsl(255, 40%, 53%)",
"dmx.webclient.color#dmx.webclient.background_color": "hsl(255, 80%, 96%)"
}
}
]
"typeUri": "dmx.webclient.view_config",
"childs": {
"dmx.webclient.color": "hsl(255, 40%, 53%)",
"dmx.webclient.color#dmx.webclient.background_color": "hsl(255, 80%, 96%)"
}
}
],
"topics": [
// Role Types
{
"value": "Configurable",
"uri": "dmx.config.configurable",
"typeUri": "dmx.core.role_type"
}
]
]
}
],
"topics": [
// Role Types
{
"value": "Configurable",
"uri": "dmx.config.configurable",
"typeUri": "dmx.core.role_type"
}
]
}
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
[
{
......
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
{
"topic_types": [
......
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
{
"topic_types": [
......
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
{
"topic_types": [
// File
"topic_types": [
// File
{
"value": "File Content",
"uri": "dmx.files.file_content",
"dataTypeUri": "dmx.core.html"
},
{
"value": "File Name",
"uri": "dmx.files.file_name",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Path",
"uri": "dmx.files.path",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Media Type",
"uri": "dmx.files.media_type",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Size",
"uri": "dmx.files.size",
"dataTypeUri": "dmx.core.number"
},
{
"value": "File",
"uri": "dmx.files.file",
"dataTypeUri": "dmx.core.identity",
"assocDefs": [
{
"value": "File Content",
"uri": "dmx.files.file_content",
"dataTypeUri": "dmx.core.html"
"childTypeUri": "dmx.files.file_content",
"childCardinalityUri": "dmx.core.one"
},
{
"value": "File Name",
"uri": "dmx.files.file_name",
"dataTypeUri": "dmx.core.text"
"childTypeUri": "dmx.files.file_name",
"childCardinalityUri": "dmx.core.one",
"includeInLabel": true
},
{
"value": "Path",
"uri": "dmx.files.path",
"dataTypeUri": "dmx.core.text"
"childTypeUri": "dmx.files.path",
"childCardinalityUri": "dmx.core.one"
},
{
"value": "Media Type",
"uri": "dmx.files.media_type",
"dataTypeUri": "dmx.core.text"
"childTypeUri": "dmx.files.media_type",
"childCardinalityUri": "dmx.core.one"
},
{
"value": "Size",
"uri": "dmx.files.size",
"dataTypeUri": "dmx.core.number"
"childTypeUri": "dmx.files.size",
"childCardinalityUri": "dmx.core.one"
},
],
"viewConfigTopics": [
{
"value": "File",
"uri": "dmx.files.file",
"dataTypeUri": "dmx.core.identity",
"assocDefs": [
{
"childTypeUri": "dmx.files.file_content",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.files.file_name",
"childCardinalityUri": "dmx.core.one",
"includeInLabel": true
},
{
"childTypeUri": "dmx.files.path",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.files.media_type",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.files.size",
"childCardinalityUri": "dmx.core.one"
},
],
"viewConfigTopics": [
{
"typeUri": "dmx.webclient.view_config",
"childs": {
"dmx.webclient.icon": "\uf15b"
}
}
]
},
// Folder
"typeUri": "dmx.webclient.view_config",
"childs": {
"dmx.webclient.icon": "\uf15b"
}
}
]
},
// Folder
{
"value": "Folder Name",
"uri": "dmx.files.folder_name",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Folder Content",
"uri": "dmx.files.folder_content",
"dataTypeUri": "dmx.core.html"
},
{
"value": "Folder",
"uri": "dmx.files.folder",
"dataTypeUri": "dmx.core.identity",
"assocDefs": [
{
"value": "Folder Name",
"uri": "dmx.files.folder_name",
"dataTypeUri": "dmx.core.text"
"childTypeUri": "dmx.files.folder_name",
"childCardinalityUri": "dmx.core.one"
},
{
"value": "Folder Content",
"uri": "dmx.files.folder_content",
"dataTypeUri": "dmx.core.html"
"childTypeUri": "dmx.files.path",
"childCardinalityUri": "dmx.core.one"
},
{
"value": "Folder",
"uri": "dmx.files.folder",
"dataTypeUri": "dmx.core.identity",
"assocDefs": [
{
"childTypeUri": "dmx.files.folder_name",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.files.path",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.files.folder_content",
"childCardinalityUri": "dmx.core.one"
}
],
"viewConfigTopics": [
{
"typeUri": "dmx.webclient.view_config",
"childs": {
"dmx.webclient.icon": "\uf07b"
}
}
]
"childTypeUri": "dmx.files.folder_content",
"childCardinalityUri": "dmx.core.one"
}
],
"viewConfigTopics": [
{
"typeUri": "dmx.webclient.view_config",
"childs": {
"dmx.webclient.icon": "\uf07b"
}
}
]
]
}
]
}
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
{
"topic_types": [
{
"value": "Disk Quota (MB)",
"uri": "dmx.files.disk_quota",
"dataTypeUri": "dmx.core.number"
}
]
"topic_types": [
{
"value": "Disk Quota (MB)",
"uri": "dmx.files.disk_quota",
"dataTypeUri": "dmx.core.number"
}
]
}
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
{
"topic_types": [
......
......@@ -8,7 +8,7 @@ import systems.dmx.core.service.Migration;
/**
* Add view configs to Core types.
* <p>
* Part of DMX 5.0
* Part of DMX 5.0-beta-3
* Runs ALWAYS
*/
public class Migration2 extends Migration {
......
......@@ -17,7 +17,7 @@ import java.util.logging.Logger;
* Note: while a "clean install" the Core types, and other types created before Webclient is activated, are repaired.
* While "update" all existing types are repaired, including the ones created by installed 3rd-party modules.
* <p>
* Part of DMX 5.0
* Part of DMX 5.0-beta-3
* Runs ALWAYS
*/
public class Migration3 extends Migration {
......
......@@ -9,7 +9,7 @@ import 'font-awesome/css/font-awesome.css'
import './element-ui'
import './websocket'
console.log('[DMX] 2019/05/26')
console.log('[DMX] 2019/05/27')
// 1) Init dm5 library
// The dm5 library must be inited *before* the dm5-webclient component is instantiated.
......
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS
[{
[
{
// View Configuration
"topic_types": [
{
"value": "Icon",
"uri": "dmx.webclient.icon",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Color",
"uri": "dmx.webclient.color",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Add to Create Menu",
"uri": "dmx.webclient.add_to_create_menu",
"dataTypeUri": "dmx.core.boolean"
},
{
"value": "Widget",
"uri": "dmx.webclient.widget",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Clearable",
"uri": "dmx.webclient.clearable",
"dataTypeUri": "dmx.core.boolean"
},
{
"value": "Customizable",
"uri": "dmx.webclient.customizable",
"dataTypeUri": "dmx.core.boolean"
}
{
"value": "Icon",
"uri": "dmx.webclient.icon",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Color",
"uri": "dmx.webclient.color",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Add to Create Menu",
"uri": "dmx.webclient.add_to_create_menu",
"dataTypeUri": "dmx.core.boolean"
},
{
"value": "Widget",
"uri": "dmx.webclient.widget",
"dataTypeUri": "dmx.core.text"
},
{
"value": "Clearable",
"uri": "dmx.webclient.clearable",
"dataTypeUri": "dmx.core.boolean"
},
{
"value": "Customizable",
"uri": "dmx.webclient.customizable",
"dataTypeUri": "dmx.core.boolean"
}
],
"assoc_types": [
{
"value": "Background Color",
"uri": "dmx.webclient.background_color",
"dataTypeUri": "dmx.core.text"
}
{
"value": "Background Color",
"uri": "dmx.webclient.background_color",
"dataTypeUri": "dmx.core.text"
}
],
// Note: the Widget instances must be created *before* the "View Configuration" composite.
// The Widget assoc def refers to a Widget instance.
"topics": [
// Widgets
{
"value": "Select",
"uri": "dmx.webclient.select",
"typeUri": "dmx.webclient.widget"
}
// Widgets
{
"value": "Select",
"uri": "dmx.webclient.select",
"typeUri": "dmx.webclient.widget"
}
]
},
{
},
{
"topic_types": [
{
"value": "View Configuration",
"uri": "dmx.webclient.view_config",
"dataTypeUri": "dmx.core.identity",
"assocDefs": [
{
"childTypeUri": "dmx.webclient.icon",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.webclient.color",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.webclient.color",
"childCardinalityUri": "dmx.core.one",
"customAssocTypeUri": "dmx.webclient.background_color"
},
{
"childTypeUri": "dmx.webclient.add_to_create_menu",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.webclient.widget",
"childCardinalityUri": "dmx.core.one",
"viewConfigTopics": [
{
"typeUri": "dmx.webclient.view_config",
"childs": {
"dmx.webclient.widget": "ref_uri:dmx.webclient.select",
"dmx.webclient.clearable": true
}
}
]
},
{
"childTypeUri": "dmx.webclient.clearable",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.webclient.customizable",
"childCardinalityUri": "dmx.core.one"
{
"value": "View Configuration",
"uri": "dmx.webclient.view_config",
"dataTypeUri": "dmx.core.identity",
"assocDefs": [
{
"childTypeUri": "dmx.webclient.icon",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.webclient.color",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.webclient.color",
"childCardinalityUri": "dmx.core.one",
"customAssocTypeUri": "dmx.webclient.background_color"
},
{
"childTypeUri": "dmx.webclient.add_to_create_menu",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.webclient.widget",
"childCardinalityUri": "dmx.core.one",
"viewConfigTopics": [
{
"typeUri": "dmx.webclient.view_config",
"childs": {
"dmx.webclient.widget": "ref_uri:dmx.webclient.select",
"dmx.webclient.clearable": true
}
}
]
}
},
{
"childTypeUri": "dmx.webclient.clearable",
"childCardinalityUri": "dmx.core.one"
},
{
"childTypeUri": "dmx.webclient.customizable",
"childCardinalityUri": "dmx.core.one"
}
]
}
]
}]
}
]
package systems.dmx.workspaces.migrations;
import systems.dmx.workspaces.WorkspacesService;
import systems.dmx.core.service.Inject;
import systems.dmx.core.service.Migration;
/**
* Adds "Sharing Mode" to "Workspace".
* Create "DMX" workspace.
* <p>
* Part of DMX 5.0
* Part of DMX 5.0-beta-3
* Runs ALWAYS
*/
public class Migration3 extends Migration {
// ---------------------------------------------------------------------------------------------- Instance Variables
@Inject
private WorkspacesService wsService;
// -------------------------------------------------------------------------------------------------- Public Methods
@Override
public void run() {
dmx.getTopicType("dmx.workspaces.workspace").addAssocDef(
mf.newAssociationDefinitionModel(
"dmx.workspaces.workspace", "dmx.workspaces.sharing_mode", "dmx.core.one",
mf.newViewConfigurationModel().setConfigValueRef(
"dmx.webclient.view_config", "dmx.webclient.widget", "dmx.webclient.select"
)
)
wsService.createWorkspace(
WorkspacesService.DMX_WORKSPACE_NAME,
WorkspacesService.DMX_WORKSPACE_URI,
WorkspacesService.DMX_WORKSPACE_SHARING_MODE
);
// Note 1: the workspace has no owner yet as the Access Control plugin is not yet activated (as it depends
// on the Workspaces plugin). We set the owner in the Access Control migration #2.
// Note 2: we can't postpone the creation of the "DMX" workspace to a Access Control migration as it
// must be already available at Workspaces plugin activation time (as needed for the type introduction).
}
}
package systems.dmx.workspaces.migrations;
import systems.dmx.workspaces.WorkspacesService;
import systems.dmx.core.service.Inject;
import systems.dmx.core.service.Migration;
/**
* Creates the "DMX" workspace.
* <p>
* Part of DMX 5.0
* Runs ALWAYS
*/
public class Migration4 extends Migration {
// ---------------------------------------------------------------------------------------------- Instance Variables
@Inject
private WorkspacesService wsService;
// -------------------------------------------------------------------------------------------------- Public Methods
@Override
public void run() {
wsService.createWorkspace(
WorkspacesService.DMX_WORKSPACE_NAME,
WorkspacesService.DMX_WORKSPACE_URI,
WorkspacesService.DMX_WORKSPACE_SHARING_MODE
);
// Note 1: the workspace has no owner yet as the Access Control plugin is not yet activated (as it depends
// on the Workspaces plugin). We set the owner in the Access Control migration #5.
// Note 2: we can't postpone the creation of the "DMX" workspace to a Access Control migration as it
// must be already available at Workspaces plugin activation time (as needed for the type introduction).
}
}
# Part of DMX 5.0
# Runs ALWAYS
// Part of DMX 5.0-beta-3
// Runs ALWAYS