[Zope-CMF] HCFileStorage

Glenn Pierce glenn.pierce at odconsultancy.com
Mon Aug 4 10:12:26 EDT 2003


For anyone with this problem the way to use HCFileStorage.

The custom_zodb file should contain something similar to the following


import os,sys
import Globals
import ZODB.HCFileStorage
                                                                                
from Products.CMFOD.WebPage import WebPage
                                                                                
historyCategories = ('WebPage With History', [WebPage], 0),
storage = ZODB.HCFileStorage.HCFileStorage(Globals.BobobaseName,
historyCategories=historyCategories)
                                                                                
DB = ZODB.DB(storage)


Where WebPage is the context type for which I want to keep histories
for.

 




On Mon, 2003-07-28 at 15:33, Glenn Pierce wrote:
> Hi 
> 
> Can anyone help me in setting up HCFileStorage
> 
> I have placed HCFileStorage in the ZODB directory with FileStorage
> 
> I have also created a custom_zodb.py with the following contents in my
> INSTANCE_HOME
> 
> 
> import Globals
> import ZODB.HCFileStorage
>                                                                                                                     
> classes = ('WebPage',)
> historyCategories = (('Content with History', classes, 10),)
> storage = ZODB.HCFileStorage.HCFileStorage(Globals.BobobaseName,
> historyCategories)
>                                                                                                                  
> DB = ZODB.DB(storage)
> 
> (WebPage is basically a Document with OFS.History)
> 
> After starting zope for the first time every thing appears to work
> however when packing zope's db
> I get permission errors of
> 
> Traceback (innermost last):
>   File /usr/lib/zope/lib/python/ZODB/DB.py, line 499, in pack
>   File /usr/lib/zope/lib/python/ZODB/HCFileStorage.py, line 534, in pack
>     (Object: /var/lib/zope/instance/default/var/Data.fs)
>   File /usr/lib/zope/lib/python/ZODB/HCFileStorage.py, line 456, in
> _oriPack
>     (Object: /var/lib/zope/instance/default/var/Data.fs)
> IOError: [Errno 13] Permission denied:
> '/var/lib/zope/instance/default/var/Data.fs'
> 
> 
> Afer changing permissions on the Dat.fs which I know is no solution
> (Just wanted to see if it would solve things)
> 
> I get
> 2003-07-28T15:27:18 ERROR(200) ZODB Couldn't load state for
> '\x00\x00\x00\x00\x00\x00\x003'
> Traceback (innermost last):
>   File /usr/lib/zope/lib/python/ZODB/Connection.py, line 509, in
> setstate
>   File /usr/lib/zope/lib/python/ZODB/FileStorage.py, line 650, in load
>     (Object: /var/lib/zope/instance/default/var/Data.fs)
>   File /usr/lib/zope/lib/python/ZODB/FileStorage.py, line 625, in _load
>     (Object: /var/lib/zope/instance/default/var/Data.fs)
> ValueError: I/O operation on closed file
> 
> 
> I have no doubt that I am using HCFileStorage incorrectly as I can find
> no examples.
> 
> Any help greatly appreciated.
> 
> Thank you
> 
> Glenn
> 
> 
> 
> 
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF at zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See http://collector.zope.org/CMF for bug reports and feature requests
> 




More information about the Zope-CMF mailing list