diff --git a/src/main/java/de/mikromedia/webpages/migrations/Migration11.java b/src/main/java/de/mikromedia/webpages/migrations/Migration10.java similarity index 54% rename from src/main/java/de/mikromedia/webpages/migrations/Migration11.java rename to src/main/java/de/mikromedia/webpages/migrations/Migration10.java index 8c8f3a9..d6d590f 100644 --- a/src/main/java/de/mikromedia/webpages/migrations/Migration11.java +++ b/src/main/java/de/mikromedia/webpages/migrations/Migration10.java @@ -1,18 +1,20 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ package de.mikromedia.webpages.migrations; - -import de.mikromedia.webpages.WebpagePlugin; import systems.dmx.accesscontrol.AccessControlService; -import systems.dmx.core.CompDef; -import static systems.dmx.core.Constants.ONE; -import systems.dmx.core.Topic; -import systems.dmx.core.TopicType; -import systems.dmx.core.ViewConfig; import systems.dmx.core.service.Inject; import systems.dmx.core.service.Migration; import systems.dmx.workspaces.WorkspacesService; -public class Migration11 extends Migration { +/** + * + * @author MRG + */ +public class Migration10 extends Migration { @Inject WorkspacesService workspaces; @Inject AccessControlService accessControlService; @@ -21,23 +23,8 @@ public class Migration11 extends Migration { public void run () { // Defunct: Hook in two custom webclient renderers (?) - // Assign new default pages - Topic webpagesWs = workspaces.getWorkspace(WebpagePlugin.WEBPAGES_WS_URI); - Topic bookmarksPage = dmx.getTopicByUri("de.mikromedia.bookmarks.page"); - Topic contactsPage = dmx.getTopicByUri("de.mikromedia.contacts.page"); - Topic notesPage = dmx.getTopicByUri("de.mikromedia.notes.page"); - Topic promutCss = dmx.getTopicByUri("de.mikromedia.iass_promut_style"); - workspaces.assignToWorkspace(bookmarksPage, webpagesWs.getId()); - workspaces.assignToWorkspace(contactsPage, webpagesWs.getId()); - workspaces.assignToWorkspace(notesPage, webpagesWs.getId()); - workspaces.assignToWorkspace(promutCss, webpagesWs.getId()); - // Add "Page Template" value to "Webpage" - TopicType webpage = dmx.getTopicType("de.mikromedia.page"); - TopicType pageTemplate = dmx.getTopicType("de.mikromedia.page.template"); - webpage.addCompDef(mf.newCompDefModel(webpage.getUri(), pageTemplate.getUri(), ONE)); - workspaces.assignTypeToWorkspace(webpage, webpagesWs.getId()); // ### Todo: Migrate default "page" template into all existing "Webpage" topics - ViewConfig styleConfig = pageTemplate.getViewConfig(); + /** ViewConfig styleConfig = pageTemplate.getViewConfig(); styleConfig.setConfigValueRef("dmx.webclient.view_config", "dmx.webclient.widget", "dmx.webclient.select"); webpage.removeCompDef("de.mikromedia.page.author_name"); // Removing "Author Name" from "Webpage" topic @@ -47,7 +34,7 @@ public void run () { Topic mapWidget = dmx.getTopicByUri("de.mikromedia.layout.map_widget"); mapWidget.delete(); Topic embed = dmx.getTopicByUri("de.mikromedia.layout.embed"); - embed.delete(); + embed.delete(); **/ // Authors/Contributors // User Profile // Rename Topics diff --git a/src/main/java/de/mikromedia/webpages/migrations/Migration9.java b/src/main/java/de/mikromedia/webpages/migrations/Migration9.java new file mode 100644 index 0000000..9b2afd8 --- /dev/null +++ b/src/main/java/de/mikromedia/webpages/migrations/Migration9.java @@ -0,0 +1,39 @@ +package de.mikromedia.webpages.migrations; + + +import de.mikromedia.webpages.WebpagePlugin; +import systems.dmx.accesscontrol.AccessControlService; +import static systems.dmx.core.Constants.ONE; +import systems.dmx.core.Topic; +import systems.dmx.core.TopicType; +import systems.dmx.core.service.Inject; +import systems.dmx.core.service.Migration; +import systems.dmx.workspaces.WorkspacesService; + +public class Migration9 extends Migration { + + @Inject WorkspacesService workspaces; + @Inject AccessControlService accessControlService; + + @Override + public void run () { + + // Assign new default pages + Topic webpagesWs = dmx.getPrivilegedAccess().getWorkspace(WebpagePlugin.WEBPAGES_WS_URI); + Topic bookmarksPage = dmx.getTopicByUri("de.mikromedia.bookmarks.page"); + Topic contactsPage = dmx.getTopicByUri("de.mikromedia.contacts.page"); + Topic notesPage = dmx.getTopicByUri("de.mikromedia.notes.page"); + Topic promutCss = dmx.getTopicByUri("de.mikromedia.promut_style"); + workspaces.assignToWorkspace(bookmarksPage, webpagesWs.getId()); + workspaces.assignToWorkspace(contactsPage, webpagesWs.getId()); + workspaces.assignToWorkspace(notesPage, webpagesWs.getId()); + workspaces.assignToWorkspace(promutCss, webpagesWs.getId()); + // Add "Page Template" value to "Webpage" + TopicType webpage = dmx.getTopicType("de.mikromedia.page"); + TopicType pageTemplate = dmx.getTopicType("de.mikromedia.page.template"); + webpage.addCompDef(mf.newCompDefModel(webpage.getUri(), pageTemplate.getUri(), ONE)); + workspaces.assignTypeToWorkspace(webpage, webpagesWs.getId()); + + } + +} diff --git a/src/main/resources/migrations/migration10.json b/src/main/resources/migrations/migration8.json similarity index 92% rename from src/main/resources/migrations/migration10.json rename to src/main/resources/migrations/migration8.json index 7e2768d..09bd4e9 100644 --- a/src/main/resources/migrations/migration10.json +++ b/src/main/resources/migrations/migration8.json @@ -15,11 +15,6 @@ } ], "topics": [ - { - "typeUri": "de.mikromedia.site.stylesheet", - "uri" : "de.mikromedia.iass_promut_style", - "value": "/de.mikromedia.webpages/static/css/promut.css" - }, { "typeUri": "de.mikromedia.page.template", "uri" : "de.mikromedia.template_page", diff --git a/src/main/resources/plugin.properties b/src/main/resources/plugin.properties index 420f9e6..58cf105 100644 --- a/src/main/resources/plugin.properties +++ b/src/main/resources/plugin.properties @@ -1,2 +1,2 @@ dmx.plugin.dependencies=systems.dmx.workspaces,systems.dmx.accesscontrol,systems.dmx.files,systems.dmx.bookmarks -dmx.plugin.model_version=7 +dmx.plugin.model_version=9