private QPropertyDefinitionId(QPropertyDefinition def) { declaringNodeType = def.getDeclaringNodeType(); name = def.getName(); }
private QPropertyDefinitionId(QPropertyDefinition def) { declaringNodeType = def.getDeclaringNodeType(); name = def.getName(); }
/** * @see QValueFactory#computeAutoValues(org.apache.jackrabbit.spi.QPropertyDefinition) */ public QValue[] computeAutoValues(QPropertyDefinition propertyDefinition) throws RepositoryException { Name declaringNT = propertyDefinition.getDeclaringNodeType(); Name name = propertyDefinition.getName(); if (NameConstants.JCR_UUID.equals(name) && NameConstants.MIX_REFERENCEABLE.equals(declaringNT)) { // jcr:uuid property of a mix:referenceable return new QValue[]{create(UUID.randomUUID().toString(), PropertyType.STRING)}; } else { throw new RepositoryException("createFromDefinition not implemented for: " + name); } }
/** * @see QValueFactory#computeAutoValues(org.apache.jackrabbit.spi.QPropertyDefinition) */ public QValue[] computeAutoValues(QPropertyDefinition propertyDefinition) throws RepositoryException { Name declaringNT = propertyDefinition.getDeclaringNodeType(); Name name = propertyDefinition.getName(); if (NameConstants.JCR_UUID.equals(name) && NameConstants.MIX_REFERENCEABLE.equals(declaringNT)) { // jcr:uuid property of a mix:referenceable return new QValue[]{create(UUID.randomUUID().toString(), PropertyType.STRING)}; } else { throw new RepositoryException("createFromDefinition not implemented for: " + name); } }
/** * {@inheritDoc} */ public void nodeTypesUnregistered(Collection<Name> names) { // flush all affected cache entries for (Name name : names) { ntCache.remove(name); } synchronized (pdCache) { Iterator<PropertyDefinitionImpl> iter = pdCache.values().iterator(); while (iter.hasNext()) { PropertyDefinitionImpl pd = iter.next(); if (names.contains(pd.unwrap().getDeclaringNodeType())) { iter.remove(); } } } synchronized (ndCache) { Iterator<NodeDefinitionImpl> iter = ndCache.values().iterator(); while (iter.hasNext()) { NodeDefinitionImpl nd = iter.next(); if (names.contains(nd.unwrap().getDeclaringNodeType())) { iter.remove(); } } } }
/** * {@inheritDoc} */ public void nodeTypeReRegistered(Name ntName) { // flush all affected cache entries ntCache.remove(ntName); synchronized (pdCache) { Iterator<PropertyDefinitionImpl> iter = pdCache.values().iterator(); while (iter.hasNext()) { PropertyDefinitionImpl pd = iter.next(); if (ntName.equals(pd.unwrap().getDeclaringNodeType())) { iter.remove(); } } } synchronized (ndCache) { Iterator<NodeDefinitionImpl> iter = ndCache.values().iterator(); while (iter.hasNext()) { NodeDefinitionImpl nd = iter.next(); if (ntName.equals(nd.unwrap().getDeclaringNodeType())) { iter.remove(); } } } }
/** * {@inheritDoc} */ public void nodeTypeReRegistered(Name ntName) { // flush all affected cache entries ntCache.remove(ntName); synchronized (pdCache) { Iterator<PropertyDefinitionImpl> iter = pdCache.values().iterator(); while (iter.hasNext()) { PropertyDefinitionImpl pd = iter.next(); if (ntName.equals(pd.unwrap().getDeclaringNodeType())) { iter.remove(); } } } synchronized (ndCache) { Iterator<NodeDefinitionImpl> iter = ndCache.values().iterator(); while (iter.hasNext()) { NodeDefinitionImpl nd = iter.next(); if (ntName.equals(nd.unwrap().getDeclaringNodeType())) { iter.remove(); } } } }
/** * {@inheritDoc} */ public void nodeTypesUnregistered(Collection<Name> names) { // flush all affected cache entries for (Name name : names) { ntCache.remove(name); } synchronized (pdCache) { Iterator<PropertyDefinitionImpl> iter = pdCache.values().iterator(); while (iter.hasNext()) { PropertyDefinitionImpl pd = iter.next(); if (names.contains(pd.unwrap().getDeclaringNodeType())) { iter.remove(); } } } synchronized (ndCache) { Iterator<NodeDefinitionImpl> iter = ndCache.values().iterator(); while (iter.hasNext()) { NodeDefinitionImpl nd = iter.next(); if (names.contains(nd.unwrap().getDeclaringNodeType())) { iter.remove(); } } } }
/** * @see QValueFactory#computeAutoValues(QPropertyDefinition) */ public QValue[] computeAutoValues(QPropertyDefinition propertyDefinition) throws RepositoryException { Name nodeType = propertyDefinition.getDeclaringNodeType(); Name name = propertyDefinition.getName(); if (NameConstants.NT_HIERARCHYNODE.equals(nodeType) && NameConstants.JCR_CREATED.equals(name)) { return new QValue[] { create(Calendar.getInstance()) }; } else if (NameConstants.NT_RESOURCE.equals(nodeType) && NameConstants.JCR_LASTMODIFIED.equals(name)) { return new QValue[] { create(Calendar.getInstance()) }; } else if (NameConstants.MIX_REFERENCEABLE.equals(nodeType) && NameConstants.JCR_UUID.equals(name)) { return new QValue[] { create(UUID.randomUUID().toString(), PropertyType.STRING) }; } else { throw new RepositoryException("createFromDefinition not implemented for: " + name); } }
Name declaringNT = def.getDeclaringNodeType();
for (QPropertyDefinition pd : ntd.getPropertyDefs()) { builder.append("\n\tPropertyDefinition"); builder.append(" (declared in ").append(pd.getDeclaringNodeType()).append(") "); builder.append("\n\t\tName\t\t").append(pd.definesResidual() ? "*" : pd.getName().toString()); String type = "null";
Name declaringNT = def.getDeclaringNodeType();
for (QPropertyDefinition aPd : pd) { builder.append("\tPropertyDefinition\n"); builder.append(" (declared in " + aPd.getDeclaringNodeType() + ")\n"); builder.append("\t\tName\t\t" + (aPd.definesResidual() ? "*" : aPd.getName().toString()) + "\n"); String type = aPd.getRequiredType() == 0 ? "null" : PropertyType.nameFromValue(aPd.getRequiredType());
Name declaringNT = def.getDeclaringNodeType(); Name name = def.getName();
Name declaringNT = def.getDeclaringNodeType(); Name name = def.getName();
/** * Copy constructor. * * @param propDef some other property definition. */ public QPropertyDefinitionImpl(QPropertyDefinition propDef) { this(propDef.getName(), propDef.getDeclaringNodeType(), propDef.isAutoCreated(), propDef.isMandatory(), propDef.getOnParentVersion(), propDef.isProtected(), propDef.getDefaultValues(), propDef.isMultiple(), propDef.getRequiredType(), propDef.getValueConstraints()); }
&& def.getDeclaringNodeType().equals(NameConstants.MIX_REFERENCEABLE)) {
&& def.getDeclaringNodeType().equals(NameConstants.MIX_REFERENCEABLE)) {
/** * Copy constructor. * * @param propDef some other property definition. */ public QPropertyDefinitionImpl(QPropertyDefinition propDef) { this(propDef.getName(), propDef.getDeclaringNodeType(), propDef.isAutoCreated(), propDef.isMandatory(), propDef.getOnParentVersion(), propDef.isProtected(), propDef.getDefaultValues(), propDef.isMultiple(), propDef.getRequiredType(), propDef.getValueConstraints(), propDef.getAvailableQueryOperators(), propDef.isFullTextSearchable(), propDef.isQueryOrderable()); }
/** * Copy constructor. * * @param propDef some other property definition. */ public QPropertyDefinitionImpl(QPropertyDefinition propDef) { this(propDef.getName(), propDef.getDeclaringNodeType(), propDef.isAutoCreated(), propDef.isMandatory(), propDef.getOnParentVersion(), propDef.isProtected(), propDef.getDefaultValues(), propDef.isMultiple(), propDef.getRequiredType(), propDef.getValueConstraints(), propDef.getAvailableQueryOperators(), propDef.isFullTextSearchable(), propDef.isQueryOrderable()); }