Hello Sunil, Thanks for the input. I tried implementing your suggestion, but I ran into a prior problem [http://www.mail-archive.com/[email protected]/msg13861.html] . This problem had actually led me to specify the child node's type as nt:unstructured]. I also tried defining my child node type as a sub-type of nt:childDefinitionType and nt:nodeType - none of them helped. I'm not sure, but I hope this issue is not linked to the ObjectContentManager [OCM].
Anything else I can try? -------- anirban -----Original Message----- From: sunild [mailto:[email protected]] Sent: Thursday, January 21, 2010 11:08 AM To: [email protected] Subject: Re: Problem with Mandatory Properties for Child Nodes Hi Anirban Majumdar, Basically nt:unstructured is the node type which doesnot mandate any restriction. Any property can be added without declaration. But you are in need of a node type where a particular property need to be mandatory. Try extending nt:resource. It will surely help. [av:childNodeType] > nt:resource - av:name mandatory - av:value Best Regards, Sunil Dhage > Hello everyone, > > > > I've come across somewhat similar posts in the archive, but they all > primarily seemed to be dealing with nt:resource. > > The problem I'm facing is that when I have a mandatory property > specified in a child node, then JackRabbit throws a > ConstraintViolationException [mandatory property does not exist] > whenever I try to save the contents of the parent node. > > To put it programmatically, > > > > I have a parent node: > > [av:someParent] > nt:base > > + av:children [av:childNodeType] > > = av:childNodeType > > Multiple > > > > [av:childNodeType] > nt:unstructured > > - av:name > > mandatory > > - av:value > > > > > > I have a bean class for someParent node, which contains a List of > childNode instances. In each of the instances I explicitly save the > "name" property. Then using OCM when I persist the parent node instance > - ocm.insert(parentNodeObj) - even this goes through fine. At the line > where I save the transient state of the repository - ocm.save() - I get > the ConstraintViolationException. > > > > Any assistance will be truly appreciated. > > > > -------- > > anirban > > > >
