Changes between Version 3 and Version 4 of stevegt


Ignore:
Timestamp:
Feb 28, 2006, 3:02:32 AM (18 years ago)
Author:
stevegt
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • stevegt

    v3 v4  
    2424extension point, not hardcoded as "highest version number", and (2)
    2525the version of the page which a user edits when they hit "Edit This
    26 Page" needs to be configurable, rather than "most recent".
     26Page" needs to be the version they are looking at, rather than always the latest.
    2727
    28 I'm starting to think that (1) is going to require a change to the
    29 !WikiPage class, and (2) a change to !WikiModule. 
     28I see two choices here:
    3029
    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.
    3432
    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
     33More 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
     34the "Edit This Page" button
     35to edit the version you're looking at, or maybe the currently elected
     36version, 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".
    3837
    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...
     38Does anyone have any preferences or thoughts about any of these alternatives?  Feel free to edit this page...
    4739
    4840