Hi Stefan, Thanks, it works that way.
Cosmin ----- Original Message ---- From: Stefan Guggisberg <[EMAIL PROTECTED]> To: [email protected] Sent: Thursday, November 16, 2006 10:46:23 AM Subject: Re: Creating NodeType with dynamic, linked properties hi cosmin On 11/16/06, Cosmin Zamfir <[EMAIL PROTECTED]> wrote: > Hello all, > > Suppose I want to create several NodeTypes, each of them containing a > Property called "category" whose value is constrained to a List of values. > > The constraint list will need to be expanded as more categories will be > added. This change should be reflected then in all NodeTypes which contain > the "category" property. > Unfortunately, it seems that the PropertyDefinition is somehow static, > getValueConstraints() only allows to define one time the constraints. There > is no functionality to create a link to a dynamic Property, so that all > changes made in the Property will be reflected in all NodeTypes using this > Property. > > The only solution I see at the moment is to create a custom implementation, > outside the repository, to mimic the NodeType interface, > including inheritance. But doing so will create a lot of disadvantages; > including the fact that there will be no checks done by the repository itself > for compliance to the NodeType of new Nodes. > > Are you aware of any posibility to create such a functionality using the > repository? you could e.g. create a node type myapp:Category that extends from mix:referenceable. now for each category (e.g. book, dvd, etc) you can create a node of type myapp:Category. in your custom node types make your "category" property a REFERENCE property and restrict it to myapp:Category. you can add new categories (nodes of type myapp:Category) at any time. cheers stefan > > Thanks a lot, > Cosmin > > > > > > > > > > ____________________________________________________________________________________ > Sponsored Link > > Mortgage rates near 39yr lows. > $510k for $1,698/mo. Calculate new payment! > www.LowerMyBills.com/lre > ____________________________________________________________________________________ Sponsored Link Online degrees - find the right program to advance your career. Www.nextag.com
