This repository has been archived by the owner on Dec 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.xsd
273 lines (248 loc) · 10.7 KB
/
settings.xsd
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="ermaket_settings" xmlns="ermaket_settings" xmlns:ns="ermaket_settings" elementFormDefault="qualified">
<xs:simpleType name="bool">
<xs:restriction base="xs:string">
<xs:enumeration value="False" />
<xs:enumeration value="True" />
</xs:restriction>
</xs:simpleType>
<!-- Кнопка -->
<!-- Связь с id запускаемого скрипта -->
<!-- Проверка допустимости location -->
<xs:complexType name="button">
<xs:sequence>
<xs:element name="text" type="xs:string" />
<xs:element name="location" type="xs:string" />
</xs:sequence>
<xs:attribute name="id" type="xs:integer" use="required" />
</xs:complexType>
<!-- Список кнопок -->
<xs:complexType name="buttonList">
<xs:sequence>
<xs:element name="button" type="button" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<!-- Возможные права доступа -->
<xs:simpleType name="accessType">
<xs:restriction base="xs:string">
<xs:enumeration value="view" />
<xs:enumeration value="change" />
<xs:enumeration value="delete" />
</xs:restriction>
</xs:simpleType>
<!-- Право доступа -->
<!-- Связь с именем роли -->
<xs:complexType name="roleAccess">
<xs:sequence>
<xs:element name="roleName" type="xs:string" />
<xs:element name="access" type="accessType" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<!-- Права доступа -->
<xs:complexType name="accessRights">
<xs:sequence>
<xs:element name="roleAccess" type="roleAccess" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="inherit" type="bool" />
</xs:complexType>
<!-- Триггер -->
<!-- Связь с названием скрипта -->
<!-- Проверка доступности activation -->
<xs:complexType name="trigger">
<xs:sequence>
<xs:element name="activation" type="xs:string" />
<xs:element name="scriptId" type="xs:integer" />
</xs:sequence>
</xs:complexType>
<!-- Список триггеров -->
<xs:complexType name="triggerList">
<xs:sequence>
<xs:element name="trigger" type="trigger" />
</xs:sequence>
</xs:complexType>
<!-- Абстрактный элемент иерархии -->
<xs:complexType name="hierarchyElement" abstract="true">
<xs:sequence>
<xs:element name="accessRights" type="accessRights" />
<xs:element name="buttonList" type="buttonList" minOccurs="0" />
<xs:element name="triggerList" type="triggerList" minOccurs="0" />
<xs:element name="name" type="xs:string" />
</xs:sequence>
<xs:attribute name="id" type="xs:integer" use="required" />
</xs:complexType>
<!-- Список детей -->
<xs:complexType name="childrenList">
<xs:sequence>
<xs:element name="childId" type="xs:integer" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<!-- Раздел иерархии -->
<xs:complexType name="section">
<xs:complexContent>
<xs:extension base="hierarchyElement">
<xs:sequence>
<xs:element name="children" type="childrenList" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Простое поле формы -->
<xs:complexType name="simpleField">
<xs:sequence>
<xs:element name="tableField" type="xs:string" />
<xs:element name="text" type="xs:string" />
<xs:element name="isEditable" type="bool" default="False" />
</xs:sequence>
</xs:complexType>
<!-- Типы справочников -->
<xs:simpleType name="referenceType">
<xs:restriction base="xs:string">
<xs:enumeration value="simple" />
<xs:enumeration value="dropdown" />
<xs:enumeration value="linkedTable" />
<xs:enumeration value="linkedForm" />
<xs:enumeration value="groupedForm" />
</xs:restriction>
</xs:simpleType>
<!-- Связанное поле формы -->
<xs:complexType name="linkedField">
<xs:complexContent>
<xs:extension base="simpleField">
<xs:sequence>
<xs:element name="linkType" type="referenceType" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Поля формы -->
<xs:complexType name="formFields">
<xs:choice maxOccurs="unbounded">
<xs:element name="simpleField" type="simpleField" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="linkedField" type="simpleField" minOccurs="0" maxOccurs="unbounded" />
</xs:choice>
</xs:complexType>
<!-- Форма -->
<xs:complexType name="formDescription">
<xs:sequence>
<xs:element name="schema" type="xs:string" />
<xs:element name="tableName" type="xs:string" />
<xs:element name="fields" type="formFields" />
</xs:sequence>
<xs:attribute name="id" type="xs:integer" use="required" />
</xs:complexType>
<!-- Форма в иерархии -->
<!-- Связь с именем таблицы -->
<xs:complexType name="formEntry">
<xs:complexContent>
<xs:extension base="hierarchyElement">
<xs:sequence>
<xs:element name="form" type="formDescription" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Столбец в таблице -->
<xs:complexType name="tableColumn">
<xs:sequence>
<xs:element name="rowName" type="xs:string" />
<xs:element name="text" type="xs:string" minOccurs="0" />
<xs:element name="isSort" type="bool" default="True" minOccurs="0" />
<xs:element name="isFilter" type="bool" default="True" minOccurs="0" />
<xs:element name="isEditable" type="bool" default="True" minOccurs="0" />
</xs:sequence>
</xs:complexType>
<!-- Типы справочников -->
<xs:simpleType name="tableReferenceType">
<xs:restriction base="xs:string">
<xs:enumeration value="simple" />
<xs:enumeration value="dropdown" />
<xs:enumeration value="linkedTable" />
</xs:restriction>
</xs:simpleType>
<!-- Связанное поле таблицы -->
<xs:complexType name="linkedTableColumn">
<xs:complexContent>
<xs:extension base="tableColumn">
<xs:sequence>
<xs:element name="linkType" type="tableReferenceType" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Набор столбцов -->
<xs:complexType name="tableColumns">
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="column" type="tableColumn" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="linkedColumn" type="ns:linkedTableColumn" minOccurs="0" maxOccurs="unbounded" />
</xs:choice>
</xs:sequence>
</xs:complexType>
<!-- Таблица в иерархии -->
<!-- Связь с именем таблицы -->
<xs:complexType name="tableEntry">
<xs:complexContent>
<xs:extension base="hierarchyElement">
<xs:sequence>
<xs:element name="tableName" type="xs:string" />
<xs:element name="schema" type="xs:string" />
<xs:element name="linesOnPage" type="xs:integer" default="50" minOccurs="0" />
<xs:element name="columns" type="tableColumn" />
<xs:element name="formDescription" type="formDescription" minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Пользовательская страница в иерархии -->
<xs:complexType name="pageEntry">
<xs:complexContent>
<xs:extension base="hierarchyElement">
<xs:sequence>
<xs:element name="componentName" type="xs:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Типы встроенных страниц -->
<xs:simpleType name="prebuiltPageType">
<xs:restriction base="xs:string">
<xs:enumeration value="sql" />
<xs:enumeration value="users" />
<xs:enumeration value="status" />
</xs:restriction>
</xs:simpleType>
<!-- Встроенная страница в иерархии -->
<xs:complexType name="prebuiltPageEntry">
<xs:complexContent>
<xs:extension base="hierarchyElement">
<xs:sequence>
<xs:element name="type" type="prebuiltPageType" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Иерархия -->
<xs:element name="hierarchy">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="section" type="section" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="formEntry" type="formEntry" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="tableEntry" type="tableEntry" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="pageEntry" type="pageEntry" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="prebuiltPageEntry" type="prebuiltPageEntry" minOccurs="0" maxOccurs="unbounded" />
</xs:choice>
</xs:complexType>
<xs:unique name="unique-id">
<xs:selector xpath="*" />
<xs:field xpath="@id" />
</xs:unique>
<xs:key name="element-key">
<xs:selector xpath="*" />
<xs:field xpath="@id" />
</xs:key>
<xs:keyref name="element-keyref" refer="element-key">
<xs:selector xpath="ns:section/ns:children/ns:childId" />
<xs:field xpath="."></xs:field>
</xs:keyref>
</xs:element>
</xs:schema>