Back to index

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

List of all members.

Public Member Functions

def getProfileInfos

Static Public Attributes

 klass = Action
string description = u'An Action object represents a reference to an action.'

Private Member Functions

def _extractChildren
def _initSettings

Detailed Description

Add view for Action.

Definition at line 30 of file actions.py.


Member Function Documentation

def CMFCore.browser.actions.ActionAddView._extractChildren (   self,
  node 
) [private]

Definition at line 60 of file actions.py.

00060 
00061     def _extractChildren(self, node):
00062         action_paths = []
00063         category_id = node.getAttribute('name')
00064         for child in node.childNodes:
00065             if child.nodeName != 'object':
00066                 continue
00067             if child.getAttribute('meta_type') == self.klass.meta_type:
00068                 action_id = child.getAttribute('name')
00069                 action_paths.append(action_id)
00070             else:
00071                 action_paths += self._extractChildren(child)
00072         return [ ('%s/%s' % (category_id, path)) for path in action_paths ]

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFCore.browser.actions.ActionAddView._initSettings (   self,
  obj,
  profile_id,
  obj_path 
) [private]

Definition at line 73 of file actions.py.

00073 
00074     def _initSettings(self, obj, profile_id, obj_path):
00075         stool = queryUtility(ISetupTool)
00076         if stool is None:
00077             return
00078 
00079         context = stool._getImportContext(profile_id)
00080         body = context.readDataFile('actions.xml')
00081         if body is None:
00082             return
00083 
00084         settings_node = None
00085         root = parseString(body).documentElement
00086         for node in root.childNodes:
00087             if node.nodeName != 'object':
00088                 continue
00089             for obj_id in obj_path:
00090                 for child in node.childNodes:
00091                     if child.nodeName != 'object':
00092                         continue
00093                     if child.getAttribute('name') != obj_id:
00094                         continue
00095                     if child.getAttribute('meta_type') == self.klass.meta_type:
00096                         settings_node = child
00097                     else:
00098                         node = child
00099                     break
00100 
00101         importer = queryMultiAdapter((obj, context), INode)
00102         if importer is None:
00103             return
00104 
00105         importer.node = settings_node
00106         return
00107 

Here is the caller graph for this function:

Definition at line 39 of file actions.py.

00039 
00040     def getProfileInfos(self):
00041         profiles = []
00042         stool = queryUtility(ISetupTool)
00043         if stool:
00044             for info in stool.listContextInfos():
00045                 obj_ids = []
00046                 context = stool._getImportContext(info['id'])
00047                 body = context.readDataFile('actions.xml')
00048                 if body is None:
00049                     continue
00050                 root = parseString(body).documentElement
00051                 for node in root.childNodes:
00052                     if node.nodeName != 'object':
00053                         continue
00054                     obj_ids += self._extractChildren(node)
00055                 obj_ids.sort()
00056                 profiles.append({'id': info['id'],
00057                                  'title': info['title'],
00058                                  'obj_ids': tuple(obj_ids)})
00059         return tuple(profiles)

Here is the call graph for this function:


Member Data Documentation

string CMFCore.browser.actions.ActionAddView.description = u'An Action object represents a reference to an action.' [static]

Definition at line 37 of file actions.py.

Definition at line 35 of file actions.py.


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