-
Notifications
You must be signed in to change notification settings - Fork 0
/
data-spec.lisp
113 lines (105 loc) · 2.85 KB
/
data-spec.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
(in-package :cl-wfx)
(add-core-definitions
'((:document-type
(:name "element"
:label "Elements"
:elements ((:name :name
:label "Name"
:key-p t
:concrete-type :string
:attributes (:display t :editable t)
:documentation "")
(:name :key-p
:label "Key"
:key-p nil
:concrete-type :boolean
:attributes (:display t :editable t)
:documentation "")
(:name :concrete-type
:label "Concrete Type"
:key-p nil
:concrete-type (:type :list
:complex-type :p-list)
:attributes (:display t :editable t)
:documentation "")
(:name :attributes
:label "Attributes"
:key-p nil
:concrete-type (:type :list (:name "role-allocation"
:label "Role Allocation"
:elements ((:name :allocation
:label "Allocation"
:key-p t
:concrete-type (:type :keyword
:complex-type :value-list
:values-lambda
(cl-wfx::get-named-list-sorted-values
"Allocation Roles")
:values ())
:attributes (:display t :editable t)
:documentation "")
(:name :percentage
:label "Percentage"
:concrete-type :number
:attributes (:display t :editable t)
:min 0
:max 100
:documentation ""))
;; :client-validation #'allocation-percentage-check)
:list-type :keyword
:delimiter " ")
:attributes (:display t :editable t)
:documentation "")))
:destinations (:core :system :license))
(:document-type
(:name "document-type"
:label "Data Type"
:elements ((:name :name
:label "Name"
:key-p t
:concrete-type :string
:attributes (:display t :editable t)
:documentation "")
(:name :label
:label "Label"
:key-p nil
:concrete-type :string
:attributes (:display t :editable t)
:documentation "")
(:name :elements
:label "Fields"
:key-p nil
:concrete-type (:type :list
:list-type :document
:document-type "element"
:key-accessor :name)
:attributes (:display t :editable t)
:documentation "")))
:destinations (:core :system :license))
(:collection
(:name "modules"
:label "Modules"
:document-type "module")
:destinations (:core :system :license)
:access
(:stores
(:core
(:user-levels
(:core (:update :delete :lookup))))
(:system
(:user-levels
(:core (:update :delete :lookup))
(:system (:update :delete :lookup))
(:license (:view :copy :lookup))))
(:license
(:user-levels
(:core (:update :delete :lookup))
(:system (:update :delete :lookup))
(:license (:update :delete :lookup))))))))
(defun get-data-spec (spec-name)
(if (current-user)
(wfx-query-document
"data-specs"
:query (lambda (document)
(equalp (name document) spec-name)))
(get-data-spec spec-name)))