How to automate system pages administration.
One can install and use EditedSystemPages macro (see MacroMarket) to get a list of edited system pages. Usually there is no reason to edit those pages, and the admin should protect those pages with acl.
Most admins would like to remove all system pages from the data directory, but FrontPage.
Here is a script to make this automatic.
First spike: MoveEditedSystemPages.py
This should be made like another mig script, so there's still a bit of work. The general idea is to move the files in a seperate directory if they are both underlay and standard pages and they do not have more than one revision. This is a pretty good heuristic here, and anyways the pages can be double-checked.
Please remove my name from this code or add your name, I don't want to get support email for other people stuff.
Sorry about this, I just noticed I left this in. :) -- TheAnarcat
Second, if you want to write a migration script, write one. This is a macro, which run automatically when you visit the page. You can take mig9 as template for this script.
Will do. Not sure I'll have time before you guys get 1.3 out though, so that's why I thought it'd be better to throw something in here, because I had to do it anyways. -- TheAnarcat
Last, few comments about this code:
- 'underlay.backup' is not good name, as the pages are not from underlay. edited-system-pages' is better name
- If would move all pages that are underlay pages ignoring the number of revisions. Then the admin can chcek each page and return it to the wiki if needed
I would not remove FrontPage or any of the translated versions, like 'פתיחה', as it is not a system page, but a wiki specific page.
How can I tell if it is a translation? Call me crazy, but in this case, shouldn't FrontPage be removed from the underlay altogether? -- TheAnarcat
FrontPage and its translations are a special case. They maybe should not be in underlay, but currently they are. To find all translations of a word, you can use this code:
Then when you have the list of pages to move, filter them with:1 pagesToMove = [name for name in pagesToMove if name not in frontPages]
-- NirSoffer 2004-11-25 22:08:31
I'm really sorry I didn't have time to do this properly and apologize if I had been, what's the word? brutal? :) -- TheAnarcat 2004-11-26 03:25:58