Feature Proposal: Query custom collections
Motivation
A couple of proposals (this one used to be known as
QueryLinksAndBacklinks) seem to be somewhat mergeable:
An
IRC discussion, established that it should be possible to 'scope' queries using the
QuerySearch syntax itself, to a particular 'collection' (better term wanted)
Description and Documentation
This requires two parts spec'd out:
- Syntax to query custom collections (and the standard 'topics' collection, which we can assume is what QuerySearch already defaults to)
- Store/Meta/??? API changes to allow registration of new collections; different collections might want to have their own store mechanisms too, unless they represent topics?
Examples
Just brainstorming
Backlinks
- Query topics that have backlinks to a given topic
%QUERY{"topiclinks[target='Web.TargetTopic']"}%
- Authors of topics that have backlinks to a given topic
%QUERY{"topiclinks[target='Web.TargetTopic'].author"}%
- Query a topic for its links to other topics
%QUERY{"topiclinks[source='Web.SourceTopic'"}%
- List all revs on a topic authored by JoeBloggs
%QUERY{"revisions[name='Web.SomeTopic' AND author='JoeBloggs']"}%
- List all revs on a topic where 'State' was Working
%QUERY{"revisions[name='Web.SomeTopic' AND State='Working']"}%
- List all revs on a topic between Jan 1 and Sep 1
%QUERY{"revisions[name='Web.SomeTopic' AND date >= d2n(2010-01-01) AND date <= d2n(2010-09-01)]"}%
- List all topics that have any rev whose 'State' was ever Waiting
%QUERY{"revisions[State='Waiting']"}%
'log' DB
Standard 'topics' collection as we already know it
- On a vanilla foswiki, probably this will expand to
%ALLOW[WEB,TOPIC]CHANGE%
- %QUERY{"acls[topic='%WEB%.%TOPIC%' AND allowtopicchange]
or, to flatten out groups as far as the user mapper is capable (TopicUserMapping should show only users, no groups): %QUERY{"acls[topic='%WEB%.%TOPIC%' AND allowtopicchange].flattened
or to list only groups: %QUERY{"acls[topic='%WEB%.%TOPIC%' AND allowtopicchange AND isgroup]
or to list flattened groups: %QUERY{"acls[topic='%WEB%.%TOPIC%' AND allowtopicchange AND isgroup].flattened
Impact
Implementation
--
Contributors: PaulHarvey - 04 Oct 2010
Discussion
it is
possible that what you call a collection, is what I've been calling a
ResultSet. (I say possible, because clearly, further thought is needed to define both of these terms.
--
SvenDowideit - 26 Oct 2010
Added the
QueryAccessControls example
--
PaulHarvey - 07 Nov 2010