如何在AlfrescoJavaAPI中获取允许的约束值列表

如何在AlfrescoJavaAPI中获取允许的约束值列表,alfresco,Alfresco,我需要从模型中的属性获取允许值的约束参数列表。下面是一个模型,其名称空间为custom,属性名称为common。我试过使用下面的JavaWebScript,但它不起作用,我得到了一个空列表 模型片段: <namespaces> <namespace uri="custom" prefix="custom"/> </namespaces> <property name="custom:common"> <title>c

我需要从模型中的属性获取允许值的约束参数列表。下面是一个模型,其名称空间为
custom
,属性名称为
common
。我试过使用下面的JavaWebScript,但它不起作用,我得到了一个空列表

模型片段:

 <namespaces>
   <namespace uri="custom" prefix="custom"/>
 </namespaces>
 <property name="custom:common">
    <title>common</title>
    <type>d:text</type>
    <mandatory>false</mandatory>
    <index enabled="true">
      <tokenised>TRUE</tokenised>
      <facetable>false</facetable>
    </index>
    <constraints>
      <constraint name="custom:LIST_6f4ee71b-0c8c-4f79-805f-a8d1065ae0b9" type="LIST">
        <parameter name="allowedValues">
          <list>
            <value>Select</value>
            <value>Unit1</value>
            <value>Unit2</value>
          </list>
        </parameter>
      </constraint>
    </constraints>
</property>
QName qName = null;
qName.createQName("custom", "custom:common");
Object list = this.serviceRegistry.getDictionaryService().getConstraint(qName).getConstraint().getParameters().get(ListOfValuesConstraint.ALLOWED_VALUES_PARAM);

您不需要获取属性的定义
custom:custom
,然后从中获取约束吗?您似乎正在尝试直接获取名为
custom:custom
的约束,但该约束不起作用,因为这是属性名称。您不需要获取属性的定义
custom:custom
,然后从该属性中获取约束吗?您似乎试图直接获取名为
custom:custom
的约束,但该约束不起作用,因为这是属性名