Changes for page Database Search

Last modified by Administrator on 2024/12/27 14:37

From version 2.1
edited by Administrator
on 2019/02/02 16:07
Change comment: Migrated property [async_enabled] from class [XWiki.UIExtensionClass]
To version 6.1
edited by Administrator
on 2024/12/27 14:37
Change comment: Install extension [org.xwiki.platform:xwiki-platform-search-ui/16.10.2]

Summary

Details

Page properties
Content
... ... @@ -1,7 +1,7 @@
1 1  {{velocity output="false"}}
2 2  #macro (databaseSearchForm)
3 3   {{html clean="false"}}
4 - <form action="$doc.getURL()" id="searchBar">
4 + <form action="$doc.getURL()" id="searchBar" role="search">
5 5   <div>
6 6   <label for="text" class="hidden">$services.localization.render('search.page.query.label')</label>
7 7   <input type="text" id="text" name="text" class="searchQuery" value="$!escapetool.xml($request.text)"
... ... @@ -56,7 +56,7 @@
56 56   #databaseAddResults(", BaseObject as obj, StringProperty as prop where $matchLocation obj.name = doc.fullName and prop.id.id = obj.id and upper(prop.value) like upper(:text) escape '!'" $params $results)
57 57   ## Search in big text fields (textarea properties)
58 58   #databaseAddResults(", BaseObject as obj, LargeStringProperty as prop where $matchLocation obj.name = doc.fullName and prop.id.id = obj.id and upper(prop.value) like upper(:text) escape '!'" $params $results)
59 - #set ($discard = $list.addAll($sorttool.sort($results, ['date'])))
59 + #set ($discard = $list.addAll($collectiontool.sort($results, ['date'])))
60 60  #end
61 61  {{/velocity}}
62 62  
... ... @@ -63,7 +63,10 @@
63 63  {{velocity}}
64 64  #set ($rssMode = $xcontext.action == 'get' || "$!request.xpage" == 'plain')
65 65  #if (!$rssMode)
66 - #set ($discard = $xwiki.ssfx.use('uicomponents/search/search.css', true))
66 + #set ($discard = $xwiki.linkx.use($services.webjars.url(
67 + 'org.xwiki.platform:xwiki-platform-search-webjar',
68 + 'search.min.css',
69 + {'evaluate': true}), {'type': 'text/css', 'rel': 'stylesheet'}))
67 67   ## Disable the document extra data: comments, attachments, history...
68 68   #set ($displayDocExtra = false)
69 69   #databaseSearchForm
... ... @@ -82,8 +82,8 @@
82 82   #set ($discard = $feed.setDescription($services.localization.render('search.rss', [$text])))
83 83   #set ($discard = $feed.setLanguage("$xcontext.locale"))
84 84   #set ($discard = $feed.setCopyright($xwiki.getXWikiPreference('copyright')))
85 - #set ($discard = $response.setContentType('application/rss+xml'))
86 - {{{$xwiki.feed.getFeedOutput($feed, $xwiki.getXWikiPreference('feed_type', 'rss_2.0'))}}}
88 + #set ($feedOutput = $xwiki.feed.getFeedOutput($feed, $xwiki.getXWikiPreference('feed_type', 'rss_2.0')))
89 + #rawResponse($feedOutput, 'application/rss+xml')
87 87   #else
88 88   {{include reference="XWiki.Results"/}}
89 89