{{velocity}}
#set($results=$xwiki.searchDocuments("where doc.hidden = false and
doc.id='${doc.parent}' order by doc.title asc"))
#foreach($item in $results)
#set ($itemdoc = $xwiki.getDocument($item))
[$item>$item],
#end
{{/velocity}}
must list all documents having ${doc.parent} as parent. So, included in
a page ICT.WebHome, must list all child documents having ICT.WebHome as
parent, mustn't it?
Well, I get nothing by including this snippet in such ICT.WebHome page.
And there are 50 documents that have this age as parent page!
Please, where am I wrong?
One more things. Please, how is it possible to compare doc.id and
$doc.parent? As far as I understand, doc.id maps to XWD_ID in xwikidoc
table (it is a bigint(20) field). And $doc.parent invokes getParent()
and gets a string in the form Space.Document. Thus, how is it possible
to compare both values?
Thanks for your help!
> Thank you,
> Chris
>
> On Thu, Nov 4, 2010 at 3:36 AM, [Ricardo Rodriguez] eBioTIC. [via XWiki] <
>
ml-node+5704373-1764624309-299502@n2.nabble.com<ml-node%2B5704373-1764624309-299502@n2.nabble.com>
>
>
>> wrote:
>>
>>
>
>
>> Sergiu Dumitriu wrote:
>>
>>
>>
>>> On 11/03/2010 07:47 PM, Chris Wagner wrote:
>>>
>>>
>>>
>>>> Hello,
>>>>
>>>> I am having some issues with the "order by" clause in HQL -
the
>>>>
>>>>
>> following
>>
>>
>>>> query:
>>>>
>>>> $xwiki.searchDocuments("where doc.hidden = false and
doc.id='${doc.parent}'
>>>>
>>>> order by doc.title asc")
>>>>
>>>>
>>>>
>> Please, Chris, what this query is designed for? And why do you use curly
>> braces to wrap doc.parent?
>>
>> Thanks!
>>
>>
>>
>>>> is returning the expected set of documents, but the title order is
>>>>
>>>>
>> erratic.
>>
>>
>>>> The documents are reordered, but it is not alphabetized as anticipated.
>>>> Instead, there are several alphabetized "spurts" -- for
example, I have
>>>>
>>>>
>> 'A',
>>
>>
>>>> 'C', 'P', ... 'A', 'A', 'B',
'C', 'D', 'E', etc. Within one of these
>>>>
>>>>
>> spans,
>>
>>
>>>> no items appear out of order, but the 'span' separation is not
expected
>>>>
>>>>
>> or
>>
>>
>>>> desired. Is there a common issue that I could be overlooking?
>>>>
>>>>
>>>>
>>> There are two types of titles.
>>>
>>> Document titles are stored in the database as the doc.title field, and
>>> they are editable in the editor above the content.
>>>
>>> Display titles are computed from the document title, first heading from
>>> the content, or the document name, depending on which one exists, in
>>> this order. Unfortunately it is not possible to see the display title in
>>> queries.
>>>
>>> I'm not sure, but I think that your problem is caused by this difference
>>> between display and document titles. The first set of documents has an
>>> empty document title, but in the UI you see their computed display
>>> title. The second set of documents is correctly ordered by their
>>> persisted document title.
>>>
>>>
>>>
>>>
>> --
>> Ricardo Rodríguez
>> CTO
>> eBioTIC.
>> Life Sciences, Data Modeling and Information Management Systems
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
<http://user/SendEmail.jtp?type=node&node=5704373&i=0>
>>
http://lists.xwiki.org/mailman/listinfo/users
>>
>>
>> ------------------------------
>> View message @
>>
http://xwiki.475771.n2.nabble.com/Unexpected-Order-By-Results-tp5702753p570…
>> To unsubscribe from Unexpected 'Order By' Results, click
here<http://xwiki.475771.n2.nabble.com/template/TplServlet.jtp?tpl=unsub…QxMjEwMQ==>.
>>
>>
>>
>>
>>
>
>
_______________________________________________
users mailing list
users(a)xwiki.org