[Zope] Question regarding acquisition behaviour.

Alec Munro alecmunro at hfx.eastlink.ca
Tue Nov 25 12:55:47 EST 2003


Thanks to Dylan for the response, and it is generally what I've been 
doing, though I had to get more complicated in most cases.
The problem with it is that I don't always know the name of the root 
folder of the site I will be implementing this on. So including the root 
folder into the path is not feasible.
As well, the suggestion for not reusing folder names might work, but I 
really prefer to be able to organize files by type. Otherwise I would 
have many folders that contained well over a hundred files.
While that is not a technical challenge, it does present a usability one.


Based on that, I see two things that could solve my problems, without me 
having to give up organizing with folders. ;)

1. A form of acquisition that allowed me hard-code as much of the path, 
starting at the right, as I wished. For example:
container.acquire('HTML/pageX')

2. A type of folder that automatically acquired the files of it's 
subfolders. So I could still organize, but as far as acquisition was 
concerned, it would be as if everything was in a single folder.
2A. Make folder views filterable (perhaps via a drop-down). So I can 
view only page templates, or only python scripts, etc. When navigating 
the tree, you could have icons next to the folder names, that could be 
used to select the views.

Perhaps some of this functionality already exists?

Thanks for your time,

Alec Munro



Dylan Reinhardt wrote:

>On Tue, 2003-11-25 at 08:51, Alec Munro wrote:
>  
>
>>Hi List,
>>
>>It is my understanding that while acquisition will traverse up the 
>>directory tree, it will only do so until it finds a match, and then it 
>>will restart from that directory.
>>    
>>
>
>Sort of.  It works fist by containment (physical path) then by context
>(how things are arranged in the URL).  If it finds a match by
>containment, it won't look at context.
>
>
>  
>
>>So if I'm in script 'someScript' looking for 'container.HTML.pageX' and 
>>my hierarchy looks something like this:
>>
>>someSite
>>-HTML
>>--pageX
>>-subSite1
>>--about
>>---HTML
>>----pageA
>>----pageX
>>--contact
>>---HTML
>>----pageA
>>
>>if someScript is in 'someSite/subSite1/about' then I will get the 
>>result: 'someSite/subSite1/about/HTML/pageX'
>>But if someScript is in 'someSite/subSite1/contact' I won't get 
>>anything. 
>>    
>>
>
>That seems correct.
>
>  
>
>>It will find the HTML folder
>>    
>>
>
>The one *in* someSite/subSite1/contact
>
>  
>
>>, and give up when there's no 
>>'pageX'
>>    
>>
>
>There isn't one... not that can be found from the folders you're in
>and/or have acquired.
>
>
>  
>
>>. What I would like is the result: '/someSite/HTML/pageX'
>>    
>>
>
>Then you should ask for that result.  Try this:
>
>.../container/someSite/HTML/pageX
>
>A better answer, long-term is not to re-use folder names so liberally. 
>The more unique they are, the easier it will be to know whether
>acquisition is working and why it isn't when it's not.
>
>HTH,
>
>Dylan
>
>
>  
>





More information about the Zope mailing list