/** * @param name node type name * @return node type * @throws NoSuchNodeTypeException if the nodetype does not exit */ @Override public NodeTypeImpl getNodeType(Name name) throws NoSuchNodeTypeException { synchronized (ntCache) { NodeTypeImpl nt = ntCache.get(name); if (nt == null) { NodeTypeRegistry registry = context.getNodeTypeRegistry(); EffectiveNodeType ent = registry.getEffectiveNodeType(name); QNodeTypeDefinition def = registry.getNodeTypeDef(name); nt = new NodeTypeImpl( ent, def, this, context, context.getValueFactory(), context.getDataStore()); ntCache.put(name, nt); } return nt; } }
for (NodeType eventType : eventTypes) { NodeTypeImpl nodeType = (NodeTypeImpl) eventType; match |= nodeType.getQName().equals(nodeTypes[i].getQName()) || nodeType.isDerivedFrom(nodeTypes[i].getQName());
if (!mixin.isMixin()) { throw new RepositoryException( context.getJCRName(mixinName) + " is not a mixin node type"); if (primaryType.isDerivedFrom(mixinName)) { for (PropertyDefinition aPda : mixin.getAutoCreatedPropertyDefinitions()) { PropertyDefinitionImpl pd = (PropertyDefinitionImpl) aPda; if (!entExisting.includesNodeType(declaringNT.getQName())) { node.createChildProperty( pd.unwrap().getName(), pd.getRequiredType(), pd); for (NodeDefinition aNda : mixin.getAutoCreatedNodeDefinitions()) { NodeDefinitionImpl nd = (NodeDefinitionImpl) aNda; if (!entExisting.includesNodeType(declaringNT.getQName())) { node.createChildNode( nd.unwrap().getName(),
private boolean matches(NodeImpl result) throws RepositoryException { Name ntName = ((NodeTypeImpl) result.getPrimaryNodeType()).getQName(); switch (authorizableType) { case UserManager.SEARCH_TYPE_GROUP: return UserConstants.NT_REP_GROUP.equals(ntName); case UserManager.SEARCH_TYPE_USER: return UserConstants.NT_REP_USER.equals(ntName); default: return UserConstants.NT_REP_USER.equals(ntName) || UserConstants.NT_REP_GROUP.equals(ntName); } } }
id, nodeType.getQName(), getNodeId(), ItemState.STATUS_NEW); for (PropertyDefinition aPda : nodeType.getAutoCreatedPropertyDefinitions()) { PropertyDefinitionImpl pd = (PropertyDefinitionImpl) aPda; node.createChildProperty(pd.unwrap().getName(), pd.getRequiredType(), pd); for (NodeDefinition aNda : nodeType.getAutoCreatedNodeDefinitions()) { NodeDefinitionImpl nd = (NodeDefinitionImpl) aNda; node.createChildNode(nd.unwrap().getName(), (NodeTypeImpl) nd.getDefaultPrimaryType(), null);
NodeTypeManagerImpl ntMgr = sessionContext.getNodeTypeManager(); NodeTypeImpl mixin = ntMgr.getNodeType(ntName); if (!mixin.isMixin()) { return false; if (primaryType.isDerivedFrom(ntName)) {
if (nodeTypeName != null) { nt = sessionContext.getNodeTypeManager().getNodeType(nodeTypeName); if (nt.isMixin()) { throw new ConstraintViolationException( "Unable to add a node with a mixin node type: " + sessionContext.getJCRName(nodeTypeName)); } else if (nt.isAbstract()) { throw new ConstraintViolationException( "Unable to add a node with an abstract node type: "
org.apache.jackrabbit.spi.commons.nodetype.NodeDefinitionImpl newTargetDef; try { newTargetDef = parent.getApplicableChildNodeDefinition(qName, nt.getQName()); } catch (RepositoryException re) { String msg = safeGetJCRPath() + ": no definition found in parent node's node type for renamed node"; if (!nt.getName().equals(newTargetDef.getName()) && !(acMgr.isGranted(getPrimaryPath(), Permission.NODE_TYPE_MNGMT))) { String msg = "Not allowed to rename node " + safeGetJCRPath() + " to " + newName; log.debug(msg);
if (values == null) { return canRemoveItem(propertyName);
private boolean isReferenceable(NodeTypeImpl mixin) { return MIX_REFERENCEABLE.equals(mixinName) || mixin.isDerivedFrom(MIX_REFERENCEABLE); }
PropertyDefinition[] propDefs = nt.getPropertyDefinitions(); for (PropertyDefinition pd : propDefs) { QPropertyDefinition propDef = ((PropertyDefinitionImpl) pd).unwrap();
for (String name : mixinNames) { Name qName = sessionContext.getQName(name); if (! ntMgr.getNodeType(qName).isMixin()) { throw new RepositoryException( sessionContext.getJCRName(qName) + " is not a mixin node type");
if (!mixin.isMixin()) { throw new RepositoryException( context.getJCRName(mixinName) + " is not a mixin node type"); if (primaryType.isDerivedFrom(mixinName)) { for (PropertyDefinition aPda : mixin.getAutoCreatedPropertyDefinitions()) { PropertyDefinitionImpl pd = (PropertyDefinitionImpl) aPda; if (!entExisting.includesNodeType(declaringNT.getQName())) { node.createChildProperty( pd.unwrap().getName(), pd.getRequiredType(), pd); for (NodeDefinition aNda : mixin.getAutoCreatedNodeDefinitions()) { NodeDefinitionImpl nd = (NodeDefinitionImpl) aNda; if (!entExisting.includesNodeType(declaringNT.getQName())) { node.createChildNode( nd.unwrap().getName(),
private boolean matches(NodeImpl result) throws RepositoryException { Name ntName = ((NodeTypeImpl) result.getPrimaryNodeType()).getQName(); switch (authorizableType) { case UserManager.SEARCH_TYPE_GROUP: return UserConstants.NT_REP_GROUP.equals(ntName); case UserManager.SEARCH_TYPE_USER: return UserConstants.NT_REP_USER.equals(ntName); default: return UserConstants.NT_REP_USER.equals(ntName) || UserConstants.NT_REP_GROUP.equals(ntName); } } }
id, nodeType.getQName(), getNodeId(), ItemState.STATUS_NEW); for (PropertyDefinition aPda : nodeType.getAutoCreatedPropertyDefinitions()) { PropertyDefinitionImpl pd = (PropertyDefinitionImpl) aPda; node.createChildProperty(pd.unwrap().getName(), pd.getRequiredType(), pd); for (NodeDefinition aNda : nodeType.getAutoCreatedNodeDefinitions()) { NodeDefinitionImpl nd = (NodeDefinitionImpl) aNda; node.createChildNode(nd.unwrap().getName(), (NodeTypeImpl) nd.getDefaultPrimaryType(), null);
NodeTypeManagerImpl ntMgr = sessionContext.getNodeTypeManager(); NodeTypeImpl mixin = ntMgr.getNodeType(ntName); if (!mixin.isMixin()) { return false; if (primaryType.isDerivedFrom(ntName)) {
if (nodeTypeName != null) { nt = sessionContext.getNodeTypeManager().getNodeType(nodeTypeName); if (nt.isMixin()) { throw new ConstraintViolationException( "Unable to add a node with a mixin node type: " + sessionContext.getJCRName(nodeTypeName)); } else if (nt.isAbstract()) { throw new ConstraintViolationException( "Unable to add a node with an abstract node type: "
org.apache.jackrabbit.spi.commons.nodetype.NodeDefinitionImpl newTargetDef; try { newTargetDef = parent.getApplicableChildNodeDefinition(qName, nt.getQName()); } catch (RepositoryException re) { String msg = safeGetJCRPath() + ": no definition found in parent node's node type for renamed node"; if (!nt.getName().equals(newTargetDef.getName()) && !(acMgr.isGranted(getPrimaryPath(), Permission.NODE_TYPE_MNGMT))) { String msg = "Not allowed to rename node " + safeGetJCRPath() + " to " + newName; log.debug(msg);
if (values == null) { return canRemoveItem(propertyName);
private boolean isReferenceable(NodeTypeImpl mixin) { return MIX_REFERENCEABLE.equals(mixinName) || mixin.isDerivedFrom(MIX_REFERENCEABLE); }