Re: SilvaNews service_news categories
Andy <[email protected]>
| Newsgroups | gmane.comp.web.zope.silva.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Guido, > So if I understand you correctly you have written a flexible generic > object to represent trees or something? In it's current state it isn't generic, but it would be VERY easy to migrate the code to work for SilvaNews categories. We'd only need to change the properties in the tree items. > Might be interesting indeed, do > you think it would be useful (and what do you think would be the > advantages) to use that tree instead of what we do in Silva now, > generate tree views directly using the Zope object structure? Are those > trees stored in the ZODB? The trees are stored in the ZODB...there is a tree item (root), which functions as a container for the hierarchy, and contains the tree items, all of which inherit SimpleItem. Here's an outline with some limitations of category management. I'll list the limitations, and then talk about how/whether this zodb tree system can overcome them. 1. Say I'm adding 10 categories which have the same parent. I have to type the title of each, and manually select the parent, which could be very far down the dropdown list. 2. You can't reparent a category. 3. You can't store any additional information in a category 4. A category only has a name 5. There is no facility to limit the categories a particular news publication can use 6. You can't have two categories with the same name, but different parents. Advantages of this zodb tree system: 1. You navigate to a tree item, and add items one at a time. The items will appear underneath the active tree item 2. Every tree item is a unique object in the zodb. Reparenting is as simple as cut and paste. Although if there is any catalog or metadata magic with news items, that would need to be worked out. 3. Since a tree item is a unique object, you can use zope properties (the 'properties tab' in the zmi). 4. Tree Items can have an id and a title, as well as any other properties that may be useful regarding news categories. Having an id and a title would be nice, if you want a more descriptive title, or are publically displaying titles (which I'm doing for my custom news system). 5. Tree Items have a 'Display TALES' property, which, if it exists and is true, will display the tree item (and any children), when the hierarchy is rendered in any form. If the tales is false, the menu (and any children) will not be displayed. This could be expanded to somehow restrict assignable categories by news publication (perhaps have a section on the publication avail only to higher roles, which can deactivate portions of the hierarchy? Or perhaps do it manually in the zmi in service_news...) 6) since tree items are stored in zodb, two items can have the same id (name) but different parents. I don't think this would work in the current news system...perhaps we'd need to store [(item,parent) , ...] or something. OR, categories in news items/publications could display the title for each tree item, and different id's could be used. If you can't tell, I think this would be useful ;-) I don't know how it should tie into the catalog or if it should use any metadata though. ttyS0, Andy > > Cheers, > > Guido