List Pages Created By Browsing User

Last modified by Vincent Massol on 2021/03/18 11:28

page_whiteSnippet to put in a Panel that lists the wiki pages created by the currently logged in user
TypeSnippet
Category
Developed by

xwiki:XWiki.PrathapPandian

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents

Description

#set($web = $doc.web)
#set($authorslist = $util.getArrayList())
#set($currentuser = $context.user)
    #foreach($page in $xwiki.getSpaceDocsName($web))
        #set($author = $xwiki.getDocument("${web}.${page}").getCreator())
            #if (!$authorslist.contains($author) && $author == $currentuser)
            #panelheader('Newly Created Page')
                #set($user=$context.user)
                #foreach($subdoc in $xwiki.getSpaceDocsName("$doc.web"))
                    #set($author = $xwiki.getDocument("${doc.web}.${subdoc}").getCreator())
                    #if($author==$user)
                       - [${doc.web}.${subdoc}]
                    #end
                #end
            #panelfooter()
        #set ($discard = $authorslist.add($author))
    #end
#end
Tags: panel
     

Get Connected