Skip to content

Commit

Permalink
Made CMFBTreeFolder compatible with CMF 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran committed Jun 20, 2005
0 parents commit 43cf6c9
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Version 1.0.2

- Made CMFBTreeFolder compatible with CMF 1.5+

Version 1.0.1

- ConflictError was swallowed by _delObject. This could break code
expecting to do cleanups before deletion.

- Renamed hasObject() to has_key(). hasObject() conflicted with
another product.

- You can now visit objects whose names have a trailing space.

Version 1.0

- BTreeFolder2s now use an icon contributed by Chris Withers.

- Since recent ZODB releases have caused minor corruption in BTrees,
there is now a manage_cleanup method for fixing damaged BTrees
contained in BTreeFolders.

Version 0.5.1

- Fixed the CMFBTreeFolder constructor.
71 changes: 71 additions & 0 deletions CMFBTreeFolder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
##############################################################################
#
# 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
#
##############################################################################
"""CMFBTreeFolder
$Id: CMFBTreeFolder.py,v 1.2 2002/10/30 14:54:18 shane Exp $
"""

import Globals
from BTreeFolder2 import BTreeFolder2Base
try:
from Products.CMFCore.PortalFolder import PortalFolderBase as PortalFolder
except ImportError:
from Products.CMFCore.PortalFolder import PortalFolder
import Products.CMFCore.PortalFolder


_actions = Products.CMFCore.PortalFolder.factory_type_information[0]['actions']

factory_type_information = ( { 'id' : 'CMF BTree Folder',
'meta_type' : 'CMF BTree Folder',
'description' : """\
CMF folder designed to hold a lot of objects.""",
'icon' : 'folder_icon.gif',
'product' : 'BTreeFolder2',
'factory' : 'manage_addCMFBTreeFolder',
'filter_content_types' : 0,
'immediate_view' : 'folder_edit_form',
'actions' : _actions,
},
)


def manage_addCMFBTreeFolder(dispatcher, id, title='', REQUEST=None):
"""Adds a new BTreeFolder object with id *id*.
"""
id = str(id)
ob = CMFBTreeFolder(id)
ob.title = str(title)
dispatcher._setObject(id, ob)
ob = dispatcher._getOb(id)
if REQUEST is not None:
REQUEST['RESPONSE'].redirect(ob.absolute_url() + '/manage_main' )


class CMFBTreeFolder(BTreeFolder2Base, PortalFolder):
"""BTree folder for CMF sites.
"""
meta_type = 'CMF BTree Folder'

def __init__(self, id, title=''):
PortalFolder.__init__(self, id, title)
BTreeFolder2Base.__init__(self, id)

def _checkId(self, id, allow_dup=0):
PortalFolder._checkId(self, id, allow_dup)
BTreeFolder2Base._checkId(self, id, allow_dup)


Globals.InitializeClass(CMFBTreeFolder)

1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BTreeFolder2-1.0.2

0 comments on commit 43cf6c9

Please sign in to comment.