[Zope-CVS] CVS: Products/AdaptableStorage - Zope2FS.py:1.14 doc.txt:1.2
Shane Hathaway
shane@zope.com
Tue, 31 Dec 2002 16:09:34 -0500
Update of /cvs-repository/Products/AdaptableStorage
In directory cvs.zope.org:/tmp/cvs-serv13064
Modified Files:
Zope2FS.py doc.txt
Log Message:
- Added ITPCConnection. It doesn't really belong in the serial
package, but there's no other good place for it right now.
- FSConnection now allows a hidden filename prefix other than
".", such as "_", taking advantage of the fact that the Zope 2 security
model disallows leading underscores.
- Added some more docs.
=== Products/AdaptableStorage/Zope2FS.py 1.13 => 1.14 ===
--- Products/AdaptableStorage/Zope2FS.py:1.13 Mon Dec 23 23:29:30 2002
+++ Products/AdaptableStorage/Zope2FS.py Tue Dec 31 16:09:04 2002
@@ -25,13 +25,13 @@
from Zope2Mapper import createZope2Mapper
-def createMapper(basepath, volatile=1):
+def createMapper(basepath, volatile=1, **kw):
"""Object mapper factory.
Usage in database configuration file:
factory=Products.AdaptableStorage.Zope2FS.createMapper
"""
- conn = FSConnection(basepath)
+ conn = FSConnection(basepath, **kw)
root_mapper = createZope2Mapper('/', 0)
root_mapper.setVolatile(int(volatile))
root_mapper.getClassifier().setGateway(FSClassificationSection(conn))
=== Products/AdaptableStorage/doc.txt 1.1 => 1.2 ===
--- Products/AdaptableStorage/doc.txt:1.1 Mon Dec 23 23:29:30 2002
+++ Products/AdaptableStorage/doc.txt Tue Dec 31 16:09:04 2002
@@ -18,8 +18,73 @@
persistent object systems like ZODB.
-** Leave "holes" in object mappers to allow separation of gateway and
- serialization. **
+Setting Up a Filesystem Mapping
+
+Use the DBTab product to set up AdaptableStorage with Zope. DBTab
+makes it easy to mount secondary databases inside the main database.
+
+To get started, add the following sections to dbtab.conf, a text file
+placed at the root of your Zope site according to the DBTab
+directions.
+
+
+[Storage: FS]
+type=ASStorage
+factory=Products.AdaptableStorage.Zope2FS.createMapper
+basepath=%(CLIENT_HOME)s/mnt
+volatile=1
+
+[Database: FS]
+class=ASDB
+cache_size=4000
+mount_paths=/fs
+auto_create=1
+
+
+Restart Zope and visit the management interface. Select "DBTab Mount
+Point" from the drop-down add box. Zope will display a list of mount
+points. Click the "add selected mount points" button to mount the
+database.
+
+Now visit the new "fs" folder. All items added to this folder get
+stored in <zope>/var/mnt/fs rather than the main database. And when
+you add folders or files to the directory, those items are visible in
+Zope.
+
+AdaptableStorage stores certain objects like page templates in text
+format, while storing other objects as pickles. It uses the page
+template object mapper to store page templates, while falling back to
+the default object mapper for objects it is not able to store in a
+better way. It is not difficult to add mappers for new object types
+or change the way objects are stored.
+
+
+Setting Up a SQL Mapping
+
+Install PostgreSQL and create a database. Add the following
+dbtab.conf entries:
+
+
+[Storage: FS]
+type=ASStorage
+factory=Products.AdaptableStorage.Zope2SQL.createMapper
+params=
+volatile=1
+
+[Database: FS]
+class=ASDB
+cache_size=4000
+mount_paths=/sql
+auto_create=1
+
+
+Add to the "params" line the parameters for connecting to the
+database, such as the host name, user name, database name, and
+password. (If Postgres is installed locally and you create a default
+database, you may be able to leave params blank.) When you add the
+"/sql" mount point, Zope will create some tables with the prefix
+"zodb" and objects placed under "/sql" will be stored in those tables.
+