one 'document' in many 'folders'
As a demonstration project to try and get a client to go with Zope, I'm converting a newsfeed database that I had originally built using Perl. The object of the game is to pull fresh articles from a Reuters server every two hours and put them in a bin. A human editor goes through the bin, culls and sorts the articles, edits where appropriate. One article may appear in more than one section of the site. For example, an article titled "Zope Is Cool" might appear in the Python, Web Development, and Open Source sections. Each section has its own contents page. This is where I get confused. My Perl application simply used the filesystem as a database, and generated three separate static copies of "Zope Is Cool", placing one in each of three directories: /python, /web_development, and /open_source. I suspect there are much better ways to do it in Zope, but how do I organize things? My naive idea is to make each article a Document, one of whose properties is a list (or dictionary) of categories in which it should be placed. Generating each section's contents page would then take some figuring out, and performance on doing the contents page would be a concern. If there's a better way, I'd certainly appreciate hearing about it. Signed, Confused a/k/a Wade Leftwich Okay Network Services, Ithaca NY tel 607-277-1334 fax 607-272-3612
----- Original Message ----- From: Wade Leftwich <wade@lightlink.com> To: <zope@zope.org> Sent: Monday, March 22, 1999 8:44 AM Subject: [Zope] one 'document' in many 'folders'
The object of the game is to pull fresh articles from a Reuters server every two hours and put them in a bin. A human editor goes through the bin, culls and sorts the articles, edits where appropriate.
One article may appear in more than one section of the site. For example, an article titled "Zope Is Cool" might appear in the Python, Web Development, and Open Source sections. Each section has its own contents page.
This application sounds similar to stuff that I (and others on this list are trying to accomplish).
This is where I get confused. My Perl application simply used the filesystem as a database, and generated three separate static copies of "Zope Is Cool", placing one in each of three directories: /python, /web_development, and /open_source. I suspect there are much better ways to do it in Zope, but how do I organize things?
My immediate term solution is to make multiple copies of the article in the ZDB. I agree that this is suboptimal. Paul@DC has mentioned that they are working on a "Catalog" feature that they would like to integrate with Zope. This feature will be *perfect* for this application (and many others). Unfortunately, I don't think this is on the very near term radar scope. Depending on how far out Catalog is, and when I manage to finish off the basic necessities for my sites, I was thinking of delving into Zope's btree stuff and trying to put together some kind of search interface. Right now, though, I've still got a bunch of work to do before I get to that point. Kevin
On Mon, 22 Mar 1999, Wade Leftwich wrote:
My naive idea is to make each article a Document, one of whose properties is a list (or dictionary) of categories in which it should be placed. Generating each section's contents page would then take some figuring out, and performance on doing the contents page would be a concern.
If there's a better way, I'd certainly appreciate hearing about it.
I suggest you try out your idea first. It sounds simple and straightforward and performance won't be a problem unless you have too many entries (but I am only guessing).
placed. Generating each section's contents page would then take some figuring out,
Assuming you have a folder Entries and folders Python and Zope. An entry in the entries folder is a DTML doc with a lines property named sections containing the sections (folder names) where the given entry belongs to. In the root folder you have a DTML method like: (untested) <H1><!--# var title--> contents:</H1> <!--# with "_.namespace(section_title=_['title']"--> <!--# in Entries--> <!--# if "section_title in sections"--> ... Do something (ie link to the entry or render the entry etc ... <!--# /if--> <!--# /in--> <!--# /with--> you can call this method from inside the index_html method in each section's folder. Pavlos
Wade Leftwich wrote:
As a demonstration project to try and get a client to go with Zope, I'm converting a newsfeed database that I had originally built using Perl.
The object of the game is to pull fresh articles from a Reuters server every two hours and put them in a bin. A human editor goes through the bin, culls and sorts the articles, edits where appropriate.
One article may appear in more than one section of the site. For example, an article titled "Zope Is Cool" might appear in the Python, Web Development, and Open Source sections. Each section has its own contents page.
This is where I get confused. My Perl application simply used the filesystem as a database, and generated three separate static copies of "Zope Is Cool", placing one in each of three directories: /python, /web_development, and /open_source. I suspect there are much better ways to do it in Zope, but how do I organize things?
My naive idea is to make each article a Document, one of whose properties is a list (or dictionary) of categories in which it should be placed. Generating each section's contents page would then take some figuring out, and performance on doing the contents page would be a concern.
If there's a better way, I'd certainly appreciate hearing about it.
I think that your approach would work and have the drawbacks you suggest. You could try it and see if performance is actually a problem. Here are some other ideas. First, you can put an object in many folders without creating multiple copies. You can't do this from DTML, but you *can* do it from Python, and therefore, from an external method. This may be the simplest approach. Second, you could come up with some sort of document management system, based on clever indexing machinery, like ZTables or on relational databases. As someone else mentioned, Zope cataloging with use ZTables to provide collections with advanced searching and organizaing features. This is still a work in progress, however. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (4)
-
Jim Fulton -
Kevin Dangoor -
Pavlos Christoforou -
Wade Leftwich