Änderungen von Dokument Excerpt Macro

Zuletzt geändert von xwikiadmin am 2025/01/07 11:39

Von Version 5.1
bearbeitet von xwikiadmin
am 2024/06/24 14:35
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.19.4]
Auf Version 4.1
bearbeitet von xwikiadmin
am 2023/10/26 09:24
Änderungskommentar: Migrated property [type] from class [XWiki.WikiMacroParameterClass]

Zusammenfassung

Details

Seiteneigenschaften
Inhalt
... ... @@ -1,6 +1,6 @@
1 1  = Description =
2 2  
3 -The Excerpt macro is a bridge between Confluence and XWiki. It allows the user to mark part of the page's content for use by other macros, for exemple {excerpt-include}}.
3 +The Excerpt macro is a bridge between Confluence and XWiki. It allows the user to mark part of the page's content for use by other macros.
4 4  
5 5  = Parameters =
6 6  
... ... @@ -7,12 +7,10 @@
7 7  |=Parameter|=Description|=Default
8 8  |**atlassian-macro-output-type**|The ouput type. It can be either BLOCK or INLINE.|INLINE
9 9  |**hidden**|If true, the content of the macro will be hidden.|false
10 -|**name**|The name of the excerpt, for named includes.|false
11 -|**allowUnprivilegedInclude**|Allow this excerpt to be seen even for people who don't have view rights on this page when included|false
12 12  
13 13  = Example of usage =
14 14  
15 -Example of excerpt with a table in it:
13 +Example of excerpt with HTML :
16 16  
17 17  {{code}}
18 18  {{excerpt}}
... ... @@ -21,7 +21,7 @@
21 21  {{/excerpt}}
22 22  {{/code}}
23 23  
24 -The result is the following:
22 +The result is the following :
25 25  
26 26  {{excerpt}}
27 27  |=Title1|=Title2|=Title3
... ... @@ -28,38 +28,16 @@
28 28  |Text1|Text2|Text3
29 29  {{/excerpt}}
30 30  
31 -Example of named hidden excerpt:
29 +Example of hidden excerpt :
32 32  
33 33  {{code}}
34 -{{excerpt hidden="true" name="myexcerpt"}}
32 +{{excerpt hidden="true"}}
35 35  My hidden content.
36 36  {{/excerpt}}
37 37  {{/code}}
38 38  
39 -The result is the following:
37 +The result is the following :
40 40  
41 -{{excerpt hidden="true" name="myexcerpt"}}
39 +{{excerpt hidden="true"}}
42 42  My hidden content.
43 43  {{/excerpt}}
44 -
45 -(yes, nothing, this is intended!)
46 -
47 -Let's include this hidden excerpt:
48 -
49 -{{code}}
50 -{{excerpt-include 0="Excerpt" name="myexcerpt"/}}
51 -{{/code}}
52 -
53 -Result:
54 -
55 -{{excerpt-include 0="Excerpt" name="myexcerpt"/}}
56 -
57 -Without the panel:
58 -
59 -{{code}}
60 -{{excerpt-include 0="Excerpt" name="myexcerpt" nopanel="true"/}}
61 -{{/code}}
62 -
63 -Result:
64 -
65 -{{excerpt-include 0="Excerpt" name="myexcerpt" nopanel="true"/}}
XWiki.WikiMacroClass[0]
Makro-Code
... ... @@ -1,25 +1,33 @@
1 1  {{velocity output="false"}}
2 2  #macro (executeMacro)
3 + ## BLOCK / INLINE
4 + #set($outputType = $wikimacro.parameters.get('atlassian-macro-output-type'))
3 3   #set($hidden = $wikimacro.parameters.get('hidden'))
4 - #if("$!hidden" != 'true')
5 - #set($outputType = $wikimacro.parameters.get('atlassian-macro-output-type'))
6 - #set($displayAsBlock = "$!outputType" != '' && $outputType.toLowerCase() == 'block')
7 - #if ($displayAsBlock)
8 -
6 + #set($displayAsBlock = "$!outputType" != '' && $outputType.toLowerCase() == 'block')
7 + #if("$!hidden" == 'true')
8 + (% class="hidden" %)
9 + #end
10 + #if($displayAsBlock)
11 + (((
12 + #end
9 9   {{wikimacrocontent /}}
10 -
11 - #else{{wikimacrocontent /}}#end##
12 - #end##
14 + #if($displayAsBlock)
15 + )))
16 + #end
13 13  #end
14 14  {{/velocity}}
15 15  
20 +{{include reference="Licenses.Code.VelocityMacros"/}}
21 +
16 16  {{velocity}}
17 17  ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right
18 18  ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
19 19  ## don't have view right on those pages.
20 -#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))
21 - #executeMacro##
26 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
27 + #executeMacro
22 22  #else
23 - {{missingLicenseMessage extensionName="proMacros.extension.name"/}}
29 + {{error}}
30 + #getMissingLicenseMessage('proMacros.extension.name')
31 + {{/error}}
24 24  #end
25 25  {{/velocity}}
Standardkategorie
... ... @@ -1,0 +1,1 @@
1 +content
XWiki.WikiMacroParameterClass[0]
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein
XWiki.WikiMacroParameterClass[1]
Parameter-Beschreibung
... ... @@ -1,1 +1,0 @@
1 -Whether the excerpt should be hidden from the page
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein
XWiki.WikiMacroParameterClass[2]
Parameter-Beschreibung
... ... @@ -1,1 +1,0 @@
1 -The name of the excerpt, for named includes.
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein
Parameter-Name
... ... @@ -1,1 +1,0 @@
1 -name
XWiki.WikiMacroParameterClass[3]
Parameter-Vorgabe
... ... @@ -1,1 +1,0 @@
1 -false
Parameter-Beschreibung
... ... @@ -1,1 +1,0 @@
1 -Allow this excerpt to be seen even for people who don't have view rights on this page when included
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein
Parameter-Name
... ... @@ -1,1 +1,0 @@
1 -allowUnprivilegedInclude
Parameter-Typ
... ... @@ -1,1 +1,0 @@
1 -java.lang.Boolean