Wiki source code of ATEsearch


Show last authors
1 {{include reference="XWiki.SearchCode"/}}
2
3 {{velocity}}
4 #set( $discard = $xwiki.ssx.use('CdLSATEPublic.CdlsatdFaqSearchSolr') )
5 #set( $discard = $xwiki.jsx.use('CdLSATEPublic.CdlsatdFaqSearchSolr') )
6 #set ($discard = $services.localization.use('document', 'xwiki:CdLSATEPublic.translations'))
7
8 = $services.localization.render('label_browse_faq') =
9
10 #if($isGuest)
11 (% class="alignRight smaller tightBottom looseTop" %)
12 [[$services.localization.render('search.page.login')>>path:$xwiki.getURL("XWiki.XWikiLogin", "login", "xredirect=$logredir")]] $services.localization.render('search.page.or') [[$services.localization.render('search.page.register')>>path:$xwiki.getURL("XWiki.Register", "register", "xredirect=$logredir")]] $services.localization.render('search.page.toask')
13 #end
14
15 ##{{include reference="cdlsServices.cdlsAsk" type="document"/}}
16
17 #if ($searchEngine == 'solr')
18 ## Customize the Solr Search UI for the Public FAQ application.
19 #set($contextLang = $xcontext.language)
20 #if("$!contextLang" == '')
21 #set($contextUser = $xwiki.getDocument($xcontext.user))
22 #set($contextLang = $contextUser.getObject('XWiki.XWikiUsers').getProperty('default_language').value)
23 #end
24 #if("$!contextLang" == '')
25 #set($contextLang = 'en')
26 #end
27 #set ($solrConfig = {
28 'queryFields': "property.CdlsatdCode.CdLSATEPublicQAClass.question property.CdlsatdCode.CdLSATEPublicQAClass.answer",
29 'facetFields': ['type', 'class', 'property.CdlsatdCode.CdLSATEPublicQAClass.language_string'],
30 'facetEnabled': false,
31 'filterQuery': [
32 "wiki:$xcontext.database",
33 "space_exact:CdLSATEPublic",
34 'class:CdlsatdCode.CdLSATEPublicQAClass',
35 "property.CdlsatdCode.CdLSATEPublicQAClass.language_da:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_pl:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_it:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_en:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_fr:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_sv:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language__:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_es:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_nl:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_pt:$contextLang property.CdlsatdCode.CdLSATEPublicQAClass.language_de:$contextLang ",
36 "type:DOCUMENT"
37 ],
38 'addBrowse': "browse-container",
39 'addInfo': ["search.page.moreInformation","CdLSATEPublic.ateSearchInfo"]
40 })
41 #end
42
43 {{include reference="$searchPage"/}}
44
45 #if(!$isGuest && $isApproved)
46 #*
47 * Set page header to always refresh page when returning to this page with the browsers' history buttons.
48 * Due to the below rules a unique ID is always created each time the page is viewed.
49 *#
50 $response.setHeader("Cache-Control", "no-store, must-revalidate, max-age=0")
51 $response.setHeader("Pragma", "no-cache")
52 $response.setHeader("Expires", "Sat, 1 Jan 2000 01:00:00 GMT")
53 #*
54 * Create a true RFC4122 random ('version 4') ID for a new question
55 * For more information about RFC4122, see http://www.rfc-base.org/txt/rfc-4122.txt
56 *#
57 #set( $hexArray = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'] )
58 #set( $hexNumbers = ['0','1','2','3','4','5','6','7'] )
59 #set( $hex = [] )
60 #foreach($idx in $hexNumbers)
61 #set( $rnd = $mathtool.getRandom() )
62 #set( $rnd = $rnd + 1 )
63 #set( $rnd = $mathtool.mul($rnd,100000) )
64 #set( $num = $mathtool.toInteger($rnd) )
65 #set( $hexParts = [] )
66 #foreach($hexPart in $hexArray)
67 #if($num!=0)
68 #set( $raw = $mathtool.div($num,16) )
69 #set( $raw = $mathtool.floor($raw) )
70 #set( $clean = $mathtool.mul($raw,16) )
71 #set( $remainder1 = $mathtool.sub($num,$clean) )
72 #set( $discard = $hexParts.add($hexArray[$remainder1]) )
73 #set( $num = $raw )
74 #else
75 #break
76 #end
77 #end
78 #set( $hexln = $hexParts.size() )
79 #set( $hexr = "" )
80 #foreach($p in $hexParts)
81 #set( $hexln = $mathtool.sub($hexln,1) )
82 #set( $hexr = "${hexr}${hexParts[$hexln]}" )
83 #end
84 #set( $discard = $hex.add($hexr) )
85 #end
86 #set( $hexName = "${hex[0]}${hex[1]}-${hex[2]}-${hex[3]}-${hex[4]}-${hex[5]}${hex[6]}${hex[7]}" )
87 (% id="ask" class="alert alert-success alignRight#if(!$request.text || $request.text=='') hidden#end" %)
88 (% class="floatLeft larger looseTop" %)Have not found your answer?(%%) [[(% class="glyphicon glyphicon-plus looseRight" %) (%%)Ask a new question>>CdLSATEPrivat.${hexName}||queryString="editor=inline&template=CdLSATEPrivat.CdLSATEPrivatTemplate&parent=WebHome" class="btn btn-success"]]
89 #end
90 {{/velocity}}