xml/config.xsd
author František Kučera <franta-hg@frantovo.cz>
Tue, 26 Feb 2019 18:19:49 +0100
branchv_0
changeset 236 a3ec71fa8e17
parent 203 504c4ba56d1c
child 249 7655df0622ee
permissions -rw-r--r--
Avoid reusing/rewriting the DB connection properties. There was weird random errors while testing connection to multiple DB in parallel when one of them was meta connection to same DB connection. Two kinds of exception: 1) missing password 2) „Passing DB password as CLI parameter is insecure!“

<?xml version="1.0" encoding="UTF-8"?>
<!--
SQL-DK
Copyright © 2013 František Kučera (frantovo.cz)

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 3 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, see <http://www.gnu.org/licenses/>.
-->
<xs:schema
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified"
	targetNamespace="https://sql-dk.globalcode.info/xmlns/configuration"
	xmlns:c="https://sql-dk.globalcode.info/xmlns/configuration">
	
	<xs:element name="configuration">
		<xs:complexType>
			<xs:sequence>
				<xs:element minOccurs="0" maxOccurs="unbounded" ref="c:database"/>
				<xs:element minOccurs="0" ref="c:defaultFormatter"/>
				<xs:element minOccurs="0" maxOccurs="unbounded" ref="c:formatter"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="database">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="c:name"/>
				<xs:element ref="c:url"/>
				<xs:element minOccurs="0" ref="c:userName"/>
				<xs:element minOccurs="0" ref="c:password"/>
				<xs:element minOccurs="0" ref="c:driver"/>
				<xs:element minOccurs="0" maxOccurs="unbounded" ref="c:property"/>
				<xs:element minOccurs="0" ref="c:tunnel"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="name" type="xs:string"/>
	<xs:element name="url" type="xs:string"/>
	<xs:element name="userName" type="xs:string"/>
	<xs:element name="password" type="xs:string"/>
	<xs:element name="driver" type="xs:string"/>
	
	<xs:element name="property">
		<xs:complexType mixed="true">
			<xs:attribute name="name" use="required"/>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="tunnel">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="c:command"/>
				<xs:element minOccurs="0" maxOccurs="unbounded" ref="c:argument"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="command" type="xs:string"/>
	
	<xs:element name="argument">
		<xs:complexType mixed="true">
			<xs:attribute name="type">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:enumeration value="literal"/>
						<xs:enumeration value="host"/>
						<xs:enumeration value="port"/>
						<xs:enumeration value="env"/>
						<xs:enumeration value="dbProperty"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="defaultFormatter" type="xs:string"/>
	
	<xs:element name="formatter">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="c:name"/>
				<xs:element ref="c:class"/>
				<xs:element minOccurs="0" maxOccurs="unbounded" ref="c:property"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="class" type="xs:string"/>
	
</xs:schema>