use of org.apache.jackrabbit.oak.spi.nodetype.EffectiveNodeType in project jackrabbit-oak by apache.
the class ReadOnlyNodeTypeManager method getDefinition.
@Nonnull
@Override
public NodeDefinition getDefinition(@Nonnull Tree parent, @Nonnull Tree targetNode) throws RepositoryException {
checkNotNull(parent);
checkNotNull(targetNode);
String name = dropIndexFromName(targetNode.getName());
EffectiveNodeType eff = getEffectiveNodeType(parent);
return eff.getNodeDefinition(name, getEffectiveNodeType(targetNode));
}
use of org.apache.jackrabbit.oak.spi.nodetype.EffectiveNodeType in project jackrabbit-oak by apache.
the class ReadOnlyNodeTypeManager method getDefinition.
@Nonnull
@Override
public PropertyDefinition getDefinition(Tree parent, PropertyState property, boolean exactTypeMatch) throws RepositoryException {
Type<?> type = property.getType();
EffectiveNodeType effective = getEffectiveNodeType(parent);
return effective.getPropertyDefinition(property.getName(), type.isArray(), type.tag(), exactTypeMatch);
}
use of org.apache.jackrabbit.oak.spi.nodetype.EffectiveNodeType in project jackrabbit-oak by apache.
the class ReadOnlyNodeTypeManager method getDefinition.
@Nonnull
@Override
public NodeDefinition getDefinition(@Nonnull Tree parent, @Nonnull String nodeName) throws RepositoryException {
checkNotNull(parent);
checkNotNull(nodeName);
EffectiveNodeType effective = getEffectiveNodeType(parent);
return effective.getNodeDefinition(nodeName, null);
}
use of org.apache.jackrabbit.oak.spi.nodetype.EffectiveNodeType in project jackrabbit-oak by apache.
the class ImporterImpl method importProperties.
private void importProperties(@Nonnull Tree tree, @Nonnull List<PropInfo> propInfos, boolean ignoreRegular) throws RepositoryException {
// process properties
for (PropInfo pi : propInfos) {
// find applicable definition
// TODO find better heuristics?
EffectiveNodeType ent = effectiveNodeTypeProvider.getEffectiveNodeType(tree);
PropertyDefinition def = ent.getPropertyDefinition(pi.getName(), pi.getType(), pi.isUnknownMultiple());
if (def.isProtected()) {
// skip protected property
log.debug("Protected property {}", pi.getName());
// notify the ProtectedPropertyImporter.
for (ProtectedPropertyImporter ppi : getPropertyImporters()) {
if (ppi.handlePropInfo(tree, pi, def)) {
log.debug("Protected property -> delegated to ProtectedPropertyImporter");
break;
}
/* else: p-i-Importer isn't able to deal with this property. try next pp-importer */
}
} else if (!ignoreRegular) {
// regular property -> create the property
createProperty(tree, pi, def);
}
}
for (ProtectedPropertyImporter ppi : getPropertyImporters()) {
ppi.propertiesCompleted(tree);
}
}
Aggregations