Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
PluggableAuthService.plugins.BasePlugin.BasePlugin Class Reference
Inheritance diagram for PluggableAuthService.plugins.BasePlugin.BasePlugin:
Inheritance graph
[legend]
Collaboration diagram for PluggableAuthService.plugins.BasePlugin.BasePlugin:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def listInterfaces
def testImplements
def manage_activateInterfaces

Static Public Attributes

tuple security = ClassSecurityInfo()
tuple manage_options
string prefix = ''
tuple manage_activateInterfacesForm

Private Member Functions

def _getPAS

Static Private Attributes

tuple _properties

Detailed Description

Base class for all PluggableAuthService Plugins

Definition at line 34 of file BasePlugin.py.


Member Function Documentation

Canonical way to get at the PAS instance from a plugin 

Definition at line 106 of file BasePlugin.py.

00106 
00107     def _getPAS( self ):
00108         """ Canonical way to get at the PAS instance from a plugin """
00109         return aq_parent( aq_inner( self ) )
00110 
00111 classImplements(BasePlugin, *implementedBy(SimpleItem))
00112 
00113 InitializeClass(BasePlugin)

Here is the call graph for this function:

Here is the caller graph for this function:

For ZMI update of interfaces. 

Definition at line 61 of file BasePlugin.py.

00061 
00062     def listInterfaces( self ):
00063         """ For ZMI update of interfaces. """
00064 
00065         results = []
00066 
00067         for iface in flattenInterfaces( providedBy( self ) ):
00068             results.append( iface.__name__ )
00069 
00070         return results

Here is the call graph for this function:

def PluggableAuthService.plugins.BasePlugin.BasePlugin.manage_activateInterfaces (   self,
  interfaces,
  RESPONSE = None 
)
For ZMI update of active interfaces. 

Definition at line 77 of file BasePlugin.py.

00077 
00078     def manage_activateInterfaces( self, interfaces, RESPONSE=None ):
00079         """ For ZMI update of active interfaces. """
00080 
00081         pas_instance = self._getPAS()
00082         plugins = pas_instance._getOb( 'plugins' )
00083 
00084         active_interfaces = []
00085 
00086         for iface_name in interfaces:
00087             active_interfaces.append( plugins._getInterfaceFromName(
00088                                                 iface_name ) )
00089 
00090         pt = plugins._plugin_types
00091         id = self.getId()
00092 
00093         for type in pt:
00094             ids = plugins.listPluginIds( type )
00095             if id not in ids and type in active_interfaces:
00096                 plugins.activatePlugin( type, id ) # turn us on
00097             elif id in ids and type not in active_interfaces:
00098                 plugins.deactivatePlugin( type, id ) # turn us off
00099 
00100         if RESPONSE is not None:
00101             RESPONSE.redirect('%s/manage_workspace'
00102                               '?manage_tabs_message='
00103                               'Interface+activations+updated.'
00104                             % self.absolute_url())

Can't access Interface.providedBy() directly in ZPT. 

Definition at line 72 of file BasePlugin.py.

00072 
00073     def testImplements( self, interface ):
00074         """ Can't access Interface.providedBy() directly in ZPT. """
00075         return interface.providedBy( self )


Member Data Documentation

Initial value:
(
        dict(id='prefix', type='string', mode='w',
             label='Optional Prefix'),)

Definition at line 51 of file BasePlugin.py.

Initial value:
PageTemplateFile(
        'www/bpActivateInterfaces', globals(),
        __name__='manage_activateInterfacesForm')

Definition at line 56 of file BasePlugin.py.

Initial value:
( ( { 'label': 'Activate',
                           'action': 'manage_activateInterfacesForm', }
                         ,
                       )
                     + SimpleItem.manage_options
                     + PropertyManager.manage_options
                     )

Definition at line 41 of file BasePlugin.py.

Definition at line 49 of file BasePlugin.py.

Definition at line 39 of file BasePlugin.py.


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