Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install zope.app.tree

How to install zope.app.tree

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install zope.app.tree
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
3.6.0 Available View build log
Windows (64-bit)
3.6.0 Available View build log
Mac OS X (10.5+)
3.6.0 Available View build log
Linux (32-bit)
3.6.0 Available View build log
Linux (64-bit)
3.6.0 Available View build log
 
License
ZPL 2.1
Lastest release
version 3.6.0 on Jan 5th, 2011

This package was designed to be a light-weight and easy-to-use static tree implementation. It allows the developer to quickly create trees with nodes that can be opened and closed without the use of JavaScript. The tree state can be retained over multiple sessions.

Detailed Documentation

ZopeTree
What is ZopeTree?

ZopeTree is a port of Philipp's Zope2 product ZopeTree. ZopeTree was meant to be a light-weight and easy-to-use static tree implementation, mainly designed for use in ZPTs. It was originally written because Zope2's ZTUtils.Tree was found to be too complicated and inflexible.

The ZTUtils package has not been ported to Zope3. Parts of it, like batching, have found their way into Zope3, though. Only support for static tree generation is not in the core.

How to use it
Using the skin

ZopeTree comes with a pre-defined skin, StaticTree. It looks just like Zope3's default skin, Rotterdam, except that it displays a static tree in the navigation box instead of the Javascript/XML based dynamic tree.

Using predefined views on objects

ZopeTree comes with several predefined views:

cookie_tree simple view using cookies for tree state storage.

folder_cookie_tree same as above, however only showing folders.

site_cookie_tree same as above, with the nearest site as root node.

root_cookie_tree same as above, with the root container as root node.

The example page template(s) in the browser package give an idea how to use these views for HTML templating.

Customization

The best way to customize ZopeTree is to define your own view for objects (usually '*'). If you want to use the cookie functionality, simply extend the cookie browser view:

System Message: WARNING/2 (<string>, line 67)

Literal block expected; none found.

from zope.app.tree.filters import OnlyInterfacesFilter from zope.app.tree.browser.cookie import CookieTreeView

class BendableStaticTreeView(StaticTreeView):

def bendablesTree(self): # tree with only IBendables, but also show the folder # they're in filter = OnlyInterfacesFilter(IBendable, IFolder) return self.cookieTree(filter)

You can also write your own filters. All you have to do is implement the IObjectFindFilter interface (which is trivial):

System Message: WARNING/2 (<string>, line 81)

Literal block expected; none found.

from zope.interface import implements from zope.app.interfaces.find import IObjectFindFilter

class BendableFilter: implements(IObjectFindFilter)

def matches(self, obj) # only allow bendable objects return obj.isBendable()

Credits

Thanks to ZopeMag (http://zopemag.com) for sponsoring development of the original ZopeTree product.

Thanks to Runyaga LLC (http://runyaga.com) for sponsoring the Zope3 port.

CHANGES
3.6.0 (2009-02-01)
  • Converted from using zope.app.container to zope.container.
3.5.1 (2009-01-29)
  • Add compatibility for newer zope.traversing releases that require us

System Message: WARNING/2 (<string>, line 128)

Bullet list ends without a blank line; unexpected unindent.

to explicitly set up testing. This also works with older releases.

3.5.0 (2009-01-17)
  • Get rid of zope.app.zapi dependency, replacing its uses with

System Message: WARNING/2 (<string>, line 134)

Bullet list ends without a blank line; unexpected unindent.

direct imports.

  • Clean up dependencies, move testing and rotterdam dependencies

System Message: WARNING/2 (<string>, line 137)

Bullet list ends without a blank line; unexpected unindent.

to extra requires.

System Message: WARNING/2 (<string>, line 140)

Bullet list ends without a blank line; unexpected unindent.

zope3-dev@zope.org. Change cheeseshop to pypi in the package url.

  • Replace __used_for__ in adapters.py with zope.component.adapts

System Message: WARNING/2 (<string>, line 144)

Bullet list ends without a blank line; unexpected unindent.

calls to make more sense.

  • Remove obsolete zpkg files, zcml include file for mkzopeinstance-based

System Message: WARNING/2 (<string>, line 147)

Bullet list ends without a blank line; unexpected unindent.

installations, versions.txt that makes no sense now.

3.4.0 (2007-10-28)
  • Initial release independent of the main Zope tree.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.