Author: doogie
Date: Sun Oct 4 19:01:44 2009 New Revision: 821576 URL: http://svn.apache.org/viewvc?rev=821576&view=rev Log: Make 2 reusable schema types, boolean, and aggregate-function. Modified: ofbiz/trunk/framework/entity/dtd/entitymodel.xsd Modified: ofbiz/trunk/framework/entity/dtd/entitymodel.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/dtd/entitymodel.xsd?rev=821576&r1=821575&r2=821576&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/dtd/entitymodel.xsd (original) +++ ofbiz/trunk/framework/entity/dtd/entitymodel.xsd Sun Oct 4 19:01:44 2009 @@ -23,6 +23,25 @@ --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <!-- ====================== Root Element ======================= --> + <xs:simpleType name="boolean"> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="aggregate-function"> + <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:element name="entitymodel"> <xs:complexType> <xs:sequence> @@ -68,38 +87,12 @@ <xs:attribute name="default-resource-name" type="xs:string"/> <xs:attribute name="dependent-on" type="xs:string"/> <xs:attribute name="sequence-bank-size" type="xs:string"/> - <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 name="extends-entity" type="xs:string"/> + <xs:attribute name="entity-type" type="xs:string"/> + <xs:attribute name="enable-lock" default="false" type="boolean"/> + <xs:attribute name="no-auto-stamp" default="false" type="boolean"/> + <xs:attribute name="never-cache" default="false" type="boolean"/> + <xs:attribute name="auto-clear-cache" default="true" type="boolean"/> <xs:attribute name="title" type="xs:string"/> <xs:attribute name="copyright" type="xs:string"/> <xs:attribute name="author" type="xs:string"/> @@ -127,29 +120,16 @@ <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="col-name" type="xs:string"/> <xs:attribute name="type" type="xs:string" 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:attribute name="encrypt" default="false" type="boolean"/> + <xs:attribute name="enable-audit-log" default="false" type="boolean"> <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:attribute name="not-null" default="false"> + <xs:attribute name="not-null" default="false" type="boolean"> <xs:annotation> <xs:documentation> This makes the field NOT NULL on the database (like primary key fields). @@ -159,12 +139,6 @@ 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"> @@ -221,14 +195,7 @@ </xs:element> <xs:attributeGroup name="attlist.index"> <xs:attribute name="name" type="xs:string" 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:attribute name="unique" default="false" type="boolean"/> </xs:attributeGroup> <xs:element name="index-field"> <xs:complexType> @@ -260,22 +227,8 @@ <xs:attribute name="package-name" type="xs:string" use="required"/> <xs:attribute name="dependent-on" type="xs:string"/> <xs:attribute name="default-resource-name" type="xs:string"/> - <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 name="never-cache" default="false" type="boolean"/> + <xs:attribute name="auto-clear-cache" default="true" type="boolean"/> <xs:attribute name="title" type="xs:string"/> <xs:attribute name="copyright" type="xs:string"/> <xs:attribute name="author" type="xs:string"/> @@ -305,28 +258,8 @@ <xs:attributeGroup name="attlist.alias-all"> <xs:attribute name="entity-alias" type="xs:string" use="required"/> <xs:attribute name="prefix" type="xs:string"/> - <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:attribute name="group-by" default="false" type="boolean"/> + <xs:attribute name="function" type="aggregate-function"/> </xs:attributeGroup> <xs:element name="exclude"> <xs:complexType> @@ -351,28 +284,8 @@ <xs:attribute name="field" type="xs:string"/> <xs:attribute name="col-alias" type="xs:string"/> <xs:attribute name="prim-key" type="xs:string"/> - <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:attribute name="group-by" default="false" type="boolean"/> + <xs:attribute name="function" type="aggregate-function"/> </xs:attributeGroup> <xs:element name="complex-alias"> <xs:annotation> @@ -408,20 +321,7 @@ <xs:attribute name="entity-alias" type="xs:string" use="required"/> <xs:attribute name="field" type="xs:string" use="required"/> <xs:attribute name="default-value" type="xs:string"/> - <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:attribute name="function" type="aggregate-function"/> </xs:attributeGroup> <xs:element name="view-link"> <xs:complexType> @@ -436,14 +336,7 @@ <xs:attributeGroup name="attlist.view-link"> <xs:attribute name="entity-alias" type="xs:string" use="required"/> <xs:attribute name="rel-entity-alias" type="xs:string" 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:attribute name="rel-optional" default="false" type="boolean"/> </xs:attributeGroup> <xs:element name="entity-condition"> <xs:complexType> @@ -469,14 +362,7 @@ </xs:simpleType> </xs:attribute> <!-- TODO: variation on filter-by-date to easily compare from/thru date to date in another field, ie: alias.from_date <= rel_alias.date_field and (alias.thru_date > rel_alias.date_field or alias.thru_date is null) --> - <xs:attribute name="distinct" 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="distinct" default="false" type="boolean"/> </xs:attributeGroup> <xs:element name="condition-expr"> <xs:complexType> @@ -505,14 +391,7 @@ <xs:attribute name="rel-entity-alias" type="xs:string"/> <xs:attribute name="rel-field-name" type="xs:string"/> <xs:attribute name="value" type="xs:string"/> - <xs:attribute name="ignore-case" 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="ignore-case" default="false" type="boolean"/> </xs:attributeGroup> <xs:element name="condition-list"> <xs:complexType> |
Free forum by Nabble | Edit this page |