def manage_updateInterfaces(self, interfaces, RESPONSE=None): """ For ZMI update of interfaces. """ pas_instance = self._getPAS() plugins = pas_instance._getOb('plugins') new_interfaces = [] for interface in interfaces: new_interfaces.append(plugins._getInterfaceFromName(interface)) klass_interfaces = [x for x in implementedBy(ScriptablePlugin)] directlyProvides(self, *(klass_interfaces + new_interfaces)) if RESPONSE is not None: RESPONSE.redirect('%s/manage_workspace' '?manage_tabs_message=' 'Interfaces+updated.' % self.absolute_url())
def manage_updateInterfaces( self, interfaces, RESPONSE=None ): """ For ZMI update of interfaces. """ pas_instance = self._getPAS() plugins = pas_instance._getOb( 'plugins' ) new_interfaces = [] for interface in interfaces: new_interfaces.append( plugins._getInterfaceFromName( interface ) ) klass_interfaces = [x for x in implementedBy(ScriptablePlugin)] directlyProvides( self, *(klass_interfaces + new_interfaces) ) if RESPONSE is not None: RESPONSE.redirect('%s/manage_workspace' '?manage_tabs_message=' 'Interfaces+updated.' % self.absolute_url())
""" For ZMI update of interfaces. """ pas_instance = self._getPAS() plugins = pas_instance._getOb('plugins') new_interfaces = [] for interface in interfaces: new_interfaces.append(plugins._getInterfaceFromName(interface)) klass_interfaces = [x for x in implementedBy(ScriptablePlugin)] directlyProvides(self, *(klass_interfaces + new_interfaces)) if RESPONSE is not None: RESPONSE.redirect('%s/manage_workspace' '?manage_tabs_message=' 'Interfaces+updated.' % self.absolute_url()) try: from Products.Five.bridge import fromZ2Interface except ImportError: ScriptablePlugin.__implements__ = ((IScriptablePlugin, ) + Folder.__implements__ + BasePlugin.__implements__) else: classImplements(ScriptablePlugin, IScriptablePlugin, *(implementedBy(Folder) + implementedBy(BasePlugin))) InitializeClass(ScriptablePlugin)
id = self.getId() for type in pt: ids = plugins.listPluginIds( type ) if id not in ids and type in active_interfaces: plugins.activatePlugin( type, id ) # turn us on elif id in ids and type not in active_interfaces: plugins.deactivatePlugin( type, id ) # turn us off if RESPONSE is not None: RESPONSE.redirect('%s/manage_workspace' '?manage_tabs_message=' 'Interface+activations+updated.' % self.absolute_url()) security.declarePrivate( '_getPAS' ) def _getPAS( self ): """ Canonical way to get at the PAS instance from a plugin """ return aq_parent( aq_inner( self ) ) try: from Products.Five.bridge import fromZ2Interface except ImportError: BasePlugin.__implements__ = SimpleItem.__implements__ else: classImplements( BasePlugin , *implementedBy(SimpleItem) ) InitializeClass(BasePlugin)
id = self.getId() for type in pt: ids = plugins.listPluginIds( type ) if id not in ids and type in active_interfaces: plugins.activatePlugin( type, id ) # turn us on elif id in ids and type not in active_interfaces: plugins.deactivatePlugin( type, id ) # turn us off if RESPONSE is not None: RESPONSE.redirect('%s/manage_workspace' '?manage_tabs_message=' 'Interface+activations+updated.' % self.absolute_url()) security.declarePrivate( '_getPAS' ) def _getPAS( self ): """ Canonical way to get at the PAS instance from a plugin """ return aq_parent( aq_inner( self ) ) try: from Products.Five.bridge import fromZ2Interface except ImportError: BasePlugin.__implements__ = SimpleItem.__implements__ else: classImplements( BasePlugin , *implementedBy(SimpleItem) ) InitializeClass(BasePlugin)
""" For ZMI update of interfaces. """ pas_instance = self._getPAS() plugins = pas_instance._getOb( 'plugins' ) new_interfaces = [] for interface in interfaces: new_interfaces.append( plugins._getInterfaceFromName( interface ) ) klass_interfaces = [x for x in implementedBy(ScriptablePlugin)] directlyProvides( self, *(klass_interfaces + new_interfaces) ) if RESPONSE is not None: RESPONSE.redirect('%s/manage_workspace' '?manage_tabs_message=' 'Interfaces+updated.' % self.absolute_url()) try: from Products.Five.bridge import fromZ2Interface except ImportError: ScriptablePlugin.__implements__ = ( Folder.__implements__ + BasePlugin.__implements__) else: classImplements( ScriptablePlugin , *(implementedBy(Folder) + implementedBy(BasePlugin)) ) InitializeClass(ScriptablePlugin)
id = self.getId() for type in pt: ids = plugins.listPluginIds(type) if id not in ids and type in active_interfaces: plugins.activatePlugin(type, id) # turn us on elif id in ids and type not in active_interfaces: plugins.deactivatePlugin(type, id) # turn us off if RESPONSE is not None: RESPONSE.redirect('%s/manage_workspace' '?manage_tabs_message=' 'Interface+activations+updated.' % self.absolute_url()) security.declarePrivate('_getPAS') def _getPAS(self): """ Canonical way to get at the PAS instance from a plugin """ return aq_parent(aq_inner(self)) try: from Products.Five.bridge import fromZ2Interface except ImportError: BasePlugin.__implements__ = SimpleItem.__implements__ else: classImplements(BasePlugin, *implementedBy(SimpleItem)) InitializeClass(BasePlugin)