2005/6/11, Roy Russo <[EMAIL PROTECTED]>:
> Thank you Oliver. I saw the JIRA tasks.
> 
> As I suspected, the file is autogenerated after setting the node types
> programatically. I'll post to the jackrabbit list, as I am stuck when it
> comes to adding new ones in my code. Thanks!

here is some example code that might help you getting started:

            NodeTypeDef ntd = new NodeTypeDef();
            ntd.setName(new
QName("http://incubator.apache.org/graffito";, "folder"));
            ntd.setMixin(false);
            ntd.setOrderableChildNodes(false);

            PropDefImpl propDefImpl = new PropDefImpl();                    
            propDefImpl.setName(PropDef.ANY_NAME);
            propDefImpl.setRequiredType(PropertyType.UNDEFINED);
            propDefImpl.setAutoCreated(false);
            propDefImpl.setMandatory(false);
            propDefImpl.setOnParentVersion(OnParentVersionAction.IGNORE);
            propDefImpl.setProtected(false);
            propDefImpl.setMultiple(false);
            propDefImpl.setDeclaringNodeType(ntd.getName());

            ntd.setSupertypes(new QName[] { new
QName("http://www.jcp.org/jcr/nt/1.0";, "base") });
            ntd.setPropertyDefs(new PropDef[] {propDefImpl});

            NodeDefImpl def = getChildNodeDef(ntd.getName());
            ntd.setChildNodeDefs(new NodeDef[] {def});

            Workspace wsp = getSession().getWorkspace();
            NodeTypeManager ntMgr = wsp.getNodeTypeManager();
            NodeTypeRegistry ntReg = ((NodeTypeManagerImpl)
ntMgr).getNodeTypeRegistry();
            ntReg.registerNodeType(ntd);    

regards,
oliver

Reply via email to