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