Search in sources :

Example 1 with CreatePageParams

use of com.enonic.xp.page.CreatePageParams in project xp by enonic.

the class CreatePageTemplateCommand method execute.

public PageTemplate execute() {
    final PropertyTree data = new PropertyTree();
    new PageTemplateFormDataBuilder().supports(supports).appendData(data.getRoot());
    final Content content = contentService.create(CreateContentParams.create().name(name).displayName(displayName).owner(PrincipalKey.ofAnonymous()).contentData(data).type(ContentTypeName.pageTemplate()).inheritPermissions(true).parent(ContentPath.from(site, ContentServiceImpl.TEMPLATES_FOLDER_NAME)).build());
    return (PageTemplate) pageService.create(new CreatePageParams().content(content.getId()).controller(controller).config(pageConfig).regions(pageRegions));
}
Also used : CreatePageParams(com.enonic.xp.page.CreatePageParams) PageTemplate(com.enonic.xp.page.PageTemplate) Content(com.enonic.xp.content.Content) PropertyTree(com.enonic.xp.data.PropertyTree)

Aggregations

Content (com.enonic.xp.content.Content)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 CreatePageParams (com.enonic.xp.page.CreatePageParams)1 PageTemplate (com.enonic.xp.page.PageTemplate)1