Skip to content

Commit 8f2615d

Browse files
committed
Improving xsd
1 parent 20fb8b8 commit 8f2615d

File tree

1 file changed

+107
-41
lines changed

1 file changed

+107
-41
lines changed

src/main/resources/schemas/lsc-core-1.0.xsd

+107-41
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<xsd:annotation>
66
<xsd:documentation>
7-
This schema specifies the configuration options for LSC implementations.
7+
This schema specifies the configuration options for LSC synchronizations tasks.
88
</xsd:documentation>
99
</xsd:annotation>
1010

@@ -13,20 +13,14 @@
1313
<xsd:documentation>Definition for the ldap connections.</xsd:documentation>
1414
</xsd:annotation>
1515
<xsd:all>
16-
<xsd:element name="id" type="xsd:string" minOccurs="1" maxOccurs="1"/>
17-
<xsd:element name="username" type="xsd:string" minOccurs="1" maxOccurs="1"/>
18-
<xsd:element name="password" type="xsd:string" minOccurs="1" maxOccurs="1"/>
19-
20-
<xsd:element name="authentication" type="xsd:string" minOccurs="1" maxOccurs="1"/>
21-
<xsd:element name="url" type="xsd:string" minOccurs="1" maxOccurs="1"/>
22-
<xsd:element name="referral" type="xsd:string" minOccurs="1" maxOccurs="1"/>
23-
<xsd:element name="derefAliases" type="xsd:string" minOccurs="1" maxOccurs="1"/>
24-
<xsd:element name="version" type="xsd:string" minOccurs="1" maxOccurs="1"/>
25-
26-
<xsd:element name="pageSize" type="xsd:integer" minOccurs="1" maxOccurs="1"/>
27-
<xsd:element name="factory" type="xsd:string" minOccurs="1" maxOccurs="1"/>
28-
<xsd:element name="tlsActivated" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="false"/>
2916
</xsd:all>
17+
<xsd:attribute name="class" type="xsd:string">
18+
<xsd:annotation>
19+
<xsd:documentation>
20+
Java class type or shortname to identify implementation
21+
</xsd:documentation>
22+
</xsd:annotation>
23+
</xsd:attribute>
3024
<xsd:attribute name="id" type="xsd:integer">
3125
<xsd:annotation>
3226
<xsd:documentation>
@@ -37,17 +31,26 @@
3731
</xsd:attribute>
3832
</xsd:complexType>
3933

40-
<xsd:complexType name="databaseConnectionType">
34+
<xsd:complexType name="connectionType">
4135
<xsd:annotation>
42-
<xsd:documentation>Definition for the SQL database connections.</xsd:documentation>
36+
<xsd:documentation>Definition for the connection options.</xsd:documentation>
4337
</xsd:annotation>
44-
<xsd:all>
38+
<xsd:sequence>
4539
<xsd:element name="id" type="xsd:string" minOccurs="1" maxOccurs="1"/>
4640
<xsd:element name="url" type="xsd:string" minOccurs="1" maxOccurs="1"/>
4741
<xsd:element name="username" type="xsd:string" minOccurs="1" maxOccurs="1"/>
4842
<xsd:element name="password" type="xsd:string" minOccurs="1" maxOccurs="1"/>
49-
<xsd:element name="driver" type="xsd:string" minOccurs="1" maxOccurs="1"/>
50-
</xsd:all>
43+
<!-- Extensibility -->
44+
<xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
45+
</xsd:sequence>
46+
<xsd:attribute name="class" type="xsd:string">
47+
<xsd:annotation>
48+
<xsd:documentation>
49+
Java class type to identify implementation. Known shortnames are : ldapConnection, sqlConnection.
50+
You may add yours by adding the XStreamAlias annotation to your new connection class.
51+
</xsd:documentation>
52+
</xsd:annotation>
53+
</xsd:attribute>
5154
<xsd:attribute name="id" type="xsd:integer">
5255
<xsd:annotation>
5356
<xsd:documentation>
@@ -58,6 +61,18 @@
5861
</xsd:attribute>
5962
</xsd:complexType>
6063

64+
<!-- SQL connection type specific parameters -->
65+
<xsd:element name="driver" type="xsd:string"/>
66+
67+
<!-- LDAP connection type specific parameter -->
68+
<xsd:element name="authentication" type="xsd:string" />
69+
<xsd:element name="referral" type="xsd:string" />
70+
<xsd:element name="derefAliases" type="xsd:string" />
71+
<xsd:element name="version" type="xsd:string" />
72+
<xsd:element name="pageSize" type="xsd:integer" />
73+
<xsd:element name="factory" type="xsd:string" />
74+
<xsd:element name="tlsActivated" type="xsd:boolean" default="false"/>
75+
6176
<xsd:complexType name="encryptionType">
6277
<xsd:annotation>
6378
<xsd:documentation>Definition for the encryption properties.</xsd:documentation>
@@ -76,35 +91,69 @@
7691
</xsd:attribute>
7792
</xsd:complexType>
7893

79-
<xsd:complexType name="ldifAuditType">
94+
<xsd:complexType name="auditLogRef">
8095
<xsd:annotation>
81-
<xsd:documentation>Definition for the LDIF audit properties.</xsd:documentation>
96+
<xsd:documentation>Definition for the auditLog node used in task.</xsd:documentation>
8297
</xsd:annotation>
83-
<xsd:all>
84-
<xsd:element name="appendToLogFile" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="true"/>
85-
<xsd:element name="logOnlyLdif" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="false"/>
86-
</xsd:all>
98+
<xsd:attribute name="class" type="xsd:string">
99+
<xsd:annotation>
100+
<xsd:documentation>
101+
Alias to identify the connection class
102+
</xsd:documentation>
103+
</xsd:annotation>
104+
</xsd:attribute>
105+
<xsd:attribute name="reference" type="xsd:integer">
106+
<xsd:annotation>
107+
<xsd:documentation>
108+
Mandatory attribute that will reference the corresponding audit
109+
</xsd:documentation>
110+
</xsd:annotation>
111+
</xsd:attribute>
112+
</xsd:complexType>
113+
114+
<xsd:complexType name="auditType">
115+
<xsd:annotation>
116+
<xsd:documentation>Definition for the generic audit properties.</xsd:documentation>
117+
</xsd:annotation>
118+
<xsd:sequence>
119+
<xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
120+
<xsd:element name="appendToLogFile" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="true"/>
121+
<!-- Extensibility -->
122+
<xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
123+
</xsd:sequence>
124+
<xsd:attribute name="class" type="xsd:string">
125+
<xsd:annotation>
126+
<xsd:documentation>
127+
Java class type or short name to identify implementation.
128+
Known shortcuts are csvAudit or ldifAudit.
129+
</xsd:documentation>
130+
</xsd:annotation>
131+
</xsd:attribute>
87132
<xsd:attribute name="id" type="xsd:integer">
88133
<xsd:annotation>
89134
<xsd:documentation>
90135
Optional attribute added by XStream parser / dumper. You can leave it or remove it but if you copy a node, do not use the same number twice.
91136
</xsd:documentation>
92137
</xsd:annotation>
93138
</xsd:attribute>
139+
<!-- <xsd:element name="logOnlyLdif" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="false"/> -->
94140
</xsd:complexType>
141+
142+
<!-- -->
143+
<xsd:element name="attributes" type="xsd:string" />
144+
<xsd:element name="separator" type="xsd:string" />
145+
<xsd:element name="append" type="xsd:boolean" />
146+
<xsd:element name="outputHeader" type="xsd:boolean"/>
147+
<xsd:element name="operations" type="xsd:string"/>
148+
<xsd:element name="taskNames">
149+
<xsd:complexType><xsd:sequence><xsd:element name="taskName" type="xsd:string" /></xsd:sequence></xsd:complexType>
150+
</xsd:element>
95151

96152
<xsd:complexType name="csvAuditType">
97153
<xsd:annotation>
98154
<xsd:documentation>Definition for the CSV audit properties.</xsd:documentation>
99155
</xsd:annotation>
100156
<xsd:sequence>
101-
<xsd:element name="attributes" type="xsd:string" minOccurs="0" maxOccurs="1"/>
102-
<xsd:element name="seperator" type="xsd:string" minOccurs="1" maxOccurs="1"/>
103-
<xsd:element name="append" type="xsd:boolean" minOccurs="1" maxOccurs="1"/>
104-
<xsd:element name="outputHeader" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="true"/>
105-
<xsd:element name="taskNames" minOccurs="0" maxOccurs="1">
106-
<xsd:complexType><xsd:sequence><xsd:element name="taskName" type="xsd:string" /></xsd:sequence></xsd:complexType>
107-
</xsd:element>
108157
</xsd:sequence>
109158
<xsd:attribute name="id" type="xsd:integer">
110159
<xsd:annotation>
@@ -127,10 +176,10 @@
127176
</xsd:documentation>
128177
</xsd:annotation>
129178
</xsd:attribute>
130-
<xsd:attribute name="id" type="xsd:integer">
179+
<xsd:attribute name="reference" type="xsd:integer">
131180
<xsd:annotation>
132181
<xsd:documentation>
133-
Optional attribute added by XStream parser / dumper. You can leave it or remove it but if you copy a node, do not use the same number twice.
182+
Mandatory attribute that will reference the corresponding connection
134183
</xsd:documentation>
135184
</xsd:annotation>
136185
</xsd:attribute>
@@ -157,6 +206,14 @@
157206
<xsd:sequence>
158207
<xsd:element name="conditions" type="xsd:string" minOccurs="1" maxOccurs="1"/>
159208
</xsd:sequence>
209+
<xsd:attribute name="class" type="xsd:string">
210+
<xsd:annotation>
211+
<xsd:documentation>
212+
Java class type to identify implementation. Known shortnames are : ldapConnection, Connection.
213+
You may add yours by adding the XStreamAlias annotation to your new connection class.
214+
</xsd:documentation>
215+
</xsd:annotation>
216+
</xsd:attribute>
160217
<xsd:attribute name="id" type="xsd:integer">
161218
<xsd:annotation>
162219
<xsd:documentation>
@@ -172,9 +229,10 @@
172229
<xsd:element name="bean" type="xsd:string" minOccurs="1" maxOccurs="1"/>
173230
<xsd:element name="cleanHook" type="xsd:string" minOccurs="0" maxOccurs="1"/>
174231
<xsd:element name="syncHook" type="xsd:string" minOccurs="0" maxOccurs="1"/>
175-
<xsd:element name="destination" type="serviceType" minOccurs="1" maxOccurs="1"/>
176-
<xsd:element name="source" type="serviceType" minOccurs="1" maxOccurs="1"/>
232+
<xsd:element name="destinationService" type="serviceType" minOccurs="1" maxOccurs="1"/>
233+
<xsd:element name="sourceService" type="serviceType" minOccurs="1" maxOccurs="1"/>
177234
<xsd:element name="syncOptions" type="syncOptionsType" minOccurs="1" maxOccurs="1"/>
235+
<xsd:element name="auditLog" type="auditLogRef" minOccurs="0"/>
178236
</xsd:all>
179237
<xsd:attribute name="id" type="xsd:integer">
180238
<xsd:annotation>
@@ -196,8 +254,7 @@
196254
<xsd:element name="connections">
197255
<xsd:complexType>
198256
<xsd:sequence>
199-
<xsd:element name="databaseConnection" type="databaseConnectionType" minOccurs="0" maxOccurs="unbounded" />
200-
<xsd:element name="ldapConnection" type="ldapConnectionType" minOccurs="0" maxOccurs="unbounded"/>
257+
<xsd:element name="connection" type="connectionType" minOccurs="0" maxOccurs="unbounded" />
201258
</xsd:sequence>
202259
<xsd:attribute name="id" type="xsd:integer">
203260
<xsd:annotation>
@@ -207,12 +264,16 @@
207264
</xsd:annotation>
208265
</xsd:attribute>
209266
</xsd:complexType>
267+
<!-- Connection id uniqueness
268+
<xs:key name="uniqueConnectionIdentifier">
269+
<xs:selector xpath="connection"/>
270+
<xs:field xpath="@name"/>
271+
</xs:key> -->
210272
</xsd:element>
211273
<xsd:element name="audits">
212274
<xsd:complexType>
213275
<xsd:sequence>
214-
<xsd:element name="ldif" type="ldifAuditType" minOccurs="0" maxOccurs="unbounded" />
215-
<xsd:element name="csv" type="csvAuditType" minOccurs="0" maxOccurs="unbounded"/>
276+
<xsd:element name="audit" type="auditType" minOccurs="0" maxOccurs="unbounded" />
216277
</xsd:sequence>
217278
<xsd:attribute name="id" type="xsd:integer">
218279
<xsd:annotation>
@@ -222,6 +283,11 @@
222283
</xsd:annotation>
223284
</xsd:attribute>
224285
</xsd:complexType>
286+
<!-- Audit name uniqueness
287+
<xs:key name="uniqueAuditIdentifier">
288+
<xs:selector xpath="audit"/>
289+
<xs:field xpath="@name"/>
290+
</xs:key> -->
225291
</xsd:element>
226292
<xsd:element name="tasks">
227293
<xsd:complexType>
@@ -237,7 +303,7 @@
237303
</xsd:attribute>
238304
</xsd:complexType>
239305
</xsd:element>
240-
<xsd:element name="security" minOccurs="1" maxOccurs="1">
306+
<xsd:element name="security" minOccurs="0" maxOccurs="1">
241307
<xsd:complexType>
242308
<xsd:sequence>
243309
<xsd:element name="encryption" type="encryptionType" minOccurs="0" maxOccurs="1" />

0 commit comments

Comments
 (0)