On Tue, Feb 7, 2012 at 12:12 AM, Sergiu Dumitriu <sergiu(a)xwiki.com> wrote:
On 02/06/2012 10:59 AM, Joris Dirks wrote:
Hi,
I create livetables with doc.title as a column. By default, this
column does not show as filterable. When I force filtering by
"filterable:true", I can type in this field but nothing shows up as
result.
The property doc.name can be used and filtered as expected.
I have created an example:
http://playground.xwiki.org/xwiki/bin/view/Sandbox/Livetable
Should I report his as a bug or did I overlook something?
There are two different things that usually act as "title", doc.title and
doc.displayTitle. The first one is an actual metadata field of the document,
persisted to the database, while the latter is a dynamic field computed from
different sources, including the doc.title field, headers in the content,
the document name, and, more recently, other fields selected by the sheet
used to display the objects in the document (a new feature of the new sheet
mechanism). Plus, it could even be more dynamic, as in text generated by
some Velocity code, in the most basic form a translation.
Livetable filters work directly on the database, meaning that they translate
into sql conditions ("and doc.title like '%text introduced by the
user%'").
The doc.title column is special, since it's not exactly the doc.title
metadata, but a combination of doc.title and doc.displayTitle, so even
though the computed display title is displayed, filtering and sorting works
on the plain title. Given the very dynamic and unpredictable aspect of the
display title, it's impossible to write a correct sql filter that would
match the display title in all cases.
For this reason, by default the title isn't filterable, since it won't meet
the user's expectations: it doesn't filter on the *displayed* title, but on
the internal title. What's more, it *can't* be configured so that it filters
on the right information all the time. For certain instances it would be
possible to actually make the field filterable, but only when your documents
really use the document title as the only source of the displayed title.
For example, if you edit some of the displayed documents in wiki or wysiwyg
mode and enter something in the document title field (the one above the
content), you will be able to filter it in the livetable.
I wouldn't report this as a bug, since it's a limitation that can't easily
be fixed, but what we could do is make more use of the document title. So
far we've been limited by the old sheet mechanism when developing
applications, so most applications define their own object property for the
title instead of using the document title, and even worse, their own
property for the main content, since the document content had to be reserved
for the sheet inclusion statement.
Clear, thanks Sergiu. Though I'm not sure how a user (like me) could
be aware of this.