コード例 #1
0
ファイル: ScriptablePlugin.py プロジェクト: bendavis78/zope
    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())
コード例 #2
0
ファイル: ScriptablePlugin.py プロジェクト: goschtl/zope
    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())
コード例 #3
0
ファイル: ScriptablePlugin.py プロジェクト: bendavis78/zope
        """ 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)
コード例 #4
0
        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)
コード例 #5
0
ファイル: BasePlugin.py プロジェクト: goschtl/zope
        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)
コード例 #6
0
ファイル: ScriptablePlugin.py プロジェクト: goschtl/zope
        """ 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)
コード例 #7
0
        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)