|
|
||||||||||||||||||
|
|
||||||||||||||||||
![]() |
![]() |
Issue 8 - Revision 8 / September 26, 2004
|
|||
|
DocFinderTab - - - - - - - - - - - - By K. Kirchner | May 27, 2004
Introduction One problem that almost inevitably arises when one is working with Zope is trying to work out where an object gets its methods and attributes. The difficulty here is often due to Python's feature of multiple base classes. Due to inheritance sometimes you have to work your way through 4 or more modules to find the method you are looking for. Debugging especially can be tedious. DocFinder or DocFinderTab will make your life easier. DocFinderTab Stefan Holek's DocFinderTab product, formerly known as DocFinderEverywhere, uses the 0.4 version of Dieter Maurer's DocFinder. For all products it patches the manage_options variable, which defines the tabs for an object, adding a tab to every object in the Zope Management Interface (ZMI), the 'Doc' tab. This tab leads to the DocFinder information, which can also be reached by adding /showDocumentation after an object's URL (for example, http://localhost/TestFolder/myfile.pdf/showDocumentation). The DocFinder information consists of a table with the object's classes, for example 'File' for a pdf file, and its base classes, for example 'PropertyManager', again for a pdf file. Each class' docstring is shown below the class name. Each class can be expanded and collapsed by clicking the + or – signs to the left of the class name.
The figure above shows the DocFinder information for a pdf file. It is accessed via the pdf file's 'Doc' tab. The information for the 'File' class has been expanded and you can see some of its methods and attributes. Together with the method name, DocFinder shows the security information for the method, as well as its arguments and, of course, the docstring. The security information consists of the permission the method is protected by and a tuple or list containing the roles that are allowed to access this method.
You can filter the information shown using the 'Filter' field in the upper right-hand corner of the page. In the figure above, the list only shows entries that contain the string 'manage_options'. You can also filter for parts of a string, for example 'manage_', to see only methods containing 'manage_'. If you activate the 'Expert' checkbox, the list is reloaded and below each class name appears the module the class is defined in, for example 'OFS.Image' for the 'File' class. This is an immense help if you want to find the source code for the class. As mentioned above, the current DocFinderTab uses the older version 0.4 of DocFinder. This product is kept in a separate folder inside the DocFinderTab folder, which makes it easy to upgrade DocFinder and still use DocFinderTab if you wish to do so. If you use the DocFinder product on its own and not the DocFinderTab product, you need to create a DocFinder instance (the best place for it is the root folder, so that it is available for all objects).
The figure above shows the DocFinder information offered in version 1.0.3. In addition to the filter field, there is a selection list. Using this list, you can limit the information displayed depending on the type of information you are interested in. Currently, DocFinder has three documentation types: programmer, scripter and web. These three types show different parts of the entire documentation for the current object. In this new version of DocFinder, the class names are links. When you click a link, the source code of the module the class is defined in appears.
You can change the templates used to display the DocFinder information by changing the Page Templates inside the DocFinder instance (see figure above). The default documentation type can be set via the DocFinder instance's 'Properties' tab. Dieter Maurer provides developers with an excellent product for debugging and understanding Zope's infrastructure. Stefan Holek has made this a bit easier to use by making it accessible via a tab. Summary The DocFinder product allows easy access to an object's docstring information, so that one no longer has to dig into the source code. DocFinderTab makes this even easier by giving each object a tab over which this information can be accessed. These products are indispensable for developers or anyone who wants to learn about Zope's infrastructure and doesn't want or need to deal with the source code itself. Product Review End.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ZopeMag is committed to bringing you the best in Zope Documentation. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
Reproduction of material from any of ZopeMag's pages without prior written permission is strictly prohibited. Copyright 2003 - 2005 ZopeMag |
|