[Zope-PTK] feature request: news categories

Kevin Dangoor kid@kendermedia.com
Tue, 15 Feb 2000 21:20:25 -0500


----- Original Message -----
From: "Chip Vanek" <chip@upcast.com>
To: <zope-ptk@zope.org>
Sent: Tuesday, February 15, 2000 6:59 PM
Subject: RE: [Zope-PTK] feature request: news categories


> I too am very interested in categories.  When you talk about
> subclassing the News object below and using folder do you
> mean that the object would be stored in this folder?
>
> The present PTK keeps all objects in the authors members folder or
> children.  I do not know if this is by design or just present
> convenience.  It does seem to simplify security and the review/
> publishing mechaism seems to allow for managed publishing.

It's true that the present PTK keeps objects in the members' folders, but it
doesn't *have* to be that way for all things. While that arrangement works
well for Zope.org, I think there will be lots of portalish sites where
things will make more sense in a centralized place.

In truth, I haven't really given much thought to the idea of storing the
items within folders named for the categories. As far as delegation of
responsibility and configuring security based on categories goes, it seems
like that would work very nicely with a minimum of fuss (read: custom code).

The thing I really don't like about putting the items within a folder based
on category is that it is quite conceivable that you may want to reorganize
items into different categories down the line. If that happens, the URLs of
your articles change. I'm a big proponent of having URLs be stable for as
long as possible. (Once they're in a search engine, it's nice if they keep
working.)

> I am new to Zope and cannot yet figure out how to create an
> object in another folder and set the correct permissions. I was
> able to subclass the portal document object and add category
> fields (properties).  I am now struggling with trying to enter
> this category property in the Catalog as a Keyword Field.

The key to putting an object in another Folder is that you've got to have
permission to create that kind of object in that Folder. If you want the
ability for a user to add something without having that permission
themselves, you use a "proxy role". This is what KM|Net News does. The
AddArticle method has a proxy role of Manager, so anyone can add an article
using that method.

> Then to simulated category lookup I would like to create
> a search query that returns just items of a certain category.
> It looks like the PTK wrapper around Zcatalog will ensure that
> only authenticated users can see non-public items.  The big problem
> I have now is finding the syntax for getCatalog().searchResults(....)
> to give me just the items with the keyWorks I want.

ZCatalog is generally pretty easy to use. There is some good information in
the HowTos on Zope.org. I haven't looked at it in the context of the PTK
yet. You would probably do something like:

<dtml-in "searchResults({'category' : ['Category1', 'Category2']})">

would probably let you search for those two categories...

> To automate the management and generation of the KeyWords, I was
> going to use a "tree" of folders that have titles that match the
> KeyWords.  Then, using acquisition one query method would parse
> the branches of the tree up to root and have the KeyWords.  The
> "tree" of keywords would be a hierarchical oncology of topics
> hosted by this site.  Adding a new topic is just adding a new
> folder to the tree.  Then a compact version of this tree needs to
> be available to the user in the add and edit forms of the object
> to ensure that correct KeyWords are used.

This sounds similar to the Topics proposal that Amos posted to the Zope.org
site a couple months back. The difference is that the Topics proposal was
completely Catalog driven. So, you could have a hierarchy of items without
regard to where they sit in the ZODB.

Kevin