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