jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Manzke <daniel.man...@googlemail.com>
Subject Re: (JCR-1.0) Restricting the length of a String property?
Date Fri, 27 Mar 2009 14:09:18 GMT
Hi Alexander,
I know that he meaned that feature. I did it also. (so it was just a
misunderstanding) ;)

I don't use the CND or Registration, because there are systems which do not
have this feature. ;) So I describing my nodes in the custom_nodetypes.xml
and deploy it in the different systems.


Bye and thanks for clarifing,
Daniel


2009/3/27 Alexander Klimetschek <aklimets@day.com>

> On Fri, Mar 27, 2009 at 2:27 PM, Daniel Manzke
> <daniel.manzke@googlemail.com> wrote:
> > <cut>
> > In the JCR 1.0 SPEC there is no way to specify how long a String property
> > could be.
> > </cut>
> > I meaned that there is no way in the custom_nodetypes.xml to specify the
> > length of a String. (like <property ... length="10"/>)
>
> What Stefan meant is the "value constraint" of a property definition,
> not something that you would have to do manually in your application.
> In the CND notation it is given with "< constraint" (see
> http://jackrabbit.apache.org/node-type-notation.html). In the XML
> notation the value constraints (there can be multiple) for a property
> are given as sub-elements - each one containing a regular expression:
>
> <propertyDefinition name="foobar" ...>
>    <valueConstraints>
>        <valueConstraint>^.{1,5}$</valueConstraint>
>        <valueConstraint>anothervalue</valueConstraint>
>        <valueConstraint>regexp3</valueConstraint>
>    </valueConstraints>
> </propertyDefinition>
>
> BTW, you should not modify the custom_nodetypes.xml directly but
> rather use the proper node type registration code (see bottom of
> http://jackrabbit.apache.org/node-types.html). Also, using the CND
> notation is much easier.
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
Mit freundlichen Grüßen

Daniel Manzke

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message