# HG changeset patch # User Paul Boddie # Date 1382030006 -7200 # Node ID 90a5f79430e941376cf2b769148cdc533fff34b0 # Parent 6719176d28084202ef7b1fc839e118f4f6f874ed Added elementary and highly specific support for Confluence dashboard actions. diff -r 6719176d2808 -r 90a5f79430e9 README.txt --- a/README.txt Thu Oct 17 18:37:21 2013 +0200 +++ b/README.txt Thu Oct 17 19:13:26 2013 +0200 @@ -160,13 +160,20 @@ sites may also employ such actions, a redirect strategy perhaps makes more sense. To support this, the following resources are involved: + * scripts/dashboard.py * scripts/search.py * config/mailmanwiki-redirect The latter configuration file is also involved in identifier-to-page mapping, -but in this case it causes requests to the "dosearchsite" action to be -directed to the search.py script, which in turn redirects the request in a -suitable form to the MoinMoin "fullsearch" action. +but in this case it causes requests to the "dashboard" and "dosearchsite" +actions to be directed to the dashboard.py and search.py scripts respectively. + +The dashboard.py script merely redirects requests to the root of the site, +thus assuming that the front page is configured to show dashboard-like +information. + +The search.py script redirects search requests in a suitable form to the +MoinMoin "fullsearch" action. Identifying and Migrating Users ------------------------------- diff -r 6719176d2808 -r 90a5f79430e9 config/mailmanwiki-redirect --- a/config/mailmanwiki-redirect Thu Oct 17 18:37:21 2013 +0200 +++ b/config/mailmanwiki-redirect Thu Oct 17 19:13:26 2013 +0200 @@ -1,3 +1,4 @@ ScriptAlias /x "/var/www/mmwiki-scripts/redirect.py" ScriptAlias /pages/viewpage.action "/var/www/mmwiki-scripts/redirect.py" ScriptAlias /dosearchsite.action "/var/www/mmwiki-scripts/search.py" +ScriptAlias /dashboard.action "/var/www/mmwiki-scripts/dashboard.py" diff -r 6719176d2808 -r 90a5f79430e9 config/mailmanwiki-redirect-htaccess --- a/config/mailmanwiki-redirect-htaccess Thu Oct 17 18:37:21 2013 +0200 +++ b/config/mailmanwiki-redirect-htaccess Thu Oct 17 19:13:26 2013 +0200 @@ -9,3 +9,7 @@ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^dosearchsite.action /search.py [PT,L,QSA] + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^dashboard.action /dashboard.py [PT,L,QSA] diff -r 6719176d2808 -r 90a5f79430e9 scripts/dashboard.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/dashboard.py Thu Oct 17 19:13:26 2013 +0200 @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +""" +Handle Confluence wiki dashboard action requests. +""" + +import cgi, sys + +# An empty string means that the wiki is anchored at the site root. + +URL_PREFIX = "" + +def redirect(): + location = "%s/" % URL_PREFIX + + print """\ +Status: 302 Redirect to page +Location: %s +Content-Type: text/html + + +Redirecting to Page + +

Redirecting to Page

+

If you see this message, try following this link.

+ + +""" % (location, cgi.escape(location, True)) + sys.exit(0) + +if __name__ == "__main__": + redirect() + +# vim: tabstop=4 expandtab shiftwidth=4