diff --git a/source/java/org/alfresco/cmis/CMISPropertyDefinition.java b/source/java/org/alfresco/cmis/CMISPropertyDefinition.java index c375ae3667..12cf358702 100644 --- a/source/java/org/alfresco/cmis/CMISPropertyDefinition.java +++ b/source/java/org/alfresco/cmis/CMISPropertyDefinition.java @@ -126,12 +126,26 @@ public interface CMISPropertyDefinition public boolean isOrderable(); /** - * For variable length properties, get the maximum length allowed. Unsupported. + * For variable length properties, get the maximum length allowed. * * @return */ public int getMaximumLength(); + /** + * For Integer and Decimal properties, get the minimum value allowed + * + * @return + */ + public Double getMinValue(); + + /** + * For Integer and Decimal properties, get the maximum value allowed + * + * @return + */ + public Double getMaxValue(); + /** * Gets the property accessor (for reading / writing values) * diff --git a/source/java/org/alfresco/cmis/dictionary/CMISBasePropertyDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISBasePropertyDefinition.java index 24c2d9d9f4..62b1943590 100644 --- a/source/java/org/alfresco/cmis/dictionary/CMISBasePropertyDefinition.java +++ b/source/java/org/alfresco/cmis/dictionary/CMISBasePropertyDefinition.java @@ -35,6 +35,7 @@ import org.alfresco.cmis.mapping.AbstractProperty; import org.alfresco.cmis.mapping.CMISMapping; import org.alfresco.repo.dictionary.IndexTokenisationMode; import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint; +import org.alfresco.repo.dictionary.constraint.NumericRangeConstraint; import org.alfresco.repo.dictionary.constraint.StringLengthConstraint; import org.alfresco.repo.search.impl.lucene.analysis.DateAnalyser; import org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser; @@ -73,6 +74,10 @@ public class CMISBasePropertyDefinition implements CMISPropertyDefinition, Seria private CMISCardinalityEnum cardinality; + private Double minValue = null; + + private Double maxValue = null; + private int maximumLength = -1; private Collection choices = new HashSet(); @@ -126,6 +131,12 @@ public class CMISBasePropertyDefinition implements CMISPropertyDefinition, Seria StringLengthConstraint slc = (StringLengthConstraint) constraint; maximumLength = slc.getMaxLength(); } + if (constraint instanceof NumericRangeConstraint) + { + NumericRangeConstraint nrc = (NumericRangeConstraint) constraint; + minValue = nrc.getMinValue(); + maxValue = nrc.getMaxValue(); + } } required = propDef.isMandatory(); defaultValue = propDef.getDefaultValue(); @@ -259,6 +270,22 @@ public class CMISBasePropertyDefinition implements CMISPropertyDefinition, Seria return maximumLength; } + /* (non-Javadoc) + * @see org.alfresco.cmis.CMISPropertyDefinition#getMinValue() + */ + public Double getMinValue() + { + return minValue; + } + + /* (non-Javadoc) + * @see org.alfresco.cmis.CMISPropertyDefinition#getMaxValue() + */ + public Double getMaxValue() + { + return maxValue; + } + /** * Get the choices available as values for this property TODO: not implemented yet *