Edit detail for ZWikiTwoDiscussion revision 3 of 3

1 2 3
Editor: FrankLaurijssens
Time: 2011/11/10 08:31:13 GMT-8

-      [draft 1], how can one write a wikipage.pt which will get used with it,
      [WikiName], how can one write a wikipage.pt which will get used with it,

What should be in the next major release of ZWiki?

Architectural Changes

Zope 2.7 contains the product ZReST, which is simply a reStructuredText document, and nothing more. Could a wiki be cobbled together from document classes (such as ZReST), separating the wiki functionality from the document itself? It would be a good idea to separate the document syntax from the wiki for maintainability. One glance at the docutils mailing list will indicate that a wiki project really does not want to be dealing with the evolution of a document format.

  • Comparing ZWiki Code Bases does an excellent job discussing these issues, and what is coming in Zope 3.
  • ZReST: simply a document. When displayed you see the document only, with no interface. How can we add an interface? A PageTemplate can easily enough suck in the document via the render() method. Given a page called WikiName, how can one write a wikipage.pt which will get used with it, without defining a new class that extends ZReST?
  • Plone Document: another example. Here the Document class is large, and very complex (CMFDefault/Document.py). It inherits plone functionality. It is a catch-all class that attempts to be all of {text, html, stx} at the same time (like zwiki). Extending it with new types is not straightforward. Besides, is it really appropriate for one class to be text, HTML, or stx at the click of a button? Given an existing HTML document, it never makes sense to hit the text button or stx button or reST button to make it something else. What one really wants to do is convert the content. A stx -> reST conversion could be defined, but is not as simple as changing the "type" in the pulldown.

Architectural Proposal

  • A folder contains many types of documents, ZReST, STX, HTML. (many classes already present in zope)
  • Interface is provided by a Wiki class. This wiki class takes a rendered document (doesn't care about document type) and adds wiki-linking and interface.
  • Presentation is defined by a ZPT PageTemplate, which doesn't have to know that it is part of a wiki, only that it will have a HTML document in the middle of it that is provided by some Wiki Class.

Implementation Proposal

  • Given a ZReST document in a folder, is it possible to override its presentation with a ZPT? http://site/wiki/WikiPage will call the appropriate index_html method, and it appears there is no way for a ZPT to intervene?
  • Can the Wiki be an object with an unknown-method-dispatch? i.e. given http://site/wiki/WikiPage, can wiki actually be an object (not a folder) such that when the method /WikiPage is called, it uses some logic to find the actual page (perhaps http://site/pages/WikiPage) and do wikilinking and render it using a ZPT wikipage.pt? Can this be done with reasonable performance or does it require exceptions?

User-level Features

  • Integration with external data sources: CVSTrac? style, or SubWiki
  • Page type conversion. Type A -> HTML -> Type B
  • Fine grained page component control (document, subtopics, comments)
  • Alternate threading rendering
  • Separation of "Wiki Page" concept from "Mailing list" concept. Allow Wiki pages with a discussion (a la the discussion tab on wikipedia)
  • Printable view
  • Plug-in system ala TWiki
  • XML-RPC interface