Hernández Cuchí wrote:
Ok,
Two questions then:
-the concept of parent? I thought that pages were just spacename.pagename, and the
parents where the link sources.
The parent of a document is an unique field of each document, which can
be used to further create deeper treelike hierarchies than the simple
space->documents relationship. You can set the parent of a document in
edit mode.
-How can I get the pages with no link to them?
No backlinks and no parent:
#foreach($item in $xwiki.searchDocuments(" where doc.parent = '' and
doc.name <> 'WebHome' and not exists(from XWikiLink link where
link.fullName = doc.fullName)"))
* [$item]
#end
No backlinks:
#foreach($item in $xwiki.searchDocuments(" where not exists(from
XWikiLink link where link.fullName = doc.fullName)"))
* [$item]
#end
Note that backlinks record only wiki links, but there are other means of
referencing a document. For example, the above query returns
Blog.WebHome as an unlinked document, although Main.Dashboard includes
it to display the most recent news.
Also, links from structured documents (like blog articles or user
profiles) are not considered for backlinks, only links found in
unstructured wiki content.
Thanks,
Francisco
-----Mensaje original-----
De: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] En nombre de Vincent Massol
Enviado el: lunes, 16 de febrero de 2009 12:04
Para: XWiki Users
Asunto: Re: [xwiki-users] My orphaned pages panels do not work properly
Hi,
On Feb 16, 2009, at 11:46 AM, Hernández Cuchí, Francisco Ricardo wrote:
Hello,
I have some pages listed in the orphaned panel, but this page have a
backlink in the backlink panel, so meybe I don´t understand the
meaning of the orphaned pages panel, but I think that a page with a
parent, is not orphaned.
* orphaned means no parent.
* backlinks means that some page points to you
If you want no parent + no backlinks then you'd need to modify the
query in your orphaned pages panel.
Thanks
-Vincent
> Here is the code of the panel:
>
> #panelheader('Páginas Huérfanas')
>
> #set ($query = "where doc.parent is null or doc.parent='' and
> doc.name <> 'WebHome' order by doc.name asc")
>
> #foreach ($item in $xwiki.searchDocuments("${query}"))
>
> #if ($xwiki.hasAccessLevel("view", $context.user, "$
> {context.database}:${item}"))
>
> #set($bentrydoc = $xwiki.getDocument($item))
>
> * [${bentrydoc.fullName}]
>
> #end
>
> #end
>
> #panelfooter()
--
Sergiu Dumitriu
http://purl.org/net/sergiu/