update author list in license for (JAL-826)
[jalview.git] / schemas / castor-mapping.xsd
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!--\r
3  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
4  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
5  * \r
6  * This file is part of Jalview.\r
7  * \r
8  * Jalview is free software: you can redistribute it and/or\r
9  * modify it under the terms of the GNU General Public License \r
10  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
11  * \r
12  * Jalview is distributed in the hope that it will be useful, but \r
13  * WITHOUT ANY WARRANTY; without even the implied warranty \r
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
15  * PURPOSE.  See the GNU General Public License for more details.\r
16  * \r
17  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
18 -->\r
19 <!--DOCTYPE schema PUBLIC "-//W3C/DTD XML Schema Version 1.0//EN"\r
20     "http://www.w3.org/TR/2000/WD-xmlschema-1-20000225/structures.dtd"-->\r
21     <!--\r
22         Castor Object Mapping XML Schema\r
23         \r
24         Namespace: http://castor.exolab.org/\r
25         System:    http://castor.exolab.org/mapping.xsd\r
26         Public:    -//EXOLAB/Castor Object Mapping Schema Version 1.0//EN\r
27         \r
28         *Note*: This schema is under evolution and subject to change.\r
29         \r
30     -->\r
31     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"\r
32         targetNamespace="http://castor.exolab.org/"\r
33         xmlns="http://castor.exolab.org/"\r
34         version="0.9.4">\r
35         \r
36         <xsd:element name="mapping">\r
37             <xsd:complexType>\r
38                 <xsd:sequence>\r
39                     <xsd:element name="description"   type="xsd:string" minOccurs="0" maxOccurs="1" />\r
40                     <xsd:element ref="include"        minOccurs="0" maxOccurs="unbounded" />\r
41                     <xsd:element ref="class"          minOccurs="0" maxOccurs="unbounded" />\r
42                     <xsd:element ref="key-generator"  minOccurs="0" maxOccurs="unbounded" />\r
43                 </xsd:sequence>\r
44             </xsd:complexType>\r
45         </xsd:element>\r
46         \r
47         <xsd:element name="include">\r
48             <xsd:complexType>\r
49                 <xsd:attribute name="href" type="xsd:string" use="required"/>\r
50             </xsd:complexType>\r
51         </xsd:element>\r
52         \r
53         <xsd:element name="class">\r
54             <xsd:complexType>\r
55                 <xsd:sequence>\r
56                     <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1" />\r
57                     <xsd:element ref="cache-type"   minOccurs="0" maxOccurs="1" />\r
58                     <xsd:element ref="map-to" minOccurs="0" maxOccurs="1" />\r
59                     <xsd:choice minOccurs="1">\r
60                         <xsd:element ref="field" minOccurs="0" maxOccurs="unbounded"/>\r
61                         <xsd:element ref="container" minOccurs="0" maxOccurs="unbounded"/>\r
62                     </xsd:choice>\r
63                 </xsd:sequence>\r
64                 <xsd:attribute name="name"     type="xsd:ID"         use="required"/>\r
65                 <xsd:attribute name="extends"  type="xsd:IDREF"      use="optional"/>\r
66                 <xsd:attribute name="depends"  type="xsd:IDREF"      use="optional"/>\r
67                 <xsd:attribute name="identity" type="xsd:NMTOKENS"   use="optional"/>\r
68                 <xsd:attribute name="access"   default="shared"    use="optional">\r
69                     <xsd:simpleType>\r
70                         <xsd:restriction base="xsd:string">\r
71                             <xsd:enumeration value="read-only"/>\r
72                             <xsd:enumeration value="shared"/>\r
73                             <xsd:enumeration value="exclusive"/>\r
74                             <xsd:enumeration value="db-locked"/>\r
75                         </xsd:restriction>\r
76                     </xsd:simpleType>\r
77                 </xsd:attribute>\r
78                 <xsd:attribute name="key-generator" type="xsd:string"   use="optional"/>\r
79                 <xsd:attribute name="auto-complete" type="xsd:boolean"  use="optional" default="false"/>\r
80                 <xsd:attribute name="verify-constructable" type="xsd:boolean"  use="optional" default="true"/>\r
81             </xsd:complexType>\r
82         </xsd:element>\r
83         \r
84         <xsd:element name="map-to">\r
85             <xsd:complexType>\r
86                 <xsd:attribute name="table"     type="xsd:NMTOKEN"  use="optional"/>\r
87                 <xsd:attribute name="xml"       type="xsd:string"   use="optional"/>\r
88                 <xsd:attribute name="ns-uri"    type="xsd:string"   use="optional"/>\r
89                 <xsd:attribute name="ns-prefix" type="xsd:NMTOKEN"  use="optional"/>\r
90                 <xsd:attribute name="ldap-dn"   type="xsd:string"   use="optional"/>\r
91                 <xsd:attribute name="ldap-oc"   type="xsd:string"   use="optional"/>\r
92             </xsd:complexType>\r
93         </xsd:element>\r
94         \r
95         <xsd:element name="field">\r
96             <xsd:complexType>\r
97                 <xsd:sequence>\r
98                     <xsd:element name="description"   type="xsd:string" minOccurs="0" maxOccurs="1" />\r
99                     <xsd:element ref="sql"            minOccurs="0" maxOccurs="1"/>\r
100                     <xsd:element ref="bind-xml"       minOccurs="0" maxOccurs="1"/>\r
101                     <xsd:element ref="ldap"           minOccurs="0" maxOccurs="1"/>\r
102                 </xsd:sequence>\r
103                 \r
104                 <xsd:attribute name="name"          type="xsd:string" use="required"/>\r
105                 <xsd:attribute name="type"          type="xsd:string" use="optional"/>\r
106                 <xsd:attribute name="required"      type="xsd:boolean"  use="optional"   default="false"/>\r
107                 <xsd:attribute name="transient"     type="xsd:boolean"  use="optional"   default="false"/>\r
108                 <xsd:attribute name="direct"        type="xsd:boolean"  use="optional"   default="false"/>\r
109                 <xsd:attribute name="lazy"          type="xsd:boolean"  use="optional"   default="false"/>\r
110                 <xsd:attribute name="container"     type="xsd:boolean"  use="optional"/>\r
111                 <xsd:attribute name="get-method"    type="xsd:string"  use="optional"/>\r
112                 <xsd:attribute name="has-method"    type="xsd:string"  use="optional"/>\r
113                 <xsd:attribute name="set-method"    type="xsd:string"  use="optional"/>\r
114                 <xsd:attribute name="create-method" type="xsd:string"  use="optional"/>\r
115                 <xsd:attribute name="handler"       type="xsd:string"   use="optional"/>\r
116                 <xsd:attribute name="collection"    use="optional">\r
117                     <xsd:simpleType>\r
118                         <xsd:restriction base="xsd:string">\r
119                             <xsd:enumeration value="array"/>\r
120                             <xsd:enumeration value="vector"/>\r
121                             <xsd:enumeration value="arraylist"/>\r
122                             <xsd:enumeration value="hashtable"/>\r
123                             <xsd:enumeration value="collection"/>\r
124                             <xsd:enumeration value="set"/>\r
125                             <xsd:enumeration value="map"/>\r
126                             <xsd:enumeration value="enumerate"/>\r
127                         </xsd:restriction>\r
128                     </xsd:simpleType>\r
129                 </xsd:attribute>\r
130             </xsd:complexType>\r
131         </xsd:element>\r
132         \r
133         <xsd:element name="container">\r
134             <xsd:complexType>\r
135                 <xsd:sequence>\r
136                     <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1" />\r
137                     <xsd:element ref="field" minOccurs="1"/>\r
138                 </xsd:sequence>\r
139                 <xsd:attribute name="name"          type="xsd:NMTOKEN" use="required"/>\r
140                 <xsd:attribute name="type"          type="xsd:NMTOKEN" use="optional"/>\r
141                 <xsd:attribute name="required"      type="xsd:boolean" use="optional"  default="false"/>\r
142                 <xsd:attribute name="direct"        type="xsd:boolean" use="optional"  default="false"/>\r
143                 <xsd:attribute name="get-method"    type="xsd:NMTOKEN" use="optional"/>\r
144                 <xsd:attribute name="set-method"    type="xsd:NMTOKEN" use="optional"/>\r
145                 <xsd:attribute name="create-method" type="xsd:NMTOKEN" use="optional"/>\r
146             </xsd:complexType>\r
147         </xsd:element>\r
148         \r
149         <xsd:element name="sql">\r
150             <xsd:complexType>\r
151                 <xsd:attribute name="name"       type="xsd:NMTOKENS"   use="optional"/>\r
152                 <xsd:attribute name="type"       type="xsd:string"   use="optional"/>\r
153                 <xsd:attribute name="many-table" type="xsd:NMTOKEN"    use="optional"/>\r
154                 <xsd:attribute name="many-key"   type="xsd:NMTOKENS"   use="optional"/>\r
155                 <xsd:attribute name="read-only"  type="xsd:boolean"    use="optional" default="false"/>\r
156                 \r
157                 <!-- signals that this field is transient for database mapping (ie should be ignored) -->\r
158                 <xsd:attribute name="transient" type="xsd:boolean" use="optional"/>\r
159                 \r
160                 \r
161                 <xsd:attribute name="dirty"  default="check"  use="optional">\r
162                     <xsd:simpleType>\r
163                         <xsd:restriction base="xsd:string">\r
164                             <xsd:enumeration value="check"/>\r
165                             <xsd:enumeration value="ignore"/>\r
166                         </xsd:restriction>\r
167                     </xsd:simpleType>\r
168                 </xsd:attribute>\r
169             </xsd:complexType>\r
170         </xsd:element>\r
171         \r
172         <!--\r
173             The 'bind-xml' element is used for specifying XML specific databinding\r
174             properties and behavior for a specific field. 'bind-xml' may only appear\r
175             as a child of a 'field' element.\r
176         -->\r
177         <xsd:element name="bind-xml">\r
178             <xsd:annotation>\r
179                 <xsd:documentation>\r
180                     The 'bind-xml' element is used for specifying XML specific databinding\r
181                     properties and behavior for a specific field. 'bind-xml' may only appear\r
182                     as a child of a 'field' element.\r
183                 </xsd:documentation>\r
184             </xsd:annotation>\r
185             <xsd:complexType>\r
186                 \r
187                 <xsd:sequence>\r
188                     <xsd:element ref="class" minOccurs="0" maxOccurs="1"/>\r
189                     <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>\r
190                 </xsd:sequence>\r
191                 \r
192                 <!--\r
193                     An optional attribute used for specifying the XML name for the\r
194                     field associated with the 'bind-xml' element.\r
195                 -->\r
196                 <xsd:attribute name="name" type="xsd:QName"  use="optional">\r
197                     <xsd:annotation>\r
198                         <xsd:documentation>\r
199                             An optional attribute used for specifying the XML name for the\r
200                             field associated with the 'bind-xml' element.\r
201                         </xsd:documentation>\r
202                     </xsd:annotation>\r
203                 </xsd:attribute>\r
204                 \r
205                 <xsd:attribute name="type" type="xsd:NMTOKEN"  use="optional"/>\r
206                 \r
207                 <!--\r
208                     Allows specifying how Castor should automatically determines\r
209                     the XML name of this field when no name has been specified.\r
210                 -->\r
211                 <xsd:attribute name="auto-naming" use="optional">\r
212                     <xsd:annotation>\r
213                         <xsd:documentation>\r
214                             Allows specifying how Castor should automatically determines\r
215                             the XML name of this field when no name has been specified.\r
216                             In most cases the XML name is determined by using the field name,\r
217                             but in some cases the user may want to use the Class name of\r
218                             the field type. This attribute allows choosing between the\r
219                             two approaches. If this attribute is not specified, the field\r
220                             name is used as the XML name.\r
221                         </xsd:documentation>\r
222                     </xsd:annotation>\r
223                     <xsd:simpleType>\r
224                         <xsd:restriction base="xsd:string">\r
225                             <xsd:enumeration value="deriveByClass"/>\r
226                             <xsd:enumeration value="deriveByField"/>\r
227                         </xsd:restriction>\r
228                     </xsd:simpleType>\r
229                 </xsd:attribute>\r
230                 \r
231                 <!--\r
232                     Allows specifying a nested location path for this field,\r
233                     the value should just be a simplified XPath like value\r
234                     where names are separated by "/".\r
235                 -->\r
236                 <xsd:attribute name="location" type="xsd:string" use="optional">\r
237                     <xsd:annotation>\r
238                         <xsd:documentation>\r
239                             Allows specifying a nested location path for this field,\r
240                             the value should just be a simplified XPath like value\r
241                             where names are separated by "/".\r
242                         </xsd:documentation>\r
243                     </xsd:annotation>\r
244                 </xsd:attribute>\r
245                 \r
246                 <!-- Allows overriding the matching rule -->\r
247                 <xsd:attribute name="matches" type="xsd:string" use="optional"/>\r
248                 \r
249                 \r
250                 <!-- Signal that this field should be marshalled as a reference -->\r
251                 <xsd:attribute name="reference" type="xsd:boolean" use="optional"/>\r
252                 \r
253                 <!-- NodeType for the XML node -->\r
254                 <xsd:attribute name="node" use="optional">\r
255                     <xsd:simpleType>\r
256                         <xsd:restriction base="xsd:string">\r
257                             <xsd:enumeration value="attribute"/>\r
258                             <xsd:enumeration value="element"/>\r
259                             <xsd:enumeration value="namespace"/>\r
260                             <xsd:enumeration value="text"/>\r
261                         </xsd:restriction>\r
262                     </xsd:simpleType>\r
263                 </xsd:attribute>\r
264                 \r
265                 <xsd:attribute name="QName-prefix" type="xsd:NMTOKEN" use="optional"/>\r
266                 \r
267                 <!-- Signal that this field is transient for XML (ie should be ignored) -->\r
268                 <xsd:attribute name="transient" type="xsd:boolean" use="optional"/>\r
269                 \r
270             </xsd:complexType>\r
271         </xsd:element>\r
272         \r
273         \r
274         \r
275         <xsd:element name="ldap">\r
276             <xsd:complexType>\r
277                 <xsd:attribute name="name" type="xsd:NMTOKEN" use="optional"/>\r
278             </xsd:complexType>\r
279         </xsd:element>\r
280         \r
281         <xsd:element name="key-generator">\r
282             <xsd:complexType>\r
283                 <xsd:sequence>\r
284                     <xsd:element ref="param" minOccurs="0" maxOccurs="unbounded" />\r
285                 </xsd:sequence>\r
286                 <xsd:attribute name="name"  type="xsd:ID"     use="required"/>\r
287                 <xsd:attribute name="alias" type="xsd:string" use="optional"/>\r
288             </xsd:complexType>\r
289         </xsd:element>\r
290         \r
291         <xsd:element name="cache-type">\r
292             <xsd:complexType>\r
293                 <xsd:attribute name="type" type="xsd:string" use="optional" default="count-limited" />\r
294                 <xsd:attribute name="capacity" type="xsd:integer" use="optional"/>\r
295             </xsd:complexType>\r
296         </xsd:element>\r
297         \r
298         <xsd:element name="param">\r
299             <xsd:complexType>\r
300                 <xsd:attribute name="name"  type="xsd:string"  use="required"/>\r
301                 <xsd:attribute name="value" type="xsd:string"  use="required"/>\r
302             </xsd:complexType>\r
303         </xsd:element>\r
304         \r
305         \r
306         <xsd:complexType name="propertyType">\r
307             <xsd:sequence>\r
308                 <xsd:element name="name"  type="xsd:string"/>\r
309                 <xsd:element name="value" type="xsd:string"/>\r
310             </xsd:sequence>\r
311         </xsd:complexType>\r
312         \r
313         \r
314     </xsd:schema>\r