Package CMFDynamicViewFTI :: Module browserdefault :: Class BrowserDefaultMixin
[show private | hide private]
[frames | no frames]

Type BrowserDefaultMixin

object --+    
         |    
      Base --+
             |
            BrowserDefaultMixin


Mixin class for content types using the dynamic view FTI

Allow the user to select a layout template (in the same way as
TemplateMixin in Archetypes does), and/or to set a contained
object's id as a default_page (acting in the same way as index_html)

Note: folderish content types should overwrite HEAD like ATContentTypes

Method Summary
  __call__(self)
Resolve and return the selected view template applied to the object.
  canSetDefaultPage(self)
Check if the user has permission to select a default page on this (folderish) item, and the item is folderish.
  canSetLayout(self)
Check if the current authenticated user is permitted to select a layout.
  defaultView(self, request)
Get the actual view to use.
  getAvailableLayouts(self)
Get the layouts registered for this object from its FTI.
  getDefaultLayout(self)
Get the default layout method.
  getDefaultPage(self)
Return the id of the default page, or None if none is set.
  getLayout(self, **kw)
Get the selected view method.
  setDefaultPage(self, objectId)
Set the default page to display in this (folderish) object.
  setLayout(self, layout)
Set the layout as the current view.
    Inherited from Base
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __getnewargs__(...)
Get arguments to be passed to __new__
  __getstate__(...)
Get the object serialization state
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
Reduce an object to contituent parts for serialization
  __setstate__(...)
Set the object serialization state The state should be in one of 3 forms: - None Ignored - A dictionary In this case, the object's instance dictionary will be cleared and updated with the new state.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
tuple __ac_permissions__ = (('Modify view template', ('setDefa...
PermissionRole __call____roles__ = <PermissionRole object at 0xb47af530...
tuple __implements__ = (<Interface Products.CMFDynamicViewFTI....
dict aliases = {'sharing': 'folder_localrole_form', 'gethtml'...
NoneType canSetDefaultPage__roles__ = None                                                                  
NoneType canSetLayout__roles__ = None                                                                  
str default_view = 'base_view'
PermissionRole defaultView__roles__ = <PermissionRole object at 0xb47af...
PermissionRole getAvailableLayouts__roles__ = <PermissionRole object at...
PermissionRole getDefaultLayout__roles__ = <PermissionRole object at 0x...
PermissionRole getDefaultPage__roles__ = <PermissionRole object at 0xb4...
PermissionRole getLayout__roles__ = <PermissionRole object at 0xb47af53...
PermissionRole setDefaultPage__roles__ = <PermissionRole object at 0xb4...
PermissionRole setLayout__roles__ = <PermissionRole object at 0xb47af4a...
tuple suppl_views = ()
str _at_fti_meta_type = 'Factory-based Type Information with...

Method Details

__call__(self)
(Call operator)

Resolve and return the selected view template applied to the object.
This should not consider the default page.

canSetDefaultPage(self)

Check if the user has permission to select a default page on this
(folderish) item, and the item is folderish.

canSetLayout(self)

Check if the current authenticated user is permitted to select a layout.

defaultView(self, request=None)

Get the actual view to use. If a default page is set, its id will
be returned. Else, the current layout's page template id is returned.

getAvailableLayouts(self)

Get the layouts registered for this object from its FTI.

getDefaultLayout(self)

Get the default layout method.

getDefaultPage(self)

Return the id of the default page, or None if none is set.

The default page must be contained within this (folderish) item.

getLayout(self, **kw)

Get the selected view method.

Note that a selected default page will override the view method.

setDefaultPage(self, objectId)

Set the default page to display in this (folderish) object.

The objectId must be a value found in self.objectIds() (i.e. a contained
object). This object will be displayed as the default_page/index_html object
of this (folderish) object. This will override the current layout
template returned by getLayout(). Pass None for objectId to turn off
the default page and return to using the selected layout template.

setLayout(self, layout)

Set the layout as the current view.

'layout' should be one of the list returned by getAvailableLayouts(), but it
is not enforced. If a default page has been set with setDefaultPage(), it is
turned off by calling setDefaultPage(None).

Class Variable Details

__ac_permissions__

Type:
tuple
Value:
(('Modify view template', ('setDefaultPage', 'setLayout')),
 ('View',
  ('getAvailableLayouts',
   'getDefaultPage',
   'getDefaultLayout',
   '__call__',
   'defaultView',
   'getLayout')))                                                      

__call____roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0xb47af530>                                  

__implements__

Type:
tuple
Value:
(<Interface Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDe\
fault at b6d6536c>,)                                                   

aliases

Type:
dict
Value:
{'(Default)': '(dynamic view)',
 'edit': 'base_edit',
 'gethtml': '',
 'index.html': '(dynamic view)',
 'mkdir': '',
 'properties': 'base_metadata',
 'sharing': 'folder_localrole_form',
 'view': '(selected layout)'}                                          

canSetDefaultPage__roles__

Type:
NoneType
Value:
None                                                                  

canSetLayout__roles__

Type:
NoneType
Value:
None                                                                  

default_view

Type:
str
Value:
'base_view'                                                            

defaultView__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0xb47af530>                                  

getAvailableLayouts__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0xb47af530>                                  

getDefaultLayout__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0xb47af530>                                  

getDefaultPage__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0xb47af530>                                  

getLayout__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0xb47af530>                                  

setDefaultPage__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0xb47af4a0>                                  

setLayout__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0xb47af4a0>                                  

suppl_views

Type:
tuple
Value:
()                                                                     

_at_fti_meta_type

Type:
str
Value:
'Factory-based Type Information with dynamic views'                    

Generated by Epydoc 2.1 on Wed Nov 30 03:58:29 2005 http://epydoc.sf.net