[Zope-CVS] CVS: Products/AdaptableStorage - Zope2FS.py:1.3
Shane Hathaway
shane@zope.com
Wed, 4 Dec 2002 23:18:38 -0500
Update of /cvs-repository/Products/AdaptableStorage
In directory cvs.zope.org:/tmp/cvs-serv26322
Modified Files:
Zope2FS.py
Log Message:
- Switched to use of the "remaining state" aspect, enabling storage of
any extra data found on ZODB objects. Fixed bugs related to this.
- Made sure Zope 2 objects store their classification.
- Modified the serialization event interface a little to allow more
control over automatic references. This needs work still.
- MetaTypeClassifier is now also an IAspectSerializer, making it
possible to delegate classification details to the classifier.
=== Products/AdaptableStorage/Zope2FS.py 1.2 => 1.3 ===
--- Products/AdaptableStorage/Zope2FS.py:1.2 Tue Dec 3 18:10:52 2002
+++ Products/AdaptableStorage/Zope2FS.py Wed Dec 4 23:18:07 2002
@@ -20,9 +20,11 @@
from serial.public \
import ObjectSerializer, ObjectGateway, ObjectMapper, DomainMapper
from serial_std.public \
- import RollCall, FixedPersistentMapping, IgnoredAttribute
+ import RollCall, FixedPersistentMapping, IgnoredAttribute, \
+ RemainingState, ClassificationAspect
from serial_ofs.public import FolderItems, MetaTypeClassifier, IdAttribute
-from gateway_fs.public import FSConnection, FSDirectoryItems, FSAutoId
+from gateway_fs.public import FSConnection, FSDirectoryItems, FSAutoId, \
+ FSSectionData, FSClassificationSection
def createDomainMapper(basepath, volatile=1):
@@ -36,22 +38,17 @@
# folder serializer
class_info = (('OFS.Folder', 'Folder'), None)
s = ObjectSerializer(class_info)
+ s.addAspect('classification', ClassificationAspect())
s.addAspect('items', FolderItems())
s.addAspect('id', IdAttribute())
- s.addAspect('owner', IgnoredAttribute('_owner'))
- s.addAspect('local_roles', IgnoredAttribute('__ac_local_roles__'))
- s.addAspect('title', IgnoredAttribute('title'))
- s.addAspect('roll_call', RollCall())
+ s.addAspect('remainder', RemainingState())
object_serializers['OFS/Folder'] = s
# application serializer
class_info = (('OFS.Application', 'Application'), None)
s = ObjectSerializer(class_info)
s.addAspect('items', FolderItems())
- s.addAspect('owner', IgnoredAttribute('_owner'))
- s.addAspect('local_roles', IgnoredAttribute('__ac_local_roles__'))
- s.addAspect('title', IgnoredAttribute('title'))
- s.addAspect('roll_call', RollCall())
+ s.addAspect('remainder', RemainingState())
object_serializers['OFS/Application'] = s
# root serializer
@@ -66,13 +63,16 @@
# folder gateway
g = ObjectGateway()
+ g.addGateway('classification', FSClassificationSection(fs_conn))
g.addGateway('items', FSDirectoryItems(fs_conn))
g.addGateway('id', FSAutoId())
+ g.addGateway('remainder', FSSectionData(fs_conn, 'remainder'))
object_gateways['OFS/Folder'] = g
# application gateway
g = ObjectGateway()
g.addGateway('items', FSDirectoryItems(fs_conn))
+ g.addGateway('remainder', FSSectionData(fs_conn, 'remainder'))
object_gateways['OFS/Application'] = g
# root gateway (no storage)