mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix ALF-2299: CMOS AtomPub binding - Property definition does not map Alfresco content model defined MINMAX constraints
- MINMAX constraint now mapped to minValue and maxValue in CMIS property definition git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19706 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -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)
|
||||
*
|
||||
|
@@ -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<CMISChoice> choices = new HashSet<CMISChoice>();
|
||||
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user