As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<constraints> <constraint name="my:constraintList" type="LIST"> <parameter name="allowedValues"> <list> <value>OPTION 1</value> <value>OPTION 2</value> <value>OPTION 3</value> </list> </parameter> <parameter name="caseSensitive"> <value>false</value> </parameter> </constraint> </constraints> <types> <type name="my:typeTest"> <title>TEST TYPE</title> <parent>cm:content</parent> <properties> <property name="my:propertyTest"> <title>TEST PROPERTY</title> <type>d:text</type> <mandatory>false</mandatory> <constraints> <constraint ref="my:constraintList" /> </constraints> </property> </properties> </type> </types>
/** * Method returns a list of constraint values for the given property. * * @param dictionaryService * - might be null, in this case the default dictionaryService * (send by this.getDictionaryService()) will be used * @param qname * - property * @return */ public static ListOfValuesConstraint getListOfValuesConstraint( DictionaryService dictionaryService, QName qname) { ListOfValuesConstraint lovConstraint = null; PropertyDefinition propertyDef = null; // get the property definition for the item if (dictionaryService == null) { propertyDef = getDictionaryService().getProperty(qname); } else { propertyDef = dictionaryService.getProperty(qname); } if (propertyDef != null) { // go through the constaints and see if it has the // list of values constraint List<ConstraintDefinition> constraints = propertyDef .getConstraints(); for (ConstraintDefinition constraintDef : constraints) { Constraint constraint = constraintDef.getConstraint(); if (constraint instanceof ListOfValuesConstraint) { lovConstraint = (ListOfValuesConstraint) constraint; break; } } } return lovConstraint; }
propertyDef.getConstraints();
{ "name" : "bpm:status", "title" : "Status", "description" : "Status", "defaultValues" : "", "dataType" : "d:text", "multiValued" : false, "mandatory" : true, "enforced" : false, "protected" : false, "indexed" : true, "indexedAtomically" : true, "constraints" : [ { "type" : "LIST", "parameters" : [ { "allowedValues" : ["Not Yet Started","In Progress","On Hold","Cancelled","Completed"] } , { "sorted" : false } , { "caseSensitive" : true } ] } ], "url" : "\/api\/property\/bpm_status" }