-----Original Message----- From: Pavlos Christoforou [mailto:pavlos@gaaros.msrc.sunysb.edu] Sent: donderdag 27 mei 1999 0:27 To: Rik Hoekstra Cc: Zope-dev@zope.org Subject: Re: [Zope-dev] DTML question
On Wed, 26 May 1999, Rik Hoekstra wrote:
On basis of a form input I want to call a DTMLDocument/Method, building a new 'workspace'. To this end I want to: 1. create a folder (using manage_addFolder) 2. create a document within the new folder (using manage_clone)
Try something like:
<!--# call "_.getitem(foldername).manage_add<whatever>()"-->
Thanks Pavlos, That helped a lot (it was probably the only modification of calling the folder I had not tried). Still I had a lot of trouble with namespaces and paticularly changing namespaces in this particular DTML. I thought that perhaps my experiences would be of use to anyone else, so I thought I'd describe them here Some things seemed impossible. If anyone knows how to - please enlighten me. This seems me to be a rather common action, especially when we are going to make ZClasses: ever tried to use a manage_clone between two folders? - I tried it with a 'with' statement - did not work: either the document showed up in the original folder or I got a traceback - tried copying from one folder and trying to past in another from DTML, but it kept giving esoteric messages about not being able to paste from the clipboard because there were too many objects or something After all I came up with the following <!--#var standard_html_header--> <!--#call "manage_addFolder(REQUEST['cursusid'])"--> <!--#call "_.getitem(REQUEST['cursusid']).manage_addDTMLDocument('intropg', 'intropg', intropage)"--> <!--#in "REQUEST.form.items()"--> <!--#if expr="_['sequence-key']=='abstract'"--> <!--#call "_.getitem(REQUEST['cursusid']).intropg.manage_addProperty( _['sequence-key'], _['sequence-item'], 'text' )"--> <!--#else--> <!--#call "_.getitem(REQUEST['cursusid']).intropg.manage_addProperty( _['sequence-key'],_['sequence-item'], 'string' )"--> <!--#/if--> <!--#/in--> <!--#var standard_html_footer--> This is a bit more eleborate, but at least it works. (wish I could use someting like plain python setitem/setattribute, but that probably wouldn't work with acquisition anyway) Rik