• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. The Component Architecture: A... > Presentation Components: Views, Reso...

Presentation Components: Views, Resources, Skins, and Layers

Presentation components, especially views, are very similar to adapters, except that they take into account additional parameters, such as layers and skins. In fact, in future versions of Zope 3, the presentation service will be removed, and presentation components will become adapters. Presentation components are used for providing presentation for other components in various output formats (that is, presentation types), such as HTML, FTP, and XML-RPC.

In order to make a view work, two pieces of information have to be provided. First, the view must know for which object it is providing a view. This object is commonly known as the context of the view. Second, you need to know some protocol-specific information, which is stored in a Request object that is always accessible under the variable name request in the view. For HTML, for example, the request contains all cookies, form variables, and HTTP header values, but also the authenticated user and the applicable locale. The return values of the methods of a view depend on the presentation type and the method itself. For example, HTTP views usually return the HTML body, and FTP might return a list of filenames.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint