You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Alessandro Bologna <al...@gmail.com> on 2007/02/01 19:43:44 UTC

Modeling data types

Hi,

is there a recommended way to model an "enum", or a "set". For instance, if
color is defined as {red, green, blue} how can I represent it in terms of
JSR-170 structures?
I experimented with using a string property and constraints, but it seems
that changing the constraints does not affect the node (in other words, if I
change "red" to "yellow", my node still has "red").

I can imagine that one way could be to use an "enum" node, with same name
siblings "values" nodes attached, and then use references, but it seems a
bit convoluted. Is there another way? Another problem is that the "enum"
should be part of the node type definition, and how would that work with
references? Can the reference be constrained to point to a specific "enum"
instance? Say, the node type "Window" has a "color" reference that points to
the single "enum" instance "colors".

Thanks,
Alessandro Bologna