Author: vmassol
Date: 2007-11-24 18:02:26 +0100 (Sat, 24 Nov 2007)
New Revision: 6064
Modified:
xwiki-products/xwiki-enterprise/trunk/wiki/src/main/resources/XWiki/WebSearchCode
Log:
Fix comment typo
Modified:
xwiki-products/xwiki-enterprise/trunk/wiki/src/main/resources/XWiki/WebSearchCode
===================================================================
---
xwiki-products/xwiki-enterprise/trunk/wiki/src/main/resources/XWiki/WebSearchCode
2007-11-24 16:46:27 UTC (rev 6063)
+++
xwiki-products/xwiki-enterprise/trunk/wiki/src/main/resources/XWiki/WebSearchCode
2007-11-24 17:02:26 UTC (rev 6064)
@@ -53,78 +53,78 @@
<tags/>
</property>
</object>
-<content>## ==================================================
-## Common code for WebSearch and WebSearchRss
-## ==================================================
-## Inputs: $text, $space
-## Output: $list
-## Note: Do not put any empty line or this will break
-## the generated RSS feed
-## ==================================================
-#set($datedlist = $xwiki.arrayList)
-#if(!$text or $text == "")
- ## No search
-#else
- #set($text = $text.replaceAll("'", "''").replaceAll("%", "\\%"))
- #set($nbitems = 50)
- ## -----------------------------------------------------------
- ## Non-admins should not see results from XWiki, Main, Admin
- ## and Panels spaces. Also exclude the WebPreferences doc.
- ## -----------------------------------------------------------
- #if ($xwiki.hasAdminRights())
- #set ($excludedWebs = "")
- #else
- #set ($excludedWebs = "doc.web<>'XWiki' and doc.web<>'Admin'
and doc.web<>'Panels' and doc.name<>'WebPreferences' and")
- #end
- ## -----------------------------------------------------------
- ## Display only a given space if $request.space is defined
- ## -----------------------------------------------------------
- #if($space and $space == "All")
- #set ($webClause = "$excludedWebs")
- #else
- #set ($webClause = "doc.web='$space' and $excludedWebs")
- #end
- #macro(addelement $item $list)
- #if($xwiki.hasAccessLevel("view", $context.user,
"${context.database}:${item}"))
- #set($itemdoc = $xwiki.getDocument($item))
- #set($sdate = $xwiki.formatDate($itemdoc.date, "yyyyMMddHHmmss"))
- #set($sitem = "${sdate}${item}")
- #if(!$list.contains($sitem))
- #set($discard = $list.add($sitem))
- #end
- #end
- #end
- ## -----------------------------------------------------------
- ## Search in the page names
- ## -----------------------------------------------------------
- #set ($sql = "where $webClause upper(doc.fullName) like upper('%$!text%')
order by doc.date desc")
- #foreach ($item in $xwiki.searchDocuments($sql , $nbitems, 0))
- #addelement($item $datedlist)
- #end
- ## -----------------------------------------------------------
- ## Search in page content
- ## -----------------------------------------------------------
- #set ($sql = "where $webClause upper(doc.content) like upper('%$!text%')
order by doc.date desc")
- #foreach ($item in $xwiki.searchDocuments($sql , $nbitems, 0))
- #addelement($item $datedlist)
- #end
- ## -----------------------------------------------------------
- ## Search in text fields (simple String properties)
- ## -----------------------------------------------------------
- #set($sql= ", BaseObject as obj, StringProperty as prop where $webClause
obj.name=doc.fullName and prop.id.id = obj.id and upper(prop.value) like
upper('%$!text%')")
- #foreach ($item in $xwiki.searchDocuments($sql , $nbitems, 0))
- #addelement($item $datedlist)
- #end
- ## -----------------------------------------------------------
- ## Search in big text fields (textarea properties)
- ## -----------------------------------------------------------
- #set($sql= ", BaseObject as obj, LargeStringProperty as prop where
$webClause obj.name=doc.fullName and prop.id.id = obj.id and upper(prop.value)
like upper('%$!text%')")
- #foreach ($item in $xwiki.searchDocuments($sql , $nbitems, 0))
- #addelement($item $datedlist)
- #end
-#end
-#set($list = $xwiki.arrayList)
-#foreach($item in $xwiki.sort($datedlist))
- #set($ok = $list.add(0, $item.substring(14)))
+<content>## ==================================================
+## Common code for WebSearch and WebSearchRss
+## ==================================================
+## Inputs: $text, $space
+## Output: $list
+## Note: Do not put any empty line or this will break
+## the generated RSS feed
+## ==================================================
+#set($datedlist = $xwiki.arrayList)
+#if(!$text or $text == "")
+ ## No search
+#else
+ #set($text = $text.replaceAll("'", "''").replaceAll("%", "\\%"))
+ #set($nbitems = 50)
+ ## -----------------------------------------------------------
+ ## Non-admins should not see results from XWiki, Admin and
+ ## Panels spaces. Also exclude the WebPreferences doc.
+ ## -----------------------------------------------------------
+ #if ($xwiki.hasAdminRights())
+ #set ($excludedWebs = "")
+ #else
+ #set ($excludedWebs = "doc.web<>'XWiki' and doc.web<>'Admin'
and doc.web<>'Panels' and doc.name<>'WebPreferences' and")
+ #end
+ ## -----------------------------------------------------------
+ ## Display only a given space if $request.space is defined
+ ## -----------------------------------------------------------
+ #if($space and $space == "All")
+ #set ($webClause = "$excludedWebs")
+ #else
+ #set ($webClause = "doc.web='$space' and $excludedWebs")
+ #end
+ #macro(addelement $item $list)
+ #if($xwiki.hasAccessLevel("view", $context.user,
"${context.database}:${item}"))
+ #set($itemdoc = $xwiki.getDocument($item))
+ #set($sdate = $xwiki.formatDate($itemdoc.date, "yyyyMMddHHmmss"))
+ #set($sitem = "${sdate}${item}")
+ #if(!$list.contains($sitem))
+ #set($discard = $list.add($sitem))
+ #end
+ #end
+ #end
+ ## -----------------------------------------------------------
+ ## Search in the page names
+ ## -----------------------------------------------------------
+ #set ($sql = "where $webClause upper(doc.fullName) like upper('%$!text%')
order by doc.date desc")
+ #foreach ($item in $xwiki.searchDocuments($sql , $nbitems, 0))
+ #addelement($item $datedlist)
+ #end
+ ## -----------------------------------------------------------
+ ## Search in page content
+ ## -----------------------------------------------------------
+ #set ($sql = "where $webClause upper(doc.content) like upper('%$!text%')
order by doc.date desc")
+ #foreach ($item in $xwiki.searchDocuments($sql , $nbitems, 0))
+ #addelement($item $datedlist)
+ #end
+ ## -----------------------------------------------------------
+ ## Search in text fields (simple String properties)
+ ## -----------------------------------------------------------
+ #set($sql= ", BaseObject as obj, StringProperty as prop where $webClause
obj.name=doc.fullName and prop.id.id = obj.id and upper(prop.value) like
upper('%$!text%')")
+ #foreach ($item in $xwiki.searchDocuments($sql , $nbitems, 0))
+ #addelement($item $datedlist)
+ #end
+ ## -----------------------------------------------------------
+ ## Search in big text fields (textarea properties)
+ ## -----------------------------------------------------------
+ #set($sql= ", BaseObject as obj, LargeStringProperty as prop where
$webClause obj.name=doc.fullName and prop.id.id = obj.id and upper(prop.value)
like upper('%$!text%')")
+ #foreach ($item in $xwiki.searchDocuments($sql , $nbitems, 0))
+ #addelement($item $datedlist)
+ #end
+#end
+#set($list = $xwiki.arrayList)
+#foreach($item in $xwiki.sort($datedlist))
+ #set($ok = $list.add(0, $item.substring(14)))
#end</content>
</xwikidoc>
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications