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));
}
Aggregations