Skip to content

Commit

Permalink
[addoninfo] xml schemas
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
  • Loading branch information
andrewfg committed Nov 8, 2023
1 parent 418164d commit ff2ddaa
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 51 deletions.
102 changes: 51 additions & 51 deletions bundles/org.openhab.core.addon/schema/addon-1.0.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@
<xs:import namespace="https://openhab.org/schemas/config-description/v1.0.0"
schemaLocation="https://openhab.org/schemas/config-description-1.0.0.xsd"/>

<xs:element name="addon">
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="addon:addonType"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="connection" type="addon:connectionType" minOccurs="0"/>
<xs:element name="countries" type="addon:countryType" minOccurs="0">
<xs:annotation>
<xs:documentation>Comma-separated list of two-letter ISO country codes.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="service-id" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>The ID (service.pid or component.name) of the main add-on service, which can be configured through OSGi configuration admin service. Should only be used in combination with a config description definition. The default value is &lt;type&gt;.&lt;name&gt;</xs:documentation>
</xs:annotation>
</xs:element>
<xs:choice minOccurs="0">
<xs:element name="config-description" type="config-description:configDescription"/>
<xs:element name="config-description-ref" type="config-description:configDescriptionRef"/>
</xs:choice>
<xs:element name="discovery-methods" type="addon:discoveryMethodsType" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" type="config-description:idRestrictionPattern" use="required">
<xs:element name="addon" type="addon:addonInfo"/>

<xs:complexType name="addonInfo">
<xs:sequence>
<xs:element name="type" type="addon:addonType"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="connection" type="addon:connectionType" minOccurs="0"/>
<xs:element name="countries" type="addon:countryType" minOccurs="0">
<xs:annotation>
<xs:documentation>Comma-separated list of two-letter ISO country codes.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="service-id" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>The id is used to construct the UID of this add-on to &lt;type&gt;-&lt;name&gt;</xs:documentation>
<xs:documentation>The ID (service.pid or component.name) of the main add-on service, which can be configured through OSGi configuration admin service. Should only be used in combination with a config description definition. The default value is &lt;type&gt;.&lt;name&gt;</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:element>
<xs:choice minOccurs="0">
<xs:element name="config-description" type="config-description:configDescription"/>
<xs:element name="config-description-ref" type="config-description:configDescriptionRef"/>
</xs:choice>
<xs:element name="discovery-methods" type="addon:discoveryMethodsType" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" type="config-description:idRestrictionPattern" use="required">
<xs:annotation>
<xs:documentation>The id is used to construct the UID of this add-on to &lt;type&gt;-&lt;name&gt;</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>

<xs:simpleType name="addonType">
<xs:restriction base="xs:string">
Expand Down Expand Up @@ -81,31 +81,31 @@
</xs:restriction>
</xs:simpleType>

<xs:complexType name="discoveryMethodsType">
<xs:sequence>
<xs:element type="addon:discoveryMethodType" name="discovery-method" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="discoveryMethodsType">
<xs:sequence>
<xs:element type="addon:discoveryMethodType" name="discovery-method" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="discoveryMethodType">
<xs:sequence>
<xs:element type="xs:string" name="service-type"/>
<xs:element type="xs:string" name="mdns-service-type" minOccurs="0"/>
<xs:element type="addon:matchPropertiesType" name="match-properties" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="discoveryMethodType">
<xs:sequence>
<xs:element type="xs:string" name="service-type"/>
<xs:element type="xs:string" name="mdns-service-type" minOccurs="0"/>
<xs:element type="addon:matchPropertiesType" name="match-properties" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="matchPropertiesType">
<xs:sequence>
<xs:element type="addon:matchPropertyType" name="match-property" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="matchPropertiesType">
<xs:sequence>
<xs:element type="addon:matchPropertyType" name="match-property" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="matchPropertyType">
<xs:sequence>
<xs:element type="xs:string" name="name"/>
<xs:element type="xs:string" name="regex"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="matchPropertyType">
<xs:sequence>
<xs:element type="xs:string" name="name"/>
<xs:element type="xs:string" name="regex"/>
</xs:sequence>
</xs:complexType>

</xs:schema>
24 changes: 24 additions & 0 deletions bundles/org.openhab.core.addon/schema/addon-list-1.0.1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:addon="https://openhab.org/schemas/addon/v1.0.0"
xmlns:addon-list="https://openhab.org/schemas/addon-list/v1.0.0"
targetNamespace="https://openhab.org/schemas/addon-list/v1.0.0">

<xs:import namespace="https://openhab.org/schemas/addon/v1.0.0"
schemaLocation="https://openhab.org/schemas/addon-1.0.0.xsd"/>

<xs:element name="addon-list">
<xs:complexType>
<xs:sequence>
<xs:element name="addons" type="addon-list:addons"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name="addons">
<xs:sequence>
<xs:element name="addon" type="addon:addonInfo" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

</xs:schema>

0 comments on commit ff2ddaa

Please sign in to comment.