Modifications pour le document Confluence bridge for Content by label
Modifié par superadmin le 21/07/2025 - 08:55
Depuis la version 7.1
modifié par superadmin
sur 21/07/2025 - 08:55
sur 21/07/2025 - 08:55
Commentaire de modification :
Migrated property [featureMandatory] from class [XWiki.WikiMacroParameterClass]
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)) ... ... @@ -59,7 +59,7 @@ 59 59 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 60 60 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 61 61 ## don't have view right on those pages. 62 -#if ($services.licensing. licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))79 +#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 63 63 #executeMacro 64 64 #else 65 65 {{missingLicenseMessage extensionName="proMacros.extension.name"/}}