| 6 | |
| 7 | == Wiki Edit Workflow Proposal == |
| 8 | |
| 9 | As wiki SPAM gets worse, as people start using trac for more critical |
| 10 | projects, and as I develop the plugin that implements my evil master |
| 11 | plan for world domination, there's going to need to be a lightweight, |
| 12 | trac-ish way of allowing plugins to do page edit workflow. I have |
| 13 | that need right now. I want to tackle this, I plan to post the result |
| 14 | on trac-hacks.org, but before I spend a lot of time going down a |
| 15 | development path, I think I should get some advice as to which path I |
| 16 | should take; it's looking more and more like trac itself will need to |
| 17 | be patched, and I'd prefer to do this in a way that the patch will |
| 18 | likely be accepted into mainstream. |
| 19 | |
| 20 | There appear to be (at least) two parts to this problem: (1) The |
| 21 | default viewable version of a wiki page needs to be selectable via an |
| 22 | extension point, not hardcoded as "highest version number", and (2) |
| 23 | the version of the page which a user edits when they hit "Edit This |
| 24 | Page" needs to be configurable, rather than "most recent". |
| 25 | |
| 26 | I'm starting to think that (1) is going to require a change to the |
| 27 | !WikiPage class, and (2) a change to !WikiModule. |
| 28 | |
| 29 | In !WikiPage, if version number is None then the default action is |
| 30 | determined by the ORDER BY sorting in a SELECT statement. I see three |
| 31 | choices here: |
| 32 | |
| 33 | * patch !WikiPage to add an IWikiPageVersionSelector extension point |
| 34 | (called before SELECT); this helps anyone implementing workflow |
| 35 | * patch !WikiModule to add an IWikiPageProvider extension point; then |
| 36 | !WikiPage implements IWikiPageProvider; this helps anyone using |
| 37 | alternate wiki page storage and/or workflow |
| 38 | * don't patch the code; just have my own plugin do the job via |
| 39 | overriding and subclassing !WikiModule, reassigning the 'WikiPage' |
| 40 | symbol at runtime, and/or other guerilla tactics; this helps nobody |
| 41 | other than myself |
| 42 | |
| 43 | In !WikiModule, right now an edit is hardcoded as "latest version" in |
| 44 | process_request. But you'd actually want the "Edit This Page" button |
| 45 | to edit the version you're looking at, or maybe the currently elected |
| 46 | version, not the latest version. This probably needs a trac.ini |
| 47 | configuration item to control it -- either another patch or another |
| 48 | override. |
| 49 | |
| 50 | Does anyone have any preference as to which of these routes I take? Feel free to edit this page... |
| 51 | |
| 52 | |
| 53 | |