forked from geonetwork/core-geonetwork
-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema-labels.xsd
298 lines (280 loc) · 11.9 KB
/
schema-labels.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2001-2016 Food and Agriculture Organization of the
~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
~ and United Nations Environment Programme (UNEP)
~
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or (at
~ your option) any later version.
~
~ This program is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
~
~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
~ Rome - Italy. email: [email protected]
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="labels">
<xs:annotation>
<xs:documentation>A list of labels describing standard descriptors
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="element">
<xs:annotation>
<xs:documentation>A descriptor with label, definition, help text and
suggestions
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="element">
<xs:complexType>
<xs:all>
<xs:element ref="label" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>The descriptor label to display next
to the field
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="btnLabel" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Optional label to be addded to the add button.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="btnClass" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Optional CSS class to be added to the add button.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="description" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>The definition to be displayed in the help
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="help" minOccurs="0">
<xs:annotation>
<xs:documentation>More help (CDATA could be used to store HTML)
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="condition" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>CHECKME: Not really used ?</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="example" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Examples to be added to the help section
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="helper" minOccurs="0">
<xs:annotation>
<xs:documentation>List of suggestion to be displayed in edit mode to
help populating the field. It's ussually common values for a
field.
More than one helper could be define if needed to match different
scope of metadata (eg. metadata on dataset and metadata on
service).
In that case, a displayIf attribute is added to define when to
display that helper list.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="context" type="xs:NMTOKEN">
<xs:annotation>
<xs:documentation>Parent element name or full XPath</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="id" type="xs:decimal">
<xs:annotation>
<xs:documentation>An optional reference to the standard descriptor
identifier.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name" use="required" type="xs:NMTOKEN"/>
</xs:complexType>
</xs:element>
<xs:element name="condition" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="help" type="xs:string"/>
<xs:element name="label" type="xs:string"/>
<xs:element name="example" type="xs:string"/>
<xs:element name="helper">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="option">
<xs:annotation>
<xs:documentation>Suggestion is an HTML option</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="rel" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the element to be populated by the title
attribute of the option. That parameter allows to update 2 fields in
the editor at a time.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="relAtt" type="xs:string">
<xs:annotation>
<xs:documentation>Name of an attribute (eg. uom) to be populated by
the title attribute of the option. That parameter allows to update 2
fields in the editor at a time.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="sort" type="xs:boolean">
<xs:annotation>
<xs:documentation>Set this attribute to true to sort by alpha order.
By default, the helpers are displayed in the order define in labels
file.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="editorMode">
<xs:annotation>
<xs:documentation>By default, the list of suggestion is displayed in a
combo next to the element.
The layout may be customized by setting the editorMode attribute.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="radio">
<xs:annotation>
<xs:documentation>Simple radio displayed next to each other.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="suggestion">
<xs:annotation>
<xs:documentation>Suggestion list. Preserve existing value, but does not allow to type value not provided in the list.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="radio_withdesc">
<xs:annotation>
<xs:documentation>Radio button with label and the description
define in the title attribute.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="radio_linebreak">
<xs:annotation>
<xs:documentation>Radio button with line break between each of
them (maybe better to use CSS to define this).
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute ref="displayIf"/>
</xs:complexType>
</xs:element>
<xs:attribute name="displayIf" type="xs:string">
<xs:annotation>
<xs:documentation>
<![CDATA[
Conditional helpers which may define an xpath expression to evaluate if the xpath match.
The scope of the expression is defined by a variable named "$p1" whitch is the current node.
For example, to match a metadata on dataset:
```displayIf="$p1/ancestor::node()[name()='gmd:MD_Metadata']/gmd:identificationInfo/gmd:MD_DataIdentification or
$p1/ancestor::node()[name()='gmd:MD_Metadata']/gmd:identificationInfo/*[@gco:isoType='gmd:MD_DataIdentification']"```
and a metadata on service:
```displayIf="$p1/ancestor::node()[name()='gmd:MD_Metadata']/gmd:identificationInfo/srv:SV_ServiceIdentification"```
or to test a value of the node
```displayIf="gco:CharacterString[contains(., 'temporal resolution: ')]"```
The result of the displayIf XPath should be one or more nodes.
It does not expect a boolean. For example, this does not work
```displayIf="gco:CharacterString/contains(., 'temporal resolution: ')"``` which return true or false.
]]>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:element name="option">
<xs:complexType mixed="true">
<xs:attribute name="id" type="xs:NMTOKEN"/>
<xs:attribute name="title"/>
<xs:attribute name="value" use="required"/>
<xs:attribute type="xs:boolean" name="default" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="inspireInfo" type="xs:string"/>
<xs:element name="codelists">
<xs:annotation>
<xs:documentation>* Hide in edit mode : If some codelist needs to be
hidden
in edit mode, the hideInEditMode attribute could be added
to any entries.
eg.
<entry hideInEditMode="true">
This will restrict the number of available entries for end
user editors and keep all records ISO compatible when using
codelist (eg. harvested records could use codelist hidden
in local node and needs to be displayed in view mode).
By default, this attribute is not used.
* editorMode attribute allows to configure the editor form field.
* - not set -: simple combo box
* radio : radio button in one line
* radio_linebreak : radio button with line break
* radio_withdesc : radion button with line break and codelist entry
description
* select : select box with size set to the number of items if lower than
7 entries.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:element name="codelist">
<xs:complexType>
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:element name="entry">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element type="xs:string" name="code" maxOccurs="1" minOccurs="1"/>
<xs:element type="xs:string" name="label" maxOccurs="1" minOccurs="1"/>
<xs:element type="xs:string" name="description" maxOccurs="1" minOccurs="0"/>
</xs:choice>
<xs:attribute type="xs:boolean" name="hideInEditMode" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional"/>
<xs:attribute ref="displayIf" use="optional" />
<xs:attribute ref="sort" use="optional" />
<xs:attribute type="xs:string" name="alias" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:attribute type="xs:string" name="sort" fixed="fixed">
<xs:annotation>
<xs:documentation>
By default codelist are sorted in alphabetical order.
Use this attribute to sort them by the order defined
in the codelist definition file.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:schema>