all: updated FSF address in GPL text
[sip-router] / doc / stylesheets / dbschema_k / xsl / dbdoc.xsl
1 <?xml version='1.0'?>
2 <!--
3  * $Id: db_berkeley.xsl 3142 2007-11-15 14:09:15Z henningw $
4  *
5  * XSL converter script for generating module parameter documentation.
6  *
7  * Copyright (C) 2008 Henning Westerholt
8  *
9  * This file is part of Kamailio, a free SIP server.
10  *
11  * Kamailio is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version
15  *
16  * Kamailio is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24  *
25  */
26 -->
27
28
29 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
30
31         <xsl:import href="common.xsl"/>
32     <!-- Create the file for the tables in module subdirectory -->
33         <xsl:template match="/">
34                 <xsl:variable name="createfile" select="concat($dir, concat('/', concat($prefix, '_db.xml')))"/>
35                 <xsl:document href="{$createfile}" method="xml" indent="yes" omit-xml-declaration="yes">
36
37 <xsl:comment xml:space="preserve">
38 WARNING:
39 This file was autogenerated from the XML source file
40 <xsl:value-of select="concat($dir, 'kamailio-', $prefix, '.xml.')"/>
41 It can be regenerated by running 'make dbdoc' in the db/schema
42 directory of the source code. You need to have xsltproc and
43 docbook-xsl stylesheets installed.
44 ALL CHANGES DONE HERE WILL BE LOST IF THE FILE IS REGENERATED&#x0A;</xsl:comment>
45
46 <xsl:text>&#x0A;</xsl:text>
47
48                         <chapter>
49                         <title>Module parameter for database access.</title>
50
51                         <section>
52                         <title><varname>db_url</varname> (String)</title>
53                         <para>URL to the database containing the data.</para>
54                         <para>
55                                 <!-- TODO use ro or rw URL depending on the module -->
56                                 <emphasis>Default value is <quote>mysql://openserro:openserro@localhost/openser</quote>.</emphasis>
57                         </para>
58                         <example>
59                                 <title>Set <varname>db_url</varname> parameter</title>
60                                 <programlisting format="linespecific">
61                                         <xsl:value-of select="concat('&#x0A;...&#x0A;modparam(&quot;', $prefix, '&quot;, &quot;db_url&quot;, &quot;dbdriver://username:password@dbhost/dbname&quot;)&#x0A;...&#x0A;')"/>
62                                 </programlisting>
63                         </example>
64                         </section>
65
66                         <xsl:apply-templates select="/database[1]"/>
67                         </chapter>
68                 </xsl:document>
69
70         </xsl:template>
71
72
73         <!-- create table name parameter -->
74         <xsl:template match="table">
75         <xsl:variable name="name">
76                 <xsl:call-template name="get-name"/>
77         </xsl:variable>
78         <section>
79                 <title><varname><xsl:value-of select="concat($name, '_table')"/></varname> (String)</title>
80                 <para><xsl:value-of select="concat('Name of the ', $name, ' table for the ', $prefix, ' module.')"/></para>
81                 <para>
82                         <emphasis>Default value is <quote><xsl:value-of select="$name"/></quote>.</emphasis>
83                 </para>
84                 <example>
85                         <title>Set <varname><xsl:value-of select="concat($name, '_table')"/></varname> parameter</title>
86                         <programlisting format="linespecific">
87                                 <xsl:value-of select="concat('&#x0A;...&#x0A;modparam(&quot;', $prefix, '&quot;, &quot;', $name, '_table&quot;, &quot;', $name, '&quot;)&#x0A;...&#x0A;')"/>
88                         </programlisting>
89                 </example>
90         </section>
91         <xsl:apply-imports/>
92         </xsl:template>
93
94         <!-- Create column parameter -->
95         <xsl:template match="column">
96         <xsl:variable name="table.name">
97                 <xsl:call-template name="get-name">
98                 <xsl:with-param name="select" select="parent::table"/>
99                 </xsl:call-template>
100         </xsl:variable>
101         <xsl:variable name="column.name">
102                 <xsl:call-template name="get-name"/>
103         </xsl:variable>
104         <section>
105                 <title><varname><xsl:value-of select="concat($table.name, '_', $column.name, '_col')"/></varname> (string)</title>
106                 <para><xsl:value-of select="description"/></para>
107                 <example>
108                         <title>Set <varname><xsl:value-of select="concat($table.name, '_', $column.name, '_col')"/></varname> parameter</title>
109                         <programlisting format="linespecific">
110                                 <xsl:value-of select="concat('&#x0A;...&#x0A;modparam(&quot;', $prefix, '&quot;, &quot;', $table.name, '_', $column.name, '_col&quot;, &quot;', $column.name, '&quot;)&#x0A;...&#x0A;')"/>
111                         </programlisting>
112                 </example>
113         </section>
114         </xsl:template>
115
116 </xsl:stylesheet>