wiki:stevegt

Version 2 (modified by stevegt, 18 years ago) (diff)

wiki edit workflow proposal

stevegt

ListTags(stevegt)?

TagIt(user)?

Wiki Edit Workflow Proposal

As wiki SPAM gets worse, as people start using trac for more critical projects, and as I develop the plugin that implements my evil master plan for world domination, there's going to need to be a lightweight, trac-ish way of allowing plugins to do page edit workflow. I have that need right now. I want to tackle this, I plan to post the result on trac-hacks.org, but before I spend a lot of time going down a development path, I think I should get some advice as to which path I should take; it's looking more and more like trac itself will need to be patched, and I'd prefer to do this in a way that the patch will likely be accepted into mainstream.

There appear to be (at least) two parts to this problem: (1) The default viewable version of a wiki page needs to be selectable via an extension point, not hardcoded as "highest version number", and (2) the version of the page which a user edits when they hit "Edit This Page" needs to be configurable, rather than "most recent".

I'm starting to think that (1) is going to require a change to the WikiPage class, and (2) a change to WikiModule.

In WikiPage, if version number is None then the default action is determined by the ORDER BY sorting in a SELECT statement. I see three choices here:

  • patch WikiPage to add an IWikiPageVersionSelector extension point

(called before SELECT); this helps anyone implementing workflow

  • patch WikiModule to add an IWikiPageProvider extension point; then

WikiPage implements IWikiPageProvider; this helps anyone using alternate wiki page storage and/or workflow

  • don't patch the code; just have my own plugin do the job via

overriding and subclassing WikiModule, reassigning the 'WikiPage' symbol at runtime, and/or other guerilla tactics; this helps nobody other than myself

In WikiModule, right now an edit is hardcoded as "latest version" in process_request. But you'd actually want the "Edit This Page" button to edit the version you're looking at, or maybe the currently elected version, not the latest version. This probably needs a trac.ini configuration item to control it -- either another patch or another override.

Does anyone have any preference as to which of these routes I take? Feel free to edit this page...