All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enonic.xp.page.EditablePage Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy