Modifications pour le document Confluence bridge for Content by label
Modifié par superadmin le 21/07/2025 - 08:55
Depuis la version 5.1
modifié par superadmin
sur 06/04/2025 - 00:00
sur 06/04/2025 - 00:00
Commentaire de modification :
Install extension [com.xwiki.pro:xwiki-pro-macros-confluence-bridges-ui/1.26.14]
Résumé
-
Propriétés de la Page (1 modifications, 0 ajouts, 0 suppressions)
-
Objets (1 modifications, 0 ajouts, 0 suppressions)
Détails
- Propriétés de la Page
-
- Auteur du document
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. superadmin1 +XWiki.admin
- 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)** ... ... @@ -26,7 +26,7 @@ 26 26 <li> 27 27 <div class="xitemcontainer"> 28 28 $services.icon.renderHTML('page') 29 - #set ($d = $xwiki.getDocument( "$r.wiki:$r.fullname"))46 + #set ($d = $xwiki.getDocument($r.fullname)) 30 30 #contentbylabellink($d) 31 31 #if ($xcontext.macro.params.showSpace != "false") 32 32 #set ($confluenceSpace = $services.confluence.spaces.getConfluenceSpace($d))