jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From greg power <greg.power...@googlemail.com>
Subject CompactNodeTypeDefWriter & NamePathResolver
Date Mon, 28 Apr 2008 16:30:58 GMT

I'm trying to write out a CND file of current node type definitions and have
hit a problem:

            NodeTypeManager ntmgr = ws.getNodeTypeManager();
            NodeTypeIterator nodeTypes = ntmgr.getAllNodeTypes();
            NodeType nType = null;
            List<NodeType> types = new ArrayList<NodeType>();
            while (nodeTypes.hasNext()) {
                nType = nodeTypes.nextNodeType();
                types.add(nType);
            }

 >>>>   NamePathResolver pathResolver =
((SessionImpl)session).getNamePathResolver();

            NamespaceResolver nameResolver = (NamespaceResolver)
ws.getNamespaceRegistry();
            StringWriter writer = new StringWriter();
           
CompactNodeTypeDefWriter.write(types,nameResolver,pathResolver,writer);
            System.out.println(writer.toString());

At the chevrons I get the exception:

   java.lang.ClassCastException: org.apache.jackrabbit.jca.JCASessionHandle

If I change the line to:

          NamePathResolver pathResolver = ((JCASessionHandle)session).?

I cannot get hold of the path resolver (no method). If I remove the line and
change to:

       
CompactNodeTypeDefWriter.write(types,nameResolver,((SessionImpl)session),writer);

I also get the JCASessionHandle ClassCast exception.

Where do I get a NamePathResolver from?

(Jackrabbit deployed as RAR on JBoss 4.2.1GA, code running within EJB3
session bean method)

gregor

  

-- 
View this message in context: http://www.nabble.com/CompactNodeTypeDefWriter---NamePathResolver-tp16942777p16942777.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message