On Mon, Apr 4, 2011 at 1:56 PM, Stefan Guggisberg <[email protected]> wrote: > On Mon, Apr 4, 2011 at 1:13 PM, Markus Joschko <[email protected]> > wrote: >> Hi, >> I have a node that should mix free and and fixed properties. >> For that purpose I created the following nodetype (leaving out the >> namespace): >> >> [Contact] > nt:unstructured, mix:created, mix:lastModified >> - primaryContactDetails (weakreference) >> >> [Individual] > Contact >> >> >> When I create a node of type Individual and set the >> primaryContactDetails property to another referencable node, it gets >> the typ "reference". >> Asked for its required type the property returns "undefined" and as >> the DeclaringNodeType it returns "nt:unstructured". >> >> When I remove "nt:unstructured" from the inheritance list, I get the >> desired "weakreference" and Contact as DeclaringNodeType. >> >> Obviously "nt:unstructure" takes precedence over the defined >> properties. > > no, named definitions should take precedence over residual definitions. > weak reference were introduced in jsr-283 (jcr 2.0). you probably > encountered a problem that is specific to weakreferences.
I did some more tests: 1) when using a defined name with the defined type -> the correct nodetype is used 2) when using a residual name -> nt:unstructured is taken as declaring nodetype 3) when using a defined name but a type that is incompatible with the defintion -> nt:unstructured is used as declaring nodetype Is 3) really a valid behaviour? I would expect this to fail. That's not only for weakreferences but for all types I tested. It is especially easy to notice with weakreferences as I can only pass a node to the setProperty method and must rely on jackrabbit to set the correct type. > do you mind filing a jira issue? a simple test case would be great :) > > cheers > stefan > >> Is there an other way to combine defined and undefined >> properties in a node? >> >> I currently use jackrabbit 2.1.1 >> >> >> Regards, >> Markus >> >
