[ZDP] Review FAQs 990308

Martijn Faassen M.Faassen@vet.uu.nl
Mon, 08 Mar 1999 17:12:38 +0100


Hi everybody,

Before I add these FAQs to the main list I'd like some reviews from
people. Pay special attention to any FIXME's. Most of these are prompted
by Rik Hoekstra's contributions (thanks again!). See also my previous
reply to Rik where I ask for a previous review (I just didn't announce
it that way yet. :)

Whenever I get questions that are either so basic I want to be
absolutely sure they're right, or so difficult I get completely confused
and can't figure them out, I'll put them up for review here before I add
them to the main FAQ. Just send any comments (or better yet, edited
FAQs) back to the mailling list.

Thanks!

Martijn

Here they come:

* How can I get access to the Folder I just added inside an External
Method?

    If you just created the Folder in the External Method, you can
    retrieve the new Folder object by doing this::

        newFolderObj = getattr(self, newFolderId)
    
    If 'newFolderName' is not a variable but hardcoded in your
    External Method, by doing for instance the following::

        self.manage_addFolder('hardcoded_id', someFolderTitle)
    
    Then you can simply do this::

        newFolderObject = self.hardcoded_id
   
* How do I add a Document or Property to a Folder inside an External
Method?

    To add a Document to a Folder (called 'folderObj')::

        folderObj.manage_addDocument(id, title, content)

    To add a Property to folderObj::

        folderObj.manage_addProperty(id, value, type)

    [FIXME: what would 'type' mean in this context?]

    The Zope builtin help (under the 'help' tab in the Zope management
    screen) documents these and a lot of other 'manage_' methods you can
call on
    Folder objects and other Zope products.