本文整理了Java中org.apache.jackrabbit.spi.QNodeDefinition.isProtected
方法的一些代码示例,展示了QNodeDefinition.isProtected
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QNodeDefinition.isProtected
方法的具体详情如下:
包路径:org.apache.jackrabbit.spi.QNodeDefinition
类名称:QNodeDefinition
方法名:isProtected
暂无
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr2spi
builder.append("\n\t\tMandatory\t").append(aNd.isMandatory());
builder.append("\n\t\tOnVersion\t").append(OnParentVersionAction.nameFromValue(aNd.getOnParentVersion()));
builder.append("\n\t\tProtected\t").append(aNd.isProtected());
builder.append("\n\t\tAllowsSameNameSiblings\t").append(aNd.allowsSameNameSiblings());
代码示例来源:origin: apache/jackrabbit
builder.append("\t\tMandatory\t" + aNd.isMandatory() + "\n");
builder.append("\t\tOnVersion\t" + OnParentVersionAction.nameFromValue(aNd.getOnParentVersion()) + "\n");
builder.append("\t\tProtected\t" + aNd.isProtected() + "\n");
builder.append("\t\tAllowsSameNameSiblings\t" + aNd.allowsSameNameSiblings() + "\n");
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core
/**
* @param name
* @throws ConstraintViolationException
*/
public void checkRemoveNodeConstraints(Name name) throws ConstraintViolationException {
/**
* as there might be multiple definitions with the same name and we
* don't know which one is applicable, we check all of them
*/
QNodeDefinition[] defs = getNamedNodeDefs(name);
if (defs != null) {
for (QNodeDefinition def : defs) {
if (def.isMandatory()) {
throw new ConstraintViolationException("can't remove mandatory node");
}
if (def.isProtected()) {
throw new ConstraintViolationException("can't remove protected node");
}
}
}
}
代码示例来源:origin: apache/jackrabbit
/**
* @param name
* @throws ConstraintViolationException
*/
public void checkRemoveNodeConstraints(Name name) throws ConstraintViolationException {
/**
* as there might be multiple definitions with the same name and we
* don't know which one is applicable, we check all of them
*/
QNodeDefinition[] defs = getNamedNodeDefs(name);
if (defs != null) {
for (QNodeDefinition def : defs) {
if (def.isMandatory()) {
throw new ConstraintViolationException("can't remove mandatory node");
}
if (def.isProtected()) {
throw new ConstraintViolationException("can't remove protected node");
}
}
}
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-spi-commons
/**
* Copy constructor.
*
* @param nodeDef some other node definition.
*/
public QNodeDefinitionImpl(QNodeDefinition nodeDef) {
this(nodeDef.getName(), nodeDef.getDeclaringNodeType(),
nodeDef.isAutoCreated(), nodeDef.isMandatory(),
nodeDef.getOnParentVersion(), nodeDef.isProtected(),
nodeDef.getDefaultPrimaryType(),
nodeDef.getRequiredPrimaryTypes(),
nodeDef.allowsSameNameSiblings());
}
代码示例来源:origin: apache/jackrabbit
/**
* Copy constructor.
*
* @param nodeDef some other node definition.
*/
public QNodeDefinitionImpl(QNodeDefinition nodeDef) {
this(nodeDef.getName(), nodeDef.getDeclaringNodeType(),
nodeDef.isAutoCreated(), nodeDef.isMandatory(),
nodeDef.getOnParentVersion(), nodeDef.isProtected(),
nodeDef.getDefaultPrimaryType(),
nodeDef.getRequiredPrimaryTypes(),
nodeDef.allowsSameNameSiblings());
}
代码示例来源:origin: org.apache.jackrabbit/com.springsource.org.apache.jackrabbit.spi.commons
/**
* Copy constructor.
*
* @param nodeDef some other node definition.
*/
public QNodeDefinitionImpl(QNodeDefinition nodeDef) {
this(nodeDef.getName(), nodeDef.getDeclaringNodeType(),
nodeDef.isAutoCreated(), nodeDef.isMandatory(),
nodeDef.getOnParentVersion(), nodeDef.isProtected(),
nodeDef.getDefaultPrimaryType(),
nodeDef.getRequiredPrimaryTypes(),
nodeDef.allowsSameNameSiblings());
}
代码示例来源:origin: apache/jackrabbit-oak
private NodeDefinitionTemplate createNodeDefinitionTemplate(NodeTypeManager ntMgr, QNodeDefinition def) throws RepositoryException {
NodeDefinitionTemplate tmpl = ntMgr.createNodeDefinitionTemplate();
Name name = def.getName();
if (name != null) {
tmpl.setName(getOakName(name));
}
tmpl.setAutoCreated(def.isAutoCreated());
tmpl.setMandatory(def.isMandatory());
tmpl.setOnParentVersion(def.getOnParentVersion());
tmpl.setProtected(def.isProtected());
tmpl.setSameNameSiblings(def.allowsSameNameSiblings());
List<String> names = newArrayListWithCapacity(def.getRequiredPrimaryTypes().length);
for (Name type : def.getRequiredPrimaryTypes()) {
names.add(getOakName(type));
}
tmpl.setRequiredPrimaryTypeNames(names.toArray(new String[names.size()]));
Name type = def.getDefaultPrimaryType();
if (type != null) {
tmpl.setDefaultPrimaryTypeName(getOakName(type));
}
return tmpl;
}
代码示例来源:origin: org.apache.jackrabbit/oak-upgrade
private NodeDefinitionTemplate createNodeDefinitionTemplate(NodeTypeManager ntMgr, QNodeDefinition def) throws RepositoryException {
NodeDefinitionTemplate tmpl = ntMgr.createNodeDefinitionTemplate();
Name name = def.getName();
if (name != null) {
tmpl.setName(getOakName(name));
}
tmpl.setAutoCreated(def.isAutoCreated());
tmpl.setMandatory(def.isMandatory());
tmpl.setOnParentVersion(def.getOnParentVersion());
tmpl.setProtected(def.isProtected());
tmpl.setSameNameSiblings(def.allowsSameNameSiblings());
List<String> names = newArrayListWithCapacity(def.getRequiredPrimaryTypes().length);
for (Name type : def.getRequiredPrimaryTypes()) {
names.add(getOakName(type));
}
tmpl.setRequiredPrimaryTypeNames(names.toArray(new String[names.size()]));
Name type = def.getDefaultPrimaryType();
if (type != null) {
tmpl.setDefaultPrimaryTypeName(getOakName(type));
}
return tmpl;
}
代码示例来源:origin: apache/jackrabbit
/**
* @see EffectiveNodeType#checkAddNodeConstraints(org.apache.jackrabbit.spi.Name,QNodeTypeDefinition, ItemDefinitionProvider)
*/
public void checkAddNodeConstraints(Name name, QNodeTypeDefinition nodeTypeDefinition, ItemDefinitionProvider definitionProvider)
throws ConstraintViolationException, NoSuchNodeTypeException {
if (nodeTypeDefinition.isAbstract()) {
throw new ConstraintViolationException("not allowed to add node " + name + ": " + nodeTypeDefinition.getName() + " is abstract and cannot be used as primary node type.");
}
if (nodeTypeDefinition.isMixin()) {
throw new ConstraintViolationException("not allowed to add node " + name + ":" + nodeTypeDefinition.getName() + " is a mixin and cannot be used as primary node type.");
}
QNodeDefinition nd = definitionProvider.getQNodeDefinition(this, name, nodeTypeDefinition.getName());
if (nd.isProtected()) {
throw new ConstraintViolationException(name + " is protected.");
}
if (nd.isAutoCreated()) {
throw new ConstraintViolationException(name + " is auto-created and can not be manually added");
}
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr2spi
/**
* @see EffectiveNodeType#checkAddNodeConstraints(org.apache.jackrabbit.spi.Name,QNodeTypeDefinition, ItemDefinitionProvider)
*/
public void checkAddNodeConstraints(Name name, QNodeTypeDefinition nodeTypeDefinition, ItemDefinitionProvider definitionProvider)
throws ConstraintViolationException, NoSuchNodeTypeException {
if (nodeTypeDefinition.isAbstract()) {
throw new ConstraintViolationException("not allowed to add node " + name + ": " + nodeTypeDefinition.getName() + " is abstract and cannot be used as primary node type.");
}
if (nodeTypeDefinition.isMixin()) {
throw new ConstraintViolationException("not allowed to add node " + name + ":" + nodeTypeDefinition.getName() + " is a mixin and cannot be used as primary node type.");
}
QNodeDefinition nd = definitionProvider.getQNodeDefinition(this, name, nodeTypeDefinition.getName());
if (nd.isProtected()) {
throw new ConstraintViolationException(name + " is protected.");
}
if (nd.isAutoCreated()) {
throw new ConstraintViolationException(name + " is auto-created and can not be manually added");
}
}
代码示例来源:origin: apache/jackrabbit
Name[] ntNames = existing.getAllNodeTypeNames();
EffectiveNodeType entExisting = provider.getEffectiveNodeType(ntNames);
if (def.isProtected() && entExisting.includesNodeType(nodeInfo.getNodeTypeName())) {
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core
pState.setPropertyValue(NameConstants.JCR_ONPARENTVERSION,
InternalValue.create(OnParentVersionAction.nameFromValue(cnDef.getOnParentVersion())));
pState.setPropertyValue(NameConstants.JCR_PROTECTED, InternalValue.create(cnDef.isProtected()));
pState.setPropertyValues(NameConstants.JCR_REQUIREDPRIMARYTYPES,
PropertyType.NAME, InternalValue.create(cnDef.getRequiredPrimaryTypes()));
代码示例来源:origin: apache/jackrabbit
pState.setPropertyValue(NameConstants.JCR_ONPARENTVERSION,
InternalValue.create(OnParentVersionAction.nameFromValue(cnDef.getOnParentVersion())));
pState.setPropertyValue(NameConstants.JCR_PROTECTED, InternalValue.create(cnDef.isProtected()));
pState.setPropertyValues(NameConstants.JCR_REQUIREDPRIMARYTYPES,
PropertyType.NAME, InternalValue.create(cnDef.getRequiredPrimaryTypes()));
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-spi-commons
/**
* Create a new JCR node definition from the given <code>QNodeDefinition</code>.
*
* @param qNd A node definition.
* @return The corresponding JCR node definition.
* @throws RepositoryException if an error occurs.
*/
public NodeDefinition create(QNodeDefinition qNd)
throws RepositoryException {
NodeDefinitionTemplate nt = ntMgr.createNodeDefinitionTemplate();
nt.setName(getJCRName(qNd.getName()));
nt.setAutoCreated(qNd.isAutoCreated());
nt.setMandatory(qNd.isMandatory());
nt.setOnParentVersion(qNd.getOnParentVersion());
nt.setProtected(qNd.isProtected());
nt.setSameNameSiblings(qNd.allowsSameNameSiblings());
nt.setDefaultPrimaryTypeName(getJCRName(qNd.getDefaultPrimaryType()));
nt.setRequiredPrimaryTypeNames(getJCRNames(qNd.getRequiredPrimaryTypes()));
return nt;
}
代码示例来源:origin: apache/jackrabbit
/**
* Create a new JCR node definition from the given <code>QNodeDefinition</code>.
*
* @param qNd A node definition.
* @return The corresponding JCR node definition.
* @throws RepositoryException if an error occurs.
*/
public NodeDefinition create(QNodeDefinition qNd)
throws RepositoryException {
NodeDefinitionTemplate nt = ntMgr.createNodeDefinitionTemplate();
nt.setName(getJCRName(qNd.getName()));
nt.setAutoCreated(qNd.isAutoCreated());
nt.setMandatory(qNd.isMandatory());
nt.setOnParentVersion(qNd.getOnParentVersion());
nt.setProtected(qNd.isProtected());
nt.setSameNameSiblings(qNd.allowsSameNameSiblings());
nt.setDefaultPrimaryTypeName(getJCRName(qNd.getDefaultPrimaryType()));
nt.setRequiredPrimaryTypeNames(getJCRNames(qNd.getRequiredPrimaryTypes()));
return nt;
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core
Constants.MANDATORY_ATTRIBUTE, def.isMandatory());
builder.setAttribute(
Constants.PROTECTED_ATTRIBUTE, def.isProtected());
builder.setAttribute(
Constants.ONPARENTVERSION_ATTRIBUTE,
代码示例来源:origin: apache/jackrabbit
Constants.MANDATORY_ATTRIBUTE, def.isMandatory());
builder.setAttribute(
Constants.PROTECTED_ATTRIBUTE, def.isProtected());
builder.setAttribute(
Constants.ONPARENTVERSION_ATTRIBUTE,
代码示例来源:origin: apache/jackrabbit
if (getDefinition().isProtected()) {
String msg = "not allowed to modify a protected node";
throw new ConstraintViolationException(msg);
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core
if (getDefinition().isProtected()) {
String msg = "not allowed to modify a protected node";
throw new ConstraintViolationException(msg);
内容来源于网络,如有侵权,请联系作者删除!