Skip to content

Commit

Permalink
Merge pull request #16 from findologic/FINDO-9587_schema_copy
Browse files Browse the repository at this point in the history
FINDO-9587_schema_copy
  • Loading branch information
nello1nello authored Oct 18, 2022
2 parents 1622fa8 + 9918248 commit 7ee2276
Show file tree
Hide file tree
Showing 2 changed files with 356 additions and 1 deletion.
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>
355 changes: 355 additions & 0 deletions src/main/resources/findologic_20.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,355 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<!-- General structure and metadata, without items in detail. -->
<xs:element name="findologic">
<xs:complexType>
<xs:sequence>
<xs:element name="items">
<xs:complexType>
<xs:sequence>
<xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute type="xs:unsignedInt" name="start" use="required"/>
<xs:attribute type="xs:unsignedInt" name="count" use="required"/>
<xs:attribute type="xs:unsignedLong" name="total" use="required"/>
</xs:complexType>

<xs:unique name="id-is-unique">
<xs:selector xpath="item"/>
<xs:field xpath="@id"/>
</xs:unique>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="version"/>
</xs:complexType>
</xs:element>

<!-- Structure of items. -->
<xs:complexType name="itemType">
<xs:all>
<!-- Mandatory -->
<xs:element type="allOrdernumbersType" name="allOrdernumbers" minOccurs="1" maxOccurs="1"/>
<xs:element type="namesType" name="names" minOccurs="1" maxOccurs="1"/>
<xs:element type="summariesType" name="summaries" minOccurs="1" maxOccurs="1"/>
<xs:element type="descriptionsType" name="descriptions" minOccurs="1" maxOccurs="1"/>
<xs:element type="pricesType" name="prices" minOccurs="1" maxOccurs="1"/>
<xs:element type="urlsType" name="urls" minOccurs="1" maxOccurs="1"/>
<xs:element type="allImagesType" name="allImages" minOccurs="1" maxOccurs="1"/>
<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="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"/>
</xs:all>
<xs:attribute type="nonEmptyString" name="id" use="required"/>
</xs:complexType>

<!-- Images -->
<xs:complexType name="allImagesType">
<xs:sequence>
<xs:element type="imagesType" name="images" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="imagesType">
<xs:sequence>
<xs:element type="imageType" name="image" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>

<xs:complexType name="imageType">
<xs:simpleContent>
<xs:extension base="httpURI">
<xs:attribute type="imageTypeType" name="type" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:simpleType name="imageTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="thumbnail"/>
</xs:restriction>
</xs:simpleType>

<!-- Keywords -->
<xs:complexType name="allKeywordsType">
<xs:sequence>
<xs:element name="keywords" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="keyword" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<!-- Properties -->
<xs:complexType name="allPropertiesType">
<xs:sequence>
<xs:element type="propertiesType" name="properties" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<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="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>

<!-- Names -->
<xs:complexType name="namesType">
<xs:sequence>
<xs:element type="nameWithUsergroup" name="name" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<!-- Attributes -->
<xs:complexType name="allAttributesType">
<xs:sequence>
<xs:element name="attributes" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="keyValuesPair" name="attribute" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<!-- URLs -->
<xs:complexType name="urlsType">
<xs:sequence>
<xs:element name="url" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="httpURI">
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<!-- Summaries -->
<xs:complexType name="summariesType">
<xs:sequence>
<xs:element type="stringWithUsergroup" name="summary" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<!-- Prices -->
<xs:complexType name="pricesType">
<xs:sequence>
<xs:element name="price" minOccurs="1" 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>
</xs:element>
</xs:sequence>
</xs:complexType>

<!-- Ordernumber -->
<xs:complexType name="allOrdernumbersType">
<xs:sequence>
<xs:element name="ordernumbers" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="nonEmptyString" name="ordernumber" maxOccurs="unbounded" minOccurs="1"/>
</xs:sequence>
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<!-- Descriptions -->
<xs:complexType name="descriptionsType">
<xs:sequence>
<xs:element type="stringWithUsergroup" name="description" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<!-- Simple type variations -->
<xs:simpleType name="httpURI">
<xs:restriction base="xs:anyURI">
<xs:pattern value="http[s]?://.*"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="stringWithUsergroup">
<xs:simpleContent>
<xs:extension base="xs:string">
<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="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<!-- Generic structure for key with multiple values elements -->
<xs:complexType name="keyValuesPair">
<xs:sequence>
<xs:element name="key">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element type="attributeValues" name="values"/>
</xs:sequence>
</xs:complexType>

<!-- Generic structure for key-value-pair elements -->
<xs:complexType name="keyValuePair">
<xs:sequence>
<xs:element name="key">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="value">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="attributeValues">
<xs:sequence>
<xs:element name="value" maxOccurs="unbounded" minOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="16383"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>

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

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

<xs:complexType name="dateAddedsType">
<xs:sequence>
<xs:element name="dateAdded" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:dateTime">
<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>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="bonusesType">
<xs:sequence>
<xs:element name="bonus" 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>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="sortsType">
<xs:sequence>
<xs:element name="sort" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute type="nonEmptyString" name="usergroup" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="visibilitiesType">
<xs:sequence>
<xs:element name="visible" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:boolean">
<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 7ee2276

Please sign in to comment.