On Fri, 2006-03-10 at 10:46 -0300, hsp wrote:
> orgeir, thanks by your help.
> What is the difference between declare a xml file or a cnd file for
> nodetype definition?
> Is the file (xml or cnd) imported automatically or I have to place the
> file in a specific place and call some special method?

There's some code in jackrabbit contrib. Basically you can do it with;

Reader fileReader = new InputStreamReader(new FileReader(new
File("filename")));
String systemId = registerForm.getFile().getFileName();

CompactNodeTypeDefReader cndReader = new
CompactNodeTypeDefReader(fileReader, systemId);

List ntdList = cndReader.getNodeTypeDefs();

NodeTypeManagerImpl ntmgr =
(NodeTypeManagerImpl)ws.getNodeTypeManager();
NodeTypeRegistry ntreg = ntmgr.getNodeTypeRegistry();

for (Iterator i = ntdList.iterator(); i.hasNext();) {
  NodeTypeDef ntd = (NodeTypeDef)i.next();
  ntreg.registerNodeType(ntd);
}

-- 
Torgeir Veimo <[EMAIL PROTECTED]>

Reply via email to