Boolean Operations on Page Listings
The possibility to combine two or more listings of pages before output in such a way as to generate a new list based on a selectable operator like- +: Intersection -- display only pages that are in both (or all) listings
- *: Union -- display all pages belonging at least to one listing
- -: Difference -- display all pages belonging to one but not the other listing
After thinking more about this: Wikka needs on one side a generic output action which accepts some content to be displayed.
{{output content="some content here" col="3"}}
As it wouldn't be convenient to manually enter content, Wikka needs some kind of database query facility (which must not be SQL). Currently, Wikka supports listings of pages according to:
- category
- last time changed
- last time commented
- page tag
- linked by (and, as simple, linking to)
- not linked by any
- linked by pages but not existing
- owner
Combining these elements should allow something like recent changes of a category, a list of pages that are in two or more categories, all pages linked by the homepage in alphabetical order, and so on. This means two things: Wikka must be able to retrieve different collections of pages, and Wikka must be able to sort them in different ways before the result will be displayed.
to be continued
Page listings are any way of getting just a simple set of pages which could be used for such operations. My idea is to have an action, e.g. call it 'intersection', which gets any parameters like
{{union set[0]="category[DarTarsFavorites]" set[1]="recentlychanged[days='7']" set[2]="recentlycommented" show="pages" col="3"}}
The output should consist of all pages (but no subcategories) from category DarTarsFavorites that are also in the set of pages from recentlychanged (in the last 7 days) which have been recently commented.
As I do not think, this is the perfect solution I still tinkering, what might work. Perhaps an action like set work:
{{set operation="DarTarsFavorites && recentlychanged[days='7'] && recentlycommented" show="pages" col="3"}}
Where 'show' has the same function as in the categories action and col, well, col is the number of columns to output. The action should return the same output as the example above.
As you see, it is a general page output action, which takes result from other sources and combines it. My motivation behind it is that I am working on a Wiki whose pages are really good categorized, even multiply. And now I want a way to get all pages output which belong to two categories, e.g. all users from Berlin. All user pages are in the CategoryUsers, all Berlin related pages are in the CategoryBerlin. Both categories include users from Berlin and this is the intersection I want to output. As I thought about this problem, I found out, that this could be generalized, as people already have asked for recentlychanged pages from a single category. and these is my idea: We need a way for operations on sets of pages. We need a way to access sets of pages in actions and use operations on them. The problem is, at least in my second example above, that I don't know what security holes might be opened this way.
What do you think of it?