-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce webpage templates & three collection pages (#22)
- Loading branch information
Showing
4 changed files
with
52 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/de/mikromedia/webpages/migrations/Migration9.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |