Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.linkintegrity.browser.confirmation.RemoveConfirmationView Class Reference
Inheritance diagram for plone.app.linkintegrity.browser.confirmation.RemoveConfirmationView:
Inheritance graph
[legend]
Collaboration diagram for plone.app.linkintegrity.browser.confirmation.RemoveConfirmationView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def originalRequest
def integrityBreaches
def isAccessible
def confirmedItems
def callbackURL
def cancelURL

Public Attributes

 exception
 request

Detailed Description

Definition at line 10 of file confirmation.py.


Constructor & Destructor Documentation

Definition at line 12 of file confirmation.py.

00012 
00013     def __init__(self, context, request):
00014         # since this is a view adapting an exception and a request (instead
00015         # of a regular content object and a request), the exception object
00016         # was passed as the context;  therefore we need to construct a
00017         # proper context in order to render the template in a sane manner;
00018         # to do this we will assume that the desired context was passed as
00019         # the first exception value...
00020         self.exception = context
00021         self.context, = context.args
00022         self.request = request

Here is the caller graph for this function:


Member Function Documentation

Definition at line 57 of file confirmation.py.

00057 
00058     def callbackURL(self):
00059         portal = getToolByName(aq_inner(self.context), "portal_url")
00060         return portal() + '/removeConfirmationAction'

Here is the call graph for this function:

Definition at line 61 of file confirmation.py.

00061 
00062     def cancelURL(self):
00063         url = self.request.environ.get('HTTP_REFERER', None)
00064         if url is None:
00065             url = getToolByName(aq_inner(self.context), "portal_url")()
00066         return url
00067 

Here is the call graph for this function:

Definition at line 52 of file confirmation.py.

00052 
00053     def confirmedItems(self):
00054         info = ILinkIntegrityInfo(self.request)
00055         targets = info.getIntegrityBreaches().keys()
00056         return info.encodeConfirmedItems(additions=targets)

Here is the caller graph for this function:

Definition at line 36 of file confirmation.py.

00036 
00037     def integrityBreaches(self):
00038         info = ILinkIntegrityInfo(self.request).getIntegrityBreaches()
00039         byTitle = lambda a,b: cmp(a.Title(), b.Title())
00040         breaches = []
00041         for target, sources in info.items():
00042             breaches.append({
00043                 'title': target.Title(),
00044                 'type': target.getPortalTypeName(),
00045                 'url': target.absolute_url(),
00046                 'sources': sorted(sources, byTitle),
00047             })
00048         return sorted(breaches, lambda a,b: cmp(a['title'], b['title']))

Definition at line 49 of file confirmation.py.

00049 
00050     def isAccessible(self, obj):
00051         return _checkPermission(AccessContentsInformation, obj)

Here is the call graph for this function:

Definition at line 23 of file confirmation.py.

00023 
00024     def originalRequest(self):
00025         # in order to interrupt the current request with a confirmation
00026         # question about removing the referred to object we need to save
00027         # the original request to be able to possibly continue it later on,
00028         # so we pickle and encode its body and environment...
00029         self.request.stdin.seek(0)
00030         body = self.request.stdin.getvalue()    # zope2 request body...
00031         env = dict(self.request._orig_env)
00032         for key in 'HTTP_AUTHORIZATION', 'HTTP_COOKIE':
00033             if env.has_key(key):
00034                 del env[key]
00035         return encodeRequestData((body, env))

Here is the call graph for this function:


Member Data Documentation

Definition at line 19 of file confirmation.py.

Definition at line 21 of file confirmation.py.


The documentation for this class was generated from the following file: