Wiki-Quellcode von XWikiClassesLiveTableResults
Zuletzt geändert von admin am 2025/02/23 10:22
Zeige letzte Bearbeiter
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{include reference="XWiki.LiveTableResultsMacros" /}} | ||
| 2 | |||
| 3 | {{velocity wiki="false"}} | ||
| 4 | #if ($xcontext.action == 'get' && $request.outputSyntax == 'plain') | ||
| 5 | ## Include only the pages that have a class definition. | ||
| 6 | #set ($extra = "and (doc.xWikiClassXML is not null and doc.xWikiClassXML like '<%')") | ||
| 7 | #set ($params = {}) | ||
| 8 | #addLivetableLocationFilter($extra $params $!request.location) | ||
| 9 | #set ($output = {}) | ||
| 10 | #gridresultwithfilter_buildJSON('' $request.collist.split(',') '' $extra $params $output) | ||
| 11 | ## Compute the page count for each class. | ||
| 12 | #foreach ($row in $output.rows) | ||
| 13 | #set ($statement = ', BaseObject as obj where doc.translation = 0 and ' + | ||
| 14 | 'doc.fullName = obj.name and obj.className = :className') | ||
| 15 | ## Note: the unique filter is required as otherwise pages are returned once for each contained XObjects, leading | ||
| 16 | ## to larger counts than expected. | ||
| 17 | #set ($hqlQuery = $services.query.hql($statement).bindValue('className', $row.doc_fullName).addFilter('unique')) | ||
| 18 | #set ($row.pageCount = $hqlQuery.count()) | ||
| 19 | #end | ||
| 20 | #jsonResponse($output) | ||
| 21 | #end | ||
| 22 | {{/velocity}} |