[Zope-CVS] CVS: Products/AdaptableStorage - CHANGES.txt:1.3.2.3 Zope2FS.py:1.16.2.5 Zope2Mapper.py:1.3.2.5 Zope2SQL.py:1.7.2.5 patches.py:1.2.2.4

Christian Zagrodnick cz@gocept.com
Tue, 4 Feb 2003 12:30:07 -0500


Update of /cvs-repository/Products/AdaptableStorage
In directory cvs.zope.org:/tmp/cvs-serv26068

Modified Files:
      Tag: zagy-patches
	CHANGES.txt Zope2FS.py Zope2Mapper.py Zope2SQL.py patches.py 
Log Message:
merging HEAD into zagy-patches branch

=== Products/AdaptableStorage/CHANGES.txt 1.3.2.2 => 1.3.2.3 ===
--- Products/AdaptableStorage/CHANGES.txt:1.3.2.2	Thu Jan 23 12:10:15 2003
+++ Products/AdaptableStorage/CHANGES.txt	Tue Feb  4 12:29:34 2003
@@ -1,8 +1,11 @@
 
-Next bugfix release
+Next release
 
   - Fixed storage of selection properties.  The select_variable was
     being forgotten.
+
+  - Integrated work by Christian Zagrodnick: added mappers for Python
+    Scripts, DTML Methods, DTML Documents, and ZSQLMethods.  Thanks!
 
 Version 0.4.2
 


=== Products/AdaptableStorage/Zope2FS.py 1.16.2.4 => 1.16.2.5 ===
--- Products/AdaptableStorage/Zope2FS.py:1.16.2.4	Mon Feb  3 12:43:00 2003
+++ Products/AdaptableStorage/Zope2FS.py	Tue Feb  4 12:29:34 2003
@@ -38,60 +38,62 @@
     root_mapper.getClassifier().setGateway(FSClassificationSection(conn))
     root_mapper.setKeychainGenerator(PathKeychainGenerator())
 
+    item_id_gw = FSAutoId()
     properties_gw = FSProperties(conn)
+    remainder_gw = FSSectionData(conn, 'remainder')
 
     # folder gateway
     g = ObjectGateway()
     g.addGateway('items', FSDirectoryItems(conn))
     g.addGateway('properties', properties_gw)
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('OFS.Folder.Folder').setGateway(g)
 
     # page template gateway
     g = ObjectGateway()
     g.addGateway('text', FSFileData(conn))
     g.addGateway('properties', properties_gw)
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('ZopePageTemplate').setGateway(g)
 
     # dtml method gateway
     g = ObjectGateway()
     g.addGateway('text', FSFileData(conn))
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('OFS.DTMLMethod.DTMLMethod').setGateway(g)
     
     # dtml document gateway
     g = ObjectGateway()
     g.addGateway('text', FSFileData(conn))
     g.addGateway('properties', properties_gw)
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('OFS.DTMLDocument.DTMLDocument').setGateway(g)
 
-    # zsql mapper
+    # zsqlmethod mapper
     g = ObjectGateway()
     g.addGateway('text', FSFileData(conn))
     g.addGateway('properties', FSProperties(conn, 'ZSQL Properties'))
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('Products.ZSQLMethods.SQL.SQL').setGateway(g)
 
     # python script mapper
     g = ObjectGateway()
     g.addGateway('body', FSFileData(conn))
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('PythonScript').setGateway(g)
 
     # file gateway
     g = ObjectGateway()
     g.addGateway('data', FSFileData(conn))
     g.addGateway('properties', properties_gw)
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('OFS.Image.File').setGateway(g)
 
     # image gateway is identical
@@ -100,21 +102,21 @@
     # user folder gateway
     g = ObjectGateway()
     g.addGateway('data', FSUserList(conn))
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('AccessControl.User.UserFolder').setGateway(g)
 
     # anyfolder object gateway
     g = ObjectGateway()
     g.addGateway('items', FSDirectoryItems(conn))
     g.addGateway('properties', properties_gw)
-    g.addGateway('id', FSAutoId())
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('anyfolder').setGateway(g)
 
     # anyfile object gateway
     g = ObjectGateway()
-    g.addGateway('id', FSAutoId())
+    g.addGateway('id', item_id_gw)
     g.addGateway('remainder', FSFileData(conn))
     root_mapper.getSubMapper('anyfile').setGateway(g)
 
@@ -122,7 +124,7 @@
     g = ObjectGateway()
     g.addGateway('properties', properties_gw)
     g.addGateway('items', FSDirectoryItems(conn))
-    g.addGateway('remainder', FSSectionData(conn, 'remainder'))
+    g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('OFS.Application.Application').setGateway(g)
 
     root_mapper.checkConfiguration()


=== Products/AdaptableStorage/Zope2Mapper.py 1.3.2.4 => 1.3.2.5 ===
--- Products/AdaptableStorage/Zope2Mapper.py:1.3.2.4	Mon Feb  3 12:43:00 2003
+++ Products/AdaptableStorage/Zope2Mapper.py	Tue Feb  4 12:29:34 2003
@@ -51,6 +51,8 @@
     else:
         folder_items_aspect = FolderItems()
     properties_aspect = OFSProperties()
+    id_aspect = IdAttribute()
+    remainder_aspect = RemainingState()
 
     # folder mapper
     m = root_mapper.addSubMapper('OFS.Folder.Folder')
@@ -58,28 +60,28 @@
     m.setSerializer(s)
     s.addAspect('items', folder_items_aspect)
     s.addAspect('properties', properties_aspect)
-    s.addAspect('id', IdAttribute())
-    s.addAspect('remainder', RemainingState())
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
     classifier.registerDefaultLoader('Folder', 'OFS.Folder.Folder', 1)
 
     # file mapper
     m = root_mapper.addSubMapper('OFS.Image.File')
     s = ObjectSerializer('OFS.Image', 'File')
     m.setSerializer(s)
-    s.addAspect('id', IdAttribute())
+    s.addAspect('id', id_aspect)
     s.addAspect('properties', properties_aspect)
     s.addAspect('data', FilePData())
-    s.addAspect('remainder', RemainingState())
+    s.addAspect('remainder', remainder_aspect)
     classifier.registerDefaultLoader('File', 'OFS.Image.File', 0)
 
     # image mapper
     m = root_mapper.addSubMapper('OFS.Image.Image')
     s = ObjectSerializer('OFS.Image', 'Image')
     m.setSerializer(s)
-    s.addAspect('id', IdAttribute())
+    s.addAspect('id', id_aspect)
     s.addAspect('properties', properties_aspect)
     s.addAspect('data', FilePData())
-    s.addAspect('remainder', RemainingState())
+    s.addAspect('remainder', remainder_aspect)
     classifier.register('Image', 'OFS.Image.Image', (
         '.gif', '.jpg', '.jpeg', '.png'))
 
@@ -90,8 +92,8 @@
     m.setSerializer(s)
     s.addAspect('text', StringDataAttribute('_text'))
     s.addAspect('properties', properties_aspect)
-    s.addAspect('id', IdAttribute())
-    s.addAspect('remainder', RemainingState())
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
     classifier.register('Page Template', 'ZopePageTemplate', (
         '.pt', '.zpt', '.html'))
 
@@ -100,10 +102,9 @@
     s = ObjectSerializer('OFS.DTMLMethod', 'DTMLMethod')
     m.setSerializer(s)
     s.addAspect('text', StringDataAttribute('raw'))
-    s.addAspect('id', IdAttribute())
-    s.addAspect('remainder', RemainingState())
-    classifier.register('DTML Method', 'OFS.DTMLMethod.DTMLMethod', (
-        '.dtml', ))
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
+    classifier.register('DTML Method', 'OFS.DTMLMethod.DTMLMethod', ('.dtml',))
 
     # dtml document mapper
     m = root_mapper.addSubMapper('OFS.DTMLDocument.DTMLDocument')
@@ -111,10 +112,9 @@
     m.setSerializer(s)
     s.addAspect('text', StringDataAttribute('raw'))
     s.addAspect('properties', properties_aspect)
-    s.addAspect('id', IdAttribute())
-    s.addAspect('remainder', RemainingState())
-    classifier.register('DTML Document', 'OFS.DTMLDocument.DTMLDocument', (
-        '.dtml', ))
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
+    classifier.register('DTML Document', 'OFS.DTMLDocument.DTMLDocument')
       
     # zsql mapper
     m = root_mapper.addSubMapper('Products.ZSQLMethods.SQL.SQL')
@@ -122,8 +122,8 @@
     m.setSerializer(s)
     s.addAspect('text', ZSQLMethodSerializer())
     s.addAspect('properties', ZSQLMethodPropertiesSerializer())
-    s.addAspect('id', IdAttribute())
-    s.addAspect('remainder', RemainingState())
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
     classifier.register('Z SQL Method', 'Products.ZSQLMethods.SQL.SQL', (
         '.sql', ))
       
@@ -133,18 +133,17 @@
         'PythonScript')
     m.setSerializer(s)
     s.addAspect('body', PythonScriptSerializer())
-    s.addAspect('id', IdAttribute())
-    s.addAspect('remainder', RemainingState())
-    classifier.register('Script (Python)', 
-        'PythonScript', ('.py', ))
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
+    classifier.register('Script (Python)', 'PythonScript', ('.py', ))
 
     # 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())
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
     classifier.register('User Folder', 'AccessControl.User.UserFolder')
 
     # anyfolder mapper
@@ -153,16 +152,16 @@
     m.setSerializer(s)
     s.addAspect('items', folder_items_aspect)
     s.addAspect('properties', OptionalAspect(properties_aspect, []))
-    s.addAspect('id', IdAttribute())
-    s.addAspect('remainder', RemainingState())
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
     classifier.registerDefaultStorage('(folderish object)', 'anyfolder', 1)
 
     # anyfile mapper
     m = root_mapper.addSubMapper('anyfile')
     s = AnyObjectSerializer()
     m.setSerializer(s)
-    s.addAspect('id', IdAttribute())
-    s.addAspect('remainder', RemainingState())
+    s.addAspect('id', id_aspect)
+    s.addAspect('remainder', remainder_aspect)
     classifier.registerDefaultStorage('(fileish object)', 'anyfile', 0)
 
     # application mapper
@@ -171,7 +170,7 @@
     m.setSerializer(s)
     s.addAspect('properties', properties_aspect)
     s.addAspect('items', folder_items_aspect)
-    s.addAspect('remainder', RemainingState())
+    s.addAspect('remainder', remainder_aspect)
     classifier.registerKey(
         'Application', 'OFS.Application.Application', app_key)
 


=== Products/AdaptableStorage/Zope2SQL.py 1.7.2.4 => 1.7.2.5 ===
--- Products/AdaptableStorage/Zope2SQL.py:1.7.2.4	Mon Feb  3 12:43:00 2003
+++ Products/AdaptableStorage/Zope2SQL.py	Tue Feb  4 12:29:34 2003
@@ -66,6 +66,36 @@
     g.addGateway('remainder', remainder_gw)
     root_mapper.getSubMapper('ZopePageTemplate').setGateway(g)
 
+    # dtml method gateway
+    g = ObjectGateway()
+    g.addGateway('text', file_data_gw)
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
+    root_mapper.getSubMapper('OFS.DTMLMethod.DTMLMethod').setGateway(g)
+    
+    # dtml document gateway
+    g = ObjectGateway()
+    g.addGateway('text', file_data_gw)
+    g.addGateway('properties', properties_gw)
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
+    root_mapper.getSubMapper('OFS.DTMLDocument.DTMLDocument').setGateway(g)
+
+    # zsqlmethod mapper
+    g = ObjectGateway()
+    g.addGateway('text', file_data_gw)
+    g.addGateway('properties', properties_gw)
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
+    root_mapper.getSubMapper('Products.ZSQLMethods.SQL.SQL').setGateway(g)
+
+    # python script mapper
+    g = ObjectGateway()
+    g.addGateway('body', file_data_gw)
+    g.addGateway('id', item_id_gw)
+    g.addGateway('remainder', remainder_gw)
+    root_mapper.getSubMapper('PythonScript').setGateway(g)
+
     # file gateway
     g = ObjectGateway()
     g.addGateway('data', file_data_gw)


=== Products/AdaptableStorage/patches.py 1.2.2.3 => 1.2.2.4 ===