[Zope-Checkins] CVS: Products/AdaptableStorage - Zope2FS.py:1.17 Zope2Mapper.py:1.5 Zope2SQL.py:1.8
Shane Hathaway
shane@zope.com
Mon, 6 Jan 2003 18:18:12 -0500
Update of /cvs-repository/Products/AdaptableStorage
In directory cvs.zope.org:/tmp/cvs-serv1755
Modified Files:
Zope2FS.py Zope2Mapper.py Zope2SQL.py
Log Message:
- Added a user folder mapper for the filesystem. SQL version coming
soon. (SQL tests fail at the moment.)
- Added unwriteData() to FSConnection. I may remove it later, since it turned
out I didn't need it.
- Made configuration errors easier to read.
- Added null implementations of certain interfaces.
- Added a default for FixedClassifier.
=== Products/AdaptableStorage/Zope2FS.py 1.16 => 1.17 ===
--- Products/AdaptableStorage/Zope2FS.py:1.16 Fri Jan 3 17:04:14 2003
+++ Products/AdaptableStorage/Zope2FS.py Mon Jan 6 18:17:39 2003
@@ -20,7 +20,8 @@
from mapper.public import ObjectGateway
from mapper_std.public import PathKeychainGenerator
from gateway_fs.public import FSConnection, FSDirectoryItems, FSAutoId, \
- FSSectionData, FSClassificationSection, FSFileData, FSProperties
+ FSSectionData, FSClassificationSection, FSFileData, FSProperties, \
+ FSUserList
from Zope2Mapper import createZope2Mapper
@@ -65,6 +66,13 @@
# image gateway is identical
root_mapper.getSubMapper('OFS.Image.Image').setGateway(g)
+
+ # user folder gateway
+ g = ObjectGateway()
+ g.addGateway('data', FSUserList(conn))
+ g.addGateway('id', FSAutoId())
+ g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+ root_mapper.getSubMapper('AccessControl.User.UserFolder').setGateway(g)
# anyfolder object gateway
g = ObjectGateway()
=== Products/AdaptableStorage/Zope2Mapper.py 1.4 => 1.5 ===
--- Products/AdaptableStorage/Zope2Mapper.py:1.4 Mon Jan 6 10:36:45 2003
+++ Products/AdaptableStorage/Zope2Mapper.py Mon Jan 6 18:17:39 2003
@@ -24,7 +24,7 @@
AnyObjectSerializer, StringDataAttribute, OptionalAspect
from serial_ofs.public \
import FolderItems, FolderItemsByKeychain, MetaTypeClassifier, \
- IdAttribute, FilePData, OFSProperties
+ IdAttribute, FilePData, OFSProperties, UserFolderSerializer
from zodb.public import RemainingState
@@ -43,11 +43,11 @@
root_mapper.setSerializer(s)
root_mapper.setGateway(ObjectGateway()) # No storage necessary
+ # Prepare some common names
if stored_keychains:
folder_items_aspect = FolderItemsByKeychain()
else:
folder_items_aspect = FolderItems()
-
properties_aspect = OFSProperties()
# folder mapper
@@ -92,6 +92,15 @@
s.addAspect('remainder', RemainingState())
classifier.register('Page Template', 'ZopePageTemplate', (
'.pt', '.zpt', '.html'))
+
+ # user folder mapper
+ m = root_mapper.addSubMapper('AccessControl.User.UserFolder')
+ s = ObjectSerializer('AccessControl.User', 'UserFolder')
+ m.setSerializer(s)
+ s.addAspect('data', UserFolderSerializer())
+ s.addAspect('id', IdAttribute())
+ s.addAspect('remainder', RemainingState())
+ classifier.register('User Folder', 'AccessControl.User.UserFolder')
# anyfolder mapper
m = root_mapper.addSubMapper('anyfolder')
=== Products/AdaptableStorage/Zope2SQL.py 1.7 => 1.8 ===
--- Products/AdaptableStorage/Zope2SQL.py:1.7 Fri Jan 3 17:04:14 2003
+++ Products/AdaptableStorage/Zope2SQL.py Mon Jan 6 18:17:39 2003
@@ -99,6 +99,8 @@
g.addGateway('remainder', remainder_gw)
root_mapper.getSubMapper('OFS.Application.Application').setGateway(g)
+ root_mapper.checkConfiguration()
+
return root_mapper, [conn], gws