diff --git a/src/adl_support/utils.clj b/src/adl_support/utils.clj index 45a3a2b..f692422 100644 --- a/src/adl_support/utils.clj +++ b/src/adl_support/utils.clj @@ -474,9 +474,9 @@ "Return `true` it the value of this `property` may be set from user-supplied data." [property] (and - (= (:tag property) :property) - (not (#{"link"} (:type (:attrs property)))) - (not (system-generated? property)))) + (= (:tag property) :property) + (not (#{"link" "list"} (:type (:attrs property)))) + (not (system-generated? property)))) (defmacro all-properties @@ -509,6 +509,17 @@ (all-properties ~entity))) +(defn required-properties + "Return the properties of this `entity` which are required and are not + system generated." + [entity] + (filter + #(and + (= (:required (:attrs %)) "true") + (not (system-generated? %))) + (descendants-with-tag entity :property))) + + (defmacro key-properties [entity] `(children-with-tag (first (children-with-tag ~entity :key)) :property))