Back to index

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

List of all members.

Public Member Functions

def __init__
def initialize

Public Attributes

 meta_type
 tools
 icon
 product_name

Static Public Attributes

tuple security = ClassSecurityInfo()

Static Private Attributes

string __name__ = 'toolinit'

Detailed Description

Utility class for generating the factories for several tools.

Definition at line 538 of file utils.py.


Constructor & Destructor Documentation

def CMFCore.utils.ToolInit.__init__ (   self,
  meta_type,
  tools,
  product_name = None,
  icon = None 
)

Definition at line 547 of file utils.py.

00547 
00548     def __init__(self, meta_type, tools, product_name=None, icon=None):
00549         self.meta_type = meta_type
00550         self.tools = tools
00551         if product_name is not None:
00552             warn("The product_name parameter of ToolInit is now ignored",
00553                  DeprecationWarning, stacklevel=2)
00554         self.icon = icon


Member Function Documentation

def CMFCore.utils.ToolInit.initialize (   self,
  context 
)

Definition at line 555 of file utils.py.

00555 
00556     def initialize(self, context):
00557         # Add only one meta type to the folder add list.
00558         productObject = context._ProductContext__prod
00559         self.product_name = productObject.id
00560         context.registerClass(
00561             meta_type = self.meta_type,
00562             # This is a little sneaky: we add self to the
00563             # FactoryDispatcher under the name "toolinit".
00564             # manage_addTool() can then grab it.
00565             constructors = (manage_addToolForm,
00566                             manage_addTool,
00567                             self,),
00568             icon = self.icon
00569             )
00570 
00571         if self.icon:
00572             icon = os_path.split(self.icon)[1]
00573         else:
00574             icon = None
00575         for tool in self.tools:
00576             tool.__factory_meta_type__ = self.meta_type
00577             tool.icon = 'misc_/%s/%s' % (self.product_name, icon)
00578 
00579 InitializeClass( ToolInit )


Member Data Documentation

string CMFCore.utils.ToolInit.__name__ = 'toolinit' [static, private]

Definition at line 542 of file utils.py.

Definition at line 553 of file utils.py.

Definition at line 548 of file utils.py.

Definition at line 558 of file utils.py.

tuple CMFCore.utils.ToolInit.security = ClassSecurityInfo() [static]

Definition at line 544 of file utils.py.

Definition at line 549 of file utils.py.


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