Part of lp.services.webapp.publication View In Hierarchy
Known subclasses: lp.services.webapp.servers.FeedsPublication, lp.services.webapp.servers.MainLaunchpadPublication, lp.services.webapp.servers.ProtocolErrorPublication, lp.services.webapp.servers.PublicXMLRPCPublication, lp.services.webapp.servers.TestOpenIDBrowserPublication, lp.services.webapp.servers.WebServicePublication
This subclass undoes the ZODB-specific things in ZopePublication, a superclass of z.a.publication.BrowserPublication.
Method | __init__ | Undocumented |
Method | annotateTransaction | See zope.app.publication.zopepublication.ZopePublication . |
Method | getDefaultTraversal | Undocumented |
Method | getApplication | Undocumented |
Method | beforeTraversal | Undocumented |
Method | getPrincipal | Return the authenticated principal for this request. |
Method | maybeRestrictToTeam | Undocumented |
Method | getNonRestrictedURL | Returns the non-restricted version of the request URL. |
Method | constructPageID | Given a view, figure out what its page ID should be. |
Method | callObject | See zope.publisher.interfaces.IPublication . |
Method | afterCall | See zope.publisher.interfaces.IPublication . |
Method | finishReadOnlyRequest | Hook called at the end of a read-only request. |
Method | callTraversalHooks | We don't want to call _maybePlacefullyAuthenticate as does |
Method | afterTraversal | See zope.publisher.interfaces.IPublication. |
Method | handleException | Undocumented |
Method | beginErrorHandlingTransaction | Hook for when a new view is started to handle an exception. |
Method | endRequest | Undocumented |
Method | _maybePlacefullyAuthenticate | This should never be called because we've excised it in |
zope.app.publication.zopepublication.ZopePublication
.
We override the method to simply save the authenticated user id in the transaction.
If there is no authenticated principal or the principal represents a personless account, return the unauthenticated principal.
The intended use is for determining the equivalent URL on the production Launchpad instance if a user accidentally ends up on a restrict_to_team Launchpad instance.
If a non-restricted URL can not be determined, None is returned.
This provides a hook point for subclasses to override.
zope.publisher.interfaces.IPublication
.
Our implementation make sure that no result is returned on redirect.
It also sets the launchpad.userid and launchpad.pageid WSGI environment variables.
zope.publisher.interfaces.IPublication
.
Our implementation calls self.finishReadOnlyRequest(), which by default aborts the transaction, for read-only requests. Because of this we cannot chain to the superclass and implement the whole behaviour here.
By default it abort()s the transaction, but subclasses may need to commit it instead, so they must overwrite this.
This hook does not invoke our parent's afterTraversal hook in zopepublication.py because we don't want to call _maybePlacefullyAuthenticate.
We need to add an additional behaviour to the usual Zope behaviour. We must restart the request timer. Otherwise we can get OOPS errors from our exception views inappropriately.