/** * Returns all the node types of the given node, in a breadth-first * traversal order of the type hierarchy. * * @param node node instance * @return all types of the given node * @throws RepositoryException if the type information can not be accessed */ @Override public EffectiveNodeType getEffectiveNodeType(Node node) throws RepositoryException { NodeTypeImpl primary = (NodeTypeImpl) node.getPrimaryNodeType(); // FIXME NodeType[] mixins = node.getMixinNodeTypes(); NodeTypeImpl[] mixinImpls = new NodeTypeImpl[mixins.length]; for (int i = 0; i < mixins.length; i++) { mixinImpls[i] = (NodeTypeImpl) mixins[i]; // FIXME } return new EffectiveNodeTypeImpl(primary, mixinImpls, this); }
/** * Returns all the node types of the given node, in a breadth-first * traversal order of the type hierarchy. * * @param node node instance * @return all types of the given node * @throws RepositoryException if the type information can not be accessed */ @Override public EffectiveNodeType getEffectiveNodeType(Node node) throws RepositoryException { NodeTypeImpl primary = (NodeTypeImpl) node.getPrimaryNodeType(); // FIXME NodeType[] mixins = node.getMixinNodeTypes(); NodeTypeImpl[] mixinImpls = new NodeTypeImpl[mixins.length]; for (int i = 0; i < mixins.length; i++) { mixinImpls[i] = (NodeTypeImpl) mixins[i]; // FIXME } return new EffectiveNodeTypeImpl(primary, mixinImpls, this); }
/** * Returns all the node types of the given node, in a breadth-first * traversal order of the type hierarchy. * * @param node node instance * @return all types of the given node * @throws RepositoryException if the type information can not be accessed */ @Override public EffectiveNodeType getEffectiveNodeType(Node node) throws RepositoryException { NodeTypeImpl primary = (NodeTypeImpl) node.getPrimaryNodeType(); // FIXME NodeType[] mixins = node.getMixinNodeTypes(); NodeTypeImpl[] mixinImpls = new NodeTypeImpl[mixins.length]; for (int i = 0; i < mixins.length; i++) { mixinImpls[i] = (NodeTypeImpl) mixins[i]; // FIXME } return new EffectiveNodeTypeImpl(primary, mixinImpls, this); }
@Override public EffectiveNodeType getEffectiveNodeType(Tree tree) throws RepositoryException { NodeTypeImpl primaryType; PropertyState jcrPrimaryType = tree.getProperty(JCR_PRIMARYTYPE); if (jcrPrimaryType != null) { String ntName = jcrPrimaryType.getValue(STRING); primaryType = internalGetNodeType(ntName); } else { throw new RepositoryException("Node at "+tree.getPath()+" has no primary type."); } PropertyState jcrMixinType = tree.getProperty(JCR_MIXINTYPES); if (jcrMixinType == null) { return new EffectiveNodeTypeImpl(primaryType, this); } else { NodeTypeImpl[] mixinTypes = new NodeTypeImpl[jcrMixinType.count()]; for (int i = 0; i < mixinTypes.length; i++) { mixinTypes[i] = internalGetNodeType(jcrMixinType.getValue(Type.NAME, i)); } return new EffectiveNodeTypeImpl(primaryType, mixinTypes, this); } }
@Override public EffectiveNodeType getEffectiveNodeType(Tree tree) throws RepositoryException { NodeTypeImpl primaryType; PropertyState jcrPrimaryType = tree.getProperty(JCR_PRIMARYTYPE); if (jcrPrimaryType != null) { String ntName = jcrPrimaryType.getValue(STRING); primaryType = internalGetNodeType(ntName); } else { throw new RepositoryException("Node at "+tree.getPath()+" has no primary type."); } PropertyState jcrMixinType = tree.getProperty(JCR_MIXINTYPES); if (jcrMixinType == null) { return new EffectiveNodeTypeImpl(primaryType, this); } else { NodeTypeImpl[] mixinTypes = new NodeTypeImpl[jcrMixinType.count()]; for (int i = 0; i < mixinTypes.length; i++) { mixinTypes[i] = internalGetNodeType(jcrMixinType.getValue(Type.NAME, i)); } return new EffectiveNodeTypeImpl(primaryType, mixinTypes, this); } }
@Override public EffectiveNodeType getEffectiveNodeType(Tree tree) throws RepositoryException { NodeTypeImpl primaryType; PropertyState jcrPrimaryType = tree.getProperty(JCR_PRIMARYTYPE); if (jcrPrimaryType != null) { String ntName = jcrPrimaryType.getValue(STRING); primaryType = internalGetNodeType(ntName); } else { throw new RepositoryException("Node at "+tree.getPath()+" has no primary type."); } PropertyState jcrMixinType = tree.getProperty(JCR_MIXINTYPES); if (jcrMixinType == null) { return new EffectiveNodeTypeImpl(primaryType, this); } else { NodeTypeImpl[] mixinTypes = new NodeTypeImpl[jcrMixinType.count()]; for (int i = 0; i < mixinTypes.length; i++) { mixinTypes[i] = internalGetNodeType(jcrMixinType.getValue(Type.NAME, i)); } return new EffectiveNodeTypeImpl(primaryType, mixinTypes, this); } }
@Override public boolean canSetProperty(String propertyName, Value value) { if (value == null) { return canRemoveProperty(propertyName); } try { EffectiveNodeTypeImpl effective = new EffectiveNodeTypeImpl(this, getManager()); PropertyDefinition def = effective.getPropertyDefinition( propertyName, false, value.getType(), false); return !def.isProtected() && meetsTypeConstraints(value, def.getRequiredType()) && meetsValueConstraints(value, def.getValueConstraints()); } catch (RepositoryException e) { // TODO don't use exceptions for flow control. Use internal method in ReadOnlyNodeTypeManager instead. log.debug(e.getMessage()); return false; } }
@Override public boolean canSetProperty(String propertyName, Value[] values) { if (values == null) { return canRemoveProperty(propertyName); } try { int type = (values.length == 0) ? PropertyType.STRING : values[0].getType(); EffectiveNodeTypeImpl effective = new EffectiveNodeTypeImpl(this, getManager()); PropertyDefinition def = effective.getPropertyDefinition( propertyName, true, type, false); return !def.isProtected() && meetsTypeConstraints(values, def.getRequiredType()) && meetsValueConstraints(values, def.getValueConstraints()); } catch (RepositoryException e) { // TODO don't use exceptions for flow control. Use internal method in ReadOnlyNodeTypeManager instead. log.debug(e.getMessage()); return false; } }
@Override public boolean canSetProperty(String propertyName, Value value) { if (value == null) { return canRemoveProperty(propertyName); } try { EffectiveNodeTypeImpl effective = new EffectiveNodeTypeImpl(this, getManager()); PropertyDefinition def = effective.getPropertyDefinition( propertyName, false, value.getType(), false); return !def.isProtected() && meetsTypeConstraints(value, def.getRequiredType()) && meetsValueConstraints(value, def.getValueConstraints()); } catch (RepositoryException e) { // TODO don't use exceptions for flow control. Use internal method in ReadOnlyNodeTypeManager instead. log.debug(e.getMessage()); return false; } }
@Override public boolean canSetProperty(String propertyName, Value value) { if (value == null) { return canRemoveProperty(propertyName); } try { EffectiveNodeTypeImpl effective = new EffectiveNodeTypeImpl(this, getManager()); PropertyDefinition def = effective.getPropertyDefinition( propertyName, false, value.getType(), false); return !def.isProtected() && meetsTypeConstraints(value, def.getRequiredType()) && meetsValueConstraints(value, def.getValueConstraints()); } catch (RepositoryException e) { // TODO don't use exceptions for flow control. Use internal method in ReadOnlyNodeTypeManager instead. log.debug(e.getMessage()); return false; } }
@Override public boolean canSetProperty(String propertyName, Value[] values) { if (values == null) { return canRemoveProperty(propertyName); } try { int type = (values.length == 0) ? PropertyType.STRING : values[0].getType(); EffectiveNodeTypeImpl effective = new EffectiveNodeTypeImpl(this, getManager()); PropertyDefinition def = effective.getPropertyDefinition( propertyName, true, type, false); return !def.isProtected() && meetsTypeConstraints(values, def.getRequiredType()) && meetsValueConstraints(values, def.getValueConstraints()); } catch (RepositoryException e) { // TODO don't use exceptions for flow control. Use internal method in ReadOnlyNodeTypeManager instead. log.debug(e.getMessage()); return false; } }
@Override public boolean canSetProperty(String propertyName, Value[] values) { if (values == null) { return canRemoveProperty(propertyName); } try { int type = (values.length == 0) ? PropertyType.STRING : values[0].getType(); EffectiveNodeTypeImpl effective = new EffectiveNodeTypeImpl(this, getManager()); PropertyDefinition def = effective.getPropertyDefinition( propertyName, true, type, false); return !def.isProtected() && meetsTypeConstraints(values, def.getRequiredType()) && meetsValueConstraints(values, def.getValueConstraints()); } catch (RepositoryException e) { // TODO don't use exceptions for flow control. Use internal method in ReadOnlyNodeTypeManager instead. log.debug(e.getMessage()); return false; } }