[Zope-PTK] feature request: news categories

Chip Vanek chip@upcast.com
Tue, 15 Feb 2000 21:12:57 -0800


>-----Original Message-----
>From: Kevin Dangoor [mailto:kid@kendermedia.com]
>Sent: Tuesday, February 15, 2000 6:20 PM
>To: Chip Vanek; zope-ptk@zope.org
>Subject: Re: [Zope-PTK] feature request: news categories
>
>
>
>----- 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 very much agree with your comment about URL stability.  I kind
of like the present PTK way because the author of the information
has the items local to them.  Now when these people leave or are
aged off the system the problems begin.  These could be moved to
a central archive and redirects added as part of the user delete
process.

I liked content stating in a users home folder, partially because of
my inability to yet figure out how to safely write a file remote
folder and partially because I liked the idea of authors owning
their output.  The catalog seems like a reasonable way to find
all the items wereever they are on the site, assuming it scales.

>> 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.

That makes sense but dosn't the object take on the proxy role as
creator?  Can the original author still edit it?


>
>> 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...

I have read all the HowTos and guides many times.  I actually built
a list of parents that essentually became the list of category keys
and have tried a syntax like that.  Shown below:

              searchResults('ZcatKeyField' in ListVar)

I also tried your secret voodoo syntax with curly brackets and :

That got me the error trace below:

<!--
Traceback (innermost last):
  File C:\JPLAT\zope\lib\python\ZPublisher\Publish.py, line 214, in
publish_module
  File C:\JPLAT\zope\lib\python\ZPublisher\Publish.py, line 179, in publish
  File C:\JPLAT\zope\lib\python\Zope\__init__.py, line 202, in
zpublisher_exception_hook
    (Object: ElementWithAttributes)
  File C:\JPLAT\zope\lib\python\ZPublisher\Publish.py, line 165, in publish
  File C:\JPLAT\zope\lib\python\ZPublisher\mapply.py, line 160, in mapply
    (Object: showTopics)
  File C:\JPLAT\zope\lib\python\ZPublisher\Publish.py, line 102, in
call_object
    (Object: showTopics)
  File C:\JPLAT\zope\lib\python\OFS\DTMLMethod.py, line 145, in __call__
    (Object: showTopics)
  File C:\JPLAT\zope\lib\python\DocumentTemplate\DT_String.py, line 502, in
__call__
    (Object: showTopics)
  File C:\JPLAT\zope\lib\python\DocumentTemplate\DT_In.py, line 633, in
renderwob
    (Object: getCatalog().searchResults({'Topic_keys' : tkeys}))
  File C:\JPLAT\zope\lib\python\DocumentTemplate\DT_Util.py, line 335, in
eval
    (Object: getCatalog().searchResults({'Topic_keys' : tkeys}))
    (Info: tkeys)
  File &lt;string&gt;, line 0, in ?
  File C:\JPLAT\zope\lib\python\Products\PTKBase\PortalCatalog.py, line 44,
in searchResults
    (Object: ElementWithAttributes)
AttributeError: AUTHENTICATED_USER

Also with explicit values in list:

File C:\JPLAT\zope\lib\python\DocumentTemplate\DT_Util.py, line 335, in eval
    (Object: getCatalog().searchResults({'Topic_keys' : ['Markets',
'Americas']}))
    (Info: getCatalog)
  File &lt;string&gt;, line 0, in ?
  File C:\JPLAT\zope\lib\python\Products\PTKBase\PortalCatalog.py, line 44,
in searchResults
    (Object: ElementWithAttributes)
AttributeError: AUTHENTICATED_USER
>
>> 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.
>

I am still only weeks in Zope land and have not read much beyond
guides and HowTos (plus some interesting mail from this list;).

I think the direction I am going is also very dependent on the
Catalog.  The items will stay in the home folder of the authors
and the sole purpose of the folder hierarchy is to provide a simple
visual metaphor for browsing the categories.  Then you can use the
tree tag, aquisition, and a simple to maintain structure to view,
use, and edit the categories.

Anyway thanks for the reply and if you have any ideas about some new
searchResults syntax, let me know.

Chip

>Kevin
>
>