User Class Refactoring

The User class should be split into a UserBase class, providing access methods, and a UserFile class, which does the file stuff (saving prefs, trail, bookmark, etc as files on disc).

That way it is possible to create UserHash, UserSQL, UserLDAP, ... classes, which use different ways to store the user data.

The password check should also move to extra methods (from load_from_id) to provide a clean interface for user authentication.

-- OliverGraf 2004-02-08 19:33:34

See OliverGraf/HttpAuthentication for some ideas on integrated authentication. -- OliverGraf 2004-02-09 10:08:38

TableOfContents and Include Refactoring

Both TOC and Include need to move nearer to the core. They need special hooks in the formatter to work properly.

For example it is not good that the TOC macro needs to look for wiki markup, cause that renders it useless for headings which come from a different parser. So the best is if the TOC macro would receive the heading calls the formatter gets to gather its information.

The Include is another thing, cause it puts multiple pages, which come perhaps from differen parsers, together. Each page currently gets its own formatter, which is wrong I think, cause the whole page plus includes normally gets formatted into one output format. So the formatter should stay the same. This allows the heading 'gatherer' to work, too.

Execution of TOC:

  1. parser parse and write markup up to TOC macro
  2. parser calls macro
    1. TOC macro call request.startTOC()
      1. request set a request.toc -one toc per request
      2. request redirect output to a StringIO - request.pageBuffer
  3. parser continue to parse as usual- no change in the parser code
  4. parser finds a heading, call formater.start_heading
    1. formater print a heading as usual (transparently redirected to request.pageBuffer)
    2. formatter adds the heading to request.toc - if exists
  5. parser continue until end of document, working through all included files
  6. parser call request.flush()
    1. request check if request.toc exists
      1. request redirect back output
      2. request prints request.toc
      3. request print request.pageBuffer (rest of page)

    I don't see startTOC as a request method, cause the formatter is the one which should handle such formatting events. It is also the formatter which knows what a heading is. So for me it belongs into the formatter (the method, the storage should still be a request member as for other stuff the formatter or parser needs to keep request global). -- OliverGraf 2004-08-03 09:50:12

    • Lets call it enableToc(). I thinks the redirection done by formatter and other code is dangerous. Formater does not have to know where the text is going, it is just a formatter. Maybe what we need is a PageView object, which collects text from macros, formatters and other code, and print it to the user using the current theme. Today request is doing this job, instead of being just a request. -- NirSoffer 2004-08-03 10:01:50

Notes

Questions:

Heading ids

The current heading ids are a pain in the @!#! here is the id for this section:

What we want from the heading ids?

Here is an option, that will work with the previous method of creating TOC - but can't use caching for included pages, which is true anyway.

Here a compact version for this page:

<a id="section-1" ...> RefactoringProposals</a>
...
<a id="section-1.1" ...>User Class Refactoring</a>
...
<a id="section-1.2" ...>TableOfContents and Include Refactoring</a>
...

Then the link wil be:

And a more verbose version:

<a id="1_RefactoringProposals" ...> RefactoringProposals</a>
...
<a id="1.1_User_Class_Refactoring" ...>User Class Refactoring</a>
...
<a id="1.2_TableOfContents_and_Include_Refactoring" ...>TableOfContents and Include Refactoring</a>
...

Then the link wil be:

MoinMoin: RefactoringProposals (last edited 2007-10-29 19:13:56 by localhost)