Logo Search packages:      
Sourcecode: zope-cmfdynamicviewfti version File versions  Download package

def CMFDynamicViewFTI::browserdefault::BrowserDefaultMixin::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.

Definition at line 136 of file browserdefault.py.

00136                                       :
        """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.
        """
        new_page = old_page = None
        if objectId is not None:
            new_page = getattr(self, objectId, None)
        if self.hasProperty('default_page'):
            pages = self.getProperty('default_page','')
            if isinstance(pages, (list, tuple)):
                for page in pages:
                    old_page = getattr(self, page, None)
                    if page is not None: break
            elif isinstance(pages, str):
                old_page = getattr(self, pages, None)

            if objectId is None:
                self.manage_delProperties(['default_page'])
            else:
                self.manage_changeProperties(default_page = objectId)
        else:
            if objectId is not None:
                self.manage_addProperty('default_page', objectId, 'string')
        if new_page != old_page:
            if new_page is not None:
                new_page.reindexObject(['is_default_page'])
            if old_page is not None:
                old_page.reindexObject(['is_default_page'])

    security.declareProtected(ModifyViewTemplate, 'setLayout')
    def setLayout(self, layout):


Generated by  Doxygen 1.6.0   Back to index