Back to index

plone3  3.1.7
Portal.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
00004 #
00005 # This software is subject to the provisions of the Zope Public License,
00006 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
00007 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00008 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00009 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00010 # FOR A PARTICULAR PURPOSE.
00011 #
00012 ##############################################################################
00013 """ Portal class
00014 
00015 $Id: Portal.py 39562 2005-10-23 09:46:52Z yuppie $
00016 """
00017 
00018 from Globals import InitializeClass
00019 
00020 from Products.CMFCore.PortalObject import PortalObjectBase
00021 
00022 from DublinCore import DefaultDublinCoreImpl
00023 from permissions import AddPortalContent
00024 from permissions import AddPortalFolders
00025 from permissions import ListPortalMembers
00026 from permissions import ReplyToItem
00027 from permissions import View
00028 
00029 
00030 class CMFSite(PortalObjectBase, DefaultDublinCoreImpl):
00031 
00032     """
00033         The *only* function this class should have is to help in the setup
00034         of a new CMFSite.  It should not assist in the functionality at all.
00035     """
00036     meta_type = 'CMF Site'
00037 
00038     _properties = (
00039         {'id':'title', 'type':'string', 'mode': 'w'},
00040         {'id':'description', 'type':'text', 'mode': 'w'},
00041         )
00042     title = ''
00043     description = ''
00044 
00045     __ac_permissions__=( ( AddPortalContent, () )
00046                        , ( AddPortalFolders, () )
00047                        , ( ListPortalMembers, () )
00048                        , ( ReplyToItem, () )
00049                        , ( View, ('isEffective',) )
00050                        )
00051 
00052     def __init__( self, id, title='' ):
00053         PortalObjectBase.__init__( self, id, title )
00054         DefaultDublinCoreImpl.__init__( self )
00055 
00056     def isEffective( self, date ):
00057         """
00058             Override DefaultDublinCoreImpl's test, since we are always viewable.
00059         """
00060         return 1
00061 
00062     def reindexObject( self, idxs=[] ):
00063         """
00064             Override DefaultDublinCoreImpl's method (so that we can play
00065             in 'editMetadata').
00066         """
00067         pass
00068 
00069 InitializeClass(CMFSite)