-
Notifications
You must be signed in to change notification settings - Fork 0
/
data-type.lisp
90 lines (83 loc) · 2.13 KB
/
data-type.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
(in-package :cl-wfx)
(add-core-definitions
'((:document-type
(:name "element"
:label "Fields"
: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 :document-type
:label "Type Def"
:key-p nil
:concrete-type (:type :list
:complex-type :p-list)
:attributes (:display t :editable t)
:documentation "")
(:name :document-type
:label "Attributes"
:key-p nil
:concrete-type (:type :list
: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-document-type (store type-name)
(query-document
(get-collection store "document-types")
:query (lambda (document)
(equalp (getx document :name) type-name))))