jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: NodeType subtypes
Date Tue, 05 Sep 2006 14:46:37 GMT
Hi,

On 9/5/06, Roberto Fonti <roberto.fonti@buongiorno.com> wrote:
> given a NodeType, how can I get subtypes?

Get a listing of all the node types using
NodeTypeManager.getAllNodeTypes(), and filter using
NodeType.isNodeType(String name). Like this:

    String name = ...; // name of the parent type
    NodeTypeManager manager = ...;
    NodeTypeIterator iterator = manager.getAllNodeTypes();
    while (iterator.hasNext()) {
        NodeType type = iterator.nextNodeType();
        if (type.isNodeType(name) && !name.equals(type.getName())) {
            System.out.println("Found a subtype: " + type.getName());
        }
    }

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Mime
View raw message