I stole this from 2 previous emails. Can someone confirm if this is
correct if I want a display of all orphaned pages in my xwiki?
#set ($sql = "where doc.parent is null or doc.parent=''")
#set ($start = 0) #set ($nb = 500)
#set($curweb="")
#foreach ($item in $xwiki.searchDocuments($sql, $nb , $start))
#if ($xwiki.hasAccessLevel("view", "${context.database}:${item}"))
#set($bentrydoc = $xwiki.getDocument($item))
#if($curweb!=${bentrydoc.web})
<div>
1.1 ${bentrydoc.web}
</div>
#set ($curweb = ${bentrydoc.web})
#end
* [$bentrydoc.name>${bentrydoc.web}.$bentrydoc.name] by
$xwiki.getLocalUserName($bentrydoc.author) on
$xwiki.formatDate($bentrydoc.date,"MMMM dd, yyyy HH:mm")
<a href="$bentrydoc.getURL("edit")">edit</a>
#end
#end