Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Code Block
titlesample.properties
main@type = mgnl:content
main@uuid = 1

main/uuidLink@type = mgnl:contentNode
main/uuidLink@uuid = 2
main/uuidLink.MetaData.mgnl\:template = someParagraphName
main/uuidLink.MetaData.mgnl\:authorid = superuser
main/uuidLink.MetaData.mgnl\:activatorid = superuser
main/uuidLink.MetaData.mgnl\:title = myTitle
main/uuidLink.link1 = 3

main/linkTarget@type = mgnl:content
main/linkTarget@uuid = 3
main/linkTarget.prop1 = sub2value1
main/linkTarget.prop2 = sub2value2
main/linkTarget.prop3 = boolean:false

main/content@type = mgnl:contentNode
main/content@uuid = 4
main/content.value = Content Value
Code Block
titleCreateMockContentFromPropertiesFile.javacreate MockHM from properties file
HierarchyManager hmSession session = SessionTestUtilMockUtil.createSessioncreateHierarchyManager(RepositoryConstants.USERS, getClass().getResourceAsStream("sample.properties"));

or you can create a variable with the data or pass it to the method call directly:

Code Block
titleCreateMockContentFromString.javacreate MockHM from properties String
final String content = StringUtils.join(Arrays.asList(
    "main/content@type=mgnl:contentNode",
    "main/content@uuid=4",
    "main/content.value=Content Value"
    ), "\n");

SessionHierarchyManager sessionhm = SessionTestUtilMockUtil.createSessioncreateHierarchyManager(RepositoryConstants.USERS, content);

You may also directly instantiate a MockContent and then add the child Contents and or NodeData's as required

Code Block
titleCreateMockContentUsingAPI.javacreate MockContent using API
MockContent page = new MockContent("page");
page.createContent("subpage", ItemType.CONTENT);
page.setNodeData("stringProperty", "HelloWorld");