Hi everybody, what I want to do is fairly simple, but I've got a namespace problem: - via a form I want to add a new folder, add some properties to the new folder, then add a DTML document within the new folder. - whatever I try, the properties as well as the new document are added to the parent folder of the new folder instead of to the new folder. Here some experiments (don't look at the syntax): <dtml- call "manage_addFolder (NewFolderName)"> <dtml-with "_.getitem(NewFolderName)"> <dtml- call "manage_addProperty (ID,...)"> <dtml- call "manage_addDocument (ID,...)"> </dtml-with> This looks fine to me, but ZOPE insists on creating the new document in /OldFolder instead of /OldFolder/NewFolder Some more stuff for wondering: If I do a <dtml-with "_.getitem('NewFolder')"> <dtml-var "_.getitem('NewFolder',0)"> to get an actual value for testing purposes, ZOPE returns the *correct* value of 'NewFolder' But if I do an additional <dtml-in objectItems> id: <dtml-var sequence-key>, type: <dtml-var meta_type> </dtml-in> to list the objects of the actual namespace (placed *after* the above <dtml-with..>, the output consists of the objects of the /OldFolder-namespace, but not that of the /OldFolder/NewFolder. ...I'm sure this is a rookie-problem and can be solved by turning a switch or two (perhaps in my brain), but I'm stuck. Do you/anybody has any clue? Thanks in advance - Alexander ~~~~~~~~~~~~~~~~~~~~~~~~~ http://www.herrenausstatter.de - Der Online-Herrenausstatter Kostenlose Serviceline: 0800 -999 66 33 Versandkostenfreie Lieferung - 30 Tage R�ckgaberecht ~~~~~~~~~~~~~~~~~~~~~~~~~ Verwaltungsadresse: DePauli.com Aktiengesellschaft Stahlgruberring 3 - 81829 M�nchen Telefon: 089 / 530 75 170 - Telefax 089 / 514 50 666
One (ugly!) way of doing it: <dtml-with "manage_addFolder ('Test1')"> <dtml-let test1Object="_.getitem(Test1')"> <dtml-with "test1Object.manage_addFolder ('Test2')"> </dtml-with> </dtml-let> </dtml-with> This creates Test2 in Test1. Ivan
Here some experiments (don't look at the syntax):
<dtml- call "manage_addFolder (NewFolderName)">
<dtml-with "_.getitem(NewFolderName)"> <dtml- call "manage_addProperty (ID,...)"> <dtml- call "manage_addDocument (ID,...)"> </dtml-with>
This looks fine to me, but ZOPE insists on creating the new document in /OldFolder instead of /OldFolder/NewFolder
Hi ! Alexander DePauli wrote:
Hi everybody,
what I want to do is fairly simple, but I've got a namespace problem:
- via a form I want to add a new folder, add some properties to the new folder, then add a DTML document within the new folder. - whatever I try, the properties as well as the new document are added to the parent folder of the new folder instead of to the new folder.
This works for me: <dtml-var standard_html_header> <dtml- call "manage_addFolder('my_folder2')"> <dtml-with "_.getitem('my_folder2')"> <dtml-call "manage_addDocument('hhh')"> <dtml-call "manage_addProperty(id='bestand', value='3', type='int')"> </dtml-with> <dtml-var standard_html_footer> Best regards, Maik Röder
participants (3)
-
Alexander DePauli -
Ivan Cornell -
Maik Röder