Back to index

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

List of all members.

Public Member Functions

def manage_aproviders
def manage_editActionsForm
def listActions
def listActionProviders
def addActionProvider
def deleteActionProvider
def listFilteredActionsFor

Public Attributes

 action_providers

Static Public Attributes

string id = 'portal_actions'
string meta_type = 'CMF Actions Tool'
tuple action_providers = ('portal_types', 'portal_workflow', 'portal_actions')
tuple security = ClassSecurityInfo()
tuple manage_options
tuple manage_overview = DTMLFile( 'explainActionsTool', _dtmldir )
tuple manage_actionProviders = DTMLFile('manageActionProviders', _dtmldir)

Static Private Attributes

tuple __implements__
tuple _product_interfaces = (IActionCategory,)

Detailed Description

    Weave together the various sources of "actions" which are apropos
    to the current user and context.

Definition at line 37 of file ActionsTool.py.


Member Function Documentation

def CMFCore.ActionsTool.ActionsTool.addActionProvider (   self,
  provider_name 
)
Add an Action Provider id to the providers queried by this tool.

Definition at line 134 of file ActionsTool.py.

00134 
00135     def addActionProvider( self, provider_name ):
00136         """ Add an Action Provider id to the providers queried by this tool.
00137         """
00138         ap = list( self.action_providers )
00139         if hasattr( self, provider_name ) and provider_name not in ap:
00140             ap.append( provider_name )
00141             self.action_providers = tuple( ap )

def CMFCore.ActionsTool.ActionsTool.deleteActionProvider (   self,
  provider_name 
)
Delete an Action Provider id from providers queried by this tool.

Definition at line 143 of file ActionsTool.py.

00143 
00144     def deleteActionProvider( self, provider_name ):
00145         """ Delete an Action Provider id from providers queried by this tool.
00146         """
00147         ap = list( self.action_providers )
00148         if provider_name in ap:
00149             ap.remove( provider_name )
00150             self.action_providers = tuple( ap )

List the ids of all Action Providers queried by this tool.

Definition at line 128 of file ActionsTool.py.

00128 
00129     def listActionProviders(self):
00130         """ List the ids of all Action Providers queried by this tool.
00131         """
00132         return self.action_providers

Here is the caller graph for this function:

def CMFCore.ActionsTool.ActionsTool.listActions (   self,
  info = None,
  object = None 
)
List all the actions defined by a provider.

Definition at line 116 of file ActionsTool.py.

00116 
00117     def listActions(self, info=None, object=None):
00118         """ List all the actions defined by a provider.
00119         """
00120         actions = list(self._actions)
00121         for category in self.objectValues():
00122             actions.extend( category.listActions() )
00123         return tuple(actions)

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFCore.ActionsTool.ActionsTool.listFilteredActionsFor (   self,
  object = None 
)
List all actions available to the user.

Definition at line 155 of file ActionsTool.py.

00155 
00156     def listFilteredActionsFor(self, object=None):
00157         """ List all actions available to the user.
00158         """
00159         actions = []
00160 
00161         # Include actions from specific tools.
00162         for provider_name in self.listActionProviders():
00163             provider = getattr(self, provider_name)
00164             if IActionProvider.providedBy(provider) or \
00165                     z2IActionProvider.isImplementedBy(provider):
00166                 actions.extend( provider.listActionInfos(object=object) )
00167 
00168         # Include actions from object.
00169         if object is not None:
00170             if IActionProvider.providedBy(object) or \
00171                     z2IActionProvider.isImplementedBy(object):
00172                 actions.extend( object.listActionInfos(object=object) )
00173 
00174         # Reorganize the actions by category.
00175         filtered_actions={'user':[],
00176                           'folder':[],
00177                           'object':[],
00178                           'global':[],
00179                           'workflow':[],
00180                           }
00181 
00182         for action in actions:
00183             catlist = filtered_actions.setdefault(action['category'], [])
00184             catlist.append(action)
00185 
00186         return filtered_actions
00187 
00188 InitializeClass(ActionsTool)

Here is the call graph for this function:

def CMFCore.ActionsTool.ActionsTool.manage_aproviders (   self,
  apname = '',
  chosen = (),
  add_provider = 0,
  del_provider = 0,
  REQUEST = None 
)
Manage action providers through-the-web.

Definition at line 78 of file ActionsTool.py.

00078 
00079                         , REQUEST=None):
00080         """
00081         Manage action providers through-the-web.
00082         """
00083         providers = list(self.listActionProviders())
00084         new_providers = []
00085         if add_provider:
00086             providers.append(apname)
00087         elif del_provider:
00088             for item in providers:
00089                 if item not in chosen:
00090                     new_providers.append(item)
00091             providers = new_providers
00092         self.action_providers = tuple(providers)
00093         if REQUEST is not None:
00094             return self.manage_actionProviders(self , REQUEST
00095                           , manage_tabs_message='Providers changed.')

Here is the call graph for this function:

def CMFCore.ActionsTool.ActionsTool.manage_editActionsForm (   self,
  REQUEST,
  manage_tabs_message = None 
)
Show the 'Actions' management tab.

Definition at line 97 of file ActionsTool.py.

00097 
00098     def manage_editActionsForm( self, REQUEST, manage_tabs_message=None ):
00099         """ Show the 'Actions' management tab.
00100         """
00101         actions = [ ai.getMapping() for ai in self._actions ]
00102 
00103         # possible_permissions is in AccessControl.Role.RoleManager.
00104         pp = self.possible_permissions()
00105         return self._actions_form( self
00106                                  , REQUEST
00107                                  , actions=actions
00108                                  , possible_permissions=pp
00109                                  , management_view='Actions'
00110                                  , manage_tabs_message=manage_tabs_message
00111                                  )


Member Data Documentation

Initial value:
(z2IActionsTool, OrderedFolder.__implements__,
                      ActionProviderBase.__implements__)

Definition at line 47 of file ActionsTool.py.

tuple CMFCore.ActionsTool.ActionsTool._product_interfaces = (IActionCategory,) [static, private]

Definition at line 52 of file ActionsTool.py.

tuple CMFCore.ActionsTool.ActionsTool.action_providers = ('portal_types', 'portal_workflow', 'portal_actions') [static]

Definition at line 53 of file ActionsTool.py.

Definition at line 91 of file ActionsTool.py.

string CMFCore.ActionsTool.ActionsTool.id = 'portal_actions' [static]

Definition at line 50 of file ActionsTool.py.

tuple CMFCore.ActionsTool.ActionsTool.manage_actionProviders = DTMLFile('manageActionProviders', _dtmldir) [static]

Definition at line 70 of file ActionsTool.py.

Initial value:
( ( OrderedFolder.manage_options[0],
                         ActionProviderBase.manage_options[0],
                         {'label': 'Action Providers',
                          'action': 'manage_actionProviders'},
                         {'label': 'Overview',
                          'action': 'manage_overview'} ) +
                       OrderedFolder.manage_options[2:] )

Definition at line 57 of file ActionsTool.py.

tuple CMFCore.ActionsTool.ActionsTool.manage_overview = DTMLFile( 'explainActionsTool', _dtmldir ) [static]

Definition at line 69 of file ActionsTool.py.

string CMFCore.ActionsTool.ActionsTool.meta_type = 'CMF Actions Tool' [static]

Definition at line 51 of file ActionsTool.py.

tuple CMFCore.ActionsTool.ActionsTool.security = ClassSecurityInfo() [static]

Definition at line 55 of file ActionsTool.py.


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