[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser - FolderContents.py:1.1.2.1

Christian Theune ct@gocept.com
Sat, 18 May 2002 06:30:07 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv32027

Added Files:
      Tag: ctheune-foldermove-branch
	FolderContents.py 
Log Message:
Renamed FolderContents.py to ../../../Content/Folder/Views/Browser//FolderContents.py

=== Added File Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/FolderContents.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
# 
##############################################################################
"""
    Define view component for folder contents.

$Id: FolderContents.py,v 1.1.2.1 2002/05/18 10:30:07 ctheune Exp $
"""

import os

from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
from Zope.App.OFS.ServiceManager.ServiceManager import ServiceManager
from Zope.App.OFS.Container.Views.Browser.Contents import Contents

class FolderContents(Contents):

    def addServiceManager(self, REQUEST=None):
        """Create a service manager then add it to the folder."""
        sm = ServiceManager()
        if self.getContext().hasServiceManager():
            raise 'HasServiceManager', (
                  'This folder already contains a service manager')
        self.getContext().setServiceManager(sm)
        if REQUEST is not None:
            return self.index(REQUEST)

    index = PageTemplateFile('contents.pt')