Fw: ZTopics and Canned Queries
Sorry my earlier post got cut off in the middle: I wrote:
Hello all,
I have been trying to use ZTopics to create views for my issue tracker product and have come across a limitation. In a ZTopic object, the query is entirely hardcoded, whereas what I need is a 'parameterized' query where the value of a filter may be supplied through the REQUEST at call time.
For example, I can create a ZTopic called FilterCreator: (creator : 'shalabh') Now http://url/FilterCreator will return all cataloged objects with creator=='shalabh'.
What I want to do is create: (creator : creatorName) And use http://url/FilterCreator?creatorName=shalabh
Currently ZTopic does not allow me to create an object like above as it tries to evaluate the query at creation time.
I have modified my local copy of ZTopics to do what I need. Now I have an extra checkbox that allows creation of 'parameterized' ZTopics. When it is checked, caching is turned off and REQUEST is also looked up during construction of the query at run time. Does anyone else find this useful? I know this product is unsupported but is it possible (or worth it) to submit this as a patch? Are there other products that might achive the same (any kind of 'search objects' or 'canned queries')? Thanks, Shalabh
Shalabh Chaturvedi wrote:
What I want to do is create: (creator : creatorName) And use http://url/FilterCreator?creatorName=shalabh
Currently ZTopic does not allow me to create an object like above as it tries to evaluate the query at creation time.
I have modified my local copy of ZTopics to do what I need. Now I have an extra checkbox that allows creation of 'parameterized' ZTopics. When it is checked, caching is turned off and REQUEST is also looked up during construction of the query at run time.
Does anyone else find this useful? I know this product is unsupported but is it possible (or worth it) to submit this as a patch? Are there other products that might achive the same (any kind of 'search objects' or 'canned queries')?
This sounds interesting. How would this end up being different from doing a ZCatalog search, though? In any case, You probably want to submit a patch to Amos Latteier (amos@digicol.com). HTH, Michael Bernstein.
Michael Bernstein wrote:
Shalabh Chaturvedi wrote:
What I want to do is create: (creator : creatorName) And use http://url/FilterCreator?creatorName=shalabh
<snipped>
This sounds interesting. How would this end up being different from doing a ZCatalog search, though?
(When I say 'ZTopic' in the following I mean my modified version) It would be a bit more convinient to use and combine different 'queries'. Assume 'FilterCreator' and 'OpenIssues' are two ZTopic objects: http://foo/FilterCreator?creatorName=shalabh Lists all objects where creator=='shalabh' http://foo/OpenIssues/ Lists all objects where status=='open' So now http://foo/OpenIssues/FilterCreator?creatorName=shalabh lists all objects where status=='open' AND creator=='shalabh' Also note that a ZTopic object can have a number of hardcoded 'filters'. So where a catalog search looks like: http://foo/report?meta_type=iTrack+Issue&status=open&creator=shalabh one could use: http://foo/OpenIssuesFor?creator=shalabh Another interesting thing possible (but not investigated much) is getting a different set of results when traversing to a ZTopic object through different non-ZTopic objects. The ZTopic object might use acquired attribute values in it's filters. I'll send a patch to Amos. Thanks, Shalabh
participants (2)
-
Michael Bernstein -
Shalabh Chaturvedi