vendor/CMF/1.6.3/CMFCore

view CMFBTreeFolder.py @ 0:587011552858

import CMF 1.6.3
author bdelbosc
date Mon, 23 Apr 2007 13:58:01 +0000
parents
children
line source
1 ##############################################################################
2 #
3 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
4 # All Rights Reserved.
5 #
6 # This software is subject to the provisions of the Zope Public License,
7 # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
8 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11 # FOR A PARTICULAR PURPOSE
12 #
13 ##############################################################################
14 """CMFBTreeFolder
16 $Id$
17 """
19 from AccessControl.SecurityInfo import ClassSecurityInfo
20 from Globals import InitializeClass
21 from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base
23 from PortalFolder import PortalFolderBase
24 from PortalFolder import factory_type_information as PortalFolder_FTI
26 _actions = PortalFolder_FTI[0]['actions']
28 factory_type_information = ( { 'id' : 'CMF BTree Folder',
29 'meta_type' : 'CMF BTree Folder',
30 'description' : """\
31 CMF folder designed to hold a lot of objects.""",
32 'icon' : 'folder_icon.gif',
33 'product' : 'CMFCore',
34 'factory' : 'manage_addCMFBTreeFolder',
35 'filter_content_types' : 0,
36 'immediate_view' : 'folder_edit_form',
37 'actions' : _actions,
38 },
39 )
42 def manage_addCMFBTreeFolder(dispatcher, id, title='', REQUEST=None):
43 """Adds a new BTreeFolder object with id *id*.
44 """
45 id = str(id)
46 ob = CMFBTreeFolder(id)
47 ob.title = str(title)
48 dispatcher._setObject(id, ob)
49 ob = dispatcher._getOb(id)
50 if REQUEST is not None:
51 REQUEST['RESPONSE'].redirect(ob.absolute_url() + '/manage_main' )
54 class CMFBTreeFolder(BTreeFolder2Base, PortalFolderBase):
55 """BTree folder for CMF sites.
56 """
57 meta_type = 'CMF BTree Folder'
58 security = ClassSecurityInfo()
60 def __init__(self, id, title=''):
61 PortalFolderBase.__init__(self, id, title)
62 BTreeFolder2Base.__init__(self, id)
64 def _checkId(self, id, allow_dup=0):
65 PortalFolderBase._checkId(self, id, allow_dup)
66 BTreeFolder2Base._checkId(self, id, allow_dup)
69 InitializeClass(CMFBTreeFolder)