Skip to content

Commit

Permalink
Merge pull request #15 from findologic/FINDO-9587_introduce_new_xml_s…
Browse files Browse the repository at this point in the history
…chema

FINDO-9587_introduce_new_xml_schema
  • Loading branch information
nello1nello authored Oct 18, 2022
2 parents a96f452 + dcb402e commit 9918248
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.findologic</groupId>
<artifactId>xml-export</artifactId>
<packaging>jar</packaging>
<version>1.6.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<name>xml-export</name>
<url>http://maven.apache.org</url>
</project>
76 changes: 37 additions & 39 deletions src/main/resources/findologic_20.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
<xs:element type="allAttributesType" name="allAttributes" minOccurs="1" maxOccurs="1"/>
<xs:element type="allKeywordsType" name="allKeywords" minOccurs="1" maxOccurs="1"/>
<xs:element type="salesFrequenciesType" name="salesFrequencies" minOccurs="1" maxOccurs="1"/>
<xs:element type="usergroupsType" name="usergroups" minOccurs="1" maxOccurs="1"/>
<xs:element type="groupsType" name="groups" minOccurs="1" maxOccurs="1"/>
<xs:element type="dateAddedsType" name="dateAddeds" minOccurs="1" maxOccurs="1"/>
<xs:element type="allPropertiesType" name="allProperties" minOccurs="1" maxOccurs="1"/>
<!-- Optional -->
<xs:element type="overriddenPricesType" name="overriddenPrices" minOccurs="0" maxOccurs="1"/>
<xs:element type="bonusesType" name="bonuses" minOccurs="0" maxOccurs="1"/>
<xs:element type="sortsType" name="sorts" minOccurs="0" maxOccurs="1"/>
<xs:element type="visibilitiesType" name="visibilities" minOccurs="0" maxOccurs="1"/>
Expand All @@ -61,7 +62,7 @@
<xs:sequence>
<xs:element type="imageType" name="image" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>

<xs:complexType name="imageType">
Expand All @@ -86,7 +87,7 @@
<xs:sequence>
<xs:element type="xs:string" name="keyword" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
Expand All @@ -97,14 +98,14 @@
<xs:sequence>
<xs:element type="propertiesType" name="properties" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>

<xs:complexType name="propertiesType">
<xs:sequence>
<xs:element type="keyValuePair" name="property" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>

<!-- Names -->
Expand Down Expand Up @@ -134,7 +135,7 @@
<xs:complexType>
<xs:simpleContent>
<xs:extension base="httpURI">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -156,7 +157,7 @@
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -167,12 +168,12 @@
<!-- Ordernumber -->
<xs:complexType name="allOrdernumbersType">
<xs:sequence>
<xs:element name="ordernumbers" maxOccurs="unbounded" minOccurs="0">
<xs:element name="ordernumbers" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="ordernumber" maxOccurs="unbounded" minOccurs="0"/>
<xs:element type="nonEmptyString" name="ordernumber" maxOccurs="unbounded" minOccurs="1"/>
</xs:sequence>
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
Expand All @@ -191,42 +192,26 @@
<xs:pattern value="http[s]?://.*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="money">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>

<!-- Usergroup support -->
<xs:simpleType name="usergroupHash">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="stringWithUsergroup">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:simpleType name="nonEmptyString">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="nameWithUsergroup">
<xs:simpleContent>
<xs:extension base="nonEmptyString">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="moneyWithUsergroup">
<xs:simpleContent>
<xs:extension base="money">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand Down Expand Up @@ -280,21 +265,21 @@

<xs:complexType name="salesFrequenciesType">
<xs:sequence>
<xs:element name="salesFrequency" minOccurs="0" maxOccurs="unbounded">
<xs:element name="salesFrequency" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:nonNegativeInteger">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="usergroupsType">
<xs:complexType name="groupsType">
<xs:sequence>
<xs:element type="usergroupHash" name="usergroup" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="nonEmptyString" name="group" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

Expand All @@ -304,7 +289,21 @@
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:dateTime">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="overriddenPricesType">
<xs:sequence>
<xs:element name="overriddenPrice" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -318,7 +317,7 @@
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -332,7 +331,7 @@
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -346,12 +345,11 @@
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:boolean">
<xs:attribute type="usergroupHash" name="usergroup" use="optional"/>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

</xs:schema>

0 comments on commit 9918248

Please sign in to comment.