Back to index

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

List of all members.

Public Member Functions

def __call__
def getLayout
def getDefaultLayout
def getTemplateFor

Static Public Attributes

 schema = TemplateMixinSchema
tuple actions
dictionary aliases
 default_view = None
tuple suppl_views = ()
tuple security = ClassSecurityInfo()
 index_html = None
 templates = _voc_templates

Private Member Functions

def _voc_templates

Static Private Attributes

 __implements__ = ITemplateMixin

Detailed Description

Definition at line 31 of file TemplateMixin.py.


Member Function Documentation

return a view based on layout

Definition at line 60 of file TemplateMixin.py.

00060 
00061     def __call__(self):
00062         """return a view based on layout"""
00063         v = self.getTemplateFor(self.getLayout())
00064         # rewrap the template in the right context
00065         context = aq_inner(self)
00066         v = v.__of__(context)
00067         return v(context, context.REQUEST)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 68 of file TemplateMixin.py.

00068 
00069     def _voc_templates(self):
00070         at = utils.getToolByName(self, TOOL_NAME)
00071         return at.lookupTemplates(self)

Get the default layout used for TemplateMixin.

Check the class definition for a attribute called 'default_view' then
check the Factory Type Information (portal_types) for an attribute
immediate_view else finally return the 'base_view' string which is a
autogenerated form from Archetypes.

Definition at line 91 of file TemplateMixin.py.

00091 
00092     def getDefaultLayout(self):
00093         """Get the default layout used for TemplateMixin.
00094 
00095         Check the class definition for a attribute called 'default_view' then
00096         check the Factory Type Information (portal_types) for an attribute
00097         immediate_view else finally return the 'base_view' string which is a
00098         autogenerated form from Archetypes.
00099         """
00100         default_view = getattr(aq_base(self), 'default_view', None)
00101         if default_view:
00102             return default_view
00103         immediate_view = getattr(self.getTypeInfo(), 'immediate_view', None)
00104         if immediate_view:
00105             return immediate_view
00106         return 'base_view'

Here is the call graph for this function:

Here is the caller graph for this function:

Get the current layout or the default layout if the current one is None

Definition at line 76 of file TemplateMixin.py.

00076 
00077     def getLayout(self, **kw):
00078         """Get the current layout or the default layout if the current one is None
00079         """
00080         if kw.has_key('schema'):
00081             schema = kw['schema']
00082         else:
00083             schema = self.Schema()
00084             kw['schema'] = schema
00085         value = schema['layout'].get(self, **kw)
00086         if value:
00087             return value
00088         else:
00089             return self.getDefaultLayout()

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.TemplateMixin.TemplateMixin.getTemplateFor (   self,
  pt,
  default = 'base_view' 
)
Let the SkinManager handle this.

But always try to show something.

Definition at line 107 of file TemplateMixin.py.

00107 
00108     def getTemplateFor(self, pt, default='base_view'):
00109         """Let the SkinManager handle this.
00110 
00111         But always try to show something.
00112         """
00113         pt = getattr(self, pt, None)
00114         if not pt:
00115             # default is the value of obj.default_view or base_view
00116             default_pt = getattr(self, 'default_view', None)
00117             if not default_pt:
00118                 default_pt = default
00119             return getattr(self, default_pt)
00120         else:
00121             return pt
00122 
00123 InitializeClass(TemplateMixin)
00124 
# BBB backward compatibility

Here is the caller graph for this function:


Member Data Documentation

Archetypes.TemplateMixin.TemplateMixin.__implements__ = ITemplateMixin [static, private]

Definition at line 32 of file TemplateMixin.py.

Initial value:
(
        { 'id': 'view',
          'name': 'View',
          'action': 'string:${object_url}/',
          'permissions': (permissions.View,),
        },
        )

Definition at line 36 of file TemplateMixin.py.

Initial value:
{
        '(Default)': '',
        'index_html': '',
        'view': '',
        'gethtml': 'source_html',
        }

Definition at line 44 of file TemplateMixin.py.

Definition at line 53 of file TemplateMixin.py.

Definition at line 58 of file TemplateMixin.py.

Definition at line 34 of file TemplateMixin.py.

tuple Archetypes.TemplateMixin.TemplateMixin.security = ClassSecurityInfo() [static]

Definition at line 56 of file TemplateMixin.py.

Definition at line 54 of file TemplateMixin.py.

Definition at line 73 of file TemplateMixin.py.


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