The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
can I do this in Zope?
Discuss can I do this in Zope? in the Python Programming forum on Dev Shed. can I do this in Zope? Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 30th, 2004, 09:14 AM
|
|
Registered User
|
|
Join Date: Jan 2003
Location: el paso, texas
Posts: 9
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
can I do this in Zope?
I want to have multiple sites that share pages. The pages will be in each site, i.e., no linking between the sites. furthermore, parts of some of the pages will be unique to each site. For example, I could have a Python site that would have articles on MySQL, with interspersed Python code, and a separate PHP site that would intersperse different code in the same places.
Not only that, but the pages will change frequently. In the above example, if MySQL had a new release every 2 or 3 days, I would be changing the MySQL parts, and want to change them in only one place for all the web sites.
Really, I would rather do this in PHP, since I have to maintain proficiency in that anyway, to read code such as phpBB and myPhpAdmin.
Is Zope the best way to do something like this? I also don't want dynamic pages, since they don't get indexed well by the search engines.
|

March 30th, 2004, 07:07 PM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 133
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
|
In Zope there is a concept called acquisition. Acquisition is a fairly complex issue somtimes. Most of the time it works in the manner of object-oriented inheritance. If you request a page in a container and the container has the page: that page will be served. If you request the page and it does not exist in the container acquisition will make Zope traverse up the path and search in the containers container, and so forth, all the way up to the root. If the page does not exist in the root an error will be issued.
Short answer: It's easy to do this in Zope. Many other things are not easy however so consider carefully before choosing. If you are building large systems Zope might be a good choice. If you are building small sites and you do not expect to have to put much work into the creation of the actual content Zope might be overkill.
|

March 31st, 2004, 05:59 AM
|
|
Contributing User
|
|
Join Date: Feb 2004
Location: London, England
|
|
I think the answer is more complex than that, percivall. Bullwinkle was asking about having multiple domains pointing into the same Zope database. I think this is possible if you set up virtual domains in Apache and redirect them into a single database. However I do not know if acquisition would work between domains. If you go down this route then http://zope.org/Members/shaw/HowTo/ApacheFrontEnd is a good starting place.
Since the pages are all static, a better solution may be to use a templating system like Cheetah ( http://www.cheetahtemplate.org). This allows heirarchies of templates to be defined, so you could have a set of base templates containing all the common stuff and override them for the site-specific stuff. You would need to regenerate the pages whenever you edited them, but that is not a big issue.
Dave - The Developers' Coach
|

March 31st, 2004, 11:30 AM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 133
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
|
Oh. I didn't think that the sites would be on different servers and different domains.
Well: It's still definitely possible (and not that hard). The solution in Zope is called ZEO (Zope Enterprise Objects) which allows you to have multiple Zope instances share a single (or multiple) datastorages. Running ZEO is a good idea even if you only use one Zope instance since it helps debugging (think: connecting to the ZODB running the Python interpreter interactively). The Zope instances connect to the ZEO server via unix sockets or via TCP. It is trivial to let each Zope instance have its own datastorage locally and mount the ZEO-controlled storage at a freely chosen mount-point under the Zope intstance's root.
I personally run Apache as a reverse proxy to a Zope instance connecting to a ZEO datastorage for the main database while letting the Zope instance have a persistent Sessioning storage stored "locally".
I'm not saying it isn't overkill; but it isn't that hard to do.
|

March 31st, 2004, 12:12 PM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 76
Time spent in forums: 1 h 16 m 14 sec
Reputation Power: 10
|
|
Quote: | Originally Posted by DevCoach I think this is possible if you set up virtual domains in Apache and redirect them into a single database. However I do not know if acquisition would work between domains. |
... I think virtual domains actually point to different paths and acquisition should kick in from there.
|

April 1st, 2004, 08:53 AM
|
|
|
Quote: Really, I would rather do this in PHP, since I have to maintain proficiency in that anyway, to read code such as phpBB and myPhpAdmin.
Is Zope the best way to do something like this? I also don't want dynamic pages, since they don't get indexed well by the search engines. |
How could you do it in PHP without it being dynamic?
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|