* @throws RepositoryException if an error occurs while reading from the
* node type manager.
*/
private void collectNodeTypes(String ntName)
throws RepositoryException {
NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
String[] resolvedNames = resolveNodeTypeName(ntName);
// now resolve node type hierarchy
for (String resolvedName : resolvedNames) {
try {
NodeType base = ntMgr.getNodeType(resolvedName);
if (base.isMixin()) {
// search for nodes where jcr:mixinTypes is set to this mixin
addTypeConstraint(new MixinComparision(resolvedName));
} else {
// search for nodes where jcr:primaryType is set to this type
addTypeConstraint(new PrimaryTypeComparision(resolvedName));
}
// now search for all node types that are derived from base
NodeTypeIterator allTypes = ntMgr.getAllNodeTypes();
while (allTypes.hasNext()) {
NodeType nt = allTypes.nextNodeType();
NodeType[] superTypes = nt.getSupertypes();
if (Arrays.asList(superTypes).contains(base)) {
if (nt.isMixin()) {