com.citytechinc.cq.component.content.Content Maven / Gradle / Ivy
/**
* Copyright 2013 CITYTECH, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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;
}
}