mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Updates to data dictionary constraints
- Added getType and getParameters methods to Constraint interface - Updated existing constraint implementations Updates to FormService - Implemented regex pattern match for selecting appropriate form processor - Added constraints to Form object constructed in NodeHandler git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12396 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package org.alfresco.repo.dictionary.constraint;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.dictionary.ConstraintException;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryException;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
@@ -47,6 +50,15 @@ public class StringLengthConstraint extends AbstractConstraint
|
||||
private int minLength = 0;
|
||||
private int maxLength = Integer.MAX_VALUE;
|
||||
|
||||
/*
|
||||
* @see org.alfresco.service.cmr.dictionary.Constraint#getType()
|
||||
*/
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return "LENGTH";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
@@ -132,4 +144,17 @@ public class StringLengthConstraint extends AbstractConstraint
|
||||
throw new ConstraintException(ERR_INVALID_LENGTH, checkValue, minLength, maxLength);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.alfresco.service.cmr.dictionary.Constraint#getParameters()
|
||||
*/
|
||||
public Map<String, Object> getParameters()
|
||||
{
|
||||
Map<String, Object> params = new HashMap<String, Object>(2);
|
||||
|
||||
params.put("minLength", this.minLength);
|
||||
params.put("maxLength", this.maxLength);
|
||||
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user