Ape and DBTab Configuration in Zope 2.7
Hi everybody, I could find any info about how to setup a filestorage with ape, dbtab and zope 2.7 (I want to keep the content of some folders in the filesystem) Could anybody point me to some infos or know how to do it? -- Thanks, Elena
I could find any info about how to setup a filestorage with ape, dbtab and zope 2.7 (I want to keep the content of some folders in the filesystem) Could anybody point me to some infos or know how to do it?
Ape 0.7.1 (the current version) doesn't work with python 2.3 and thus zope 2.7. If you really need to use Ape either use python 2.1 and zope 2.6.x or wait for Ape 0.8 to come out (I have no idea when the will happen, but Shane is still working on it.) If you're comfortable with cvs, then you can try getting Ape from zope's cvs repository. Last time I did a checkout the cvs version was working with zope 2.7. I wouldn't use it in production though. hth, joseph
On 15 Mar 2004 at 14:57, Elena Schulz wrote:
I could find any info about how to setup a filestorage with ape, dbtab and zope 2.7 (I want to keep the content of some folders in the filesystem) Could anybody point me to some infos or know how to do it?
I am using Ape 0.7.1 with Python 2.3.2 and Zope 2.7.0 on RH Linux 9.. No problems other than trying to store an ldapUserFolder. I have a workaround from shane but I haven't tried it since I had refactored my site to remove the problem. -- Someone else said:
Ape 0.7.1 (the current version) doesn't work with python 2.3 and thus zope 2.7.
But it works for me. Put Ape into 2.7.0/lib/python/Products (it cannot be in an INSTANCE_HOME Products directory) Ape has a file called "component.xml" that tells you what to do for 2.7:: To use this, first add the following line near the top of Zope/Startup/zopeschema.xml: <import package="Products.Ape"/> Then add to zope.conf: <ape-db fs> <ape-storage> mapper-variation filesystem <ape-fs-connection fs> basepath $INSTANCE/var/myfs </ape-fs-connection> </ape-storage> mount-point /fs scan-interval 10 </ape-db> - - Then start up Zope, and "Add A ZODB Mount Point" via ZMI. I don't know if it matters where you "add the mount point", it seems to use what's in zope.conf for the path anyway. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements
I could find any info about how to setup a filestorage with ape, dbtab and zope 2.7 (I want to keep the content of some folders in the filesystem) Could anybody point me to some infos or know how to do it?
I am using Ape 0.7.1 with Python 2.3.2 and Zope 2.7.0 on RH Linux 9.. No problems other than trying to store an ldapUserFolder. I have a workaround from shane but I haven't tried it since I had refactored my site to remove the problem.
--
Someone else said:
Ape 0.7.1 (the current version) doesn't work with python 2.3 and thus zope 2.7.
But it works for me.
I guess I should clarify. It works, but not for all object types. I'm guessing the problem you ran into with ldapUserFolder was that Zope would eventually give an out of memory error when you tried to add that particular type of object. I decided Ape 0.7.1 wouldn't work for me since the unit tests wouldn't pass... one of them caused the out of memory problem. Some object types worked for me, a few critical ones didn't, but I never wrote down exactly which ones. Is the workaround posted in the archives anywhere? If so I haven't been able to find it. I know Shane has it fixed the problem in cvs, but I was never able to figure out a working set of changes to get the unit tests to pass. joseph
On 15 Mar 2004 at 12:51, Joseph Kocherhans wrote:
Is the workaround posted in the archives anywhere? If so I haven't been able to find it. I know Shane has
Here's what Shane told me. I'm afraid I haven't tried it since I couldn't wait for an answer (he was out of town consulting at the time) so I rearranged my site and haven't changed it back. --- On Tue, 16 Dec 2003, Brad Clements wrote:
Hi,
This isn't critical. Just a report.
Storing an LDAPUserFolder object in Ape causes Zope 2.7 to allocate memory with bounds, and eventually fault (redhat linux 9) on Python 2.3.2 . it's not a recursion exceeded error.
I think something in Ape doesn't know how to serialize LDAPUserFolder. I'm using the stock .xml config you shipped in the lastest APE and storing to the file system.
What's the best way for me to debug this?
Try instructing it to serialize as a file rather than a folder. At the bottom of apeconf.xml there are two similar workarounds. Add something like this: <mapper name="anyfile"> <use-for class="Products.LDAPUserFolder.LDAPUserFolder.LDAPUserFolder" /> </mapper> Shane -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements
Hi Brad,
But it works for me. For me not :(my environment: Zope 2.7.0, python 2.3.2, win32)
Put Ape into 2.7.0/lib/python/Products (it cannot be in an INSTANCE_HOME Products directory) Ok, this I changed. I had it in INSTANCE_HOME/Products
Ape has a file called "component.xml" that tells you what to do for 2.7:: Good to know, but ...
add the following line near the top of Zope/Startup/zopeschema.xml: <import package="Products.Ape"/> .. as soon as I add this to my Zope/Startup/zopeschema.xml starting Zope I get the below error.
Does anybody know about that? -- Thanks, Elena Error when starting Zope with <import package="Products.Ape"/> in Zope/Startup/zopeschema.xml: L:\Zope\ZopeData\bin>"I:\Python\ActivePython232\python.exe" "L:\Zope\Zope-2.7.0\lib\python\Zope\Star tup\run.py" -C "L:\Zope\ZopeData\etc\zope2.7.0.conf" Traceback (most recent call last): File "L:\Zope\Zope-2.7.0\lib\python\Zope\Startup\run.py", line 49, in ? run() File "L:\Zope\Zope-2.7.0\lib\python\Zope\Startup\run.py", line 18, in run opts = _setconfig() File "L:\Zope\Zope-2.7.0\lib\python\Zope\Startup\run.py", line 41, in _setconfig opts.realize(doc="Sorry, no option docs yet.") File "L:\Zope\Zope-2.7.0\lib\python\zdaemon\zdoptions.py", line 262, in realize self.load_schema() File "L:\Zope\Zope-2.7.0\lib\python\zdaemon\zdoptions.py", line 303, in load_schema self.schema = ZConfig.loadSchema(self.schemafile) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\loader.py", line 37, in loadSchema return SchemaLoader().loadURL(url) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\loader.py", line 71, in loadURL return self.loadResource(r) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\loader.py", line 137, in loadResource schema = ZConfig.schema.parseResource(resource, self) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\schema.py", line 43, in parseResource xml.sax.parse(resource.file, parser) File "I:\Python\ActivePython232\lib\xml\sax\__init__.py", line 33, in parse parser.parse(source) File "I:\Python\ActivePython232\lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "I:\Python\ActivePython232\lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "I:\Python\ActivePython232\lib\xml\sax\expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "I:\Python\ActivePython232\lib\xml\sax\expatreader.py", line 300, in start_element self._cont_handler.startElement(name, AttributesImpl(attrs)) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\schema.py", line 119, in startElement getattr(self, "start_" + name)(attrs) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\schema.py", line 309, in start_import self.loadComponent(src) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\schema.py", line 315, in loadComponent xml.sax.parse(r.file, parser) File "I:\Python\ActivePython232\lib\xml\sax\__init__.py", line 33, in parse parser.parse(source) File "I:\Python\ActivePython232\lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "I:\Python\ActivePython232\lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "I:\Python\ActivePython232\lib\xml\sax\expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "I:\Python\ActivePython232\lib\xml\sax\expatreader.py", line 300, in start_element self._cont_handler.startElement(name, AttributesImpl(attrs)) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\schema.py", line 119, in startElement getattr(self, "start_" + name)(attrs) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\schema.py", line 343, in start_sectiontype interface = self._schema.gettype(ifname) File "L:\Zope\Zope-2.7.0\lib\python\ZConfig\info.py", line 262, in gettype raise ZConfig.SchemaError("unknown type name: " + `name`) ZConfig.SchemaError: unknown type name: 'zodb.storage'
Elena Schulz wrote:
Hi Brad,
But it works for me.
For me not :(my environment: Zope 2.7.0, python 2.3.2, win32)
Put Ape into 2.7.0/lib/python/Products (it cannot be in an INSTANCE_HOME
Products
directory)
Ok, this I changed. I had it in INSTANCE_HOME/Products
Ape has a file called "component.xml" that tells you what to do for 2.7::
Good to know, but ...
add the following line near the top of Zope/Startup/zopeschema.xml: <import package="Products.Ape"/>
.. as soon as I add this to my Zope/Startup/zopeschema.xml starting Zope I get the below error.
Does anybody know about that?
-- Thanks, Elena
Are you using the latest CVS version? I looked at component.xml and the setup instructions have changed. The mention of adding <import package="Products.Ape"/> was taken out on Oct 14, 2003, but it looks like you have to put %import Products.Ape in your zope.conf... I don't know enough about ZConfig to know whether the percent sign there is a type, or some sort of config option. I'd try it both ways and see if it works. joseph
Joseph Kocherhans wrote:
Are you using the latest CVS version? I looked at component.xml and the setup instructions have changed. The mention of adding <import package="Products.Ape"/> was taken out on Oct 14, 2003, but it looks like you have to put %import Products.Ape in your zope.conf... I don't know enough about ZConfig to know whether the percent sign there is a type, or some sort of config option. I'd try it both ways and see if it works.
Here is what I put in my zope.conf (with the latest CVS): %import Products.Ape <ape-db fs> <ape-storage> mapper-variation filesystem <ape-fs-connection fs> basepath $INSTANCE/db </ape-fs-connection> </ape-storage> mount-point / scan-interval 10 </ape-db> Note that I mounted at the root. Cool, huh? I plan to release version 0.8 after I update README.txt and fix the MySQL support. This next release is intended to be a major simplification that reduces the number of concepts you have to learn to serialize your own objects and extend Ape. There are also fewer monkey patches. Shane
Hi Joseph and Shane,
Are you using the latest CVS version? Yes, thats why I was wondering about your <import package="Products.Ape"/> instruction.
%import Products.Ape in your zope.conf... I don't know enough about ZConfig to know whether the percent sign there is a type, or some sort of config option. Yes, %import is a ZConfig directive and I learned that the mounted folder *have to be created after* adding ZODB Mount Point
So, doing as said in the Zope/Startup/zopeschema.xml i.e. adding %import Products.Ape in my zope.conf and deleting the mounted folders from ZMI everything works like a charm, almost :-). Shane, that root mounting is very cool indeed. So that's an easy alternative to the Direct-Storage-Project? How is the performance of the fs-storage of ape compared to Data.fs storages? Is there any knowledge about that? Thanks a lot for your help and this product. I have one or two more questions about ape fs storage: 1. Some meta_types are stored in plain readable text like Python Scripts, ZSQL-Methods and Page Templates. Others like DTML Documents and Methods have a pickled fs represantation. As ZSQL-Methods are almost the same as DTML I don't see a reason for this. Does anyone know more about that and may be how to give DTML Documents and Methods also a readable fs representation. 2. On windows PageTemplates get the extension html. How to change that into zpt? Same with other meta_types like DTML (after makeing them human readable) -- Thanks for any input, Elena
Elena Schulz wrote:
I have one or two more questions about ape fs storage: 1. Some meta_types are stored in plain readable text like Python Scripts, ZSQL-Methods and Page Templates. Others like DTML Documents and Methods have a pickled fs represantation. As ZSQL-Methods are almost the same as DTML I don't see a reason for this. Does anyone know more about that and may be how to give DTML Documents and Methods also a readable fs representation.
2. On windows PageTemplates get the extension html. How to change that into zpt? Same with other meta_types like DTML (after makeing them human readable)
These are both configurable in apeconf.xml. See: http://cvs.zope.org/Products/Ape/lib/apelib/zope2/apeconf.xml?rev=1.9&conten... http://cvs.zope.org/Products/Ape/doc/apexml.txt?rev=1.4 Shane
participants (4)
-
Brad Clements -
Elena Schulz -
Joseph Kocherhans -
Shane Hathaway