[Proposal] Solution for filtering out pages in the XE wiki

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Proposal] Solution for filtering out pages in the XE wiki

vmassol
Administrator
Hi,

We need a global solution for including/excluding pages in the XE  
wiki. The needs comes from the fact that we shouldn't show internal  
pages to casual xwiki users and we shouldn't show pages that they  
don't have the rights to view. At least the following places need to  
use this feature:
* Navigation panel
* All docs Treeview
* All docs Index
* WebSearch
* WebSearchRss
* WebRss
* Orphaned pages + Panel

I propose the following implementation:

1) Add a new API $xwiki.filterDocuments(List docNamesList, String  
persmissionToCheck). It would be used like this:

for each ($item in $xwiki.filterDocuments($xwiki.searchDocuments
($sql), "view"))
...

In the XE wiki:

2) Add a XWiki.PageFiltersClass class with 1 property: Includes. This  
property will contain pages to exclude, using HQL like format (one  
entry per line)

3) Add a XWiki.PageFiltersClassSheet to explain what this is about,  
explain how to add/remove entries, etc

4) Add a XWiki.PageFilters document that contains a  
XWiki.PageFiltersClass object and which has velocity code in its wiki  
content to compute the HQL clause corresponding to the exclusions  
specified in its object.

5) Modify the documents listed above to use XWiki.PageFilters as  
follows:

#includeInContext("XWiki.PageFilters")
#if (!$pageFiltersSqlClause)
   #set ($pageFiltersSqlClause = "")
#end

#set ($sql = ".... and $pageFiltersSqlClause ...")
#set ($list = $xwiki.filterDocuments($xwiki.searchDocuments($sql ,  
$nb , 0), "view"))

...

WDYT?

Thanks
-Vincent




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Solution for filtering out pages in the XE wiki

ebullient
On 7/15/07, Vincent Massol <[hidden email]> wrote:
> Hi,
>
> We need a global solution for including/excluding pages in the XE
> wiki.

[snip ..]

>
> I propose the following implementation:
>
> 1) Add a new API $xwiki.filterDocuments(List docNamesList, String
> persmissionToCheck). It would be used like this:
>
> for each ($item in $xwiki.filterDocuments($xwiki.searchDocuments
> ($sql), "view"))
> ...

Could this mechanism be used for other types of queries, too? Would be
nice if this filter mechanism could replace access checks like this:

  #if($xwiki.hasAccessLevel("view", "${context.database}:${item}"))

> In the XE wiki:
>
> 2) Add a XWiki.PageFiltersClass class with 1 property: Includes. This
> property will contain pages to exclude, using HQL like format (one
> entry per line)
>
> 3) Add a XWiki.PageFiltersClassSheet to explain what this is about,
> explain how to add/remove entries, etc
>
> 4) Add a XWiki.PageFilters document that contains a
> XWiki.PageFiltersClass object and which has velocity code in its wiki
> content to compute the HQL clause corresponding to the exclusions
> specified in its object.
>
> 5) Modify the documents listed above to use XWiki.PageFilters as
> follows:
>
> #includeInContext("XWiki.PageFilters")
> #if (!$pageFiltersSqlClause)
>    #set ($pageFiltersSqlClause = "")
> #end
>
> #set ($sql = ".... and $pageFiltersSqlClause ...")
> #set ($list = $xwiki.filterDocuments($xwiki.searchDocuments($sql ,
> $nb , 0), "view"))
>
Sometimes what you want to exclude varies from place to place. Seems
like a way to specify an arbitrary document with a PageFiltersClass
object would be a way to solve that issue.. (I assume you meant it,
and I just didn't read it that way).


Erin

--
'Waste of a good apple' -Samwise Gamgee



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws