Velocity : retrieving language, other language translations, last updting date of docs


I started writing a velocity macro in a wiki to list in a table all pages (docs) containing a certain object. It works.
Now I would like :
To retrieve the language of the doc.
To retrieve the last updating date of the doc
To retrieve the other existing translations

Could I get a hint for the queries concerning these different properties?

$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
{{html wiki="true"}}

#set($hql = "select distinct doc from XWikiDocument as doc, BaseObject as obj where and obj.className='Documentation.Code.SectionClass' order by doc.title asc")
#set($resulos = $$hql, 500, 0))
<table id="fred" class="grid sortable" style="width: 85%;">
<tr class="sortHeader">
<th style="width: 85%;">Title</th><th style="width: 15%;"></th>

#foreach ($itemo in $results)
#set ($label = $itemo.getTitle())
<tr><td>[[$label>>$itemo]]</td><td align=right</td></tr>


I think it would be even nicer if you were using the livedata macro:

That would scale better, allow filtering, sorting, different views, etc :slight_smile:

And it supports xobjects.

For example to list all pages with the XWiki.XWikiUsers xobject:



1 Like

And if you want that in the query you can filter on the language column, see xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/xwiki.hbm.xml at 405d210dfad79f723617ba727fbcc5f0f6d2fbca · xwiki/xwiki-platform · GitHub

1 Like