Back to index

plone3  3.1.7
Public Member Functions
five.customerize.browser.RegistrationsView Class Reference
Inheritance diagram for five.customerize.browser.RegistrationsView:
Inheritance graph
[legend]
Collaboration diagram for five.customerize.browser.RegistrationsView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def viewRegistrations
def getAllInterfaceNames
def getRequestInterfaceNames
def unregister
def register

Detailed Description

Definition at line 162 of file browser.py.


Member Function Documentation

Definition at line 176 of file browser.py.

00176 
00177     def getAllInterfaceNames(self):
00178         factory = getUtility(IVocabularyFactory, 'Interfaces')
00179         vocab = factory(self.context)
00180         return (term.token for term in vocab)

Here is the call graph for this function:

Definition at line 181 of file browser.py.

00181 
00182     def getRequestInterfaceNames(self):
00183         factory = getUtility(IVocabularyFactory, 'Interfaces')
00184         vocab = factory(self.context)
00185         return (term.token for term in vocab
00186                 if term.value.isOrExtends(IBrowserRequest))

Here is the call graph for this function:

def five.customerize.browser.RegistrationsView.register (   self,
  for_name,
  type_name,
  name = '',
  comment = '' 
)

Definition at line 205 of file browser.py.

00205 
00206     def register(self, for_name, type_name, name='', comment=''):
00207         for_ = getUtility(IInterface, for_name)
00208         type = getUtility(IInterface, type_name)
00209         components = getSiteManager(self.context)
00210         components.registerAdapter(self.context, (for_, type),
00211                                    Interface, name, comment)
00212         self.request.response.redirect('registrations.html')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 188 of file browser.py.

00188 
00189     def unregister(self):
00190         index = self.request.form.get('index')
00191         try:
00192             index = int(index)
00193         except (TypeError, ValueError):
00194             index = None
00195         if index is None:
00196             #XXX: find right exception type
00197             raise ValueError("Missing or invalid 'index' parameter.")
00198         regs = self.viewRegistrations()
00199         reg = regs[index]
00200         components = getSiteManager(self.context)
00201         components.unregisterAdapter(reg.factory, reg.required, reg.provided,
00202                                      reg.name)
00203         self.request.response.redirect('registrations.html')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 164 of file browser.py.

00164 
00165     def viewRegistrations(self):
00166         regs = []
00167         components = getSiteManager(self.context)
00168         for reg in components.registeredAdapters():
00169             if (len(reg.required) == 2 and
00170                 reg.required[1].isOrExtends(IBrowserRequest) and
00171                 reg.factory == self.context):
00172                 regs.append(reg)
00173         def regkey(reg):
00174             return (reg.name, reg.required)
00175         return sorted(regs, key=regkey)

Here is the call graph for this function:

Here is the caller graph for this function:


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