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

net.anotheria.anosite.content.bean.PageBean Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
package net.anotheria.anosite.content.bean;

import net.anotheria.anosite.util.AnositeConstants;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

/**
 * Represents a CMS page for rendering.
 *
 * @author lrosenberg
 */
public class PageBean {
	/**
	 * Request attribute name for NAME property.
	 */
	public static final String PAGE_NAME_REQUEST_ATTR = AnositeConstants.BEAN_PREFIX + "page.pageName";
	/**
	 * Request attribute name for DESCRIPTION property.
	 */
	public static final String PAGE_DESCRIPTION_REQUEST_ATTR = AnositeConstants.BEAN_PREFIX + "page.pageDescription";
	/**
	 * Request attribute name for TITLE property.
	 */
	public static final String PAGE_TITLE_REQUEST_ATTR = AnositeConstants.BEAN_PREFIX + "page.pageTitle";
	/**
	 * Title of the page.
	 */
	private String title;
	/**
	 * Keywords of the page if differ from site-wide keywords.
	 */
	private String keywords;
	/**
	 * Description of the page if differ from site-wide description.
	 */
	private String description;
	/**
	 * Name of the page.
	 */
	private String name;
    /**
     * Localized name of the page.
     */
    private String localizedName;
	/**
	 * List of boxes in first column.
	 */
	private List column1;
	/**
	 * List of boxes in second column.
	 */
	private List column2;
	/**
	 * List of boxes in third column.
	 */
	private List column3;
	/**
	 * List of boxes in the meta part (html head part).
	 */
	private List metaBoxes;
	/**
	 * List of Media Links in the meta part (html head part).
	 */
	private Set mediaLinks;
	/**
	 * List with scripts.
	 */
	private Set scripts;
	/**
	 * List of header boxes (before the start or the main content columns).
	 */
	private List headerBoxes;
	/**
	 * List of footer boxes (after the main content columns).
	 */
	private List footerBoxes;
	/**
	 * Generated timestamp (last updated timestamp formated for meta generated)
	 */
	private String generated;
	/**
	 * Attributes assigned to the page.
	 */
	private AttributeMap attributes;


	public PageBean() {
		column1 = new ArrayList();
		column2 = new ArrayList();
		column3 = new ArrayList();

		metaBoxes = new ArrayList();
		headerBoxes = new ArrayList();
		footerBoxes = new ArrayList();
		mediaLinks = new LinkedHashSet();
		scripts = new LinkedHashSet();
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

    public String getLocalizedName() {
        return localizedName;
    }

    public void setLocalizedName(String localizedName) {
        this.localizedName = localizedName;
    }

    public void addBoxToColumn1(BoxBean aBox) {
		column1.add(aBox);
	}

	public void addBoxToColumn2(BoxBean aBox) {
		column2.add(aBox);
	}

	public void addBoxToColumn3(BoxBean aBox) {
		column3.add(aBox);
	}

	@Override
	public String toString() {
		return getName() + " c1: " + column1.size() + ", c2: " + column2.size() + ", c3: " + column3.size() + " boxes.";
	}

	public List getColumn1() {
		return column1;
	}

	public void addColumn1(List boxes) {
		column1.addAll(boxes);
	}

	public void addColumn2(List boxes) {
		column2.addAll(boxes);
	}

	public void addColumn3(List boxes) {
		column3.addAll(boxes);
	}

	public void addMetaBoxes(List boxes) {
		metaBoxes.addAll(boxes);
	}

	public void addHeaderBoxes(List boxes) {
		headerBoxes.addAll(boxes);
	}

	public void addFooterBoxes(List boxes) {
		footerBoxes.addAll(boxes);
	}

	public void setColumn1(List column1) {
		this.column1 = column1;
	}

	public List getColumn2() {
		return column2;
	}

	public void setColumn2(List column2) {
		this.column2 = column2;
	}

	public List getColumn3() {
		return column3;
	}

	public void setColumn3(List column3) {
		this.column3 = column3;
	}

	public List getMetaBoxes() {
		return metaBoxes;
	}

	public void setMetaBoxes(List headerBoxes) {
		this.metaBoxes = headerBoxes;
	}

	public List getFooterBoxes() {
		return footerBoxes;
	}

	public void setFooterBoxes(List footerBoxes) {
		this.footerBoxes = footerBoxes;
	}

	public List getHeaderBoxes() {
		return headerBoxes;
	}

	public void setHeaderBoxes(List headerBoxes) {
		this.headerBoxes = headerBoxes;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List getMediaLinks() {
		return new ArrayList(mediaLinks);
	}

	public void addMediaLinks(List mediaLinks) {
		this.mediaLinks.addAll(mediaLinks);
	}

	public List getScripts() {
		return new ArrayList(scripts);
	}

	public void addScripts(List mediaLinks) {
		this.scripts.addAll(mediaLinks);
	}

	public String getGenerated() {
		return generated;
	}

	public void setGenerated(String generated) {
		this.generated = generated;
	}

	public AttributeMap getAttributes() {
		return attributes;
	}

	public void setAttributes(AttributeMap attributes) {
		this.attributes = attributes;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy