XML Definitionen

Dieses Kapitel enthält die XML Definitionen der im Raptor System verwendeten Dateiformate. Du kannst sie mit einem entsprechenden Editor verwenden um die Syntax deiner Dateien zu überprüfen und bessere Vorschläge für neue Elemente zu erhalten.

Zugriffsregeln

  1<?xml version="1.0" encoding="utf-8"?>
  2<xs:schema
  3	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4	attributeFormDefault="unqualified"
  5	elementFormDefault="qualified"
  6	xmlns="http://educateit.ch/software/Raptor/AccessRules/1"
  7	targetNamespace="http://educateit.ch/software/Raptor/AccessRules/1"
  8	xmlns:xs="http://www.w3.org/2001/XMLSchema">
  9
 10
 11	<!--
 12		Common definitions
 13	-->
 14	<xs:simpleType name="ObjectType">
 15		<xs:restriction base="xs:string">
 16			<xs:enumeration value="User" />
 17			<xs:enumeration value="Computer" />
 18			<xs:enumeration value="WebPage" />
 19			<xs:enumeration value="Application" />
 20			<xs:enumeration value="Process" />
 21		</xs:restriction>
 22	</xs:simpleType>
 23
 24
 25	<!-- Definition of the boolean matching rules -->
 26	<xs:complexType name="AccessStringCompareType">
 27		<xs:simpleContent>
 28			<xs:extension base="xs:string">
 29				<xs:attribute name="caseSensitivity" default="CaseSensitive" use="optional">
 30					<xs:annotation>
 31						<xs:documentation>Specifies if this operation should work case sensitive or case insensitive.</xs:documentation>
 32					</xs:annotation>
 33					<xs:simpleType>
 34						<xs:restriction base="xs:string">
 35							<xs:enumeration value="CaseSensitive" />
 36							<xs:enumeration value="CaseInsensitive" />
 37						</xs:restriction>
 38					</xs:simpleType>
 39				</xs:attribute>
 40			</xs:extension>
 41		</xs:simpleContent>
 42	</xs:complexType>
 43
 44	<xs:group name="AccessValueMatchElements">
 45		<xs:choice>
 46			<xs:element name="Contains" type="AccessStringCompareType">
 47				<xs:annotation>
 48					<xs:documentation>
 49						This operation is true if the given string is contained in the matching string.
 50						If this operation is applied on a list of strings, every string in the list is tested. If
 51						one string in the list matches, the result of this operation is true. If this operation
 52						is applied on any other type. The type is converted into a string, which can lead
 53						to undefined behavior.
 54					</xs:documentation>
 55				</xs:annotation>
 56			</xs:element>
 57			<xs:element name="Equals" type="AccessStringCompareType">
 58				<xs:annotation>
 59					<xs:documentation>
 60						This operation is true if the given string is equal to the matching string.
 61						If this operation is applied on a list of strings, every string in the list is tested. If
 62						one string in the list matches, the result of this operation is true. If this operation
 63						is applied to an integer, an integer comparison is done. If this operation is
 64						applied to an boolean, an boolean comparsion is done. Valid boolean values are
 65						"true" and "false". For any other type, the type is converted into a string, which can
 66						lead to undefined behaviour.
 67					</xs:documentation>
 68				</xs:annotation>
 69			</xs:element>
 70			<xs:element name="RegExp" type="AccessStringCompareType">
 71				<xs:annotation>
 72					<xs:documentation>
 73						This operation is true, if the given regular expression matches the tested string.
 74						For any other type, the type is converted into a string, which can lead to
 75						undefined behaviour.
 76					</xs:documentation>
 77				</xs:annotation>
 78			</xs:element>
 79			<xs:element name="MinInclusive" type="xs:integer">
 80				<xs:annotation>
 81					<xs:documentation>
 82						This operation is true if the tested integer is greater or equal the given value.
 83						For any other type, the operation is false.
 84					</xs:documentation>
 85				</xs:annotation>
 86			</xs:element>
 87			<xs:element name="MaxInclusive" type="xs:integer">
 88				<xs:annotation>
 89					<xs:documentation>
 90						This operation is true if the tested integer is less or equal the given value.
 91						For any other type, the operation is false.
 92					</xs:documentation>
 93				</xs:annotation>
 94			</xs:element>
 95			<xs:element name="And" type="AccessValueMatchGroupType">
 96				<xs:annotation>
 97					<xs:documentation>
 98						The boolean "and" operation contains a list of operations which all have to be true
 99						to make the "and" operation true.
100					</xs:documentation>
101				</xs:annotation>
102			</xs:element>
103			<xs:element name="Or" type="AccessValueMatchGroupType">
104				<xs:annotation>
105					<xs:documentation>
106						The boolean "or" operation contains a list of operations. If one of this
107						operations is true, the "or" operation is true.
108					</xs:documentation>
109				</xs:annotation>
110			</xs:element>
111			<xs:element name="Not" type="AccessValueMatchSingleType">
112				<xs:annotation>
113					<xs:documentation>
114						The boolean "not" operation contains one single operation. It reverses the result of
115						this operation and returns the opposite result.
116					</xs:documentation>
117				</xs:annotation>
118			</xs:element>
119		</xs:choice>
120	</xs:group>
121
122	<xs:complexType name="AccessValueMatchGroupType">
123		<xs:group ref="AccessValueMatchElements" minOccurs="2" maxOccurs="unbounded" />
124	</xs:complexType>
125
126	<xs:complexType name="AccessValueMatchSingleType">
127		<xs:group ref="AccessValueMatchElements" />
128	</xs:complexType>
129
130	<xs:complexType name="AccessAnyMatchType">
131		<!-- must be empty -->
132	</xs:complexType>
133
134	<!-- the definition of the controlled subject elements-->
135	<xs:group name="AccessCSElements">
136		<xs:choice>
137			<xs:element name="LoginUsername" type="AccessValueMatchSingleType">
138				<xs:annotation>
139					<xs:documentation>Matches the name of the user which is accessing the resource.</xs:documentation>
140				</xs:annotation>
141			</xs:element>
142			<xs:element name="LoginGroup" type="AccessValueMatchSingleType">
143				<xs:annotation>
144					<xs:documentation>Matches the list of groups in which the logged in user is member of.</xs:documentation>
145				</xs:annotation>
146			</xs:element>
147			<xs:element name="Any" type="AccessAnyMatchType">
148				<xs:annotation>
149					<xs:documentation>The "any" operation is true in every case and can be used as wildcard.</xs:documentation>
150				</xs:annotation>
151			</xs:element>
152			<xs:element name="And" type="AccessCSGroupType">
153				<xs:annotation>
154					<xs:documentation>
155						The boolean "and" operation contains a list of operations which all have to be true
156						to make the "and" operation true.
157					</xs:documentation>
158				</xs:annotation>
159			</xs:element>
160			<xs:element name="Or" type="AccessCSGroupType">
161				<xs:annotation>
162					<xs:documentation>
163						The boolean "or" operation contains a list of operations. If one of this
164						operations is true, the "or" operation is true.
165					</xs:documentation>
166				</xs:annotation>
167			</xs:element>
168			<xs:element name="Not" type="AccessCSSingleType">
169				<xs:annotation>
170					<xs:documentation>
171						The boolean "not" operation contains one single operation. It reverses the result of
172						this operation and returns the opposite result.
173					</xs:documentation>
174				</xs:annotation>
175			</xs:element>
176		</xs:choice>
177	</xs:group>
178	<xs:complexType name="AccessCSGroupType">
179		<xs:group ref="AccessCSElements" minOccurs="2" maxOccurs="unbounded" />
180	</xs:complexType>
181	<xs:complexType name="AccessCSSingleType">
182		<xs:group ref="AccessCSElements" />
183	</xs:complexType>
184
185	<!-- the definition of the target elements -->
186	<xs:complexType name="AccessObjectValueMatchType">
187		<xs:complexContent>
188			<xs:extension base="AccessValueMatchSingleType">
189				<xs:attribute name="informationBlock" type="xs:string" use="required">
190					<xs:annotation>
191						<xs:documentation>The internal id of the information block.</xs:documentation>
192					</xs:annotation>
193				</xs:attribute>
194				<xs:attribute name="valueName" type="xs:string" use="required">
195					<xs:annotation>
196						<xs:documentation>The internal name of the value.</xs:documentation>
197					</xs:annotation>
198				</xs:attribute>
199			</xs:extension>
200		</xs:complexContent>
201	</xs:complexType>
202	<xs:group name="AccessTargetElements">
203		<xs:choice>
204			<xs:element name="ObjectType">
205				<xs:annotation>
206					<xs:documentation>This matches the object type of the checked object.</xs:documentation>
207				</xs:annotation>
208				<xs:complexType>
209					<xs:sequence>
210						<xs:element name="Equals" type="ObjectType">
211							<xs:annotation>
212								<xs:documentation>Compares the object type.</xs:documentation>
213							</xs:annotation>
214						</xs:element>
215					</xs:sequence>
216				</xs:complexType>
217			</xs:element>
218			<xs:element name="ObjectName" type="AccessValueMatchSingleType">
219				<xs:annotation>
220					<xs:documentation>This matches the object name of the checked object.</xs:documentation>
221				</xs:annotation>
222			</xs:element>
223			<xs:element name="ObjectContext" type="AccessValueMatchSingleType">
224				<xs:annotation>
225					<xs:documentation>This matches the object context of the checked object.</xs:documentation>
226				</xs:annotation>
227			</xs:element>
228			<xs:element name="ObjectValue" type="AccessObjectValueMatchType">
229				<xs:annotation>
230					<xs:documentation>
231						This matches an object value in a given information block.
232						Note that this information block has to be a permanent block.
233					</xs:documentation>
234				</xs:annotation>
235			</xs:element>
236			<xs:element name="Any" type="AccessAnyMatchType">
237				<xs:annotation>
238					<xs:documentation>The "any" operation is true in every case and can be used as wildcard.</xs:documentation>
239				</xs:annotation>
240			</xs:element>
241			<xs:element name="And" type="AccessTargetGroupType">
242				<xs:annotation>
243					<xs:documentation>
244						The boolean "and" operation contains a list of operations which all have to be true
245						to make the "and" operation true.
246					</xs:documentation>
247				</xs:annotation>
248			</xs:element>
249			<xs:element name="Or" type="AccessTargetGroupType">
250				<xs:annotation>
251					<xs:documentation>
252						The boolean "or" operation contains a list of rules. If one of this
253						operations is true, the "or" operation is true.
254					</xs:documentation>
255				</xs:annotation>
256			</xs:element>
257			<xs:element name="Not" type="AccessTargetSingleType">
258				<xs:annotation>
259					<xs:documentation>
260						The boolean "not" operation contains one single rule. It reverses the result of
261						this operation and returns the opposite result.
262					</xs:documentation>
263				</xs:annotation>
264			</xs:element>
265		</xs:choice>
266	</xs:group>
267	<xs:complexType name="AccessTargetGroupType">
268		<xs:group ref="AccessTargetElements" maxOccurs="unbounded" />
269	</xs:complexType>
270	<xs:complexType name="AccessTargetSingleType">
271		<xs:group ref="AccessTargetElements" />
272	</xs:complexType>
273
274	<!-- Every rule has to contain the subject and the target -->
275	<xs:complexType name="AccessRule">
276		<xs:sequence>
277			<xs:element name="ControlledSubject" type="AccessCSSingleType">
278				<xs:annotation>
279					<xs:documentation>
280						Defines the controlled subject for this rule. This should contain a single element to match the subject
281						for which the access is controlled.
282					</xs:documentation>
283				</xs:annotation>
284			</xs:element>
285			<xs:element name="Target" type="AccessTargetSingleType">
286				<xs:annotation>
287					<xs:documentation>
288						Defines the target for this rule. This should contain a single element to match the target
289						for which the access is controlled.
290					</xs:documentation>
291				</xs:annotation>
292			</xs:element>
293		</xs:sequence>
294		<xs:attribute name="scope" use="optional" default="Object">
295			<xs:annotation>
296				<xs:documentation>The scope of this rule. Object rules limit the access to whole objects.</xs:documentation>
297			</xs:annotation>
298			<xs:simpleType>
299				<xs:restriction base="xs:string">
300					<xs:enumeration value="Object">
301						<xs:annotation>
302							<xs:documentation>Limit the access for the whole object.</xs:documentation>
303						</xs:annotation>
304					</xs:enumeration>
305				</xs:restriction>
306			</xs:simpleType>
307		</xs:attribute>
308	</xs:complexType>
309
310	<!-- A sequence of Allow and Deny rules -->
311	<xs:complexType name="AccessType">
312		<xs:annotation>
313			<xs:documentation>The section with a list of access rules. The rules are processed in the order of declaration.</xs:documentation>
314		</xs:annotation>
315		<xs:choice minOccurs="0" maxOccurs="unbounded">
316			<xs:element name="Allow" type="AccessRule">
317				<xs:annotation>
318					<xs:documentation>
319						An allow rule. If the controlled subject and the target of this rule match, the access is granted
320						and the processing of further rules is stopped.
321					</xs:documentation>
322				</xs:annotation>
323			</xs:element>
324			<xs:element name="Deny" type="AccessRule">
325				<xs:annotation>
326					<xs:documentation>
327						An deny rule. If the controlled subject and the target of this rule match, the access is rejected
328						and the processing of further rules is stopped.
329					</xs:documentation>
330				</xs:annotation>
331			</xs:element>
332		</xs:choice>
333		<xs:attribute name="version" type="xs:integer" />
334	</xs:complexType>
335
336	<xs:element name="AccessRules" type="AccessType" />
337
338</xs:schema>

Anwendungszuordnung

 1<?xml version="1.0" encoding="utf-8"?>
 2<xs:schema
 3	attributeFormDefault="unqualified"
 4	elementFormDefault="qualified"
 5	targetNamespace="http://educateit.ch/software/Raptor/ApplicationMap/1"
 6	xmlns="http://educateit.ch/software/Raptor/ApplicationMap/1"
 7	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 8	xmlns:xs="http://www.w3.org/2001/XMLSchema">
 9
10	<xs:simpleType name="ApplicationName">
11		<xs:restriction base="xs:string">
12			<xs:minLength value="1" />
13			<xs:maxLength value="64" />
14			<xs:pattern value="^[-a-zA-Z0-9._() ]+$" />
15		</xs:restriction>
16	</xs:simpleType>
17
18	<xs:simpleType name="ProcessName">
19		<xs:restriction base="xs:string">
20			<xs:pattern value="^[-a-zA-Z0-9._]+$" />
21		</xs:restriction>
22	</xs:simpleType>
23
24	<xs:complexType name="Process">
25		<xs:attribute name="name" type="ProcessName" />
26	</xs:complexType>
27	
28	<xs:complexType name="Application">
29		<xs:sequence minOccurs="1" maxOccurs="unbounded">
30			<xs:element name="Process" type="Process" nillable="true" />
31		</xs:sequence>
32		<xs:attribute name="name" type="ApplicationName" use="required" />
33		<xs:attribute name="filtered" type="xs:boolean" use="required" />
34	</xs:complexType>
35
36	<xs:element name="RaptorApplicationMap">
37		<xs:complexType>
38			<xs:sequence>
39				<xs:element maxOccurs="unbounded" name="Application" type="Application" />
40			</xs:sequence>
41			<xs:attribute name="version" type="xs:integer" use="required" />
42		</xs:complexType>
43
44		<xs:unique name="UniqueApplicationName">
45			<xs:selector xpath="Application" />
46			<xs:field xpath="@name" />
47		</xs:unique>
48
49		<xs:unique name="UniqueProcessName">
50			<xs:selector xpath="Process" />
51			<xs:field xpath="@name" />
52		</xs:unique>
53		
54	</xs:element>
55		
56</xs:schema>

Expertensystem

 1<?xml version="1.0" encoding="utf-8"?>
 2<xs:schema
 3	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4	attributeFormDefault="unqualified"
 5	elementFormDefault="qualified"
 6	xmlns="http://educateit.ch/software/Raptor/ExpertSystem/1"
 7	targetNamespace="http://educateit.ch/software/Raptor/ExpertSystem/1"
 8	xmlns:xs="http://www.w3.org/2001/XMLSchema">
 9
10	<xs:simpleType name="ObjectType">
11		<xs:restriction base="xs:string">
12			<xs:enumeration value="User" />
13			<xs:enumeration value="Computer" />
14			<xs:enumeration value="WebPage" />
15			<xs:enumeration value="Application" />
16			<xs:enumeration value="Process" />
17		</xs:restriction>
18	</xs:simpleType>
19
20	<xs:complexType name="ExpertSystemRuleType">
21		<xs:annotation>
22			<xs:documentation>
23				A test of the expert system. The content of this tag has to be a valid ECMA script.
24			</xs:documentation>
25		</xs:annotation>
26		<xs:simpleContent>
27			<xs:extension base="xs:string">
28				<xs:attribute name="id" type="xs:string" use="required">
29					<xs:annotation>
30						<xs:documentation>
31							The unique id of this test. The id should be a simple string identifier which is used to
32							reference to this test. For example in error messages.
33						</xs:documentation>
34					</xs:annotation>
35				</xs:attribute>
36				<xs:attribute name="caption" type="xs:string" use="required">
37					<xs:annotation>
38						<xs:documentation>
39							The human readable caption of this test. This caption is displayed
40							in the client to identify this test for the user.
41						</xs:documentation>
42					</xs:annotation>
43				</xs:attribute>
44				<xs:attribute name="objectType" type="ObjectType" use="required">
45					<xs:annotation>
46						<xs:documentation>
47							The type of object for which this test was written. The test is only executed for
48							an object with the same type.
49						</xs:documentation>
50					</xs:annotation>
51				</xs:attribute>
52			</xs:extension>
53		</xs:simpleContent>
54	</xs:complexType>
55
56	<xs:complexType name="ExpertSystemType">
57		<xs:annotation>
58			<xs:documentation>
59				The expert system rule list. Contains a list of tests.
60			</xs:documentation>
61		</xs:annotation>
62		<xs:sequence>
63			<xs:element name="Test" type="ExpertSystemRuleType" minOccurs="0" maxOccurs="unbounded" />
64		</xs:sequence>
65		<xs:attribute name="version" type="xs:integer" />
66	</xs:complexType>
67
68	<xs:element name="ExpertSystem" type="ExpertSystemType" />
69	
70</xs:schema>