Modifications pour le document Liste des pages de l'espace
Modifié par superadmin le 2021/12/12 21:55
modifié par Paul Libbrecht (admin)
sur 2019/10/13 16:31
sur 2019/10/13 16:31
modifié par Administrator
sur 2013/06/04 10:05
sur 2013/06/04 10:05
Commentaire de modification :
Import
Résumé
Détails
- Propriétés de la Page
-
- Auteur du document
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. adminPolx1 +XWiki.Admin - Contenu
-
... ... @@ -1,10 +1,7 @@ 1 1 {{velocity}} 2 2 #if("$!request.space" != "") #set($space=$request.space) #else #set($space = $doc.space) #end 3 3 $services.localization.render('platform.index.spaceIndexDescription', [$space]) 4 -## Since we display the space index, we do not display page titles and locations, but the old columns name and space 5 -## (old behavior consistent with this old macro)... 6 6 7 -{{documents space="$space.replaceAll('["~]', '~$0')" id="spaceindex" columns="doc.name, doc.space, doc.date, doc.author"/}} 8 -#set($docextras=[]) 5 +{{documents space="$space.replaceAll('["~]', '~$0')" id="spaceindex"/}} 9 9 {{/velocity}} 10 10
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -1,6 +1,6 @@ 1 1 {{velocity}} 2 - ## TODO: add a parameter to specify the style, list or livetable 3 - ## Get the number of documents to display2 + ## TODO: add me a parameter to specify the style, list or livetable 3 + ## get the number of documents to display 4 4 #set ($limit = $xcontext.macro.params.get('count')) 5 5 #if ("$!limit" == '') 6 6 ## 100 documents displayed by default if no value is specified ... ... @@ -7,26 +7,13 @@ 7 7 #set ($limit = '100') 8 8 #end 9 9 #set ($limit = $mathtool.toInteger($limit)) 10 - ## Compute the XWQL portion related to sorting, based on the passed "sort" parameter 11 - ## Valid values are "creationDate", "modificationDate" and "docName" 12 - #set ($sort = $xcontext.macro.params.get('sort')) 13 - #if ("$sort" == 'docName') 14 - ## Sorting alphabetically 15 - #set ($sortQuery = 'doc.name asc') 16 - #elseif ("$sort" == 'modificationDate') 17 - ## Sorting by update date 18 - #set ($sortQuery = 'doc.contentUpdateDate desc') 19 - #else 20 - ## Sort by creation date by default 21 - #set ($sortQuery = 'doc.creationDate desc') 22 - #end 23 - ## Get the space to display the documents for 10 + ## get the space to display the documents for 24 24 #set ($spaceParam = $doc.space) 25 25 #set ($spaceMacroParam = $xcontext.macro.params.get('space')) 26 26 #if ("$!spaceMacroParam" != '') 27 27 #set ($spaceParam = $spaceMacroParam) 28 28 #end 29 - #set ($docNames = $ser vices.query.hql("where doc.space=? order by$sortQuery").addFilter('currentlanguage').addFilter('hidden').setLimit($limit).bindValues([${spaceParam}]).execute())16 + #set ($docNames = $xwiki.searchDocuments('where doc.space=? order by doc.creationDate desc', $limit, 0, [${spaceParam}])) 30 30 {{html}} 31 31 #displayDocumentList($docNames false []) 32 32 ## Note: we pass an empty blacklistedSpaces list since we are used as a space dashboard, not a global dashboard ... ... @@ -33,7 +33,7 @@ 33 33 {{/html}} 34 34 35 35 #if ($docNames.size() == $limit) 36 - #set ($docCount = $ services.query.xwql('where doc.space:space').bindValue('space', $spaceParam).addFilter('unique').count())23 + #set ($docCount = $xwiki.countDocuments('where doc.space=?', [${spaceParam}])) 37 37 #set ($remaining = $mathtool.sub($docCount, $limit)) 38 38 #if ($remaining > 0) 39 39 (% class="documentListMore" %) ((( - Description de la macro
-
... ... @@ -1,1 +1,1 @@ 1 -Lists documents in a space. 1 +Lists the documents in a space.
- XWiki.WikiMacroParameterClass[2]
-
- Valeur par défaut du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -creationDate - Description du paramètre
-
... ... @@ -1,5 +1,0 @@ 1 -Optional parameter to choose the sorting of the list of document. 2 -Value must be: 3 -- creationDate sort by creation date (default) 4 -- modificationDate sort by update date 5 -- or docName sort alphabetically - Paramètre obligatoire
-
... ... @@ -1,1 +1,0 @@ 1 -0 - Nom du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -sort