indent.
[working/Evergreen.git] / tools / xml.tmpl
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <chapter id="databaseschema">
3         <title>Database Schema</title>
4         <para>This is the schema for the Evergreen database.</para>
5         <!-- TMPL_LOOP name="schemas" -->
6         <section id="<!-- TMPL_VAR name="schema_sgmlid" -->">
7                 <title>Schema <!-- TMPL_VAR name="schema_dbk" --></title>
8                 <!-- TMPL_LOOP name="tables" -->
9                 <simplesect id="<!-- TMPL_VAR name="table_sgmlid" -->" xreflabel="<!-- TMPL_VAR name="schema_dbk" -->.<!-- TMPL_VAR name="table_dbk" -->">              
10                         <title><!-- TMPL_VAR name="table_dbk" --></title>
11                         <informaltable>
12                                 <tgroup cols="3">
13                                         <colspec colnum="1" colname="col1" colwidth="1*"/>
14                                         <colspec colnum="2" colname="col2" colwidth="1*"/>
15                                         <colspec colnum="3" colname="col3" colwidth="2*"/>
16                                         <thead>
17                                                 <row>
18                                                         <entry>Field</entry>
19                                                         <entry>Data Type</entry>
20                                                         <entry>Constraints and References</entry>
21                                                 </row>
22                                                 </thead>
23                                                 <tbody>
24                                                 <!-- TMPL_LOOP name="columns" -->
25                                                         <row>
26                                                                 <entry><!-- TMPL_VAR name="column_dbk" --></entry>
27                                                                 <entry><!-- TMPL_VAR name="column_type_dbk" --></entry>
28                                                                 <entry><para>
29                                                                         <!-- TMPL_LOOP name="column_constraints" -->
30                                                                                 <!-- TMPL_IF name="column_primary_key" -->
31                                                                                         PRIMARY KEY
32                                                                                 <!-- /TMPL_IF name="column_primary_key" -->                             
33                                                                         <!-- TMPL_IF name="column_unique" -->
34                                                                                 UNIQUE<!-- TMPL_IF name="column_unique_keygroup" -->#<!-- TMPL_VAR name="column_unique_keygroup" -->
35                                                                                 <!-- /TMPL_IF name="column_unique_keygroup" -->;
36                                                                                 <!-- /TMPL_IF name="column_unique" -->
37                                                                         <!-- /TMPL_LOOP name="column_constraints" -->
38                                                                         <!-- TMPL_IF name="column_constraint_notnull" -->
39                                                                                 NOT NULL;
40                                                                         <!-- /TMPL_IF name="column_constraint_notnull" -->
41                                                                         <!-- TMPL_IF name="column_default" -->
42                                                                                 DEFAULT <!-- TMPL_VAR name="column_default_dbk" -->;
43                                                                         <!-- /TMPL_IF name="column_default" -->
44                                                                         <!-- TMPL_LOOP name="column_constraints" -->
45                                                                                 <!-- TMPL_IF name="column_fk" -->
46                                                                                 <xref linkend="<!-- TMPL_VAR name="column_fk_sgmlid" -->"/>
47                                                                                 <!-- /TMPL_IF name="column_fk" -->
48                                                                         <!-- /TMPL_LOOP name="column_constraints" -->
49                                                                         </para></entry>
50                                                         </row>
51                                                 <!-- /TMPL_LOOP name="columns" -->
52                                                 </tbody>
53                                         </tgroup>
54                                 </informaltable>
55                                 <para>
56                                 <!-- TMPL_LOOP name="constraints" -->
57                                 <!-- TMPL_IF name="__FIRST__" -->
58                                         <variablelist>
59                                                 <title>Constraints on <!-- TMPL_VAR name="table_dbk" --></title>
60                                                 <!-- /TMPL_IF name="__FIRST__" -->
61                                                 <varlistentry>
62                                                         <term><!-- TMPL_VAR name="constraint_name_dbk" --></term>
63                                                         <listitem><para><!-- TMPL_VAR name="constraint_dbk" --></para></listitem>
64                                                 </varlistentry>
65                                                 <!-- TMPL_IF name="__LAST__" -->
66                                         </variablelist>
67                                 <!-- /TMPL_IF name="__LAST__" -->
68                                 <!-- /TMPL_LOOP name="constraints" -->
69                                 <!-- TMPL_LOOP name="fk_schemas" -->
70                                 <!-- TMPL_IF name="__FIRST__" -->
71                                         <itemizedlist>
72                                                 <title>
73                                                         Tables referencing <!-- TMPL_IF name="number_of_schemas" --><!-- TMPL_VAR ESCAPE="HTML" name="fk_schema_dbk" -->.<!-- /TMPL_IF name="number_of_schemas" --><!-- TMPL_VAR ESCAPE="HTML" name="fk_table_dbk" --> via Foreign Key Constraints
74                                                 </title>
75                                 <!-- /TMPL_IF name="__FIRST__" -->
76                                                         <listitem>
77                                                                 <para><xref linkend="<!-- TMPL_VAR name="fk_sgmlid" -->"/></para>
78                                                         </listitem>
79                                                         <!-- TMPL_IF name="__LAST__" -->
80                                         </itemizedlist>
81                                 <!-- /TMPL_IF name="__LAST__" -->
82                                 <!-- /TMPL_LOOP name="fk_schemas" -->
83                                 
84                                 <!-- TMPL_LOOP name="permissions" -->
85                                 <!-- TMPL_IF name="__FIRST__" -->
86                                         <variablelist>
87                                                 <title>Permissions on <!-- TMPL_IF name="number_of_schemas" --><!-- TMPL_VAR ESCAPE="HTML" name="schema" -->.<!-- /TMPL_IF name="number_of_schemas" --><!-- TMPL_VAR name="table_dbk" --></title>
88                                 <!-- /TMPL_IF name="__FIRST__" -->
89                                                 <varlistentry>
90                                                         <term><!-- TMPL_VAR name="user_dbk" --></term>
91                                                         <listitem>
92                                                                 <para>
93                                                                 <simplelist type="inline">
94                                                                 <!-- TMPL_IF name="select" -->
95                                                                         <member>Select</member>
96                                                                 <!-- /TMPL_IF name="select" -->
97                                                                 <!-- TMPL_IF name="insert" -->
98                                                                         <member>Insert</member>
99                                                                 <!-- /TMPL_IF name="insert" -->
100                                                                 <!-- TMPL_IF name="update" -->
101                                                                         <member>Update</member>
102                                                                 <!-- /TMPL_IF name="update" -->
103                                                                 <!-- TMPL_IF name="delete" -->
104                                                                         <member>Delete</member>
105                                                                 <!-- /TMPL_IF name="delete" -->
106                                                                 <!-- TMPL_IF name="rule" -->
107                                                                         <member>Rule</member>
108                                                                 <!-- /TMPL_IF name="rule" -->
109                                                                 <!-- TMPL_IF name="references" -->
110                                                                         <member>References</member>
111                                                                 <!-- /TMPL_IF name="references" -->
112                                                                 <!-- TMPL_IF name="trigger" -->
113                                                                          <member>Trigger</member>
114                                                                 <!-- /TMPL_IF name="trigger" -->
115                                                                 </simplelist>
116                                                                 </para>
117                                                         </listitem>
118                                                 </varlistentry>
119                                 <!-- TMPL_IF name="__LAST__" -->
120                                         </variablelist>
121                                 <!-- /TMPL_IF name="__LAST__" -->
122                                 <!-- /TMPL_LOOP name="permissions" -->
123                 </para>
124                 </simplesect>
125                 <!-- /TMPL_LOOP name="tables" -->
126         </section>
127         <!-- /TMPL_LOOP name="schemas" -->
128   </chapter>
129