Show last authors
1 Here's the list of available [[Transformations>>Architecture]] you can use:
2
3 {{toc/}}
4
5 To configure the list of Transformations to execute in your wiki, edit your ##xwiki.properties## file and look for the ##rendering.transformations## configuration key. The default value is (which means you have the Macro Transformation and the Icon Transformation enabled by default in your wiki):
6
7 {{code language="none"}}
8 rendering.transformations = macro, icon
9 {{/code}}
10
11 = Macro Transformation =
12
13 See [[Architecture]].
14
15 = Icon Transformation =
16
17 See the [[Icon Transformation documentation>>extensions:Extension.Icon Transformation]] to understand what this transformation does.
18
19 Example of usage:
20
21 {{code language="java"}}
22 // Initialize Rendering components and allow getting instances
23 final EmbeddableComponentManager cm = new EmbeddableComponentManager();
24 cm.initialize(this.getClass().getClassLoader());
25
26 XDOM xdom = new XDOM(Arrays.<Block>asList(new ParagraphBlock(Arrays.asList((Block) new SpecialSymbolBlock(':'),
27 new SpecialSymbolBlock(')')))));
28
29 Transformation transformation = cm.lookup(Transformation.class, "icon");
30 TransformationContext txContext = new TransformationContext();
31 transformation.transform(xdom, txContext);
32
33 WikiPrinter printer = new DefaultWikiPrinter();
34 BlockRenderer renderer = cm.lookup(BlockRenderer.class, Syntax.XWIKI_2_0.toIdString());
35 renderer.render(xdom, printer);
36
37 String expected = "image:emoticon_smile";
38
39 Assert.assertEquals(expected, printer.toString());
40 {{/code}}
41
42 It's also possible to configure new emoticons or override existing ones by getting the ##IconTransformationConfiguration## component as shown below (works on XWiki Rendering 3.3M1+):
43
44 {{code language="java"}}
45 // Initialize Rendering components and allow getting instances
46 final EmbeddableComponentManager cm = new EmbeddableComponentManager();
47 cm.initialize(this.getClass().getClassLoader());
48
49 XDOM xdom = new XDOM(Arrays.<Block>asList(new ParagraphBlock(Arrays.asList((Block) new SpecialSymbolBlock(':'),
50 new SpecialSymbolBlock(':')))));
51
52 // Test adding a new Icon Mapping.
53 cm.lookup(IconTransformationConfiguration.class).addMapping("::", "something");
54
55 Transformation transformation = cm.lookup(Transformation.class, "icon");
56 TransformationContext txContext = new TransformationContext();
57 transformation.transform(xdom, txContext);
58
59 WikiPrinter printer = new DefaultWikiPrinter();
60 BlockRenderer renderer = cm.lookup(BlockRenderer.class, Syntax.XWIKI_2_0.toIdString());
61 renderer.render(xdom, printer);
62
63 String expected = "image:box";
64
65 Assert.assertEquals(expected, printer.toString());
66 {{/code}}
67
68 = WikiWord Transformation =
69
70 See the [[WikiWord Transformation documentation>>extensions:Extension.WikiWord Transformation]] to understand what this transformation does.
71
72 Example of usage:
73
74 {{code language="java"}}
75 // Initialize Rendering components and allow getting instances
76 final EmbeddableComponentManager cm = new EmbeddableComponentManager();
77 cm.initialize(this.getClass().getClassLoader());
78
79 XDOM xdom = new XDOM(
80 Arrays.<Block>asList(new ParagraphBlock(Arrays.asList((Block) new WordBlock("WikiWord")))));
81
82 Transformation transformation = cm.lookup(Transformation.class, "wikiword");
83 TransformationContext txContext = new TransformationContext();
84 transformation.transform(xdom, txContext);
85
86 WikiPrinter printer = new DefaultWikiPrinter();
87 BlockRenderer renderer = cm.lookup(BlockRenderer.class, Syntax.XWIKI_2_0.toIdString());
88 renderer.render(xdom, printer);
89
90 String expected = "[[WikiWord]]";
91
92 Assert.assertEquals(expected, printer.toString());
93 {{/code}}
94
95 = LinkChecker Transformation =
96
97 See the [[Link Checker Transformation documentation>>extensions:Extension.Link Checker Transformation]] to understand what this transformation does and how to use it.
  • Powered by XWiki 11.10.2-node2. Hosted and managed by XWiki SAS

Get Connected