31 | | In !WikiPage, if version number is None then the default action is |
32 | | determined by the ORDER BY sorting in a SELECT statement. I see three |
33 | | choices here: |
| 30 | * Patch !WikiPage, !WikiModule, and !WikiSystem to add an IWikiWorkflowController extension point; this extension point includes a get_default_version() function, and disables edit collision detection (as a first approximation) so edits can be based on back-level revisions; I've actually already written this patch, as well as a sample workflow controller, and it all works great. All of this was surprisingly simple, thanks to trac's simplicity and the component api. |
| 31 | * 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. I don't want to resort to this. |
35 | | * patch !WikiPage to add an IWikiPageVersionSelector extension point (called before SELECT); this helps anyone implementing workflow |
36 | | * patch !WikiModule to add an IWikiPageProvider extension point; then !WikiPage implements IWikiPageProvider; this helps anyone using alternate wiki page storage and/or workflow |
37 | | * 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 |
| 33 | More about edits and collision detection... In !WikiModule, right now an edit is hardcoded as "latest version" in process_request. But if an IWikiWorkflowController is loaded, then you'd actually want |
| 34 | the "Edit This Page" button |
| 35 | to edit the version you're looking at, or maybe the currently elected |
| 36 | version, not the latest version. Right now I'm just punting and, if workflow is on, then edit the version the user's looking at. This required disabling collision detection, because trac's default collision detection asserts that req.args.get('version') == "current latest version". A better alternative might be to add a hidden form variable, say, 'latest_version', and yell if req.args.get('latest_version') != "current latest version". |
39 | | In !WikiModule, right now an edit is hardcoded as "latest version" in |
40 | | process_request. But you'd actually want the "Edit This Page" button |
41 | | to edit the version you're looking at, or maybe the currently elected |
42 | | version, not the latest version. This probably needs a trac.ini |
43 | | configuration item to control it -- either another patch or another |
44 | | override. |
45 | | |
46 | | Does anyone have any preference as to which of these routes I take? Feel free to edit this page... |
| 38 | Does anyone have any preferences or thoughts about any of these alternatives? Feel free to edit this page... |