Hi, How can I get the list of all urls from zodb. This is for creating an xml Sitemap? Zope version is 2.8. Thanks Pearl
On 27.11.2008 14:45 Uhr, Rupesh P Raj wrote:
Hi,
How can I get the list of all urls from zodb. This is for creating an xml Sitemap? Zope version is 2.8.
You mean a list of all persistent objects? <untested> root = context.getPhysicalRoot() for path, obj in root.ZopeFind(root, search_sub=True): print path, obj.absolute_url(1) This is a *VERY EXPENSIVE* operation unless you use something like Plone or CMF and ask the portal_catalog for all objects. -aj
Hi AJ, By Sitemap, what I mean is a list of all pages of a website, such as the following : http://www.example.com/homepage.html http://www.example.com/about.html http://www.example.com/faqs.html http://www.example.com/file1.html http://www.example.com/file2.html Does my requirement makes sense? I am quite new to plone, so I am not sure whether it is persistent objects? We do use CMF. On Sitemap: http://www.google.com/support/webmasters/bin/topic.py?topic=8467 Thanks Pearl
On 27.11.2008 15:13 Uhr, Rupesh P Raj wrote:
Hi AJ,
By Sitemap, what I mean is a list of all pages of a website, such as the following :
http://www.example.com/homepage.html
http://www.example.com/about.html http://www.example.com/faqs.html
http://www.example.com/file1.html http://www.example.com/file2.html
Does my requirement makes sense? I am quite new to plone, so I am not sure whether it is persistent objects? We do use CMF.
If you are using CMF you might consider "ExtendedPathIndex" (part of Plone) within CMF as a replacement for the 'path' index. It has support for generating sitemap related functionalities. Check its README.txt file. -aj
Andreas Jung wrote:
This is a *VERY EXPENSIVE* operation unless you use something like Plone or CMF and ask the portal_catalog for all objects.
How is that any less expensive? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On 28.11.2008 12:15 Uhr, Chris Withers wrote:
Andreas Jung wrote:
This is a *VERY EXPENSIVE* operation unless you use something like Plone or CMF and ask the portal_catalog for all objects.
How is that any less expensive?
huh? You have to walk through the whole folder hierarchy?1 -aj
Andreas Jung wrote:
huh? You have to walk through the whole folder hierarchy?1
So? With a catalog query you'll have return the *whole* catalog contents. And if you're stupid enough to get getObject involved, then you drag them all into memory *and* the catalog anyway... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On 28.11.2008 12:21 Uhr, Chris Withers wrote:
Andreas Jung wrote:
huh? You have to walk through the whole folder hierarchy?1
So? With a catalog query you'll have return the *whole* catalog contents.
There is a difference pulling 500k brains out-of-the catalog compared to traversing a ZODB with 500k object. I assume that the catalog solution is slightly faster :) Andreas -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK ------------------------------------------------------------------------ E-Publishing, Python, Zope & Plone development, Consulting
Andreas Jung wrote:
There is a difference pulling 500k brains out-of-the catalog compared to traversing a ZODB with 500k object. I assume that the catalog solution is slightly faster :)
Yes, well, you kno what they say about assumptions... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On 28.11.2008 12:56 Uhr, Chris Withers wrote:
Andreas Jung wrote:
There is a difference pulling 500k brains out-of-the catalog compared to traversing a ZODB with 500k object. I assume that the catalog solution is slightly faster :)
Yes, well, you kno what they say about assumptions...
ok, you want the hard facts :-) CMF Site with subfolder containing 87k objects: Obtaining the brains from the catalog: 25 seconds (uncached, basically only ZODB load operations) Same with the ZCatalog within the ZODB cache: <1 milli second Using ZopeFind: I stopped after 10 minutes... ANdreas
participants (3)
-
Andreas Jung -
Chris Withers -
Rupesh P Raj