Back to index

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

List of all members.

Public Member Functions

def __init__
def getInfoData

Public Attributes

 id

Static Public Attributes

string i18n_domain = 'cmf_default'
tuple security = ClassSecurityInfo()
tuple manage_options

Private Member Functions

def _setPropValue

Static Private Attributes

tuple _properties

Detailed Description

Reference to an action.

Definition at line 71 of file ActionInformation.py.


Constructor & Destructor Documentation

def CMFCore.ActionInformation.Action.__init__ (   self,
  id,
  kw 
)

Definition at line 105 of file ActionInformation.py.

00105 
00106     def __init__(self, id, **kw):
00107         self.id = id
00108         self._setPropValue( 'title', kw.get('title', '') )
00109         self._setPropValue( 'description', kw.get('description', '') )
00110         self._setPropValue( 'i18n_domain', kw.get('i18n_domain', '') )
00111         self._setPropValue( 'url_expr', kw.get('url_expr', '') )
00112         self._setPropValue( 'icon_expr', kw.get('icon_expr', '') )
00113         self._setPropValue( 'available_expr', kw.get('available_expr', '') )
00114         self._setPropValue( 'permissions', kw.get('permissions', () ) )
00115         self._setPropValue( 'visible', kw.get('visible', True) )


Member Function Documentation

def CMFCore.ActionInformation.Action._setPropValue (   self,
  id,
  value 
) [private]

Definition at line 116 of file ActionInformation.py.

00116 
00117     def _setPropValue(self, id, value):
00118         self._wrapperCheck(value)
00119         if isinstance(value, list):
00120             value = tuple(value)
00121         setattr(self, id, value)
00122         if value and id.endswith('_expr'):
00123             setattr( self, '%s_object' % id, Expression(value) )

Get the data needed to create an ActionInfo.

Definition at line 125 of file ActionInformation.py.

00125 
00126     def getInfoData(self):
00127         """ Get the data needed to create an ActionInfo.
00128         """
00129         category_path = []
00130         lazy_keys = []
00131         lazy_map = {}
00132 
00133         lazy_map['id'] = self.getId()
00134 
00135         parent = aq_parent(self)
00136         while parent is not None and parent.getId() != 'portal_actions':
00137             category_path.append( parent.getId() )
00138             parent = aq_parent(parent)
00139         lazy_map['category'] = '/'.join(category_path[::-1])
00140 
00141         for id, val in self.propertyItems():
00142             if id.endswith('_expr'):
00143                 id = id[:-5]
00144                 if val:
00145                     val = getattr(self, '%s_expr_object' % id)
00146                     lazy_keys.append(id)
00147                 elif id == 'available':
00148                     val = True
00149             elif id == 'i18n_domain':
00150                 continue
00151             elif self.i18n_domain and id in ('title', 'description'):
00152                 val = Message(val, self.i18n_domain)
00153             lazy_map[id] = val
00154 
00155         return (lazy_map, lazy_keys)
00156 
00157 InitializeClass(Action)
00158 


Member Data Documentation

Initial value:
(
        {'id': 'title', 'type': 'string', 'mode': 'w',
         'label': 'Title'},
        {'id': 'description', 'type': 'text', 'mode': 'w',
         'label': 'Description'},
        {'id':'i18n_domain', 'type': 'string', 'mode':'w',
         'label':'I18n Domain'},
        {'id': 'url_expr', 'type': 'string', 'mode': 'w',
         'label': 'URL (Expression)'},
        {'id': 'icon_expr', 'type': 'string', 'mode': 'w',
         'label': 'Icon (Expression)'},
        {'id': 'available_expr', 'type': 'string', 'mode': 'w',
         'label': 'Condition (Expression)'},
        {'id': 'permissions', 'type': 'multiple selection', 'mode': 'w',
         'label': 'Permissions', 'select_variable': 'possible_permissions'},
        {'id': 'visible', 'type': 'boolean', 'mode': 'w',
         'label': 'Visible?'},
        )

Definition at line 82 of file ActionInformation.py.

string CMFCore.ActionInformation.Action.i18n_domain = 'cmf_default' [static]

Definition at line 78 of file ActionInformation.py.

Definition at line 106 of file ActionInformation.py.

Initial value:
(
        PropertyManager.manage_options
        + SimpleItem.manage_options)

Definition at line 101 of file ActionInformation.py.

tuple CMFCore.ActionInformation.Action.security = ClassSecurityInfo() [static]

Definition at line 80 of file ActionInformation.py.


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