Commit 3dff4fca authored by Oliver Bock's avatar Oliver Bock

Further refactoring to support full duplicate tagname prevention

* Compound elements are now solely used to define preference setting elements that have attributes
* Grouping of simple preference elements is now done by a new dedicated element called "group"
* Group elements are rendered as separate sections in the GUI
* Group can either hold a set of simple elements or a single compound element
* Compound elements have to be enclosed in a group as well to allow for overall duplicate checking
  -> Such groups have their "rendered" attribute set to "false" and don't need a title
  -> That's because their compound element (via its title) defines the GUI section header (as before)
parent 46601c19
......@@ -138,34 +138,49 @@
</xs:complexContent>
</xs:complexType>
<xs:complexType name="apps">
<xs:complexType name="compound">
<xs:sequence>
<xs:element name="title" type="title" minOccurs="1" maxOccurs="1" />
<xs:element name="app" type="app" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="attributes" type="attributes">
<xs:unique name="unique-preference-attributes-per-tag">
<xs:selector xpath=".//*"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
</xs:complexType>
<!-- compound element type -->
<!-- grouping types -->
<xs:complexType name="compound">
<xs:complexType name="apps">
<xs:sequence>
<xs:element name="title" type="title" minOccurs="1" maxOccurs="1" />
<xs:element name="app" type="app" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="group">
<xs:sequence>
<xs:element name="title" type="title" minOccurs="0" maxOccurs="1" />
<xs:choice minOccurs="1" maxOccurs="1">
<!-- The title element is required when the following non-compound elements are grouped -->
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="text" type="text" />
<xs:element name="boolean" type="boolean" />
<xs:element name="radio" type="radio" />
<xs:element name="dropdown" type="dropdown" />
</xs:choice>
<xs:element name="attributes" type="attributes">
<xs:unique name="unique-preference-attributes-per-tag">
<xs:selector xpath=".//*"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
<!--
* Single Compound elements have to be put into a group as well to allow for tag uniqueness verification
* If a compound element is grouped, the group's "rendered" attribute must be set to "false"
(the GUI doesn't support group nesting and compound elements are rendered like groups)
* The compound element's title is used instead of the group element's title
-->
<xs:element name="compound" type="compound" />
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="rendered" type="xs:boolean" default="true" />
</xs:complexType>
<!-- root element -->
......@@ -175,16 +190,12 @@
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="apps" type="apps" />
<xs:element name="compound" type="compound" />
<xs:element name="group" type="group" />
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:unique name="unique-attributed-preference-tags-per-venue">
<xs:selector xpath=".//psp:compound"/>
<xs:field xpath="@name"/>
</xs:unique>
<xs:unique name="unique-simple-preference-tags-per-venue">
<xs:selector xpath=".//psp:compound/*"/>
<xs:unique name="unique-preference-tags-per-venue">
<xs:selector xpath=".//psp:group/*"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment