[Setup] Re: Batch generation of folders in Plone

Raphael Ritz r.ritz at biologie.hu-berlin.de
Mon May 22 09:52:33 UTC 2006


Jan Torleif Pedersen wrote:
> Greetings,
> 
> I have setup a Plone site for a Biology application and now I would like 
> to generate a set of standard folders to contain information on a set of 
> genes. That is I want a folder for each gene in a list of approximately 
> 10.000 genes. How can I generate these automagically ? Does anyone have 
> a php script to do this ?

PHP? We're part of the Python world here ;-)

> Or do I have to make a script to do it through 
> lynx … - which I would like to avoid. Or is there a really smart way of 
> doing this in Plone/Zope

In a custom TTW Python script to be called on the parent of
these new folders do something like:

new_folder_data = ((id1, title1), (id2, title2), ...)

for id, title in new_folder_data:
     context.invokeFactory('Folder', id)
     context[id].setTitle(title)
     context[id].reindexObject()

For more inspiration see

     http://www.neuroinf.de/LabTools/ScriptingCMF-0_1.tgz/view

Raphael

> 
> Jan
> 




More information about the Setup mailing list