[Zope-CMF] Easy Content-Add script

Florent Guillaume fg@nuxeo.com
11 Nov 2001 23:56:48 GMT


> I want to create a very simple news_add form. It should be a mix of the 
> metadata and the lead-in/body. Additionally I would like to set the path 
> where this item will be saved..
> The only thing I could found is, how to generate an auto-ID.
> 
> The invokeFactory can just create an object, not set it's properties?

It's not clear from what you say if you want to set properties at object
creation time, or later on.

If it's at creation time, you can do it like Tres proposes, in the skin
responsible for creation. Another IMHO cleanrer solution would be to use
a Scriptable Type for your News type, and the script would call the
appropriate product constructor then set initial values in the object.
This way invokeFactory transparently does all that's needed.


> I tried to read the metadata_edit and the news_edit script, but I couldn't 
> figure out what these script does.

Then you have some catching up to do on Zope documentation :-)

        -- Florent
-- 
Florent Guillaume, Nuxeo SARL (Paris, France)
+33 1 40 33 79 10  http://nuxeo.com  mailto:fg@nuxeo.com