Modifications pour le document Macros de résultats Livetable

Modifié par Florent Charton le 2026/03/13 11:03

Depuis la version 5.1
modifié par Florent Charton
sur 2026/01/13 15:00
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-livetable-ui/17.10.2]
À la version 6.1
modifié par Florent Charton
sur 2026/03/13 11:03
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-livetable-ui/17.10.4]

Résumé

Détails

Propriétés de la Page
Contenu
... ... @@ -37,9 +37,10 @@
37 37   #foreach($colname in $collist)
38 38   ## If a classname is defined and the class field corresponding to the column name,
39 39   ## we check the type of the field and skip it if it's Password.
40 - #if ($className != '' && $class.get($colname))
41 - #set ($isPasswordType = $class.get($colname).classType == 'Password')
42 - #set ($isEmailType = $class.get($colname).classType == 'Email')
40 + #livetable_getPropertyClassAndType($colname)
41 + #if ($propType != '')
42 + #set ($isPasswordType = $propClass.get($colname).classType == 'Password')
43 + #set ($isEmailType = $propClass.get($colname).classType == 'Email')
43 43   #set ($emailObfuscated = $services.mail.general.shouldObfuscate())
44 44   #if (!($isPasswordType || ($isEmailType && $emailObfuscated)))
45 45   #livetable_addColumnToQuery($colname)
... ... @@ -692,6 +692,19 @@
692 692   #elseif ($colName == 'doc.date' || $colName == 'doc.creationDate' || $colName == 'doc.contentUpdateDate')
693 693   #livetable_getTableAlias($colName)
694 694   #livetable_filterDateProperty()
696 + #elseif ($colName == 'doc.hidden' || $colName == 'doc.minorEdit1' || $colName == 'doc.enforceRequiredRights')
697 + ## Boolean document fields need special handling to work across all databases
698 + ## (HSQLDB/PostgreSQL use true/false, MySQL/MariaDB/Oracle use 1/0).
699 + ## Support both true/false and 1/0 as Live Data uses the former while LiveTable uses the latter.
700 + #set ($booleanValue = ($filterValue.toLowerCase() == 'true' || $filterValue == '1'))
701 + ## No need to clean the column name since it's only one of the given values.
702 + #if ($whereParams.entrySet())
703 + #set ($whereSql = "${whereSql} and $colName = :${colName.replace('.', '_')}_filter")
704 + #set ($discard = $whereParams.put("${colName.replace('.', '_')}_filter", $booleanValue))
705 + #else
706 + #set ($whereSql = "${whereSql} and $colName = ?")
707 + #set ($discard = $whereParams.add($booleanValue))
708 + #end
695 695   #else
696 696   #set ($safeColName = $colName.replaceAll('[^a-zA-Z0-9_.]', '').replace('_', '.'))
697 697   #if ($whereParams.entrySet())