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

com.citytechinc.cq.component.content.Content Maven / Gradle / Ivy

There is a newer version: 7.0.0
Show newest version
package com.citytechinc.cq.component.content;

import java.util.List;

import com.citytechinc.cq.component.util.Constants;
import com.citytechinc.cq.component.xml.AbstractXmlElement;
import com.citytechinc.cq.component.xml.NameSpacedAttribute;

/**
 * Based on http://dev.day.com/docs/en/cq/current/developing/components.html
 */
public class Content extends AbstractXmlElement {

	private final List allowedChildren;
	private final List allowedParents;
	private final String componentGroup;
	private final NameSpacedAttribute cellName;
	private final NameSpacedAttribute isContainer;
	private final NameSpacedAttribute noDecoration;
	private final NameSpacedAttribute templatePath;
	private final String dialogPath;
	private final NameSpacedAttribute created;
	private final NameSpacedAttribute description;
	private final NameSpacedAttribute title;
	private final NameSpacedAttribute resourceSuperType;
	private final String className;

	public Content(ContentParameters parameters) {
		super(parameters);

		allowedChildren = parameters.getAllowedChildren();
		allowedParents = parameters.getAllowedParents();
		componentGroup = parameters.getComponentGroup();
		cellName =
			new NameSpacedAttribute(Constants.CQ_NS_URI, Constants.CQ_NS_PREFIX, parameters.getCellName());
		isContainer =
			new NameSpacedAttribute(Constants.CQ_NS_URI, Constants.CQ_NS_PREFIX, parameters.getIsContainer());
		noDecoration =
			new NameSpacedAttribute(Constants.CQ_NS_URI, Constants.CQ_NS_PREFIX, parameters.getNoDecoration());
		templatePath =
			new NameSpacedAttribute(Constants.CQ_NS_URI, Constants.CQ_NS_PREFIX, parameters.getTemplatePath());
		dialogPath = parameters.getDialogPath();
		created =
			new NameSpacedAttribute(Constants.JCR_NS_URI, Constants.JCR_NS_PREFIX, parameters.getCreated());
		description =
			new NameSpacedAttribute(Constants.JCR_NS_URI, Constants.JCR_NS_PREFIX, parameters.getDescription());
		title = new NameSpacedAttribute(Constants.JCR_NS_URI, Constants.JCR_NS_PREFIX, parameters.getTitle());
		resourceSuperType =
			new NameSpacedAttribute(Constants.SLING_NS_URI, Constants.SLING_NS_PREFIX,
				parameters.getResourceSuperType());
		className = parameters.getClassName();
	}

	public List getAllowedChildren() {
		return allowedChildren;
	}

	public List getAllowedParents() {
		return allowedParents;
	}

	public String getClassName() {
		return className;
	}

	public String getComponentGroup() {
		return componentGroup;
	}

	public NameSpacedAttribute getCellName() {
		return cellName;
	}

	public NameSpacedAttribute getIsContainer() {
		return isContainer;
	}

	public NameSpacedAttribute getNoDecoration() {
		return noDecoration;
	}

	public NameSpacedAttribute getTemplatePath() {
		return templatePath;
	}

	public String getDialogPath() {
		return dialogPath;
	}

	public NameSpacedAttribute getCreated() {
		return created;
	}

	public NameSpacedAttribute getDescription() {
		return description;
	}

	public NameSpacedAttribute getTitle() {
		return title;
	}

	public NameSpacedAttribute getResourceSuperType() {
		return resourceSuperType;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy