You are not logged in Log in Join
You are here: Home » Members » Tres Seaver's Zope.org Site » StructuredText Document » STX_Document » View Document

Log in
Name

Password

 

STX_Document

Design Notes, Known Issues, and General Maundering

  • STX_Document is a "pure ZClass" product: it needs no outside assistance from lordly Python products to make it go. I went this route with the product back when I was first beginning to use ZClasses in a big way; it still seems like a pretty reasonable design choice today.
  • STX_Document can serve as a pretty easy introduction into the world of user-defined ZClasses. In particular, it works as a useful starting point for other, more elaborate "content" objects.
  • One consequence of this choice is that STX_Documents cannot be used, out of the box, as drop-in replacements for DTML Methods/Documents in all cases: in particular, a stock STX_Document won't do the Right Thing (TM) when used as the index_html default view for a Folder or other ObjectManager.
  • To remedy this lack, I have blazed the following trail:
    1. Get Lalo's excellent RenderableZClass, and install it in your Zope.
    2. Inside the STX_Document product, add a new ZClass (call it RSTX_Document), with Renderable and CatalogAware as base classes (in that order).
    3. Duplicate the two propertysheets from STX_Document (HelpText, which has help_stx, as "static" content showing how to use StructuredText; and Properties, which has title:string and body_stx:text instance properties).
    4. Copy and paste all the methods from STX_Document into RSTX_Document.
      • Copy and paste the index_html method and name the copy render.
    5. Duplicate the views from STX_Document onto the RSTX_Document Views tab:
      Edit
      propertysheets/Properties
      View
      index_html
      Security
      manage_access
      Help
      help_stx
  • I have decided not to fold these changes into STX_Document itself in order to preserve its nice "didactic" qualities: it is still useful for the majority of users in the original form, and by leaving it alone, I avoid adding a dependency on another third-party product.
  • If DC ever adds the functionality of Lalo's product to the "base" ZClass (I hope they do!), then STX_Document will automatically become a first-class citizen.