public QPropertyDefinition getApplicablePropertyDef(EffectiveNodeType ent) throws ConstraintViolationException { if (multipleStatus == MultipleStatus.MULTIPLE) { return ent.getApplicablePropertyDef(name, type, true); } else if (multipleStatus == MultipleStatus.SINGLE) { return ent.getApplicablePropertyDef(name, type, false); } else { // multipleStatus == MultipleStatus.UNKNOWN if (values.length == 1) { // one value => could be single- or multi-valued return ent.getApplicablePropertyDef(name, type); } else { // zero or more than one values => must be multi-valued return ent.getApplicablePropertyDef(name, type, true); } } }
@Override public QPropertyDefinition getApplicablePropertyDef(EffectiveNodeType ent) throws ConstraintViolationException { // The eventual target type has to be checked not the current in between type. // This is relevant for dereferenced Reference's, because they are exported as String's. int checkType = type; if (isPathReference) { checkType = PropertyType.REFERENCE; } if (values.length == 1 || binaryURLs.length == 1) { // could be single- or multi-valued (n == 1) return ent.getApplicablePropertyDef(name, checkType); } else { // can only be multi-valued (n == 0 || n > 1) return ent.getApplicablePropertyDef(name, checkType, true); } }
public QPropertyDefinition getApplicablePropertyDef(EffectiveNodeType ent) throws ConstraintViolationException { if (multipleStatus == MultipleStatus.MULTIPLE) { return ent.getApplicablePropertyDef(name, type, true); } else if (multipleStatus == MultipleStatus.SINGLE) { return ent.getApplicablePropertyDef(name, type, false); } else { // multipleStatus == MultipleStatus.UNKNOWN if (values.length == 1) { // one value => could be single- or multi-valued return ent.getApplicablePropertyDef(name, type); } else { // zero or more than one values => must be multi-valued return ent.getApplicablePropertyDef(name, type, true); } } }
/** * retrieves the property definition for the given constraints * * @param parent The parent node state. * @param propertyName The name of the property. * @param type * @param multiValued * @return * @throws RepositoryException */ protected QPropertyDefinition getApplicablePropertyDef(NodeState parent, Name propertyName, int type, boolean multiValued) throws RepositoryException { return getEffectiveNodeType(parent).getApplicablePropertyDef(propertyName, type, multiValued); }
/** * retrieves the property definition for the given constraints * * @param parent The parent node state. * @param propertyName The name of the property. * @param type * @param multiValued * @return * @throws RepositoryException */ protected QPropertyDefinition getApplicablePropertyDef(NodeState parent, Name propertyName, int type, boolean multiValued) throws RepositoryException { return getEffectiveNodeType(parent).getApplicablePropertyDef(propertyName, type, multiValued); }
/** * Helper method that finds the applicable definition for a property with * the given name, type in the parent node's node type and mixin types. * Other than <code>{@link #findApplicablePropertyDefinition(Name, int, boolean, NodeState)}</code> * this method does not take the multiValued flag into account in the * selection algorithm. If there more than one applicable definitions then * the following rules are applied: * <ul> * <li>named definitions are preferred to residual definitions</li> * <li>definitions with specific required type are preferred to definitions * with required type UNDEFINED</li> * <li>single-value definitions are preferred to multiple-value definitions</li> * </ul> * * @param name * @param type * @param parentState * @return a <code>QPropertyDefinition</code> * @throws ConstraintViolationException if no applicable property definition * could be found * @throws RepositoryException if another error occurs */ public QPropertyDefinition findApplicablePropertyDefinition(Name name, int type, NodeState parentState) throws RepositoryException, ConstraintViolationException { EffectiveNodeType entParent = getEffectiveNodeType(parentState); return entParent.getApplicablePropertyDef(name, type); }
/** * Helper method that finds the applicable definition for a property with * the given name, type and multiValued characteristic in the parent node's * node type and mixin types. If there more than one applicable definitions * then the following rules are applied: * <ul> * <li>named definitions are preferred to residual definitions</li> * <li>definitions with specific required type are preferred to definitions * with required type UNDEFINED</li> * </ul> * * @param name * @param type * @param multiValued * @param parentState * @return a <code>QPropertyDefinition</code> * @throws ConstraintViolationException if no applicable property definition * could be found * @throws RepositoryException if another error occurs */ public QPropertyDefinition findApplicablePropertyDefinition(Name name, int type, boolean multiValued, NodeState parentState) throws RepositoryException, ConstraintViolationException { EffectiveNodeType entParent = getEffectiveNodeType(parentState); return entParent.getApplicablePropertyDef(name, type, multiValued); }
/** * Helper method that finds the applicable definition for a property with * the given name, type in the parent node's node type and mixin types. * Other than <code>{@link #findApplicablePropertyDefinition(Name, int, boolean, NodeState)}</code> * this method does not take the multiValued flag into account in the * selection algorithm. If there more than one applicable definitions then * the following rules are applied: * <ul> * <li>named definitions are preferred to residual definitions</li> * <li>definitions with specific required type are preferred to definitions * with required type UNDEFINED</li> * <li>single-value definitions are preferred to multiple-value definitions</li> * </ul> * * @param name * @param type * @param parentState * @return a <code>QPropertyDefinition</code> * @throws ConstraintViolationException if no applicable property definition * could be found * @throws RepositoryException if another error occurs */ public QPropertyDefinition findApplicablePropertyDefinition(Name name, int type, NodeState parentState) throws RepositoryException, ConstraintViolationException { EffectiveNodeType entParent = getEffectiveNodeType(parentState); return entParent.getApplicablePropertyDef(name, type); }
/** * Helper method that finds the applicable definition for a property with * the given name, type and multiValued characteristic in the parent node's * node type and mixin types. If there more than one applicable definitions * then the following rules are applied: * <ul> * <li>named definitions are preferred to residual definitions</li> * <li>definitions with specific required type are preferred to definitions * with required type UNDEFINED</li> * </ul> * * @param name * @param type * @param multiValued * @param parentState * @return a <code>QPropertyDefinition</code> * @throws ConstraintViolationException if no applicable property definition * could be found * @throws RepositoryException if another error occurs */ public QPropertyDefinition findApplicablePropertyDefinition(Name name, int type, boolean multiValued, NodeState parentState) throws RepositoryException, ConstraintViolationException { EffectiveNodeType entParent = getEffectiveNodeType(parentState); return entParent.getApplicablePropertyDef(name, type, multiValued); }
QPropertyDefinition pd; if (exactTypeMatch || type == PropertyType.UNDEFINED) { pd = getEffectiveNodeType().getApplicablePropertyDef( propertyName, type, multiValued); } else { try { pd = getEffectiveNodeType().getApplicablePropertyDef( propertyName, type, multiValued); } catch (ConstraintViolationException cve) { pd = getEffectiveNodeType().getApplicablePropertyDef( propertyName, PropertyType.UNDEFINED, multiValued);
QPropertyDefinition pd; if (exactTypeMatch || type == PropertyType.UNDEFINED) { pd = getEffectiveNodeType().getApplicablePropertyDef( propertyName, type, multiValued); } else { try { pd = getEffectiveNodeType().getApplicablePropertyDef( propertyName, type, multiValued); } catch (ConstraintViolationException cve) { pd = getEffectiveNodeType().getApplicablePropertyDef( propertyName, PropertyType.UNDEFINED, multiValued);
/** * Returns the property definition for the property state * @param prop the property state * @return the prop def * @throws RepositoryException if an error occurs */ public QPropertyDefinition getDefinition(PropertyState prop) throws RepositoryException { return getEffectiveNodeType().getApplicablePropertyDef( prop.getName(), prop.getType(), prop.isMultiValued()); }
/** * Returns the property definition for the property state * @param prop the property state * @return the prop def * @throws RepositoryException if an error occurs */ public QPropertyDefinition getDefinition(PropertyState prop) throws RepositoryException { return getEffectiveNodeType().getApplicablePropertyDef( prop.getName(), prop.getType(), prop.isMultiValued()); }
try { def = ent.getApplicablePropertyDef(name, type, true); } catch (ConstraintViolationException cve) { def = ent.getApplicablePropertyDef(name, PropertyType.UNDEFINED, true);
try { def = ent.getApplicablePropertyDef(name, type, true); } catch (ConstraintViolationException cve) { def = ent.getApplicablePropertyDef(name, PropertyType.UNDEFINED, true);
try { def = ent.getApplicablePropertyDef(name, value.getType(), false); } catch (ConstraintViolationException cve) { def = ent.getApplicablePropertyDef(name, PropertyType.UNDEFINED, false);
try { def = ent.getApplicablePropertyDef(name, value.getType(), false); } catch (ConstraintViolationException cve) { def = ent.getApplicablePropertyDef(name, PropertyType.UNDEFINED, false);
NodeTypeRegistry ntReg = sessionContext.getNodeTypeRegistry(); QPropertyDefinition def = ntReg.getEffectiveNodeType( NameConstants.MIX_REFERENCEABLE).getApplicablePropertyDef( state.getName(), state.getType()); return sessionContext.getNodeTypeManager().getPropertyDefinition(def); QPropertyDefinition def; try { def = ent.getApplicablePropertyDef( state.getName(), state.getType(), state.isMultiValued()); } catch (ConstraintViolationException e) { ent = ntReg.getEffectiveNodeType(NameConstants.NT_UNSTRUCTURED); def = ent.getApplicablePropertyDef(state.getName(), state.getType(), state.isMultiValued()); log.warn("Fallback to nt:unstructured due to unknown property " +
NodeTypeRegistry ntReg = sessionContext.getNodeTypeRegistry(); QPropertyDefinition def = ntReg.getEffectiveNodeType( NameConstants.MIX_REFERENCEABLE).getApplicablePropertyDef( state.getName(), state.getType()); return sessionContext.getNodeTypeManager().getPropertyDefinition(def); QPropertyDefinition def; try { def = ent.getApplicablePropertyDef( state.getName(), state.getType(), state.isMultiValued()); } catch (ConstraintViolationException e) { ent = ntReg.getEffectiveNodeType(NameConstants.NT_UNSTRUCTURED); def = ent.getApplicablePropertyDef(state.getName(), state.getType(), state.isMultiValued()); log.warn("Fallback to nt:unstructured due to unknown property " +
QPropertyDefinition def = ent.getApplicablePropertyDef( srcChildState.getName(), srcChildState.getType(), srcChildState.isMultiValued());