Re: [xwiki-users] Nested document killed {{spaceindex}} macro?
Thxs for your advices but I didn't found a way to displayed last edited documents but finally I edited the code to resolve my use case. My spaceindex {{spaceindex sort="modificationDate" count="20" /}} displayed this nice screen now: https://snag.gy/ia6XOZ.jpg Imodified spaceindex macro to list all last doc (nested and terminale page) from current space: /bin/edit/Main/SpaceIndex?editor=object with * #if ("$!spaceMacroParam" != '') #set ($spaceParam = $spaceMacroParam) #end #set ($docNames = $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() == $limit) ##set ($docCount = $services.query.xwql('where doc.space = :space').bindValue('space', $spaceParam).addFilter('unique').count()) #set ($docCount = $services.query.hql("where doc.space like ? or doc.space like ?").bindValues(["${spaceParam}","${spaceParam}.%"]).addFilter('unique').count()) #set ($remaining = $mathtool.sub($docCount, $limit)) #if ($remaining > 0) (% class="documentListMore" %) ((( //Liste des $limit derniers documents $sortMessg.// {{html}}▶{{/html}} //[[Consulter la liste complète>>Main.SpaceIndex||queryString="space=$spaceParam"]]// ))) #end #end {{html}} #displayDocumentList($docNames false []) * and edited displayDocumentList macro in ./templates/macros.vm to add nice folder icon for parent page: * #foreach($document in $documentList) #if ($document.getSpace() != $previousSpace && $displaySpaces) #if($velocityCount > 1) #end ## Close previous space item if needed ${escapetool.xml($document.getSpace())} ## Open new space item #set($previousSpace = $document.getSpace()) #end #if ($document.name == 'WebHome') ${escapetool.xml($document.getPlainTitle())} #else ${escapetool.xml($document.getPlainTitle())} #end #end #if($displaySpaces) * I haven't page and parent name with dot may be I will check my code again when I have some (I'm too lazy) A better fix would be to add a new sort parameter in treeview but I didn't found the query in xwiki code. Thxs Pascal B En date de : Mer 14.12.16, Marius Dumitru Florea a écrit : Objet: Re: [xwiki-users] Nested document killed {{spaceindex}} macro? À: "XWiki Users" Date: Mercredi 14 décembre 2016, 16h11 ... "Space"' on http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module#HQueryLanguageExamples , but take into account the issue described at http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module#HFindingpagesundernestedpages . - replace my target /Main/SpaceIndex?space=MySpace by ... ??? > On http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki72#HFlamingo there is this mention: "A new "children" viewer is now accessible in the "more actions" menu, along with the other viewers." The URL is /xwiki/bin/view/Path/To/Page/?viewer=children . It uses a live table. If you want a tree instead then there is http://extensions.xwiki.org/xwiki/bin/view/Extension/Children+Macro/ . Hope this helps, Marius > Probably I must create a custom LT to list every sub pages >
Re: [xwiki-users] Nested document killed {{spaceindex}} macro?
Hi Pascal, > On 14 Dec 2016, at 16:11, Marius Dumitru Florea > wrote: > > Hi Pascal, > > On Thu, Dec 8, 2016 at 7:18 PM, Pascal BASTIEN > wrote: > >> Hello, >> >> With my xwiki7.0.1 to 8.4 upgrade process, I noticed that all my WebHome >> on spaces (with dashboard+{{spaceindex}} macro) are "broken”. [snip] > >> Probably I must create a custom LT to list every sub pages >> >> Finaly, may be a caution text must be added on this page: >> http://extensions.xwiki.org/xwiki/bin/view/Extension/SpaceIndex+Macro >> (ie "don't use this macro anymore with nested page!" or "list only direct >> children terminal page “) I’ve added some explanations to: - http://extensions.xwiki.org/xwiki/bin/view/Extension/SpaceIndex+Macro - http://extensions.xwiki.org/xwiki/bin/view/Extension/Spaces+Macro Thanks -Vìncent >> >> Thxs for your help. >> >> Pascal BASTIEN >>
Re: [xwiki-users] Nested document killed {{spaceindex}} macro?
Hi Pascal, On Thu, Dec 8, 2016 at 7:18 PM, Pascal BASTIEN wrote: > Hello, > > With my xwiki7.0.1 to 8.4 upgrade process, I noticed that all my WebHome > on spaces (with dashboard+{{spaceindex}} macro) are "broken". > After a little bit of search, I understood that spaceindex macro list only > direct children terminal page... > In some different post from dev list, it seem that I must use > {{documentTree}} macro instead. > > My spaces dashboard use > {{spaceindex sort="modificationDate" count="20" /}} > to list the 20 more recents page and I added a shortcut to > /bin/view/Main/SpaceIndex?space=MySpace (broken too:-( ) > > Could you give me some advices how can I replace my "spaceindex" to: > - list the 20 more recents page (terminale and none terminale) on current > space? > I didn't found a "modificationDate" sorting parameter in {{documentTree}} > The document tree doesn't have this parameter, and it's not suited for your use case anyway. I would use the Query Manager to retrieve the most recent pages. Look for 'List all nested documents in the space "Space"' on http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module#HQueryLanguageExamples , but take into account the issue described at http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module#HFindingpagesundernestedpages . - replace my target /Main/SpaceIndex?space=MySpace by ... ??? > On http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki72#HFlamingo there is this mention: "A new "children" viewer is now accessible in the "more actions" menu, along with the other viewers." The URL is /xwiki/bin/view/Path/To/Page/?viewer=children . It uses a live table. If you want a tree instead then there is http://extensions.xwiki.org/xwiki/bin/view/Extension/Children+Macro/ . Hope this helps, Marius > Probably I must create a custom LT to list every sub pages > > Finaly, may be a caution text must be added on this page: > http://extensions.xwiki.org/xwiki/bin/view/Extension/SpaceIndex+Macro > (ie "don't use this macro anymore with nested page!" or "list only direct > children terminal page ") > > Thxs for your help. > > Pascal BASTIEN >
Re: [xwiki-users] Nested document killed {{spaceindex}} macro?
I didn't found equivalent of {{spaceindex sort="modificationDate" count="20" /}} then I must modify hql query in: /bin/edit/Main/SpaceIndex?editor=object but I failed too too! :-( I would to list all documents (terminale page and child space) under a root space, the i use this query : #set ($docNames = $services.query.hql("from XWikiSpace as space where doc.space = space.reference and ((doc.space like ? )) order by $sortQuery").addFilter('currentlanguage').addFilter('hidden').setLimit($limit).bindValues([${spaceParam}]).execute()) - $spaceParam is my root Space - $sortQuery = 'doc.contentUpdateDate desc' but the query displayed this error: Caused by: org.hibernate.hql.ast.QuerySyntaxException: Invalid path: 'doc.space' [from com.xpn.xwiki.doc.XWikiSpace as space where doc.space = space.reference and ((doc.space like ? )) order by doc.contentUpdateDate desc] Thxs. (I didn't found the query of Document Tree in source code either) Pascal B En date de : Jeu 8.12.16, Pascal BASTIEN a écrit : Objet: Nested document killed {{spaceindex}} macro? À: "XWiki Users" Date: Jeudi 8 décembre 2016, 18h18 Hello, With my xwiki7.0.1 to 8.4 upgrade process, I noticed that all my WebHome on spaces (with dashboard+{{spaceindex}} macro) are "broken". After a little bit of search, I understood that spaceindex macro list only direct children terminal page... In some different post from dev list, it seem that I must use {{documentTree}} macro instead. My spaces dashboard use {{spaceindex sort="modificationDate" count="20" /}} to list the 20 more recents page and I added a shortcut to /bin/view/Main/SpaceIndex?space=MySpace (broken too:-( ) Could you give me some advices how can I replace my "spaceindex" to: - list the 20 more recents page (terminale and none terminale) on current space? I didn't found a "modificationDate" sorting parameter in {{documentTree}} - replace my target /Main/SpaceIndex?space=MySpace by ... ??? Probably I must create a custom LT to list every sub pages Finaly, may be a caution text must be added on this page: http://extensions.xwiki.org/xwiki/bin/view/Extension/SpaceIndex+Macro (ie "don't use this macro anymore with nested page!" or "list only direct children terminal page ") Thxs for your help. Pascal BASTIEN
[xwiki-users] Nested document killed {{spaceindex}} macro?
Hello, With my xwiki7.0.1 to 8.4 upgrade process, I noticed that all my WebHome on spaces (with dashboard+{{spaceindex}} macro) are "broken". After a little bit of search, I understood that spaceindex macro list only direct children terminal page... In some different post from dev list, it seem that I must use {{documentTree}} macro instead. My spaces dashboard use {{spaceindex sort="modificationDate" count="20" /}} to list the 20 more recents page and I added a shortcut to /bin/view/Main/SpaceIndex?space=MySpace (broken too:-( ) Could you give me some advices how can I replace my "spaceindex" to: - list the 20 more recents page (terminale and none terminale) on current space? I didn't found a "modificationDate" sorting parameter in {{documentTree}} - replace my target /Main/SpaceIndex?space=MySpace by ... ??? Probably I must create a custom LT to list every sub pages Finaly, may be a caution text must be added on this page: http://extensions.xwiki.org/xwiki/bin/view/Extension/SpaceIndex+Macro (ie "don't use this macro anymore with nested page!" or "list only direct children terminal page ") Thxs for your help. Pascal BASTIEN