ilscipio/scipio-erp

View on GitHub
framework/entity/dtd/entity-config.xsd

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!-- ====================== Root Element ======================= -->
    <xs:element name="entity-config">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" ref="resource-loader"/>
                <xs:element ref="transaction-factory"/>
                <xs:element minOccurs="0" ref="connection-factory"/>
                <xs:element ref="debug-xa-resources"/>
                <xs:element maxOccurs="unbounded" ref="delegator"/>
                <xs:element maxOccurs="unbounded" ref="entity-model-reader"/>
                <xs:element maxOccurs="unbounded" ref="entity-group-reader"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="entity-eca-reader"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="entity-data-reader"/>
                <xs:element maxOccurs="unbounded" ref="field-type"/>
                <xs:element maxOccurs="unbounded" ref="datasource"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="resource-loader">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.resource-loader"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.resource-loader">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="class" use="required"/>
        <xs:attribute type="xs:string" name="prepend-env"/>
        <xs:attribute type="xs:string" name="prefix"/>
    </xs:attributeGroup>
    <xs:element name="transaction-factory">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="user-transaction-jndi"/>
                <xs:element minOccurs="0" ref="transaction-manager-jndi"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.transaction-factory"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.transaction-factory">
        <xs:attribute type="xs:string" name="class" use="required"/>
    </xs:attributeGroup>
    <xs:element name="user-transaction-jndi">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.user-transaction-jndi"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.user-transaction-jndi">
        <xs:attribute type="xs:string" name="jndi-server-name" use="required"/>
        <xs:attribute type="xs:string" name="jndi-name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="transaction-manager-jndi">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.transaction-manager-jndi"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.transaction-manager-jndi">
        <xs:attribute type="xs:string" name="jndi-server-name" use="required"/>
        <xs:attribute type="xs:string" name="jndi-name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="connection-factory">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.connection-factory"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.connection-factory">
        <xs:attribute type="xs:string" name="class" use="required"/>
    </xs:attributeGroup>
    <xs:element name="debug-xa-resources">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.debug-xa-resources"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.debug-xa-resources">
        <xs:attribute type="xs:string" name="value" use="required"/>
    </xs:attributeGroup>
    <xs:element name="delegator">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" ref="group-map"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.delegator"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.delegator">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="entity-model-reader" use="required"/>
        <xs:attribute type="xs:string" name="entity-group-reader" use="required"/>
        <xs:attribute type="xs:string" name="entity-eca-reader"/>
        <xs:attribute name="entity-eca-enabled" type="xs:boolean" default="true"/>
        <xs:attribute type="xs:string" name="entity-eca-handler-class-name" default="org.ofbiz.entityext.eca.DelegatorEcaHandler"/>
        <xs:attribute name="distributed-cache-clear-enabled"
                      type="xs:boolean" default="false"/>
        <xs:attribute type="xs:string" name="distributed-cache-clear-class-name" default="org.ofbiz.entityext.cache.EntityCacheServices"/>
        <xs:attribute type="xs:string" name="distributed-cache-clear-user-login-id" default="system"/>
        <xs:attribute type="xs:string" name="sequenced-id-prefix"/>
        <xs:attribute type="xs:string" name="default-group-name" default="org.ofbiz"/>
        <xs:attribute type="xs:string" name="key-encrypting-key"/>
    </xs:attributeGroup>
    <xs:element name="group-map">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.group-map"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.group-map">
        <xs:attribute type="xs:string" name="group-name" use="required"/>
        <xs:attribute type="xs:string" name="datasource-name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="entity-model-reader">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="resource"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.entity-model-reader"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.entity-model-reader">
        <xs:attribute type="xs:string" name="name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="resource">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.resource"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.resource">
        <xs:attribute type="xs:string" name="loader" use="required"/>
        <xs:attribute type="xs:string" name="location" use="required"/>
    </xs:attributeGroup>
    <xs:element name="entity-eca-reader">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="resource"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.entity-eca-reader"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.entity-eca-reader">
        <xs:attribute type="xs:string" name="name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="entity-group-reader">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="resource"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.entity-group-reader"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.entity-group-reader">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="loader"/>
        <xs:attribute type="xs:string" name="location"/>
    </xs:attributeGroup>
    <xs:element name="entity-data-reader">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="resource"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.entity-data-reader"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.entity-data-reader">
        <xs:attribute type="xs:string" name="name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="field-type">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.field-type"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.field-type">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="loader" use="required"/>
        <xs:attribute type="xs:string" name="location" use="required"/>
    </xs:attributeGroup>
    <xs:element name="datasource">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="sql-load-path"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="read-data"/>
                <xs:choice minOccurs="1" maxOccurs="1">
                    <xs:element minOccurs="0" maxOccurs="1" ref="jndi-jdbc"/>
                    <xs:element minOccurs="0" maxOccurs="1" ref="inline-jdbc"/>
                    <xs:element minOccurs="0" maxOccurs="1" ref="tyrex-dataSource"/>
                </xs:choice>
                <!-- <xs:any minOccurs="0" maxOccurs="unbounded"/> -->
            </xs:sequence>
            <xs:attributeGroup ref="attlist.datasource"/>
        </xs:complexType>
    </xs:element>
    <!-- main subelements of datasource are (sql-load-path*, (inline-jdbc | jndi-jdbc | tyrex-dataSource | ANY), but ANY must be used alone for certain XML parsers -->
    <xs:attributeGroup name="attlist.datasource">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="helper-class" use="required"/>
        <xs:attribute type="xs:string" name="field-type-name" use="required"/>
        <xs:attribute name="use-schemas" type="xs:boolean" default="true"/>
        <xs:attribute type="xs:string" name="schema-name"/>
        <xs:attribute name="check-on-start" type="xs:boolean" default="true"/>
        <xs:attribute name="add-missing-on-start" type="xs:boolean"
                      default="false"/>
        <xs:attribute name="use-pk-constraint-names" type="xs:boolean"
                      default="true"/>
        <xs:attribute name="check-pks-on-start" type="xs:boolean" default="true"/>
        <xs:attribute type="xs:nonNegativeInteger" name="constraint-name-clip-length" default="30"/>
        <xs:attribute name="use-proxy-cursor" type="xs:boolean" default="false"/>
        <xs:attribute type="xs:string" name="proxy-cursor-name" default="p_cursor"/>
        <xs:attribute type="xs:integer" name="result-fetch-size" default="-1"/>
        <xs:attribute name="use-foreign-keys" type="xs:boolean" default="true"/>
        <xs:attribute name="use-foreign-key-indices" type="xs:boolean"
                      default="true"/>
        <xs:attribute name="check-fks-on-start" type="xs:boolean" default="false"/>
        <xs:attribute name="check-fk-indices-on-start"
                      type="xs:boolean" default="false"/>
        <xs:attribute name="fk-style" default="name_constraint">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="name_constraint"/>
                    <xs:enumeration value="name_fk"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="use-fk-initially-deferred"
                      type="xs:boolean" default="false"/>
        <xs:attribute name="use-indices" type="xs:boolean" default="true">
            <xs:annotation><xs:documentation>Use manually declared indices (indexes)?</xs:documentation></xs:annotation>
        </xs:attribute>
        <xs:attribute name="use-indices-unique" type="xs:boolean" default="true">
            <xs:annotation><xs:documentation>For manually declared indices (if used), use the unique constraint?</xs:documentation></xs:annotation>
        </xs:attribute>
        <xs:attribute name="check-indices-on-start" type="xs:boolean" default="false"/>
        <xs:attribute name="check-modified-indices-on-start" type="xs:boolean" default="true">
            <xs:annotation>
                <xs:documentation>
                    When check-indices-on-start true, in addition to adding new indices, if supported by the database,
                    field modifications on existing indices are detected and the indices are deleted and recreated.
                    This is enabled by default only if check-indices-on-start is explicitly enabled as well, and
                    can be disabled separately in case of problems.
                    Currently supports databases:
                    * Postgresql (postgres, postnew)
                    SCIPIO: 2.1.0: Added.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="join-style" default="ansi">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="ansi"/>
                    <xs:enumeration value="ansi-no-parenthesis"/>
                    <xs:enumeration value="theta-oracle"/>
                    <xs:enumeration value="theta-mssql"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="alias-view-columns" type="xs:boolean" default="false"/>
        <xs:attribute name="always-use-constraint-keyword"
                      type="xs:boolean" default="false"/>
        <xs:attribute name="drop-fk-use-foreign-key-keyword"
              type="xs:boolean" default="false"/>
        <xs:attribute name="use-binary-type-for-blob"
                      type="xs:boolean" default="false"/>
        <xs:attribute name="use-order-by-nulls" type="xs:boolean" default="false"/>
        <xs:attribute name="offset-style" default="none">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="none"/>
                    <xs:enumeration value="fetch"/>
                    <xs:enumeration value="limit"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute type="xs:string" name="table-type"/>
        <xs:attribute type="xs:string" name="character-set"/>
        <xs:attribute type="xs:string" name="collate"/>
        <xs:attribute type="xs:integer" name="max-worker-pool-size" default="1"/>
        <!-- SCIPIO: If set to dynamic fixes the 'Specified key was too long; max key length is 767 bytes' issue (only for MySQL 5.6+ and MariaDB 10.1+) -->
        <!-- check https://dev.mysql.com/doc/refman/8.0/en/innodb-row-format.html & https://answers.launchpad.net/maria/+question/241612 for further info -->
        <xs:attribute name="row-format" default="none">
            <xs:simpleType>
                    <xs:restriction base="xs:token">
                        <xs:enumeration value="none"/>
                        <xs:enumeration value="redundant"/>
                        <xs:enumeration value="compact"/>
                        <xs:enumeration value="dynamic"/>
                        <xs:enumeration value="compressed"/>
                    </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:attributeGroup>
    <xs:element name="sql-load-path">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.sql-load-path"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.sql-load-path">
        <xs:attribute type="xs:string" name="path" use="required"/>
        <xs:attribute type="xs:string" name="prepend-env"/>
    </xs:attributeGroup>
    <xs:element name="read-data">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.read-data"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.read-data">
        <xs:attribute type="xs:string" name="reader-name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="inline-jdbc">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.inline-jdbc"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.inline-jdbc">
        <xs:attribute type="xs:string" name="jdbc-driver" use="required"/>
        <xs:attribute type="xs:string" name="jdbc-uri" use="required"/>
        <xs:attribute type="xs:string" name="jdbc-username" use="required"/>
        <xs:attribute type="xs:string" name="jdbc-password"/>
        <xs:attribute type="xs:string" name="jdbc-password-lookup"/>
        <xs:attribute name="isolation-level">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="None"/>
                    <xs:enumeration value="ReadCommitted"/>
                    <xs:enumeration value="ReadUncommitted"/>
                    <xs:enumeration value="RepeatableRead"/>
                    <xs:enumeration value="Serializable"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute type="xs:nonNegativeInteger" name="pool-maxsize" default="50"/>
        <xs:attribute type="xs:nonNegativeInteger" name="pool-minsize" default="2"/>
        <xs:attribute type="xs:nonNegativeInteger" name="idle-maxsize">
            <xs:annotation>
                <xs:documentation>
                    Maximum number of idle connections that should remain in the pool. Defaults to 50% of pool-maxsize and always greater than pool-minsize.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:nonNegativeInteger" name="time-between-eviction-runs-millis" default="600000">
            <xs:annotation>
                <xs:documentation>
                    Sets the number of milliseconds between eviction runs for idle connections.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:nonNegativeInteger" name="soft-min-evictable-idle-time-millis" default="600000">
            <xs:annotation>
                <xs:documentation>
                    Sets the minimum amount of time a connection may sit idle in the pool before it is eligible for eviction.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:nonNegativeInteger" name="pool-sleeptime" default="120000">
            <xs:annotation>
                <xs:documentation>
                    Sets the maximum amount of time (in milliseconds) to wait for a connection when the pool is exhausted
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:nonNegativeInteger" name="pool-lifetime" default="600000">
            <xs:annotation>
                <xs:documentation>
                    This parameter is currently not implemented
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:nonNegativeInteger" name="pool-deadlock-maxwait" default="300000">
            <xs:annotation>
                <xs:documentation>
                    This parameter is currently not implemented
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:nonNegativeInteger" name="pool-deadlock-retrywait" default="10000">
            <xs:annotation>
                <xs:documentation>
                    This parameter is currently not implemented
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:string" name="pool-jdbc-test-stmt">
            <xs:annotation>
                <xs:documentation>
                    Connection validation query
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:boolean" name="test-on-create" default="false">
            <xs:annotation>
                <xs:documentation>
                    Run validation query when a connection is created in the pool
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:boolean" name="test-on-borrow" default="false">
            <xs:annotation>
                <xs:documentation>
                    Run validation query when a connection is borrowed from pool
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:boolean" name="test-on-return" default="false">
            <xs:annotation>
                <xs:documentation>
                    Run validation query when a connection is returned to pool
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:boolean" name="test-while-idle" default="false">
            <xs:annotation>
                <xs:documentation>
                    Run validation query while connection is in idle in the pool with frequency set in time-between-eviction-runs-millis
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:string" name="pool-xa-wrapper-class">
            <xs:annotation>
                <xs:documentation>
                    This parameter is currently not implemented
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:attributeGroup>
    <xs:element name="jndi-jdbc">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.jndi-jdbc"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.jndi-jdbc">
        <xs:attribute type="xs:string" name="jndi-server-name" use="required"/>
        <xs:attribute type="xs:string" name="jndi-name" use="required"/>
        <xs:attribute name="isolation-level">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="None"/>
                    <xs:enumeration value="ReadCommitted"/>
                    <xs:enumeration value="ReadUncommitted"/>
                    <xs:enumeration value="RepeatableRead"/>
                    <xs:enumeration value="Serializable"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:attributeGroup>
    <xs:element name="tyrex-dataSource">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.tyrex-dataSource"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.tyrex-dataSource">
        <xs:attribute type="xs:string" name="dataSource-name" use="required"/>
        <xs:attribute name="isolation-level">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="None"/>
                    <xs:enumeration value="ReadCommitted"/>
                    <xs:enumeration value="ReadUncommitted"/>
                    <xs:enumeration value="RepeatableRead"/>
                    <xs:enumeration value="Serializable"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:attributeGroup>
    <xs:complexType name="any" mixed="true">
        <xs:sequence>
            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>