1.1 --- a/README.txt Thu Oct 17 18:37:21 2013 +0200
1.2 +++ b/README.txt Thu Oct 17 19:13:26 2013 +0200
1.3 @@ -160,13 +160,20 @@
1.4 sites may also employ such actions, a redirect strategy perhaps makes more
1.5 sense. To support this, the following resources are involved:
1.6
1.7 + * scripts/dashboard.py
1.8 * scripts/search.py
1.9 * config/mailmanwiki-redirect
1.10
1.11 The latter configuration file is also involved in identifier-to-page mapping,
1.12 -but in this case it causes requests to the "dosearchsite" action to be
1.13 -directed to the search.py script, which in turn redirects the request in a
1.14 -suitable form to the MoinMoin "fullsearch" action.
1.15 +but in this case it causes requests to the "dashboard" and "dosearchsite"
1.16 +actions to be directed to the dashboard.py and search.py scripts respectively.
1.17 +
1.18 +The dashboard.py script merely redirects requests to the root of the site,
1.19 +thus assuming that the front page is configured to show dashboard-like
1.20 +information.
1.21 +
1.22 +The search.py script redirects search requests in a suitable form to the
1.23 +MoinMoin "fullsearch" action.
1.24
1.25 Identifying and Migrating Users
1.26 -------------------------------
2.1 --- a/config/mailmanwiki-redirect Thu Oct 17 18:37:21 2013 +0200
2.2 +++ b/config/mailmanwiki-redirect Thu Oct 17 19:13:26 2013 +0200
2.3 @@ -1,3 +1,4 @@
2.4 ScriptAlias /x "/var/www/mmwiki-scripts/redirect.py"
2.5 ScriptAlias /pages/viewpage.action "/var/www/mmwiki-scripts/redirect.py"
2.6 ScriptAlias /dosearchsite.action "/var/www/mmwiki-scripts/search.py"
2.7 +ScriptAlias /dashboard.action "/var/www/mmwiki-scripts/dashboard.py"
3.1 --- a/config/mailmanwiki-redirect-htaccess Thu Oct 17 18:37:21 2013 +0200
3.2 +++ b/config/mailmanwiki-redirect-htaccess Thu Oct 17 19:13:26 2013 +0200
3.3 @@ -9,3 +9,7 @@
3.4 RewriteCond %{REQUEST_FILENAME} !-f
3.5 RewriteCond %{REQUEST_FILENAME} !-d
3.6 RewriteRule ^dosearchsite.action /search.py [PT,L,QSA]
3.7 +
3.8 +RewriteCond %{REQUEST_FILENAME} !-f
3.9 +RewriteCond %{REQUEST_FILENAME} !-d
3.10 +RewriteRule ^dashboard.action /dashboard.py [PT,L,QSA]
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/scripts/dashboard.py Thu Oct 17 19:13:26 2013 +0200
4.3 @@ -0,0 +1,34 @@
4.4 +#!/usr/bin/env python
4.5 +
4.6 +"""
4.7 +Handle Confluence wiki dashboard action requests.
4.8 +"""
4.9 +
4.10 +import cgi, sys
4.11 +
4.12 +# An empty string means that the wiki is anchored at the site root.
4.13 +
4.14 +URL_PREFIX = ""
4.15 +
4.16 +def redirect():
4.17 + location = "%s/" % URL_PREFIX
4.18 +
4.19 + print """\
4.20 +Status: 302 Redirect to page
4.21 +Location: %s
4.22 +Content-Type: text/html
4.23 +
4.24 +<html>
4.25 +<head><title>Redirecting to Page</title></head>
4.26 +<body>
4.27 +<h1>Redirecting to Page</h1>
4.28 +<p>If you see this message, try following <a href="%s">this link</a>.</p>
4.29 +</body>
4.30 +</html>
4.31 +""" % (location, cgi.escape(location, True))
4.32 + sys.exit(0)
4.33 +
4.34 +if __name__ == "__main__":
4.35 + redirect()
4.36 +
4.37 +# vim: tabstop=4 expandtab shiftwidth=4