[Zope] Creation of components for use across many sites.

Alec Munro alec.munro@eoascientific.com
Thu, 31 Jul 2003 11:54:49 -0300


Hi List,

I've been working using Zope to build a set of components intended to be 
abstract and reusable. These components currently exist as folders, with 
each folder having a set of page templates, Python scripts, and SQL 
queries (and sometimes other stuff).
The idea is that for a given site, I will declare that I am utilizing 
component X, and the component's default scripts and templates will 
allow for all the functionality I need. However, there are many cases 
where I need to override a given template or script in a component.
I have this working to a degree, by having a folder called "site" in 
each component's folder, and in that folder I have the replacement 
scripts/templates/etc. Then I simply change my references like the 
following:
"componentX/HTML/someTemplate" becomes: 
"componentX/HTML/site/HTML/someTemplate"
"componentY/someScript" becomes: "componentY/site/someScript"

As I said, this works. The problem is the folder that contains the 
components has to be copied to each site's root folder.
What I would like is a system where in the root of my zope, I can have 
one folder for the components, and then in each sites folder, I can 
create the overriding scripts. This is complicated a slight bit by the 
fact that I need all URLs on a site to be within that site's folder. So 
I need to be able to call a URL like:
"http://www.somesite.com/components/catalogue/buyStuff"
and if I have overridden the "buyStuff" script, have it call the 
overridding script, but if I haven't, I need it to somehow acquire 
"zopeRoot/components/catalogue/buyStuff".
I'm sure I haven't explained this properly, or there's something obvious 
I'm overlooking, so please ask questions as if I were terminally stupid :)
Thanks for your time,

Alec Munro