com.enonic.xp.page.EditablePage Maven / Gradle / Ivy
package com.enonic.xp.page;
import com.enonic.xp.annotation.PublicApi;
import com.enonic.xp.data.PropertyTree;
import com.enonic.xp.region.Component;
@PublicApi
public final class EditablePage
{
public DescriptorKey controller;
public PageTemplateKey template;
public PageRegions regions;
public Component fragment;
public PropertyTree config;
public boolean customized;
public EditablePage( final Page source )
{
this.controller = source.getDescriptor();
this.template = source.getTemplate();
this.regions = source.hasRegions() ? source.getRegions().copy() : null;
this.config = source.hasConfig() ? source.getConfig().copy() : null;
this.customized = source.isCustomized();
this.fragment = source.getFragment();
}
public Page build()
{
final Page.Builder builder = Page.create();
builder.descriptor( controller );
builder.template( template );
builder.regions( regions );
builder.config( config );
builder.customized( customized );
builder.fragment( fragment );
return builder.build();
}
}