You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Kooper <se...@list.ru> on 2009/04/24 13:53:11 UTC

Reset to empty value property that has constraints

Hi, I have task to give ability to reset property that has constraints to
empty value,
e.g.
<propertyDefinition name="Weather" requiredType="String" autoCreated="false"
mandatory="false" onParentVersion="COPY" protected="false" multiple="false"
>
<valueConstraints>
<valueConstraint>Rain</valueConstraint>
<valueConstraint>Snow</valueConstraint>
<valueConstraint>Windy</valueConstraint>
<valueConstraint>Muddy</valueConstraint>
<valueConstraint>Cold</valueConstraint>
<valueConstraint>Hot</valueConstraint>
</valueConstraints>
</propertyDefinition>
and of course when I try to set empty value I recieve constraint exception.
Currently I added empty constraint to property and it works
e.g.
<propertyDefinition name="Weather" requiredType="String" autoCreated="false"
mandatory="false" onParentVersion="COPY" protected="false" multiple="false"
>
<valueConstraints>
<valueConstraint></valueConstraint>
<valueConstraint>Rain</valueConstraint>
<valueConstraint>Snow</valueConstraint>
<valueConstraint>Windy</valueConstraint>
<valueConstraint>Muddy</valueConstraint>
<valueConstraint>Cold</valueConstraint>
<valueConstraint>Hot</valueConstraint>
</valueConstraints>
</propertyDefinition>

, but may be there is more elegant way to do that?
Thanks for your time. 
-- 
View this message in context: http://www.nabble.com/Reset-to-empty-value-property-that-has-constraints-tp23214921p23214921.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Reset to empty value property that has constraints

Posted by Stefan Guggisberg <st...@gmail.com>.
On Fri, Apr 24, 2009 at 1:53 PM, Kooper <se...@list.ru> wrote:
>
> Hi, I have task to give ability to reset property that has constraints to
> empty value,
> e.g.
> <propertyDefinition name="Weather" requiredType="String" autoCreated="false"
> mandatory="false" onParentVersion="COPY" protected="false" multiple="false"
>>
> <valueConstraints>
> <valueConstraint>Rain</valueConstraint>
> <valueConstraint>Snow</valueConstraint>
> <valueConstraint>Windy</valueConstraint>
> <valueConstraint>Muddy</valueConstraint>
> <valueConstraint>Cold</valueConstraint>
> <valueConstraint>Hot</valueConstraint>
> </valueConstraints>
> </propertyDefinition>
> and of course when I try to set empty value I recieve constraint exception.
> Currently I added empty constraint to property and it works
> e.g.
> <propertyDefinition name="Weather" requiredType="String" autoCreated="false"
> mandatory="false" onParentVersion="COPY" protected="false" multiple="false"
>>
> <valueConstraints>
> <valueConstraint></valueConstraint>
> <valueConstraint>Rain</valueConstraint>
> <valueConstraint>Snow</valueConstraint>
> <valueConstraint>Windy</valueConstraint>
> <valueConstraint>Muddy</valueConstraint>
> <valueConstraint>Cold</valueConstraint>
> <valueConstraint>Hot</valueConstraint>
> </valueConstraints>
> </propertyDefinition>
>
> , but may be there is more elegant way to do that?

no. if a property has a constraint defined, its value must
satisfy the constraint.

cheers
stefan

> Thanks for your time.
> --
> View this message in context: http://www.nabble.com/Reset-to-empty-value-property-that-has-constraints-tp23214921p23214921.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>