Changes for page Attachments (Confluence)

Last modified by 병곤 김 on 2026/10/06 04:54

From version 1.1
edited by 병곤 김
on 2026/10/06 04:53
Change comment: install attachments wiki macro
To version 2.1
edited by 병곤 김
on 2026/10/06 04:54
Change comment: install attachments wiki macro

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,14 +1,0 @@
1 -{{velocity}}
2 -#set($pattern = "$!xcontext.macro.params.patterns")
3 -#if($pattern == '')#set($pattern = "$!xcontext.macro.params.pattern")#end
4 -#set($regex = '')
5 -#if($pattern != '')#set($regex = $pattern.replaceAll('\*', '.*'))#end
6 -#foreach($att in $doc.getAttachmentList())
7 -#set($name = $att.getFilename())
8 -#set($show = true)
9 -#if($regex != '' && !$name.matches($regex))#set($show = false)#end
10 -#if($show)
11 -* [[$name>>attach:$name]] ($mathtool.div($att.getLongSize(), 1024) KB)
12 -#end
13 -#end
14 -{{/velocity}}
Macro content availability
... ... @@ -1,1 +1,0 @@
1 -No content
Macro description
... ... @@ -1,1 +1,0 @@
1 -Confluence compatibility: attachments
Macro id
... ... @@ -1,1 +1,0 @@
1 -attachments
Macro name
... ... @@ -1,1 +1,0 @@
1 -Attachments (Confluence)
Supports inline mode
... ... @@ -1,1 +1,0 @@
1 -Yes
Macro visibility
... ... @@ -1,1 +1,0 @@
1 -wiki
XWiki.WikiMacroParameterClass[0]
Parameter description
... ... @@ -1,1 +1,0 @@
1 -patterns
Parameter mandatory
... ... @@ -1,1 +1,0 @@
1 -No
Parameter name
... ... @@ -1,1 +1,0 @@
1 -patterns
XWiki.WikiMacroParameterClass[1]
Parameter description
... ... @@ -1,1 +1,0 @@
1 -pattern
Parameter mandatory
... ... @@ -1,1 +1,0 @@
1 -No
Parameter name
... ... @@ -1,1 +1,0 @@
1 -pattern
XWiki.WikiMacroParameterClass[2]
Parameter description
... ... @@ -1,1 +1,0 @@
1 -labels
Parameter mandatory
... ... @@ -1,1 +1,0 @@
1 -No
Parameter name
... ... @@ -1,1 +1,0 @@
1 -labels
XWiki.WikiMacroClass[1]
Macro id
... ... @@ -1,0 +1,1 @@
1 +attachments
Macro name
... ... @@ -1,0 +1,1 @@
1 +Attachments (Confluence)
Macro description
... ... @@ -1,0 +1,1 @@
1 +Confluence compatibility: attachments
Macro visibility
... ... @@ -1,0 +1,1 @@
1 +wiki
Supports inline mode
... ... @@ -1,0 +1,1 @@
1 +Yes
Macro content availability
... ... @@ -1,0 +1,1 @@
1 +No content
Macro code
... ... @@ -1,0 +1,14 @@
1 +{{velocity}}
2 +#set($pattern = "$!xcontext.macro.params.patterns")
3 +#if($pattern == '')#set($pattern = "$!xcontext.macro.params.pattern")#end
4 +#set($regex = '')
5 +#if($pattern != '')#set($regex = $pattern.replaceAll('\*', '.*'))#end
6 +#foreach($att in $doc.getAttachmentList())
7 +#set($name = $att.getFilename())
8 +#set($show = true)
9 +#if($regex != '' && !$name.matches($regex))#set($show = false)#end
10 +#if($show)
11 +* [[$name>>attach:$name]] ($mathtool.div($att.getLongSize(), 1024) KB)
12 +#end
13 +#end
14 +{{/velocity}}
XWiki.WikiMacroParameterClass[3]
Parameter name
... ... @@ -1,0 +1,1 @@
1 +patterns
Parameter description
... ... @@ -1,0 +1,1 @@
1 +patterns
Parameter mandatory
... ... @@ -1,0 +1,1 @@
1 +No
XWiki.WikiMacroParameterClass[4]
Parameter name
... ... @@ -1,0 +1,1 @@
1 +pattern
Parameter description
... ... @@ -1,0 +1,1 @@
1 +pattern
Parameter mandatory
... ... @@ -1,0 +1,1 @@
1 +No
XWiki.WikiMacroParameterClass[5]
Parameter name
... ... @@ -1,0 +1,1 @@
1 +labels
Parameter description
... ... @@ -1,0 +1,1 @@
1 +labels
Parameter mandatory
... ... @@ -1,0 +1,1 @@
1 +No