AnsweredAssumed Answered

Get property constraints

Question asked by joblo on Jul 23, 2013
Latest reply on Sep 23, 2013 by jpotts
Hi,

Im trying to get all the constraints from my Alfresco data-model in Java. Right now I'm able to get the maxLength of a String property. In the Alfresco data-model is it also possible to put the minLength of a d:text. In the openCMIS PropertyStringDefinition interface there is only a function to get the maxLength. My question is: how can I get the minLength in Java?

Same for regular expressions. Is it possible to get them?


PropertyStringDefinition propDefString = (PropertyStringDefinition) propDef;
if (propDefString.getMaxLength() != null) {
    // Do something
}



<property name="ex:example">
    <title>Example</title>
    <description></description>
    <type>d:text</type>
    <mandatory>true</mandatory>
    <constraints>
        <constraint type="LENGTH">
            <parameter name="minLength">
          <value>5</value>
      </parameter>
      <parameter name="maxLength">
          <value>5</value>
      </parameter>
        </constraint>
    </constraints>
</property>


Thanks in advance

Outcomes