[Zope] Newbie Acquisition Question

Johan Carlsson johanc@torped.se
Tue, 19 Oct 1999 01:52:31 +0200


Hi James,
You probably have misspelling somewhere.
It should work as you anticipated, or I haven't
understood your problem correctly.

//johan


> I've been playing with Zope for a couple of days.  Coming from a 
> Smalltalk  background, many of the concepts employed by Zope are very 
> familiar.  However, I seem to have a fundamental misunderstanding 
> about how acquisition works.  As an experiment, I created a Folder object called 
> "Testing".  I defined an index_html document with the following DTML code:
> 
> <dtml-var standard_html_header>
> <dtml-var folderName>
> <dtml-var standard_html_footer>
> 
> I also defined a DTML method in Testing called "folderName" which 
> contained the following:
> 
> Testing
> 
> I viewed the page in a browser via http://localhost:8080/Testing and sure 
> enough I saw a page with the phrase "Testing" correctly 
> displayed.  I then  created a Folder within Testing called 
> "SubTest".  In SubTest, I defined one DTML method called "folderName" 
>  Inside of this method I put the contents:
> 
> SubTest
> 
> I then displayed the page via 
> http://localhost:8080/Testing/SubTest and was 
> confused when the screen still displayed the phrase "Testing" instead of 
> "SubTest".  It's probably my Smalltalk bias, but I was expecting that the 
> system would look up the tree from SubTest until it found an index_html 
> that it could display.  Having found that, it would see that it needed to 
> execute the method "folderName".  Since the object being displayed was 
> SubTest, I assumed that it would try to find the "folderName" method 
> starting in SubTest.  Having found it, it would use the result from that 
> method for display.  However, this is not what happened.  Where did I go 
> wrong?  I was under the impression that I could factor common behavior up 
> the tree and only implement distinct behavior at lower levels.  Did I just 
> do something wrong?  Is there a way to accomplish what I want to accomplish?