AnsweredAssumed Answered

Regular Expression Issue in constraints Tag when using custom model

Question asked by ajay.k on Oct 30, 2018
Latest reply on Nov 5, 2018 by ajay.k


                     I created custom model to apply for uploaded documents in alfresco share. My customModel.xml has constraints as




<?xml version="1.0" encoding="UTF-8"?>

<model name="t:membershipdocumentsmodel" xmlns="">

<!-- Optional meta-data about the model -->
<description>Membership Document Model</description>

<!-- Imports are required to allow references to definitions in other models -->
<!-- Import Alfresco Dictionary Definitions -->
<import uri="" prefix="d" />
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="" prefix="cm" />
<import uri="" prefix="sys"/> 

<namespace uri="" prefix="t" />


<constraint name="t:alphanumeric" type="REGEX">
<parameter name="expression">
<parameter name='requiresMatch'><value>true</value></parameter>
<constraint name="t:length" type="LENGTH">
<parameter name='minLength'><value>1</value></parameter>
<parameter name='maxLength'><value>10</value></parameter>


<!-- Enterprise-wide generic document type -->
<type name="t:membership_doc">
<title>Transaction Document</title>
<property name="t:membership_id">
<constraint ref="t:alphanumeric" />
<constraint ref="t:length" />





My goal is to allow only alphanumeric characters but for above regular expression it is showing failure message


And it is allowing the special characters which i won't need.

Is there any mistake in my approach?



Thanks & Regards