| <?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. |
| --> |
| <!-- |
| *This is the DTD for the Open For Business Generic Entity Model entity definition XML file. |
| *This DTD is meant to be as simple as possible, and is modelled from the standard ejb deployment descriptor ejb-jar.xml. |
| --> |
| <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> |
| <!-- ====================== Root Element ======================= --> |
| <xs:element name="entitymodel"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="title"/> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="copyright"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="author"/> |
| <xs:element minOccurs="0" ref="version"/> |
| <xs:choice minOccurs="0" maxOccurs="unbounded"> |
| <xs:element ref="entity"/> |
| <xs:element ref="view-entity"/> |
| <xs:element ref="extend-entity"/> |
| </xs:choice> |
| </xs:sequence> |
| </xs:complexType> |
| </xs:element> |
| <!-- ================= Children of entitymodel =================== --> |
| <xs:element name="title" type="xs:string"/> |
| <xs:element name="description" type="xs:string"/> |
| <xs:element name="copyright" type="xs:string"/> |
| <xs:element name="author" type="xs:string"/> |
| <xs:element name="version" type="xs:string"/> |
| <!-- ================== entity ===================== --> |
| <xs:element name="entity"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element maxOccurs="unbounded" ref="field"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="prim-key"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="relation"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="index"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.entity"/> |
| </xs:complexType> |
| </xs:element> |
| <!-- see the children of entitymodel section for description, etc. --> |
| <xs:attributeGroup name="attlist.entity"> |
| <xs:attribute type="xs:string" name="entity-name" use="required"/> |
| <xs:attribute type="xs:string" name="table-name"/> |
| <xs:attribute type="xs:string" name="package-name" use="required"/> |
| <xs:attribute type="xs:string" name="default-resource-name"/> |
| <xs:attribute type="xs:string" name="dependent-on"/> |
| <xs:attribute type="xs:string" name="sequence-bank-size"/> |
| <xs:attribute name="enable-lock" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute name="no-auto-stamp" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute name="never-cache" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute name="auto-clear-cache" default="true"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute type="xs:string" name="title"/> |
| <xs:attribute type="xs:string" name="copyright"/> |
| <xs:attribute type="xs:string" name="author"/> |
| <xs:attribute type="xs:string" name="version"/> |
| </xs:attributeGroup> |
| <xs:element name="prim-key"> |
| <xs:complexType> |
| <xs:attributeGroup ref="attlist.prim-key"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.prim-key"> |
| <xs:attribute type="xs:string" name="field" use="required"/> |
| </xs:attributeGroup> |
| <!-- ==================== field ===================== --> |
| <xs:element name="field"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="validate"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.field"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.field"> |
| <xs:attribute type="xs:string" name="name" use="required"/> |
| <xs:attribute type="xs:string" name="col-name"/> |
| <xs:attribute type="xs:string" name="type" use="required"/> |
| <xs:attribute name="encrypt" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute name="enable-audit-log" default="false"> |
| <xs:annotation><xs:documentation>If this is set to true then whenever the value for this field on a record changes the Entity Engine will record the change in the EntityAuditLog entity. Defaults to false.</xs:documentation></xs:annotation> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| </xs:attributeGroup> |
| <xs:element name="validate"> |
| <xs:complexType> |
| <xs:attributeGroup ref="attlist.validate"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.validate"> |
| <xs:attribute type="xs:string" name="name" use="required"/> |
| </xs:attributeGroup> |
| <!-- ==================== relation ====================== --> |
| <!-- specifies whether or not the relation is a dependent one; ie if the related entity can exist without the main entity --> |
| <xs:element name="relation"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element maxOccurs="unbounded" ref="key-map"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.relation"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.relation"> |
| <xs:attribute name="type" use="required"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="one"/> |
| <xs:enumeration value="many"/> |
| <xs:enumeration value="one-nofk"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute type="xs:string" name="title"/> |
| <xs:attribute type="xs:string" name="rel-entity-name" use="required"/> |
| <xs:attribute type="xs:string" name="fk-name"/> |
| </xs:attributeGroup> |
| <xs:element name="key-map"> |
| <xs:complexType> |
| <xs:attributeGroup ref="attlist.key-map"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.key-map"> |
| <xs:attribute type="xs:string" name="field-name" use="required"/> |
| <xs:attribute type="xs:string" name="rel-field-name"/> |
| </xs:attributeGroup> |
| <!-- ==================== index ===================== --> |
| <xs:element name="index"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element maxOccurs="unbounded" ref="index-field"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.index"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.index"> |
| <xs:attribute type="xs:string" name="name" use="required"/> |
| <xs:attribute name="unique" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| </xs:attributeGroup> |
| <xs:element name="index-field"> |
| <xs:complexType> |
| <xs:attributeGroup ref="attlist.index-field"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.index-field"> |
| <xs:attribute type="xs:string" name="name" use="required"/> |
| </xs:attributeGroup> |
| <!-- ================== view-entity ===================== --> |
| <xs:element name="view-entity"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element maxOccurs="unbounded" ref="member-entity"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="alias-all"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="alias"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="view-link"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="relation"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.view-entity"/> |
| </xs:complexType> |
| </xs:element> |
| <!-- see the children of entitymodel section for description, etc. --> |
| <xs:attributeGroup name="attlist.view-entity"> |
| <xs:attribute type="xs:string" name="entity-name" use="required"/> |
| <xs:attribute type="xs:string" name="package-name" use="required"/> |
| <xs:attribute type="xs:string" name="dependent-on"/> |
| <xs:attribute type="xs:string" name="default-resource-name"/> |
| <xs:attribute name="never-cache" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute name="auto-clear-cache" default="true"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute type="xs:string" name="title"/> |
| <xs:attribute type="xs:string" name="copyright"/> |
| <xs:attribute type="xs:string" name="author"/> |
| <xs:attribute type="xs:string" name="version"/> |
| </xs:attributeGroup> |
| <xs:element name="member-entity"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.member-entity"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.member-entity"> |
| <xs:attribute type="xs:string" name="entity-alias" use="required"/> |
| <xs:attribute type="xs:string" name="entity-name" use="required"/> |
| </xs:attributeGroup> |
| <xs:element name="alias-all"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="exclude"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.alias-all"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.alias-all"> |
| <xs:attribute type="xs:string" name="entity-alias" use="required"/> |
| <xs:attribute type="xs:string" name="prefix"/> |
| <xs:attribute name="group-by" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute name="function"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="min"/> |
| <xs:enumeration value="max"/> |
| <xs:enumeration value="sum"/> |
| <xs:enumeration value="avg"/> |
| <xs:enumeration value="count"/> |
| <xs:enumeration value="count-distinct"/> |
| <xs:enumeration value="upper"/> |
| <xs:enumeration value="lower"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| </xs:attributeGroup> |
| <xs:element name="exclude"> |
| <xs:complexType> |
| <xs:attributeGroup ref="attlist.exclude"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.exclude"> |
| <xs:attribute type="xs:string" name="field" use="required"/> |
| </xs:attributeGroup> |
| <xs:element name="alias"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element minOccurs="0" ref="complex-alias"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.alias"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.alias"> |
| <xs:attribute type="xs:string" name="entity-alias"/> |
| <xs:attribute type="xs:string" name="name" use="required"/> |
| <xs:attribute type="xs:string" name="field"/> |
| <xs:attribute type="xs:string" name="col-alias"/> |
| <xs:attribute type="xs:string" name="prim-key"/> |
| <xs:attribute name="group-by" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| <xs:attribute name="function"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="min"/> |
| <xs:enumeration value="max"/> |
| <xs:enumeration value="sum"/> |
| <xs:enumeration value="avg"/> |
| <xs:enumeration value="count"/> |
| <xs:enumeration value="count-distinct"/> |
| <xs:enumeration value="upper"/> |
| <xs:enumeration value="lower"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| </xs:attributeGroup> |
| <xs:element name="complex-alias"> |
| <xs:annotation> |
| <xs:documentation> |
| In every SELECT statement, the fields that are normally used are really defined to be expressions. |
| This means for example that you can supply an expression like (discountPercent * 100) in place of just a field name. |
| The complex-alias tag is the Ofbiz way to do this. |
| |
| The argument to the right of operator = can be any operator valid for that data type on the database system you are using. |
| For example, *, +, -, and / are commonly available mathematical operators (min, max, sum, avg, count, count-distinct, upper, lower) |
| You can also use any operator on any data type supported on the underlying database system including string and date operators. |
| complex-alias can be as complex as you need by adding nested complex-alias statements and complex-alias-field |
| can use the same functions (min, max, count, count-distinct, sum, avg, upper, and lower) as the alias tag. |
| </xs:documentation> |
| </xs:annotation> |
| <xs:complexType> |
| <xs:choice minOccurs="0" maxOccurs="unbounded"> |
| <xs:element ref="complex-alias"/> |
| <xs:element ref="complex-alias-field"/> |
| </xs:choice> |
| <xs:attributeGroup ref="attlist.complex-alias"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.complex-alias"> |
| <xs:attribute type="xs:string" name="operator" use="required"/> |
| </xs:attributeGroup> |
| <xs:element name="complex-alias-field"> |
| <xs:complexType> |
| <xs:attributeGroup ref="attlist.complex-alias-field"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.complex-alias-field"> |
| <xs:attribute type="xs:string" name="entity-alias" use="required"/> |
| <xs:attribute type="xs:string" name="field" use="required"/> |
| <xs:attribute type="xs:string" name="default-value"/> |
| <xs:attribute name="function"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="min"/> |
| <xs:enumeration value="max"/> |
| <xs:enumeration value="sum"/> |
| <xs:enumeration value="avg"/> |
| <xs:enumeration value="count"/> |
| <xs:enumeration value="count-distinct"/> |
| <xs:enumeration value="upper"/> |
| <xs:enumeration value="lower"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| </xs:attributeGroup> |
| <xs:element name="view-link"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" ref="description"/> |
| <xs:element maxOccurs="unbounded" ref="key-map"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.view-link"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.view-link"> |
| <xs:attribute type="xs:string" name="entity-alias" use="required"/> |
| <xs:attribute type="xs:string" name="rel-entity-alias" use="required"/> |
| <xs:attribute name="rel-optional" default="false"> |
| <xs:simpleType> |
| <xs:restriction base="xs:token"> |
| <xs:enumeration value="true"/> |
| <xs:enumeration value="false"/> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:attribute> |
| </xs:attributeGroup> |
| |
| <xs:element name="extend-entity"> |
| <xs:complexType> |
| <xs:sequence> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="field"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="relation"/> |
| <xs:element minOccurs="0" maxOccurs="unbounded" ref="index"/> |
| </xs:sequence> |
| <xs:attributeGroup ref="attlist.extend-entity"/> |
| </xs:complexType> |
| </xs:element> |
| <xs:attributeGroup name="attlist.extend-entity"> |
| <xs:attribute type="xs:string" name="entity-name" use="required"/> |
| </xs:attributeGroup> |
| </xs:schema> |