To be able to use a Wiki as a Database we thought we should hack up some Macro. Markus Maier in fact wrote then two of them:
- attachment:?GetValues.py
- attachment:?GetUniqueValues.py These suppose you organize information in definition lists like:
Host::: ?SomeHost
IP::: 182.168.0.1
The definition term is the database key, the definition itself is the value. One Page with such definitions is a database record.
?GetUniqueValues
This macro shows a list of unique definition values from pages
- whose names match the given regular expression and
- who contain a definition with a certain heading
Usage:
<span class="createlink"><a href="/sw/wiki/ikiwiki.cgi?page=GetUniqueValues__40__PageRE__44__DefinitionTermRE__41__&from=TipsAnd%2FMoinMoin%2FDataBase&do=create" rel="nofollow">?</a>GetUniqueValues(PageRE,DefinitionTermRE)</span>
Examples: <span class="createlink"><a href="/sw/wiki/ikiwiki.cgi?page=GetUniqeVals__40__.__42__Service__44__Host__41__&from=TipsAnd%2FMoinMoin%2FDataBase&do=create" rel="nofollow">?</a>GetUniqeVals(.*Service,Host)</span>
might output the following:
Host ?SomeHost ?AnotherHost ?TestSystem
Get Values
This macro shows a list of pages
- whose names match the given regular expression and
- who contain a definition with a certain heading which optionally has a value matching a certain regular expresion
Usage:
[[GetValues(PageRE,DefinitionTermRE[,DefinitionValueRE])]]
Examples: <span class="createlink"><a href="/sw/wiki/ikiwiki.cgi?page=GetValues__40__.__42__Service__44__Host__41__&from=TipsAnd%2FMoinMoin%2FDataBase&do=create" rel="nofollow">?</a>GetValues(.*Service,Host)</span>
might output the following:
. ?FooService Host: ?FooHost . ?BarService Host: ?BarHost