[ZDP] ZDPTool Prototype Implementation - Part 1

Maik Roeder roeder@berg.net
Sat, 25 Dec 1999 04:44:40 +0100


Hi !


For those who are interested in my ideas of a possible implementation 
of the ZDP-Tools, here is the first in a series of step by step
descriptions. 

Greetings,

Maik Röder


Steps to the ZDP-Tools Homepage

   Before we can make use of the ZDP-Tools for a big project like ZDP,
   I am building a prototype site using the ZDP-Tools. To show how
   extensible the ZDP-Tool design is, I am going to manage the ZDP-Tool
   documentation using the ZDP-Tools while they are being written ;-)

   This is a step by step description of how I develop the ZDP-Tools.
   In the first part we will see how to integrate a listing of all
   projects and members into the main page.

   The first thing to do is setting up the ZClasses "Member" and
   "DocumentFolder". Take extra care to make CatalogAware the first
   Base Class.

      Create the Member ZClass
         1. Add a Product
            1. Id: MemberProduct
            2. Title: A member product
         2. Add ZClass to the Product
            1. Id: MemberClass
            2. Title: A Member Class
            3. Meta type: Member
            4. Base classes: CatalogAware, Folder, ObjectManager
         3. Add the Property Sheet "Info":
               1. Id: Info
               2. Title: Information about a member
         4. Add properties to the "Info" Property Sheet
               1. string: name
               2. string: email
               3. string: company
               4. text: fields_of_interest
               5. text: fields_of_expertise
               6. text: statement_of_involvement
               7. int: active 
         5. Add view "EditInfo": propertysheets/Info/manage
         6. Add icon under Basic Tab

      Create the DocumentFolder ZClass

         1. Add Product
            1. Id: DocumentFolderProduct
            2. Title: A document folder product
         2. Add ZClass to the Product
            1. Id: DocumentFolderClass
            2. Title: A DocumentFolder Class
            3. Meta type: DocumentFolder
            4. Base classes: CatalogAware,Folder,ObjectManager
         3. Add the Property Sheet "Info":
            1. Id: Info
            2. Title: Information about the document folder
         4. Add properties to the "Info" Property Sheet
            1. int: NeedsReaders
            2. int: NeedsCommenters
            3. int: NeedsWriters
            4. int: NeedsReviewers
            5. int: NeedsApprovers
            6. int: NeedsMaintainers
            7. type: string
            8. category: string
            9. keyword: string

         5. Add view "EditInfo": propertysheets/Info/manage
         6. Add icon under Basic Tab

   To allow searches on these catalog-aware ZClasses, create a Catalog, to
   which our Member and DocumentFolder ZClasses will automatically register:

      In the root Folder, add a ZCatalog
         Id: Catalog
         Title: The Catalog

   Create the Main Folder for the ZDP project:
   
      Create a DocumentFolder ZDP

   Add a Members folder:

      Create a normal Folder Members inside Folder ZDP

   Enter some information about the homepage of the ZDP project:

      Create an index_html document in Folder ZDP:

         <dtml-var standard_html_header>
         <H1>Welcome to the ZDP Homepage !</H1>
         (Insert all the information from the existing ZDP Homepage here.)

         Here we will insert the project and member lists.

         <dtml-var standard_html_footer>

   What is needed now, is a place where the Members of the project can work
   on their documentation tasks.

      Create a folder Members inside Folder ZDP

   Of course, the Member Folder needs to be populated with members. For now
   this is just member maik.

      Create a Member maik in Folder Members
      Click on the Folder of Member maik
      Click on EditInfo in the Tab
      Enter the personal information for Member maik

   Now create a new project called ZDPTools for user maik. The ZDPTools
   Documentation is temporarily inside the Member Folder of maik, but it
   really makes no difference where we put this folder in the hierarchy.
   ZCatalog will find it wherever it is ! :-)

      Create a DocumentFolder ZDPTools inside maik
 
   What would the ZDP-Tools project be without a Homepage ???

      Add this index_html to Folder ZDPTools:

         <dtml-var standard_html_header>
         <H1>Welcome to the ZDPTools Homepage !</H1>

         (Insert all the information from the existing ZDPTools Homepage here.)

         Here we will insert the project and member lists.

         <dtml-var standard_html_footer>

   The question now is, how will the new project be known to the
   visitor of the ZDP homepage ? We surely want Readers and Commenters,
   so we get some feedback. But we also could use some Writers, which
   help development of the ZDP-Tools. 

      Click on the EditInfo Tab of the ZDPTools Folder
      set these integer properties to a value of 1:

         NeedsReaders 
         NeedsCommenters
         NeedsWriters

    These properties mark projects which are in need of the special role.
    At first, we want to attract readers, so we want the ZDPTools project
    listed on the main ZDP page. The properties can be searched for using
    ZCatalog. We just need to perform a search for all DocumentFolders
    which have the NeedsReaders property set.

    The following DTML Method is placed in the Documentfolder ZClass itself,
    so it can be reused both for the main ZDP page and the ZDP-Tools page
    by putting a simple <dtml-var DocumentFoldersNeedsReaders> into the
    index_html of the ZDP and ZDP-Tools folder. We could have put it
    somewhere else in the hierarchy, but the Right Place(TM) is the ZClass
    method folder, where all services for the ZClass should be put

      Click on the DocumentFolderClass ZClass
      Add a method
         Id: ProjectNeedsReaders
         Title: Search for Projects that need Readers
      Enter the following code into the method:
         <ul>
         <dtml-in "Catalog(meta_type='DocumentFolder',
                           NeedsReaders=1,
                           type='Project')">
         <li>Found Match:
         <a href="<dtml-var "Catalog.getpath(data_record_id_)">">
         <dtml-var id></a>
         </dtml-in>
         </ul>

   What are we doing here ? Well, we are calling the Catalog and ask for all
   DocumentFolders which have the NeedsReaders property set. The results
   of the search are presented in a simple list. If we have correctly set
   the type property of the ZDPTools to "Project", then we get the ZDPTools
   project as a search result.

   If we insert this template to the index_html files of the ZDP or the
   ZDP-Tools folders, we will get all Projects that are available for
   the public to read. 

      Add the following line to the index_html files:

         <dtml-var ProjectNeedsReaders>

   In addition to listing the ongoing projects, we are interested in the
   activity of the members of the ZDP project. It is an easy excercise
   for the reader to add a Search for Members which have the property
   "active" set to "1" or "0", and to list them on the index_html pages
   of ZDP and ZDP_Tools ;-)

   We are not going to search with search terms until we have inserted 
   the content into the ZDP-Tools site. We are also not going to add
   a category or keyword search, because none of these exist up to now.
   This has to wait till the next part.

   In the meantime I wish you happy Zopeing !

   Maik Röder
   <roeder@berg.net>