[Zope-CMF] Workflow and zcatalog and zclasses

S Haldar shaldar11@yahoo.com
Wed, 17 Jul 2002 16:13:21 -0700 (PDT)


Thanks for the input Dieter:

I am facing a couple of problems here. Even if I index
a property (in this case lets call it "District"), the
sort_on doesn't work. In the workflow variables, I
declared a variable "District" with default expression
"here/District".

I created the index "District" in portal_catalog. It
seems that the only way I can access the district
value from the catalog search results is by getting it
after a getObject() call.

Note: I subclaased from CatalogAware instead of
CatalogPathAware since the latter wass not listed in
the product list for Base classes. Is there a
difference between the two? If so, how do I subclass
from catalogPathAware?


Thanks and regards,
Susmit


--- Dieter Maurer <dieter@handshake.de> wrote:
> S Haldar writes:
>  > ...
>  > Now the second part of the problem -- I want to
> sort
>  > the portal search results by a property value,
>  > district wise. What's the best approach?I tried
> the
>  > following two - and came up with some problems:
> You do not tell us which problems you came up
> with...
> 
> 
>  > 1. Sorting the results when I make the 
>  > portal_catalog() call. Is there any way to sort
> the
>  > objects by zclass properties when I do a
>  > portal_catalog call?
> Yes, if your property is indexed. Then, you can use
> the "sort_on"
> argument to the search.
> 
> 
>  > 2. Creating new metadata that can be used for
> sorting.
>  > Is there any way to define your own metadata when
> you
>  > programatically create zclass objects.
> You define the metadata table only once, not each
> time
> a ZInstance is created.
> 
> To get you ZInstance automatically cataloged, you
> derive
> from ZCatalogPathAware.
> 
> 
> Dieter


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com