Allgemeine Aktionen:
Anmelden
Registrieren
Start ▼: Wiki Verzeichnis
»
Bereich: XWiki
»
Seite: SearchCode
default
Aktionen:
Exportieren ▼: Als PDF exportieren Als RTF exportieren Als HTML exportieren
Weitere Aktionen ▼: Druckvorschau Zeige den Quellcode
Willkommen bei bytebang » SearchCode

# Wiki-Quellcode von SearchCode

Zuletzt geändert von Administrator am 2014/06/29 19:29
Anhänge (0) · Information
Zeilennummern anzeigen {{velocity output="false"}} #set ($searchConfigDoc = $xwiki.getDocument('XWiki.SearchConfig')) #set ($searchConfigClass = $xwiki.getDocument('XWiki.SearchConfigClass').xWikiClass) ## Get or create the configuration object #set ($searchConfigObj = $searchConfigDoc.getObject($searchConfigClass.name, true)) #set ($searchEngine = "$!{searchConfigObj.getProperty('engine').value}") ## Default search engine to use in case the configured one is not found: ## - 'solr' is the preferred default ## - 'database' is the fall-back default #set ($searchExtensions = $services.uix.getExtensions('org.xwiki.platform.search', {'sortByCustomOrder' : "${searchEngine}, solr, database"})) #if (!$searchExtensions.isEmpty()) #set ($searchExtension = $searchExtensions[0]) ## Update the configuration if it is out of synch with the reality (installed extensions). #set ($needsUpdate = $searchEngine != $searchExtension.id) #set ($searchEngine = $searchExtension.id) #if ($needsUpdate && $searchConfigDoc.hasAccessLevel('edit')) #if ($searchConfigDoc.parent == '') $searchConfigDoc.setParent('XWiki.SearchAdmin') #end ## Save the updated configuration. Make sure to set it hidden as it's a technical document. $searchConfigObj.set('engine', $searchEngine) $searchConfigDoc.setHidden(true) $searchConfigDoc.save() #end #set ($searchPage = $searchExtension.parameters.search) #set ($searchAdminPage = $searchExtension.parameters.admin) #else ## No Search UI Extension was found! #set ($searchPage = '') #set ($searchAdminPage = '') #end {{/velocity}}

(c) 2026, by bytebang e.U. - Impressum - Datenschutz / Nutzungsbedingungen
-