Getting all images in the ZODB 'out' into Apache-land?
Hi all, Hopefully the subject gives you the gist. I have a really good group of guys here who have been squirreling away images into the ZODB. Many images. Sometimes big images. All over the ZODB. I wish to save them from themselves and have these images made available via Apache :) Can anyone give me a clue how I might do this? The images are all over the place - I'd like to extract them into an external directory structure that I'll plop into Apache. They can then use a judicious combination of the Replace product (great product!) and old fashioned sweat to get the img src="" stuff sorted out. Cheers Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
Hi, You could use the catalog to collect the images, search for meta_type. Then create links to all the images and have a python script read them from your server and save them to the local harddisk, using urllib.urlopen or something. This script could also call manage_delObjects if you want to remove them from zope. Douwe
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Tony McDonald Sent: Tuesday, July 16, 2002 12:55 PM To: 'zope@zope.org' Subject: [Zope] Getting all images in the ZODB 'out' into Apache-land?
Hi all, Hopefully the subject gives you the gist.
I have a really good group of guys here who have been squirreling away images into the ZODB. Many images. Sometimes big images. All over the ZODB.
I wish to save them from themselves and have these images made available via Apache :)
Can anyone give me a clue how I might do this? The images are all over the place - I'd like to extract them into an external directory structure that I'll plop into Apache. They can then use a judicious combination of the Replace product (great product!) and old fashioned sweat to get the img src="" stuff sorted out.
Cheers Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On 16/7/02 12:11 pm, "douwe@oberon.nl" <douwe@oberon.nl> wrote:
Hi,
You could use the catalog to collect the images, search for meta_type. Then create links to all the images and have a python script read them from your server and save them to the local harddisk, using urllib.urlopen or something. This script could also call manage_delObjects if you want to remove them from zope.
Douwe
Thanks Douwe, That seems certainly doable - I'm not hugely familiar with catalogs but I'll have a look see. The urllib stuff, I'm pretty ok with. Thanks for the thoughts tone -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
Thanks Douwe, That seems certainly doable - I'm not hugely familiar with catalogs but I'll have a look see. The urllib stuff, I'm pretty ok with.
We'll you don't have to use the catalog. a python method like: def printImagesFromObj( obj ): for child in context.objectValues(): if child.meta_type=='Image': print '<a href="%s">%s</a>' % (child.absolute_url(), child.title_or_id() ) elif child.meta_type in ['Folder',...]: printImagesFromObj( child ) printImagesFromObj( context ) I didn't really test it, but you get the idea. Douwe
douwe@oberon.nl wrote:
Thanks Douwe, That seems certainly doable - I'm not hugely familiar with catalogs but I'll have a look see. The urllib stuff, I'm pretty ok with.
We'll you don't have to use the catalog. a python method like:
def printImagesFromObj( obj ): for child in context.objectValues(): if child.meta_type=='Image': print '<a href="%s">%s</a>' % (child.absolute_url(), child.title_or_id() ) elif child.meta_type in ['Folder',...]: printImagesFromObj( child )
printImagesFromObj( context )
I didn't really test it, but you get the idea.
Douwe
Alternatively, use ZopeFind to get the urls of the images and feed wget with this list. No need to "artificially" build a html page with links. cheers, oliver
On Tue, 16 Jul 2002 8:55 pm, Tony McDonald wrote:
I have a really good group of guys here who have been squirreling away images into the ZODB. Many images. Sometimes big images. All over the ZODB.
I wish to save them from themselves and have these images made available via Apache :)
Can anyone give me a clue how I might do this? The images are all over the place - I'd like to extract them into an external directory structure that I'll plop into Apache. They can then use a judicious combination of the Replace product (great product!) and old fashioned sweat to get the img src="" stuff sorted out.
We used a different scheme - all images are stored in a top-level directory that is separate from the dynamic portions of the website. A simple sucker script can extract the images from that dir into an Apache dir. Apache then has a simple rewrite rule to serve the dynamic stuff from Zope, and the rest comes from disk. Works a treat. See also http://www.zope.org/Members/richard/docs/zope_optimisation.html Richard
participants (4)
-
douwe@oberon.nl -
Oliver Bleutgen -
Richard Jones -
Tony McDonald