Bringing the DTD more into line with Andrew's current practice

This commit is contained in:
sb 2008-01-29 11:08:52 +00:00
parent 8d7697cb26
commit 981c40b57d

View file

@ -13,7 +13,7 @@
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> <!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- <!--
$Revision: 1.2 $ $Revision: 1.3 $
--> -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> <!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
@ -47,7 +47,7 @@
<!ENTITY % Permissions "none|read|insert|noedit|edit|all" > <!ENTITY % Permissions "none|read|insert|noedit|edit|all" >
<!-- <!--
data types which can be used in a definition to provide validation - data types which can be used in a typedef to provide validation -
e.g. a string can be used with a regexp or a scalar can be used with e.g. a string can be used with a regexp or a scalar can be used with
min and max values min and max values
string: varchar java.sql.Types.VARCHAR string: varchar java.sql.Types.VARCHAR
@ -76,7 +76,7 @@
list : a list of some other entity that links to me (i.e. the 'one' end of list : a list of some other entity that links to me (i.e. the 'one' end of
a one-to-many link); a one-to-many link);
link : a many to many link (via a link table); link : a many to many link (via a link table);
defined : a type defined by a definition. defined : a type defined by a typedef.
--> -->
<!ENTITY % ComplexDataTypes "entity|link|list|defined" > <!ENTITY % ComplexDataTypes "entity|link|list|defined" >
@ -109,13 +109,22 @@
<!-- Elements --> <!-- Elements -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> <!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- the application that the document describes: required top level element --> <!--
<!ELEMENT application ( documentation?, content?, definition*, group*, entity*)> the application that the document describes: required top level element
name: the name of this application
version: the version number of this application
assembly: C# implementation detail, should not be here
namespace: C# implementation detail, should not be here
-->
<!ELEMENT application ( documentation?, content?, type*, typedef*, group*, entity*)>
<!ATTLIST application <!ATTLIST application
name CDATA #REQUIRED name CDATA #REQUIRED
assembly CDATA #IMPLIED
namespace CDATA #IMPLIED
version CDATA #IMPLIED> version CDATA #IMPLIED>
<!-- <!--
the definition of a defined type. At this stage a defined type is either the definition of a defined type. At this stage a defined type is either
a string in which case it must have size and pattern, or a string in which case it must have size and pattern, or
a scalar in which case it must have minimum and/or maximum a scalar in which case it must have minimum and/or maximum
@ -124,16 +133,16 @@
Validation may be done client-side and/or server-side at application layer Validation may be done client-side and/or server-side at application layer
and/or server side at database layer. and/or server side at database layer.
name: the name of this definition name: the name of this typedef
type: the simple type on which this defined type is based type: the simple type on which this defined type is based
size: the data size of this defined type size: the data size of this defined type
pattern: a regular expression which values for this type must match pattern: a regular expression which values for this type must match
minimum: the minimum value for this type (if base type is scalar) minimum: the minimum value for this type (if base type is scalar)
maximum: the maximum value for this type (if base type is scalar) maximum: the maximum value for this type (if base type is scalar)
--> -->
<!ELEMENT definition (documentation?, help*) > <!ELEMENT typedef (documentation?, in-implementation*, help*) >
<!ATTLIST definition <!ATTLIST typedef
name CDATA #REQUIRED name CDATA #REQUIRED
type (%DefinableDataTypes;) #REQUIRED type (%DefinableDataTypes;) #REQUIRED
size CDATA #IMPLIED size CDATA #IMPLIED
@ -141,7 +150,19 @@
minimum CDATA #IMPLIED minimum CDATA #IMPLIED
maximum CDATA #IMPLIED> maximum CDATA #IMPLIED>
<!--
information about how to translate a type into types known to different target
languages. TODO: Once again I'm not wholly comfortable with the name; I'm not
really comfortable that this belongs in ADL at all.
target: the target language
value: the type to use in that target language
-->
<!ELEMENT in-implementation (documentation?)>
<!ATTLIST in-implementation
target CDATA #REQUIRED
value CDATA #REQUIRED>
<!-- <!--
a group of people with similar permissions to one another a group of people with similar permissions to one another
@ -165,12 +186,17 @@
natural-key: if present, the name of a property of this entity which forms natural-key: if present, the name of a property of this entity which forms
a natural primary key [NOTE: Only partly implemented. NOTE: much of a natural primary key [NOTE: Only partly implemented. NOTE: much of
the present implementation assumes all primary keys will be the present implementation assumes all primary keys will be
integers. This needs to be fixed!] integers. This needs to be fixed!] TODO: remove; replace with the
'key' element, below.
table: the name of the table in which this entity is stored. TODO: more thought
--> -->
<!ELEMENT entity ( documentation?, content?, property*, permission*, (form | page | list)*)> <!ELEMENT entity ( documentation?, content?,
(property | key | one-to-many | many-to-many | many-to-one)*,
permission*, (form | page | list)*)>
<!ATTLIST entity <!ATTLIST entity
name CDATA #REQUIRED name CDATA #REQUIRED
natural-key CDATA #IMPLIED> natural-key CDATA #IMPLIED
table CDATA #IMPLIED>
<!-- <!--
contains documentation on the element which immediately contains it. TODO: contains documentation on the element which immediately contains it. TODO:
@ -179,6 +205,11 @@
--> -->
<!ELEMENT documentation (#PCDATA)> <!ELEMENT documentation (#PCDATA)>
<!-- an explicit primary key, possibly compound -->
<!ELEMENT key (property*)>
<!-- <!--
a property (field) of an entity (table) a property (field) of an entity (table)
@ -186,7 +217,7 @@
type: the type of this property. type: the type of this property.
default: the default value of this property. There will probably be default: the default value of this property. There will probably be
magic values of this! magic values of this!
definition: name of the definition to use, it type = 'defined'. typedef: name of the typedef to use, it type = 'defined'.
distinct: distinct='system' required that every value in the system distinct: distinct='system' required that every value in the system
will be distinct (i.e. natural primary key); will be distinct (i.e. natural primary key);
distinct='user' implies that the value may be used by users distinct='user' implies that the value may be used by users
@ -205,6 +236,13 @@
concrete: if set to 'false', this property is not stored in the concrete: if set to 'false', this property is not stored in the
database but must be computed (manually written code must database but must be computed (manually written code must
be provided to support this) be provided to support this)
column: name of the column in a SQL database table in which this property
is stored. TODO: Think about this.
unsaved-value:
of a property whose persistent value is set on first being
committed to persistent store, the value which it holds before
it has been committed
--> -->
<!ELEMENT property ( documentation?, permission*, option*, prompt*, help*, ifmissing*)> <!ELEMENT property ( documentation?, permission*, option*, prompt*, help*, ifmissing*)>
@ -212,13 +250,15 @@
name CDATA #REQUIRED name CDATA #REQUIRED
type (%AllDataTypes;) #REQUIRED type (%AllDataTypes;) #REQUIRED
default CDATA #IMPLIED default CDATA #IMPLIED
definition CDATA #IMPLIED typedef CDATA #IMPLIED
distinct (none|all|user|system) #IMPLIED distinct (none|all|user|system) #IMPLIED
entity CDATA #IMPLIED entity CDATA #IMPLIED
farkey CDATA #IMPLIED farkey CDATA #IMPLIED
required %Boolean; #IMPLIED required %Boolean; #IMPLIED
size CDATA #IMPLIED size CDATA #IMPLIED
concrete %Boolean; #IMPLIED> concrete %Boolean; #IMPLIED
column CDATA #IMPLIED
unsaved-value CDATA #IMPLIED>
<!-- <!--
one of an explicit list of optional values a property may have one of an explicit list of optional values a property may have
@ -272,7 +312,7 @@
<!-- <!--
helptext about a property of an entity, or a field of a page, form or helptext about a property of an entity, or a field of a page, form or
list, or a definition. Typically there will be only one of these per property list, or a typedef. Typically there will be only one of these per property
per locale; if there are more than one all those matching the locale may per locale; if there are more than one all those matching the locale may
be concatenated, or just one may be used. be concatenated, or just one may be used.