[ 
http://jira.xwiki.org/jira/browse/XE-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vincent Massol updated XE-41:
-----------------------------

    Fix Version/s: 1.3 RC1
                       (was: 1.3 M2)

> Allow for filtering pages and Spaces out of Web RSS
> ---------------------------------------------------
>
>                 Key: XE-41
>                 URL: http://jira.xwiki.org/jira/browse/XE-41
>             Project: XWiki Enterprise
>          Issue Type: Improvement
>          Components: Navigation Application
>    Affects Versions: 1.0 B4
>            Reporter: Paul Armstrong
>         Assigned To: Vincent Massol
>             Fix For: 1.3 RC1
>
>         Attachments: WebRssCode.diff
>
>
> Here's a full replacement for the XWiki.WebRssCode to allow for filtering out 
> pages.
> Please keep the indentation as it's easier to read than the non-indented code 
> that was there....
> It's probably be good to make $hiddenPages and $hiddenSpaces centralized so 
> that other things like the navigation panel can all be changed from one place.
> {code:title=XWiki.WebRssCode}
> {pre}
> #set ($hiddenSpaces = ["XWiki", "Admin", "Panels"])
> #set ($hiddenPages = ["Main.WebRss", "Main.WebSearch", 
> "Main.BlogRss","Main.Test", "Blog.Macros", "Main.TagsRss", "Main.WikiLaunch", 
> "Main.RegisterNewUserAction", "Main.SpaceIndex", "Blog.Category", 
> "Main.RecentMembers", "Main.Tags", "Main.Dashboard", "Main.PersonalRSS", 
> "Blog.Categories"])
> $context.setCacheDuration(1800)
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; 
> xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns="http://purl.org/rss/1.0/"; 
> xmlns:dc="http://purl.org/dc/elements/1.1/"; 
> xmlns:wiki="http://purl.org/rss/1.0/modules/wiki/"; 
> xmlns:html="http://www.w3.org/1999/xhtml";>
> <channel rdf:about="$baseurl">
> <title>
> #if($title)
>   $title
> #else
>   $request.serverName
> #end
> </title>
> <link>$baseurl</link>
> <description>
> #if($description)
>   $description
> #else
>   $request.serverName
> #end
> </description>
> #set($logourl = $xwiki.getSkinFile($xwiki.getSkinPreference('logo', 
> 'logo.png')))
> #set($port = "")
> #if(($request.scheme == "http") && ($request.serverPort != 80))
>   #set($port = ":${request.serverPort}")
> #elseif(($request.scheme == "https") && ($request.serverPort != 443))
>   #set($port = ":${request.serverPort}")
> #end
> #set($logourl = "${request.scheme}://${request.serverName}${port}$logourl")
> <image rdf:resource="$logourl"/>
> <dc:language>$doc.defaultLanguage</dc:language>
> <dc:rights>$xwiki.getXMLEncoded($xwiki.webCopyright.replaceAll('<', 
> '<html:').replaceAll('<html:/', '</html:'))</dc:rights>
> <dc:publisher>$xwiki.getUserName($doc.author, false)</dc:publisher>
> <dc:creator>$xwiki.getUserName($doc.author, false)</dc:creator>
> <items>
> <rdf:Seq>
> #if(!$list)
>   #if(!$sql)
>     #set($sql = "where 1=1 order by doc.date desc")
>   #end
>   #set($list = $xwiki.searchDocuments($sql, 50, 0))
> #end
> #set($list = $xwiki.wrapDocs($list))
> #foreach ($currentdoc in $list)
>   #if(!$hiddenPages.contains($currentdoc.fullName) && 
> !$hiddenSpaces.contains($currentdoc.space))
>     #if($xwiki.hasAccessLevel("view", 
> "${context.database}:${currentdoc.fullName}"))
>       <rdf:li rdf:resource="$currentdoc.getExternalURL('view', 
> "language=${currentdoc.realLanguage}")" />
>     #end
>   #end
> #end
> </rdf:Seq>
> </items>
> </channel>
> <image rdf:about="$logourl">
>   <title>XWiki Logo</title>
>   <link>${baseurl}</link>
>   <url>$logourl</url>
> </image>
> #foreach ($currentdoc in $list)
>   #if(!$hiddenPages.contains($currentdoc.fullName) && 
> !$hiddenSpaces.contains($currentdoc.space))
>     #if($xwiki.hasAccessLevel("view", 
> "${context.database}:${currentdoc.fullName}"))
>       #set ($url = $currentdoc.getExternalURL('view', 
> "language=${currentdoc.realLanguage}"))
>       #if ($currentdoc.content.length() < 255)
>         #set ($length = $currentdoc.content.length())
>       #else
>         #set ($length = 255)
>       #end
>       <item rdf:about="$url">
>         <title>$xwiki.getXMLEncoded(${currentdoc.displayTitle})</title>
>         <link>$url</link>
>         <description>Version $currentdoc.version edited by 
> $xwiki.getXMLEncoded($xwiki.getUserName($currentdoc.author,     false)) on 
> $currentdoc.date</description>
>         #set($tz = $xwiki.formatDate($currentdoc.date, "Z"))
>         #set($tz = "${tz.substring(0, 3)}:${tz.substring(3)}")
>         <dc:date>$xwiki.formatDate($currentdoc.date, 
> "yyyy-MM-dd")T$xwiki.formatDate($currentdoc.date, "hh:mm:ss")$tz</dc:date>
>         
> <dc:creator>$xwiki.getXMLEncoded($xwiki.getUserName($currentdoc.creator, 
> false))</dc:creator>
>         <dc:contributor>
>           <rdf:Description link="">
>             
> <rdf:value>$xwiki.getXMLEncoded($xwiki.getUserName($currentdoc.author, 
> false))</rdf:value>
>           </rdf:Description>
>         </dc:contributor>
>       </item>
>     #end
>   #end
> #end
> </rdf:RDF>
> {/pre}
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.xwiki.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
notifications mailing list
notifications@xwiki.org
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to