[Zope] forcing acquired DTML to act as if not acquired

Karl Anderson kra@monkey.org
26 Apr 2000 18:20:52 -0700


I'm trying to make a simple interface to create a subfolder without using
the management interface.  I'm using a form to get the title.  I want
the user to be able to use this to create a subfolder anywhere under
a top folder, and I want all created folders to have the same
index_html (which also links to the folder creation form), so I'm
putting the form in the top and having the user reach it and
index_html through acquisition.

So, in my simplified tests, I have an index_html which contains this
(all tree items are folders):

<dtml-tree expr="PARENTS[0]" branches=objectValues>
 <a href="<dtml-var tree-item-url>/addFolderForm">addFolder</a><br>
</dtml-tree>

where addFolderForm is a form that exists only at the root of the tree
and is acquired.  addFolderForm is a dtml document, also acquired,
which contains <dtml-call "manage_addFolder('testname')">.  This is for
testing, it'll eventually be a form that targets the document.

Problem is, the tree-item-url prefix doesn't make a difference.  An
acquired document thinks it's at the acquisition source, not the
acquisition destination, so the folder is created at the top, not at
tree-item-url.

There's workarounds for my particular problem, but I want to know if I
can still use acquisition.

In order of simplicity: I suppose I could send the tree-item-url
as a query string to the dtml document, parse that into levels at the
destionation dtml document, and put the dtml-call in a dtml-with for
each level.  That's more dtml than I want to know, I'd probably do
that in python.  I could add the folder creation form and index_html
to the created folder at creation time, and not use acquisition, but
I'd rather use acquisition.  I could make my own folderish class that
does the right thing, but I'd rather use the standard objects.

-- 
Karl Anderson      kra@monkey.org           http://www.pobox.com/~kra/