Back to index

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

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes

 context
 request

Detailed Description

Definition at line 14 of file remove.py.


Constructor & Destructor Documentation

Definition at line 16 of file remove.py.

00016 
00017     def __init__(self, context, request):
00018         self.context = context
00019         self.request = request

Here is the caller graph for this function:


Member Function Documentation

Definition at line 20 of file remove.py.

00020 
00021     def __call__(self):
00022         # this view is intended to provide an action called by the
00023         # confirmation form;  all it does is prepare the request for
00024         # the retry exception and raise it...
00025         context = aq_inner(self.context)
00026         request = aq_inner(self.request)
00027         clicked = request.form.has_key
00028         if clicked('delete') or clicked('delete_all'):
00029             # the user choose to actually delete the referred to object,
00030             # so we reconstruct the original request which we interrupted
00031             # before, store the so far confirmed items and retry it...
00032             body, env = decodeRequestData(request.get('original_request'))
00033             marker = ILinkIntegrityInfo(request).getEnvMarker()
00034             if clicked('delete_all'):
00035                 env[marker] = 'all'
00036             else:
00037                 env[marker] = request.get('confirmed_items')
00038             auth = request._authUserPW()
00039             if auth is not None:
00040                 authtoken = b64encode('%s:%s' % auth)
00041                 env['HTTP_AUTHORIZATION'] = 'Basic %s' % authtoken
00042             env['HTTP_COOKIE'] = request.get('HTTP_COOKIE', '')
00043             setattr(request, 'stdin', StringIO(body))
00044             setattr(request, '_orig_env', env)
00045             raise Retry
00046         else:
00047             # the user choose to cancel the removal, in which case we
00048             # redirect back to the original HTTP_REFERER url...
00049             msg = _(u'Removal cancelled.')
00050             IStatusMessage(request).addStatusMessage(msg, type='info')
00051             request.RESPONSE.redirect(request.get('cancel_url'))
00052 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 17 of file remove.py.

Definition at line 18 of file remove.py.


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