[Zope] ExternalMethod for exporting un-pickled Office files to the filesyst

Martin Aspeli optilude at gmx.net
Thu Jun 22 07:31:59 EDT 2006



michael nt milne wrote:
> 
> Cheers, thanks a lot for that. I'll give it a go. I still may be
> interested
> in sponsoring a version with the improvements you mention etc and possibly
> more. Would that code be compatible for Unix and also for Windows NTFS?
> 

Note: I think this deals with Files, as per Zope's built-in OFS types, not
ATFile, the 'File' type you see in Plone. It may still work, but you may
also need to access ATFile's API directly.

Note that another version of this script may be to just use wget to pull the
URLs for files. For example, you could have a script:

from Products.CMFCore.utils import getToolByName
catalog = getToolByName(context, 'portal_catalog')
for i in catalog(portal_type = ('File', 'ATFile',)):
    print i.getURL()
return printed

... put that in a skin folder or portal_skins custom. Then write a bash
shell script or similar that first does a wget to
http://my.server.com/getAllFileUrls (if that's the name of the script),
saving the body of the response (a newline-delimited list of filenames) to a
file or just an array in-memory (you could do this with python's urllib as
well). Then, loop over the lines in that file, and do a get on each one - it
should fetch the file for you.

Martin
--
View this message in context: http://www.nabble.com/ExternalMethod-for-exporting-un-pickled-Office-files-to-the-filesystem-etc-t1829379.html#a4991401
Sent from the Zope - General forum at Nabble.com.



More information about the Zope mailing list