155 |
@item |
@item |
156 |
Appendix D @emph{Querying using regular expressions} |
Appendix D @emph{Querying using regular expressions} |
157 |
@*Version 4 complete. |
@*Version 4 complete. |
158 |
|
|
159 |
|
@item |
160 |
|
Appendixes E and F were written specifically for GNATS 4. |
161 |
@end itemize |
@end itemize |
162 |
|
|
163 |
@menu |
@menu |
169 |
* gnatsd:: The GNATS network server. |
* gnatsd:: The GNATS network server. |
170 |
* Access Control:: Controlling access to GNATS databases. |
* Access Control:: Controlling access to GNATS databases. |
171 |
* Regexps:: Querying using regular expressions. |
* Regexps:: Querying using regular expressions. |
172 |
|
* dbconfig recipes:: Useful dbconfig tricks. |
173 |
* Support:: GNATS related sites and mailing lists. |
* Support:: GNATS related sites and mailing lists. |
174 |
* Index:: |
* Index:: |
175 |
@end menu |
@end menu |
2009 |
|
|
2010 |
@c =============================================================== |
@c =============================================================== |
2011 |
|
|
2012 |
|
@node dbconfig recipes |
2013 |
|
@appendix @file{dbconfig} recipes |
2014 |
|
@cindex dbconfig |
2015 |
|
@cindex @file{dbconfig} recipes |
2016 |
|
|
2017 |
|
The @file{dbconfig} file (@ref{dbconfig file,,The @file{dbconfig} |
2018 |
|
file}) is the heart of any @sc{gnats} installation. It contains some |
2019 |
|
very powerful machinery, something which this appendix tries to |
2020 |
|
illustrate. |
2021 |
|
|
2022 |
|
We provide a range of examples that are both intended to be useful in |
2023 |
|
their own right and to serve as starting points or building blocks for |
2024 |
|
your own modifications. |
2025 |
|
|
2026 |
|
@subsubheading Provide Gnatsweb URL in initial response |
2027 |
|
|
2028 |
|
Sites that have Gnatsweb installed may wish to modify the response |
2029 |
|
e-mail which is sent to the submitter of a PR so that it includes a |
2030 |
|
URL where the status of the PR can be monitored. In order to allow |
2031 |
|
this, you should first create an entry in @file{gnatsd.user_access} |
2032 |
|
which allows viewing of PRs in your database |
2033 |
|
(@xref{gnatsd.user_access,,The @file{gnatsd.user_access} file}.) |
2034 |
|
|
2035 |
|
Next, locate the entry @code{mail-format |
2036 |
|
"initial-response-to-submitter"} in the @file{dbconfig} file of your |
2037 |
|
database and add the following @emph{before} the line reading ``The |
2038 |
|
individual assigned...'' in the @code{body} section: |
2039 |
|
|
2040 |
|
@verbatim |
2041 |
|
\nYou can follow the status of this report on\n\ |
2042 |
|
http://hostname/cgi-bin/scriptname?\n\ |
2043 |
|
cmd=view&database=dbname&user=username&\n\ |
2044 |
|
password=passwd&pr=%s\n\n\ |
2045 |
|
@end verbatim |
2046 |
|
|
2047 |
|
@noindent |
2048 |
|
Substitute @code{hostname}, @code{cgi-bin} and @code{scriptname} as |
2049 |
|
appropriate for the setup of your web server. The part before the |
2050 |
|
@samp{?} would typically look something like |
2051 |
|
@code{http://www.example.com/cgi-bin/gnatsweb.pl}. Substitute the |
2052 |
|
name of your database for @code{dbname}, and the username and password |
2053 |
|
of the user with @code{view} rights for @code{username} and |
2054 |
|
@code{passwd}. |
2055 |
|
|
2056 |
|
@noindent |
2057 |
|
Next, add a @code{Number} to the @code{fields} list statement inside |
2058 |
|
the @code{body} so it reads as follows: |
2059 |
|
|
2060 |
|
@verbatim |
2061 |
|
fields { "Category" "Number" "Number" "Responsible" |
2062 |
|
"Category" "Responsible" "Synopsis" |
2063 |
|
"Arrival-Date" } |
2064 |
|
@end verbatim |
2065 |
|
|
2066 |
|
@subsubheading State full name of responsible in initial response |
2067 |
|
|
2068 |
|
The initial e-mail response to the submitter of a PR identifies the |
2069 |
|
responsible person assigned to the PR as follows: ``The individual |
2070 |
|
assigned to look at your report is: @var{GNATS username}''. Some |
2071 |
|
sites may wish to modify this so that the full name of the responsible |
2072 |
|
person is used instead of the @sc{gnats} user name. |
2073 |
|
|
2074 |
|
The full name is contained in the @code{fullname} subfield of the |
2075 |
|
user's entry in the @file{responsible} file and can be accessed as |
2076 |
|
@code{Responsible[fullname]} (@pxref{administrative files,,Enumerated |
2077 |
|
field administrative files}.) |
2078 |
|
|
2079 |
|
The change is achieved by editing the @file{dbconfig} item |
2080 |
|
@code{mail-format "initial-response-to-submitter"} and changing the |
2081 |
|
@code{fields} part of the @code{Body} from |
2082 |
|
|
2083 |
|
@verbatim |
2084 |
|
fields { "Category" "Number" "Responsible" |
2085 |
|
"Category" "Responsible" "Synopsis" |
2086 |
|
"Arrival-Date" } |
2087 |
|
@end verbatim |
2088 |
|
|
2089 |
|
@noindent |
2090 |
|
to |
2091 |
|
|
2092 |
|
@verbatim |
2093 |
|
fields { "Category" "Number" "Responsible[fullname]" |
2094 |
|
"Category" "Responsible" "Synopsis" |
2095 |
|
"Arrival-Date" } |
2096 |
|
@end verbatim |
2097 |
|
|
2098 |
|
@subsubheading Append-only Audit-Trail |
2099 |
|
|
2100 |
|
The Audit-Trail of a PR is by default editable. For some |
2101 |
|
applications, one might want to make the Audit-Trail append-only, so |
2102 |
|
it provides a full and unchangeable case history. Also by default, |
2103 |
|
only certain changes, such as change of state and change of |
2104 |
|
responsible gets recorded in the Audit-Trail. In some cases, it might |
2105 |
|
also be convenient to have a way of inserting comments directly into |
2106 |
|
the Audit-Trail. |
2107 |
|
|
2108 |
|
The following procedure creates such an append-only Audit-Trail and |
2109 |
|
adds a PR field which makes it possible to register comments in the |
2110 |
|
Audit-Trail. |
2111 |
|
|
2112 |
|
@noindent |
2113 |
|
First, add the keyword @code{read-only} to the Audit-Trail field |
2114 |
|
definition in @file{dbconfig}. |
2115 |
|
|
2116 |
|
@noindent |
2117 |
|
Then, add the following field definition to @file{dbconfig}: |
2118 |
|
|
2119 |
|
@verbatim |
2120 |
|
field "Add-To-Audit-Trail" { |
2121 |
|
description "Add a log entry to the Audit Trail" |
2122 |
|
multitext { default "\n" } |
2123 |
|
on-change { |
2124 |
|
add-audit-trail |
2125 |
|
audit-trail-format { |
2126 |
|
format "**** Comment added by %s on %s ****\n %s\n\n" |
2127 |
|
fields { "$EditUserEmailAddr" "$CurrentDate" "$NewValue" |
2128 |
|
} |
2129 |
|
} |
2130 |
|
} |
2131 |
|
on-change { |
2132 |
|
set-field "Add-To-Audit-Trail" { "\n" } |
2133 |
|
} |
2134 |
|
} |
2135 |
|
@end verbatim |
2136 |
|
|
2137 |
|
@c =============================================================== |
2138 |
|
|
2139 |
@node Support |
@node Support |
2140 |
@appendix @sc{gnats} support |
@appendix @sc{gnats} support |
2141 |
|
|