Back to index

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

List of all members.

Public Member Functions

def __creatable_by_emergency_user__
def __init__
def hasMethod
def all_meta_types
def manage_updateInterfaces

Public Attributes

 id
 title

Static Public Attributes

tuple security = ClassSecurityInfo()
string meta_type = 'Scriptable Plugin'
tuple manage_options
tuple manage_editInterfacesForm

Private Member Functions

def _delOb

Private Attributes

 _id

Detailed Description

Allow users to implement plugin interfaces using script objects.

o Allowable types include ExternalMethods, Python Scripts, ZSQL Methods,
  and DTML methods.

o Provide UI for creating scripts for known plugin types.

Definition at line 58 of file ScriptablePlugin.py.


Constructor & Destructor Documentation

Definition at line 88 of file ScriptablePlugin.py.

00088 
00089     def __init__(self, id, title=None):
00090         self._id = self.id = id
00091         self.title = title


Member Function Documentation

Definition at line 85 of file ScriptablePlugin.py.

00085 
00086     def __creatable_by_emergency_user__( self ):
00087         return 1

    Override ObjectManager's _delOb to account for removing any
    interface assertions the object might implement.

Definition at line 111 of file ScriptablePlugin.py.

00111 
00112     def _delOb( self, id ):
00113         """
00114             Override ObjectManager's _delOb to account for removing any
00115             interface assertions the object might implement.
00116         """
00117         myId = self.getId()
00118         pas_instance = self._getPAS()
00119         plugins = pas_instance._getOb( 'plugins' )
00120         curr_interfaces = Set(providedBy(self))
00121 
00122         del_interfaces = Set([x for x in providedBy(self) if id in x.names()])
00123 
00124         for interface in del_interfaces:
00125             if myId in plugins.listPluginIds( interface ):
00126                 plugins.deactivatePlugin( interface, myId )
00127 
00128         delattr( self, id )
00129 
00130         directlyProvides( self, *(list(curr_interfaces - del_interfaces)) )

What objects can be contained here? 

Definition at line 99 of file ScriptablePlugin.py.

00099 
00100     def all_meta_types(self):
00101         """ What objects can be contained here? """
00102         allowed_types = ( 'Script (Python)'
00103                         , 'External Method'
00104                         , 'Z SQL Method'
00105                         , 'DTML Method'
00106                         , 'Page Template'
00107                         )
00108 
00109         return [x for x in Products.meta_types if x['name'] in allowed_types]

Do we implement this method directly?

Definition at line 93 of file ScriptablePlugin.py.

00093 
00094     def hasMethod(self, method_name):
00095         """ Do we implement this method directly?
00096         """
00097         return method_name in self.objectIds()

Here is the call graph for this function:

For ZMI update of interfaces. 

Definition at line 132 of file ScriptablePlugin.py.

00132 
00133     def manage_updateInterfaces( self, interfaces, RESPONSE=None ):
00134         """ For ZMI update of interfaces. """
00135 
00136         pas_instance = self._getPAS()
00137         plugins = pas_instance._getOb( 'plugins' )
00138 
00139         new_interfaces = []
00140 
00141         for interface in interfaces:
00142             new_interfaces.append( plugins._getInterfaceFromName( interface ) )
00143 
00144         klass_interfaces = [x for x in implementedBy(ScriptablePlugin)]
00145         directlyProvides( self, *(klass_interfaces + new_interfaces) )
00146 
00147         if RESPONSE is not None:
00148             RESPONSE.redirect('%s/manage_workspace'
00149                               '?manage_tabs_message='
00150                               'Interfaces+updated.'
00151                             % self.absolute_url())
00152 
00153 
00154 classImplements( ScriptablePlugin
00155                , IScriptablePlugin
00156                , *(implementedBy(Folder) + implementedBy(BasePlugin))
00157                )
00158 
00159 InitializeClass(ScriptablePlugin)

Here is the call graph for this function:


Member Data Documentation

Definition at line 89 of file ScriptablePlugin.py.

Definition at line 89 of file ScriptablePlugin.py.

Initial value:
PageTemplateFile(
        'www/spEditInterfaces', globals(),
        __name__='manage_editInterfacesForm')

Definition at line 81 of file ScriptablePlugin.py.

Initial value:
( ( Folder.manage_options[0], )
                     + ( { 'label': 'Interfaces',
                           'action': 'manage_editInterfacesForm', }
                         ,
                       )
                     + BasePlugin.manage_options
                     )

Definition at line 72 of file ScriptablePlugin.py.

Definition at line 70 of file ScriptablePlugin.py.

Definition at line 68 of file ScriptablePlugin.py.

Definition at line 90 of file ScriptablePlugin.py.


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