Update schema xml template (xml.tmpl) for autogenerated schema from Evergreen database.
authorrsoulliere <robert.soulliere@mohawkcollege.ca>
Fri, 3 Jun 2011 19:31:21 +0000 (15:31 -0400)
committerrsoulliere <robert.soulliere@mohawkcollege.ca>
Fri, 3 Jun 2011 19:31:21 +0000 (15:31 -0400)
tools/xml.tmpl

index 7758a8f..e9b5121 100644 (file)
+
 <?xml version="1.0" encoding="UTF-8" ?>
 <chapter id="databaseschema">
        <title>Database Schema</title>
-       <para>This is the schema for the Evergreen database.</para>
+       <para>This is the schema for the Evergreen database.</para>     
+       <!-- TMPL_IF name="database_comment" -->
+       <!-- TMPL_VAR name="database_comment_dbk" -->
+       <!-- /TMPL_IF name="database_comment" -->
+       
        <!-- TMPL_LOOP name="schemas" -->
        <section id="<!-- TMPL_VAR name="schema_sgmlid" -->">
                <title>Schema <!-- TMPL_VAR name="schema_dbk" --></title>
-               <!-- TMPL_LOOP name="tables" -->
-               <simplesect id="<!-- TMPL_VAR name="table_sgmlid" -->" xreflabel="<!-- TMPL_VAR name="schema_dbk" -->.<!-- TMPL_VAR name="table_dbk" -->">              
-                       <title><!-- TMPL_VAR name="table_dbk" --></title>
-                       <informaltable>
-                               <tgroup cols="3">
-                                       <colspec colnum="1" colname="col1" colwidth="1*"/>
-                                       <colspec colnum="2" colname="col2" colwidth="1*"/>
-                                       <colspec colnum="3" colname="col3" colwidth="2*"/>
-                                       <thead>
-                                               <row>
-                                                       <entry>Field</entry>
-                                                       <entry>Data Type</entry>
-                                                       <entry>Constraints and References</entry>
-                                               </row>
-                                               </thead>
-                                               <tbody>
-                                               <!-- TMPL_LOOP name="columns" -->
-                                                       <row>
-                                                               <entry><!-- TMPL_VAR name="column_dbk" --></entry>
-                                                               <entry><!-- TMPL_VAR name="column_type_dbk" --></entry>
-                                                               <entry><para>
-                                                                       <!-- TMPL_LOOP name="column_constraints" -->
-                                                                               <!-- TMPL_IF name="column_primary_key" -->
-                                                                                       PRIMARY KEY
-                                                                               <!-- /TMPL_IF name="column_primary_key" -->                             
-                                                                       <!-- TMPL_IF name="column_unique" -->
-                                                                               UNIQUE<!-- TMPL_IF name="column_unique_keygroup" -->#<!-- TMPL_VAR name="column_unique_keygroup" -->
-                                                                               <!-- /TMPL_IF name="column_unique_keygroup" -->;
-                                                                               <!-- /TMPL_IF name="column_unique" -->
-                                                                       <!-- /TMPL_LOOP name="column_constraints" -->
-                                                                       <!-- TMPL_IF name="column_constraint_notnull" -->
-                                                                               NOT NULL;
-                                                                       <!-- /TMPL_IF name="column_constraint_notnull" -->
-                                                                       <!-- TMPL_IF name="column_default" -->
-                                                                               DEFAULT <!-- TMPL_VAR name="column_default_dbk" -->;
-                                                                       <!-- /TMPL_IF name="column_default" -->
-                                                                       <!-- TMPL_LOOP name="column_constraints" -->
-                                                                               <!-- TMPL_IF name="column_fk" -->
-                                                                               <xref linkend="<!-- TMPL_VAR name="column_fk_sgmlid" -->"/>
-                                                                               <!-- /TMPL_IF name="column_fk" -->
-                                                                       <!-- /TMPL_LOOP name="column_constraints" -->
-                                                                       </para></entry>
-                                                       </row>
-                                               <!-- /TMPL_LOOP name="columns" -->
-                                               </tbody>
-                                       </tgroup>
-                               </informaltable>
-                               <para>
-                               <!-- TMPL_LOOP name="constraints" -->
-                               <!-- TMPL_IF name="__FIRST__" -->
-                                       <variablelist>
-                                               <title>Constraints on <!-- TMPL_VAR name="table_dbk" --></title>
-                                               <!-- /TMPL_IF name="__FIRST__" -->
-                                               <varlistentry>
-                                                       <term><!-- TMPL_VAR name="constraint_name_dbk" --></term>
-                                                       <listitem><para><!-- TMPL_VAR name="constraint_dbk" --></para></listitem>
-                                               </varlistentry>
-                                               <!-- TMPL_IF name="__LAST__" -->
-                                       </variablelist>
-                               <!-- /TMPL_IF name="__LAST__" -->
-                               <!-- /TMPL_LOOP name="constraints" -->
-                               <!-- TMPL_LOOP name="fk_schemas" -->
-                               <!-- TMPL_IF name="__FIRST__" -->
-                                       <itemizedlist>
-                                               <title>
-                                                       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
-                                               </title>
-                               <!-- /TMPL_IF name="__FIRST__" -->
-                                                       <listitem>
-                                                               <para><xref linkend="<!-- TMPL_VAR name="fk_sgmlid" -->"/></para>
-                                                       </listitem>
-                                                       <!-- TMPL_IF name="__LAST__" -->
-                                       </itemizedlist>
-                               <!-- /TMPL_IF name="__LAST__" -->
-                               <!-- /TMPL_LOOP name="fk_schemas" -->
-                               
-                               <!-- TMPL_LOOP name="permissions" -->
-                               <!-- TMPL_IF name="__FIRST__" -->
-                                       <variablelist>
-                                               <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>
-                               <!-- /TMPL_IF name="__FIRST__" -->
-                                               <varlistentry>
-                                                       <term><!-- TMPL_VAR name="user_dbk" --></term>
-                                                       <listitem>
-                                                               <para>
-                                                               <simplelist type="inline">
-                                                               <!-- TMPL_IF name="select" -->
-                                                                       <member>Select</member>
-                                                               <!-- /TMPL_IF name="select" -->
-                                                               <!-- TMPL_IF name="insert" -->
-                                                                       <member>Insert</member>
-                                                               <!-- /TMPL_IF name="insert" -->
-                                                               <!-- TMPL_IF name="update" -->
-                                                                       <member>Update</member>
-                                                               <!-- /TMPL_IF name="update" -->
-                                                               <!-- TMPL_IF name="delete" -->
-                                                                       <member>Delete</member>
-                                                               <!-- /TMPL_IF name="delete" -->
-                                                               <!-- TMPL_IF name="rule" -->
-                                                                       <member>Rule</member>
-                                                               <!-- /TMPL_IF name="rule" -->
-                                                               <!-- TMPL_IF name="references" -->
-                                                                       <member>References</member>
-                                                               <!-- /TMPL_IF name="references" -->
-                                                               <!-- TMPL_IF name="trigger" -->
-                                                                        <member>Trigger</member>
-                                                               <!-- /TMPL_IF name="trigger" -->
-                                                               </simplelist>
-                                                               </para>
-                                                       </listitem>
-                                               </varlistentry>
-                               <!-- TMPL_IF name="__LAST__" -->
-                                       </variablelist>
-                               <!-- /TMPL_IF name="__LAST__" -->
-                               <!-- /TMPL_LOOP name="permissions" -->
-               </para>
-               </simplesect>
-               <!-- /TMPL_LOOP name="tables" -->
+               <para><!-- TMPL_VAR name="schema_comment_dbk" --></para>        
+       <!-- TMPL_LOOP name="tables" -->
+      <simplesect id="<!-- TMPL_VAR name="table_sgmlid" -->"
+               xreflabel="<!-- TMPL_VAR name="schema_dbk" -->.<!-- TMPL_VAR name="table_dbk" -->">
+        <title id="<!-- TMPL_VAR name="table_sgmlid" -->-title">
+         <!-- TMPL_IF name="view_definition" -->View:
+         <!-- TMPL_ELSE -->Table:
+         <!-- /TMPL_IF name="view_definition" -->
+         <!-- TMPL_VAR name="table_dbk" -->
+        </title>
+<!-- TMPL_IF name="table_comment" -->
+        <para>
+          <!-- TMPL_VAR name="table_comment_dbk" -->
+        </para>
+<!-- /TMPL_IF name="table_comment" -->
+               <formalpara>
+                       <title>Columns:</title>
+                       <simplelist type="horiz" columns="1">
+                       <member><emphasis class="italic">field name : datatype -- parameters, contraints and notes</emphasis></member>
+<!-- TMPL_LOOP name="columns" -->
+                       <member>
+                       <database class="field"><!-- TMPL_VAR name="column_dbk" --></database> : <database class="datatype"><!-- TMPL_VAR name="column_type_dbk" --></database> 
+--
+<!-- TMPL_LOOP name="column_constraints" -->
+<!-- TMPL_IF name="column_primary_key" -->
+                        <literal>PRIMARY KEY</literal>,
+<!-- /TMPL_IF name="column_primary_key" -->
+<!-- TMPL_IF name="column_unique" -->
+                        <literal>UNIQUE<!-- TMPL_IF name="column_unique_keygroup" -->#<!-- TMPL_VAR name="column_unique_keygroup" --><!-- /TMPL_IF name="column_unique_keygroup" --></literal>,
+<!-- /TMPL_IF name="column_unique" -->
+<!-- /TMPL_LOOP name="column_constraints" -->
+<!-- TMPL_IF name="column_constraint_notnull" -->
+                       <literal>NOT NULL</literal>, 
+<!-- /TMPL_IF name="column_constraint_notnull" -->
+<!-- TMPL_IF name="column_default" -->
+                       <literal>DEFAULT <!-- TMPL_VAR name="column_default_dbk" --></literal>, 
+<!-- /TMPL_IF name="column_default" -->
+<!-- TMPL_LOOP name="column_constraints" -->
+<!-- TMPL_IF name="column_fk" -->
+                       <literal>REFERENCES</literal> <xref linkend="<!-- TMPL_VAR name="column_fk_sgmlid" -->"/>. 
+<!-- /TMPL_IF name="column_fk" -->
+<!-- /TMPL_LOOP name="column_constraints" -->
+<!-- TMPL_IF name="column_comment" --> <!-- TMPL_VAR name="column_comment_dbk" --><!-- /TMPL_IF name="column_comment" -->
+                       </member>
+<!-- /TMPL_LOOP name="columns" -->
+               </simplelist>
+               </formalpara>
+<!-- TMPL_LOOP name="constraints" -->
+<!-- TMPL_IF name="__FIRST__" -->
+        <formalpara>
+       <title>Constraints:</title>
+       <simplelist type="horiz" columns="1">
+<!-- /TMPL_IF name="__FIRST__" -->
+          <member><database class="constraint"><!-- TMPL_VAR name="constraint_name_dbk" --></database> : <!-- TMPL_VAR name="constraint_dbk" --></member>
+<!-- TMPL_IF name="__LAST__" -->
+       </simplelist>
+       </formalpara>
+<!-- /TMPL_IF name="__LAST__" -->
+<!-- /TMPL_LOOP name="constraints" -->
+<!-- TMPL_LOOP name="indexes" -->
+<!-- TMPL_IF name="__FIRST__" -->
+       <formalpara>
+               <title>Indexes:</title>
+               <simplelist type="horiz" columns="1">
+<!-- /TMPL_IF name="__FIRST__" -->
+       <member><database class="index"><!-- TMPL_VAR name="index_name_dbk" --></database> : <!-- TMPL_VAR name="index_definition_dbk" --></member>
+<!-- TMPL_IF name="__LAST__" -->
+       </simplelist>
+       </formalpara>   
+<!-- /TMPL_IF name="__LAST__" -->
+<!-- /TMPL_LOOP name="indexes" -->
+<!-- TMPL_LOOP name="fk_schemas" -->
+<!-- TMPL_IF name="__FIRST__" -->
+       <formalpara>         
+               <title>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:</title>
+               <simplelist type="horiz" columns="2">
+<!-- /TMPL_IF name="__FIRST__" -->
+               <member><xref linkend="<!-- TMPL_VAR name="fk_sgmlid" -->"/></member> 
+<!-- TMPL_IF name="__LAST__" -->
+               </simplelist>
+        </formalpara>
+<!-- /TMPL_IF name="__LAST__" -->
+<!-- /TMPL_LOOP name="fk_schemas" -->
+
+<!-- TMPL_LOOP name="permissions" -->
+<!-- TMPL_IF name="__FIRST__" -->
+        <variablelist>
+          <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>
+<!-- /TMPL_IF name="__FIRST__" -->
+          <varlistentry>
+            <term><!-- TMPL_VAR name="user_dbk" --></term>
+            <listitem>
+              <para>
+                <simplelist type="inline">
+<!-- TMPL_IF name="select" -->
+                  <member>Select</member>
+<!-- /TMPL_IF name="select" -->
+<!-- TMPL_IF name="insert" -->
+                  <member>Insert</member>
+<!-- /TMPL_IF name="insert" -->
+<!-- TMPL_IF name="update" -->
+                  <member>Update</member>
+<!-- /TMPL_IF name="update" -->
+<!-- TMPL_IF name="delete" -->
+                  <member>Delete</member>
+<!-- /TMPL_IF name="delete" -->
+<!-- TMPL_IF name="rule" -->
+                  <member>Rule</member>
+<!-- /TMPL_IF name="rule" -->
+<!-- TMPL_IF name="references" -->
+                  <member>References</member>
+<!-- /TMPL_IF name="references" -->
+<!-- TMPL_IF name="trigger" -->
+                  <member>Trigger</member>
+<!-- /TMPL_IF name="trigger" -->
+                </simplelist>
+              </para>
+            </listitem>
+          </varlistentry>
+<!-- TMPL_IF name="__LAST__" -->
+        </variablelist>
+<!-- /TMPL_IF name="__LAST__" -->
+<!-- /TMPL_LOOP name="permissions" -->
+    </simplesect>
+<!-- /TMPL_LOOP name="tables" -->
+<!-- TMPL_LOOP name="functions" -->
+    <simplesect id="<!-- TMPL_VAR NAME="function_sgmlid" -->" xreflabel="<!-- TMPL_VAR NAME="schema_dbk" --><!-- TMPL_VAR NAME="function_dbk"-->">
+      <title id="<!-- TMPL_VAR NAME="function_sgmlid" -->-title"><!-- TMPL_VAR name="function_dbk" --></title>
+            <para>
+       <!-- TMPL_VAR name="function_comment_dbk" -->  
+       <segmentedlist>
+        <title>Function Properties</title>
+        <?dbhtml list-presentation="list"?>
+        <segtitle>Language</segtitle>
+        <segtitle>Return Type</segtitle>
+        <seglistitem>
+         <seg><!-- TMPL_VAR ESCAPE="HTML" name="function_language" --></seg>
+         <seg><!-- TMPL_VAR ESCAPE="HTML" name="function_returns" --></seg>
+        </seglistitem>
+       </segmentedlist>
+</para>
+</simplesect>
+<!-- /TMPL_LOOP name="functions" -->
+       
        </section>
        <!-- /TMPL_LOOP name="schemas" -->
   </chapter>