From pbasnews-xwiki@yahoo.fr Thu Dec 15 11:01:35 2016 From: Pascal BASTIEN To: xwiki-users@xwiki.org Subject: Re: [xwiki-users] Nested document killed {{spaceindex}} macro? Date: Thu, 15 Dec 2016 10:01:33 +0000 Message-ID: <2138075914.5607993.1481796093737@mail.yahoo.com> In-Reply-To: <2138075914.5607993.1481796093737.ref@mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1326929882116014655==" --===============1326929882116014655== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thxs for your advices but I didn't found a way to displayed last edited docum= ents but finally I edited the code to resolve my use case. My spaceindex=20 {{spaceindex sort=3D"modificationDate" count=3D"20" /}} displayed this nice screen now: https://snag.gy/ia6XOZ.jpg Imodified spaceindex macro to list all last doc (nested and terminale page) f= rom current space: /bin/edit/Main/SpaceIndex?editor=3Dobject with ***************** #if ("$!spaceMacroParam" !=3D '') #set ($spaceParam =3D $spaceMacroParam) #end #set ($docNames =3D $services.query.hql("where doc.space like ? or doc.space = like ? order by $sortQuery").addFilter('currentlanguage').addFilter('hidden')= .setLimit($limit).bindValues(["${spaceParam}","${spaceParam}.%"]).execute()) #if ($docNames.size() =3D=3D $limit) ##set ($docCount =3D $services.query.xwql('where doc.space =3D :space').b= indValue('space', $spaceParam).addFilter('unique').count()) #set ($docCount =3D $services.query.hql("where doc.space like ? or doc.sp= ace like ?").bindValues(["${spaceParam}","${spaceParam}.%"]).addFilter('uniqu= e').count()) #set ($remaining =3D $mathtool.sub($docCount, $limit)) #if ($remaining > 0) (% class=3D"documentListMore" %) ((( //Liste des $limit derniers documents $sortMessg.// {{html}}▶{{/html}} //[[Consulter la liste compl=C3=A8te>>Main.SpaceInd= ex||queryString=3D"space=3D$spaceParam"]]// ))) #end #end {{html}} #displayDocumentList($docNames false [])=20 ***************** and edited displayDocumentList macro in ./templates/macros.vm to add nice fol= der icon for parent page: ***************** #foreach($document in $documentList) #if ($document.getSpace() !=3D $previousSpace && $displaySpaces) #if($velocityCount > 1) #end ## Close previous spa= ce item if needed
  • ${escapet= ool.xml($document.getSpace())}
      ## Open new space item #set($previousSpace =3D $document.getSpace()) #end #if ($document.name =3D=3D 'WebHome')
    • #else
    • #end #end #if($displaySpaces) ***************** I haven't page and parent name with dot may be I will check my code again whe= n I have some (I'm too lazy) A better fix would be to add a new sort parameter in treeview but I didn't fo= und the query in xwiki code. Thxs Pascal B -------------------------------------------- En date de=C2=A0: Mer 14.12.16, Marius Dumitru Florea a =C3=A9crit=C2=A0: Objet: Re: [xwiki-users] Nested document killed {{spaceindex}} macro? =C3=80: "XWiki Users" Date: Mercredi 14 d=C3=A9cembre 2016, 16h11 =20 =20 ... "Space"' on http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module#HQueryLang= uageExamples , but take into account the issue described at http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module#HFindingpa= gesundernestedpages . =20 - replace my target /Main/SpaceIndex?space=3DMySpace by ... ??? > =20 On http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki72#HFlamin= go there is this mention: =20 "A new "children" viewer is now accessible in the "more actions" menu, along with the other viewers." =20 The URL is /xwiki/bin/view/Path/To/Page/?viewer=3Dchildren . It uses a live table. If you want a tree instead then there is http://extensions.xwiki.org/xwiki/bin/view/Extension/Children+Macro/ . =20 Hope this helps, Marius =20 =20 > Probably I must create a custom LT to list every sub pages > =20 --===============1326929882116014655==--