Modifications pour le document Confluence bridge for Attachments
Modifié par Admin le 21/07/2025 - 09:06
Résumé
-
Objets (2 modifications, 0 ajouts, 0 suppressions)
Détails
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -8,12 +8,6 @@ 8 8 }); 9 9 10 10 require(['jquery', 'xwiki-l10n!xwiki-confluence-attachments-messages'], function($, l10n) { 11 - 12 - // Trigger Collabora integration. 13 - $(document).on('xwiki:livedata:entriesUpdated', function(){ 14 - $(document).trigger('xwiki:collabora:addButtons'); 15 - }); 16 - 17 17 var enhanceUploadInputs = function(liveDataElems) { 18 18 $.each(liveDataElems.find('input[type=file]'), function() { 19 19 // Since the attachments liveData is refreshed on file upload, there is no need for a response container.
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -118,14 +118,29 @@ 118 118 } 119 119 }) 120 120 121 + #if ("$!wikimacro.parameters.patterns" != '') 122 + #set ($liveDataConfig.query = {}) 123 + #set ($liveDataConfig.query.filters = [ 124 + { 125 + "property": "filename", 126 + "matchAll": true, 127 + "constraints": [] 128 + } 129 + ]) 130 + #set ($filters = $stringtool.split($wikimacro.parameters.patterns, ',')) 131 + #foreach ($filter in $filters) 132 + #set ($discard = $liveDataConfig.query.filters[0].constraints.add( 133 + { "operator": "contains", "value": "$!filter.trim()" } 134 + )) 135 + #end 136 + #end 121 121 #set ($sourceParams = { 122 122 'translationPrefix': 'core.viewers.attachments.livetable.', 123 123 'className': 'XWiki.AllAttachments', 124 - "\$doc": "$attachmentsDoc", 125 - 'patterns': "$!wikimacro.parameters.patterns" 140 + "\$doc": "$attachmentsDoc" 126 126 }) 127 127 #set ($discard = $sourceParams.put('template', 'xpart.vm')) 128 - #set ($discard = $sourceParams.put('vm', ' filteredAttachments.vm'))143 + #set ($discard = $sourceParams.put('vm', 'attachmentsjson.vm')) 129 129 #getLiveDataSort($liveDataSort) 130 130 #if ($invalidSortBy) 131 131 {{warning}} ... ... @@ -161,8 +161,8 @@ 161 161 'forceSkinAction': true, 162 162 'language': $xcontext.locale 163 163 })) 164 - #set ($discard = $xwiki.jsx.use("Confluence.Macros. ConfluenceAttachments"))165 - #set ($discard = $xwiki.ssx.use("Confluence.Macros. ConfluenceAttachments"))179 + #set ($discard = $xwiki.jsx.use("Confluence.Macros.Attachments")) 180 + #set ($discard = $xwiki.ssx.use("Confluence.Macros.Attachments")) 166 166 #set ($document = $doc) 167 167 #if ("$!wikimacro.parameters.page" != '') 168 168 #set ($document = $xwiki.getDocument("$!wikimacro.parameters.page")) ... ... @@ -169,7 +169,7 @@ 169 169 #end 170 170 171 171 {{html clean="false" wiki="true"}} 172 - <div class=' attachments confluenceAttachmentsMacro'>187 + <div class='confluenceAttachmentsMacro'> 173 173 #showConfluenceAttachments($document) 174 174 </div> 175 175 {{/html}} ... ... @@ -181,7 +181,7 @@ 181 181 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 182 182 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 183 183 ## don't have view right on those pages. 184 -#if ($services.licensing. licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))199 +#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 185 185 #executeMacro 186 186 #else 187 187 {{missingLicenseMessage extensionName="proMacros.extension.name"/}}