Personal tools
Skip to content. | Skip to navigation
This package provides shared browser components for the Zope Toolkit.
This package is at present not reusable without depending on a large chunk of the Zope Toolkit and its assumptions. It is maintained by the Zope Toolkit project. This package provides ZCML directives for configuring browser views. More specifically it defines the following ZCML directives: browser:page browser:pages browser:view These directives also support menu item registration for pages, when zope.browsermenu package is installed. Otherwise, they simply ignore the menu attribute.
This package is at present not reusable without depending on a large chunk of the Zope Toolkit and its assumptions. It is maintained by the Zope Toolkit project. This package provides an implementation of browser resources. It also provides directives for defining those resources using ZCML. Resources are static files and directories that are served to the browser directly from the filesystem. The most common example are images, CSS style sheets, or JavaScript files. Resources are be registered under a symbolic name and can later be referred to by that name, so their usage is independent from their physical location. You can register a single file with the <browser:resource> directive, and a whole directory with the <browser:resourceDirectory> directive, for example <browser:resource file=”/path/to/static.file” name=”myfile” /> <browser:resourceDirectory directory=”/path/to/images” name=”main-images” /> This causes a named adapter to be registered that adapts the request to zope.interface.Interface (XXX why do we not use an explicit interface?), so to later retrieve a resource, use zope.component.getAdapter(request, name=’myfile’). There are two ways to traverse to a resource, with the ‘empty’ view on a site, e. g. http://localhost/@@/myfile (This is declared by zope.browserresource) with the ++resource++ namespace, e. g. http://localhost/++resource++myfile (This is declared by zope.traversing.namespace) In case of resource-directories traversal simply continues through its contents, e. g. http://localhost/@@/main-images/subdir/sample.jpg Rather than putting together the URL to a resource manually, you should use zope.traversing.browser.interfaces.IAbsoluteURL to get the URL, or for a shorthand, call the resource object. This has an additional benefit: If you want to serve resources from a different URL, for example because you want to use a web server specialized in serving static files instead of the appserver, you can register an IAbsoluteURL adapter for the site under the name ‘resource’ that will be used to compute the base URLs for resources. For example, if you register ‘http://static.example.com/’ as the base ‘resource’ URL, the resources from the above example would yield the following absolute URLs: http://static.example.com/@@/myfile and http://static.example.com/@@/main-images
Cached descriptors cache their output. They take into account instance attributes that they depend on, so when the instance attributes change, the descriptors will change the values they return. Cached descriptors cache their data in _v_ attributes, so they are also useful for managing the computation of volatile attributes for persistent objects. Persistent descriptors: property A simple computed property. See property.txt. method Idempotent method. The return values are cached based on method arguments and on any instance attributes that the methods are defined to depend on. **Note**, only a cache based on arguments has been implemented so far. See method.txt. Cached Properties ----------------- Cached properties are computed properties that cache their computed values. They take into account instance attributes that they depend on, so when the instance attributes change, the properties will change the values they return.
Catalogs provide management of collections of related indexes with a basic search algorithm.
Zope Component API
This package contains various vocabularies.
The zope configuration system provides an extensible system for supporting various kinds of configurations. It is based on the idea of configuration directives. Users of the configuration system provide configuration directives in some language that express configuration choices. The intent is that the language be pluggable. An XML language is provided by default.
This package define interfaces of container components, and provides container implementations such as a BTreeContainer and OrderedContainer, as well as the base class used by zope.site.folder for the Folder implementation.