Consortium
Activities
Projects
Forge
Events
Log-in
Register
Search on ObjectWeb Website
Space Menu
Consortium
|
Solutions
|
Middleware
|
Forge
|
MyObjectWeb
|
PDF
|
History
|
More Actions
View
Code
|
XML
|
Help
Documentation
|
XWiki Syntax
|
1 Search on ObjectWeb Website #set($formatDate = "MMMM dd, yyyy HH:mm") #if ($request.getParameter("text")) #set ($text = $request.getParameter("text") ) #else #set($text = "") #end <center> <form action="WebSearch"> <input type="text" name="text" value="$!text"> <input type="submit" name="search" value="Search"> </form> </center> #if($text!="") #set ($sql = "where doc.web like '%$text%' or doc.name like '%$text%' or doc.content like '%$text%' order by doc.date desc") #set ($start = 0) #set ($nb = 50) <!-- Sql: $sql Sql: $start Sql: $nb --> 1.1 Search in documents #foreach ($item in $xwiki.searchDocuments($sql , $nb , $start)) #if ($xwiki.hasAccessLevel("view", $context.user, "${context.database}:${item}")) #set($bentrydoc = $xwiki.getDocument($item)) * [$bentrydoc.name>${bentrydoc.web}.$bentrydoc.name] by $xwiki.getLocalUserName($bentrydoc.author) on $xwiki.formatDate($bentrydoc.date, $formatDate) #end #end ---- 1.1 Search in text fields #set($sql= ", BaseObject as obj, StringProperty as prop where obj.name=doc.fullName and prop.id.id = obj.id and prop.value like '%$text%'") #foreach ( $item in $xwiki.searchDocuments($sql , $nb , $start)) #if ($xwiki.hasAccessLevel("view", $context.user, "${context.database}:${item}")) #set($bentrydoc = $xwiki.getDocument($item)) * [$bentrydoc.name>${bentrydoc.web}.$bentrydoc.name] by $xwiki.getLocalUserName($bentrydoc.author) on $xwiki.formatDate($bentrydoc.date, $formatDate) #end #end ---- 1.1 Search in big text fields #set($sql= ", BaseObject as obj, LargeStringProperty as prop where obj.name=doc.fullName and prop.id.id = obj.id and prop.value like '%$text%'") #foreach ( $item in $xwiki.searchDocuments($sql , $nb , $start)) #if ($xwiki.hasAccessLevel("view", $context.user, "${context.database}:${item}")) #set($bentrydoc = $xwiki.getDocument($item)) * [$bentrydoc.name>${bentrydoc.web}.$bentrydoc.name] by $xwiki.getLocalUserName($bentrydoc.author) on $xwiki.formatDate($bentrydoc.date, $formatDate) #end #end ---- 1.1 Search in attachment file names #set($sql= ", XWikiAttachment attach where doc.id = attach.docId and attach.filename like '%$text%' ") #foreach ( $item in $xwiki.searchDocuments($sql , $nb , $start)) #if ($xwiki.hasAccessLevel("view", $context.user, "${context.database}:${item}")) #set($bentrydoc = $xwiki.getDocument($item)) * [$bentrydoc.name>${bentrydoc.web}.$bentrydoc.name] by $xwiki.getLocalUserName($bentrydoc.author) on $xwiki.formatDate($bentrydoc.date, $formatDate) #end #end ---- 1.1 Search in attachment file content #set($sql= ", XWikiAttachment attach, XWikiAttachmentContent as attachc where doc.id = attach.docId and attach.id = attachc.id and attachc.content like '%$text%' ") #foreach ( $item in $xwiki.searchDocuments($sql , $nb , $start)) #if ($xwiki.hasAccessLevel("view", $context.user, "${context.database}:${item}")) #set($bentrydoc = $xwiki.getDocument($item)) * [$bentrydoc.name>${bentrydoc.web}.$bentrydoc.name] by $xwiki.getLocalUserName($bentrydoc.author) on $xwiki.formatDate($bentrydoc.date, $formatDate) #end #end #end