Table of Contents

Class: IWebTraversable ./src/peak/web/interfaces.py

A component that supports path traversal

Base Classes   
Interface
Methods   
getObject
getURL
preTraverse
traverseTo
  getObject 
getObject ( interaction )

Return the underlying object that would be traversed

  getURL 
getURL ( context )

Return this object's URL in traversal context context

  preTraverse 
preTraverse ( context )

Invoked before traverse by web requests

This can be used to enforce any preconditions for interacting with this object via the web. For example, an e-commerce "checkout" traversable might want to ensure that there is an active session and there are items in the user's cart, or that the connection is secure.

This method is only invoked when the traversable is about to be traversed or rendered via a web request. It is not invoked when app-server code traverses a location (e.g. by paths in page templates). Traversables can take advantage of this to have different security restrictions for app-server code and via-the-web URL traversal. Resources, for example, do not do security checks in traverseTo(), only in preTraverse(), thus ensuring that app-server code can access all available resources, whether they are available to the user or not.

  traverseTo 
traverseTo ( name,  context )

Return named IWebTraversable, or raise NotAllowed/NotFound


Table of Contents

This document was automatically generated on Tue Feb 17 19:55:56 2004 by HappyDoc version 2.1