Changes for page Sandbox

Last modified by Drunk Monkey on 2024-05-02 05:56

From version 1.1
edited by Drunk Monkey
on 2020-04-11 15:52
Change comment: Install extension [org.xwiki.platform:xwiki-platform-sandbox/12.2.1]
To version 11.1
edited by Drunk Monkey
on 2022-11-01 05:01
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,3 +1,71 @@
1 += Quagmyre =
2 +
3 +Quagmyre
4 +
5 +External Link ([[good>>https://files.quagmyre.com/index.html]])
6 +
7 +External Link ([[bad>>https://files.quagmyre.com/nosuchfile.html]])
8 +
9 +
10 +{{groovy}}
11 +import com.xpn.xwiki.web.*
12 +import org.xwiki.rendering.transformation.*
13 +
14 +def checker = Utils.getComponent(Transformation.class, "linkchecker")
15 +
16 +print "Link checker queue size = ${checker.linkQueue.size()}"
17 +{{/groovy}}
18 +
19 +
20 +{{groovy}}
21 +import groovy.util.logging.*
22 +import org.xwiki.observation.*
23 +import org.xwiki.observation.event.*
24 +import org.xwiki.rendering.transformation.linkchecker.*
25 +import com.xpn.xwiki.web.*
26 +import com.xpn.xwiki.*
27 +
28 +@Log
29 +class MyLinkListener implements EventListener
30 +{
31 + def xwiki
32 + def context
33 +
34 + MyLinkListener(xwiki, context)
35 + {
36 + this.xwiki = xwiki
37 + this.context = context
38 + }
39 +
40 + String getName()
41 + {
42 + return "myLinkListener"
43 + }
44 +
45 + List<Event> getEvents()
46 + {
47 + return Arrays.asList(new InvalidURLEvent())
48 + }
49 +
50 + void onEvent(Event event, Object eventSource, Object data)
51 + {
52 + def url = eventSource.get("url")
53 + def source = eventSource.get("source")
54 + def state = eventSource.get("state")
55 +
56 + log.info("Error for {url} in ${source} - Response code: ${state.getResponseCode()} - Checked: ${String.format('%tF %<tT', state.getLastCheckedTime())}")
57 + }
58 +}
59 +
60 +// Register against the Observation Manager
61 +def observation = Utils.getComponent(ObservationManager.class)
62 +observation.removeListener("myLinkListener")
63 +def listener = new MyLinkListener(xwiki, xcontext)
64 +observation.addListener(listener)
65 +{{/groovy}}
66 +
67 +
68 +
1 1  The sandbox is a part of your wiki that you can freely modify. It's meant to let you practice editing. You will discover how page editing works and create new pages. Simply click on **Edit** to get started!
2 2  
3 3  {{info}}
... ... @@ -14,7 +14,7 @@
14 14  
15 15  Below is a demonstration of the [[XWiki Syntax>>XWiki.XWikiSyntax]] you can use in wiki pages (headings, images, tables).
16 16  
17 -= Headings =
85 += {{id name="你好"/}}Headings =
18 18  
19 19  XWiki offers 6 levels of headings. You can use them to structure your pages.
20 20  
... ... @@ -28,7 +28,7 @@
28 28  
29 29  ====== Level 6 Heading 6 ======
30 30  
31 -= Styles =
99 += {{id name="这个"/}}Styles =
32 32  
33 33  Basic styles are supported in XWiki:
34 34  
... ... @@ -39,6 +39,18 @@
39 39  * Text in ,,subscript,,
40 40  * Text in ^^superscript^^
41 41  
110 += Anchors - ascii =
111 +
112 +xwiki code: ~{~{id name="ae"/}}
113 +
114 +{{id name="ae"/}}ae
115 +
116 += Anchors - non ascii =
117 +
118 +xwiki code: ~{~{id name="ä"/}}
119 +
120 +{{id name="ä"/}}ä
121 +
42 42  = Lists =
43 43  
44 44  You can create various types of lists in your wiki pages:
... ... @@ -100,20 +100,62 @@
100 100  
101 101  You can insert images in your wiki pages:
102 102  
103 -image:XWikiLogo.png
183 +[[image:XWikiLogo.png]]
104 104  
105 105  = Macros =
106 106  
107 107  Macros allow you to make wiki content look better and to add additional features to your wiki. Here are 2 examples of how macros can be used in wiki pages:
108 108  
109 -== Warning Macro ==
189 +== Box Macro ==
110 110  
111 -This macro allows you to draw users' attention to a specific piece of information:
191 +{{box}}
192 +box
193 +{{/box}}
112 112  
195 +{{box title="**Title**"}}
196 +box
197 +{{/box}}
198 +
199 +== Error Macro ==
200 +
201 +{{error}}
202 +Error
203 +{{/error}}
204 +
205 +{{error title="**Title**"}}
206 +Error
207 +{{/error}}
208 +
209 +== Info Macro ==
210 +
211 +{{info}}
212 +Info
213 +{{/info}}
214 +
215 +{{info title="**Title**"}}
216 +Info
217 +{{/info}}
218 +
219 +== Success Macro ==
220 +
221 +{{success}}
222 +Success
223 +{{/success}}
224 +
225 +{{success title="**Title**"}}
226 +Success
227 +{{/success}}
228 +
229 +== Warning Macro ==
230 +
113 113  {{warning}}
114 114  Hello World
115 115  {{/warning}}
116 116  
235 +{{warning title="**Title**"}}
236 +Hello World
237 +{{/warning}}
238 +
117 117  == Table of Contents ==
118 118  
119 119  This macro automatically generates a table of contents of your wiki page based on headings: