Modifications pour le document Confluence bridge for Content by label
Modifié par superadmin le 21/07/2025 - 08:59
Résumé
-
Objets (1 modifications, 0 ajouts, 0 suppressions)
Détails
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -2,6 +2,15 @@ 2 2 3 3 {{velocity output=false}} 4 4 5 +## See https://solr.apache.org/guide/solr/latest/query-guide/standard-query-parser.html#escaping-special-characters 6 +## And https://jira.xwiki.org/browse/XCOMMONS-2926 7 +#set ($solrSpecialChars = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '/', '\', ' ']) 8 +#set ($escapedSolrSpecialChars = ['\+', '\-', '\&&', '\||', '\!', '\(', '\)', '\{', '\}', '\[', '\]', '\^', '\"', '\~', '\*', '\?', '\:', '\/', '\\', '\ ']) 9 + 10 +#macro (escapeSolr $v) 11 +$stringtool.replaceEach($v, $solrSpecialChars, $escapedSolrSpecialChars)## 12 +#end 13 + 5 5 #macro (contentbylabellink $d) 6 6 <a href="$escapetool.xml($d.getURL('view'))">## 7 7 $escapetool.xml($d.getDisplayTitle())## ... ... @@ -8,6 +8,14 @@ 8 8 </a>## 9 9 #end 10 10 20 +#macro (getSpaceFacet $space) 21 +#set ($facetNumber = $space.getReversedReferenceChain().size() - 1) 22 +#if ($space.getRoot().getType().toString() == "WIKI")) 23 +#set ($facetNumber = $facetNumber - 1) 24 +#escapeSolr("$facetNumber/${serializer.serialize($space)}.")## 25 +#end 26 +#end 27 + 11 11 #macro (executeMacro) 12 12 #if ("$!xcontext.macro.params.title" != "") 13 13 **$services.rendering.escape($xcontext.macro.params.title, $xwiki.currentContentSyntaxId)**