Search in sources :

Example 11 with PartComponent

use of com.enonic.xp.region.PartComponent in project xp by enonic.

the class ComponentInstructionTest method createFragmentPage.

private Content createFragmentPage(final String id, final String name) {
    PropertyTree rootDataSet = new PropertyTree();
    rootDataSet.addString("property1", "value1");
    PartComponent fragmentComponent = PartComponent.create().descriptor(DescriptorKey.from("myapplication:myparttemplate")).build();
    Page page = Page.create().template(PageTemplateKey.from("my-page")).fragment(fragmentComponent).build();
    return Content.create().id(ContentId.from(id)).path(ContentPath.from(name)).owner(PrincipalKey.from("user:myStore:me")).displayName("My Content").modifier(PrincipalKey.from("user:system:admin")).type(ContentTypeName.fragment()).page(page).build();
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) Page(com.enonic.xp.page.Page) PartComponent(com.enonic.xp.region.PartComponent)

Aggregations

PartComponent (com.enonic.xp.region.PartComponent)11 PropertyTree (com.enonic.xp.data.PropertyTree)5 LayoutComponent (com.enonic.xp.region.LayoutComponent)5 PartDescriptor (com.enonic.xp.region.PartDescriptor)4 Test (org.junit.jupiter.api.Test)4 Form (com.enonic.xp.form.Form)3 Page (com.enonic.xp.page.Page)3 LayoutDescriptor (com.enonic.xp.region.LayoutDescriptor)3 EditableContent (com.enonic.xp.content.EditableContent)2 AbstractDescriptorServiceTest (com.enonic.xp.core.impl.content.page.AbstractDescriptorServiceTest)2 PageDescriptor (com.enonic.xp.page.PageDescriptor)2 Component (com.enonic.xp.region.Component)2 Region (com.enonic.xp.region.Region)2 PropertySet (com.enonic.xp.data.PropertySet)1 DescriptorKey (com.enonic.xp.page.DescriptorKey)1 PageRegions (com.enonic.xp.page.PageRegions)1 RegionDescriptors (com.enonic.xp.region.RegionDescriptors)1