Changes for page Sandbox


on 2022-04-02 07:52


on 2024-05-02 05:53
Summary
Details
- Page properties
-
- Content
-
... ... @@ -1,7 +1,84 @@ 1 += rss macro = 2 + 3 +{{rss feed="https://nitter.net/I_Am_The_ICT/with_replies/rss" content="false" css="true" image="false" decoration="true"/}} 4 + 1 1 = Quagmyre = 2 2 3 3 Quagmyre 4 4 9 +External Link ([[good>>https://files.quagmyre.com/index.html]]) 10 + 11 +External Link ([[bad>>https://files.quagmyre.com/nosuchfile.html]]) 12 + 13 +Linkchecker: [[here>>XWiki.ExternalLinks]] 14 + 15 +Non existing [[internal link>>notexist||style="outline-width: 0px !important; user-select: auto !important;"]] test 16 + 17 +== lc queue size == 18 + 19 +{{groovy}} 20 +import com.xpn.xwiki.web.* 21 +import org.xwiki.rendering.transformation.* 22 + 23 +def checker = Utils.getComponent(Transformation.class, "linkchecker") 24 + 25 +print "Link checker queue size = ${checker.linkQueue.size()}" 26 +{{/groovy}} 27 + 28 + 29 +== lc invalid links == 30 + 31 +{{groovy}} 32 +import groovy.util.logging.* 33 +import org.xwiki.observation.* 34 +import org.xwiki.observation.event.* 35 +import org.xwiki.rendering.transformation.linkchecker.* 36 +import com.xpn.xwiki.web.* 37 +import com.xpn.xwiki.* 38 + 39 +@Log 40 +class MyLinkListener implements EventListener 41 +{ 42 + def xwiki 43 + def context 44 + 45 + MyLinkListener(xwiki, context) 46 + { 47 + this.xwiki = xwiki 48 + this.context = context 49 + } 50 + 51 + String getName() 52 + { 53 + return "myLinkListener" 54 + } 55 + 56 + List<Event> getEvents() 57 + { 58 + return Arrays.asList(new InvalidURLEvent()) 59 + } 60 + 61 + void onEvent(Event event, Object eventSource, Object data) 62 + { 63 + def url = eventSource.get("url") 64 + def source = eventSource.get("source") 65 + def state = eventSource.get("state") 66 + 67 + log.info("Error for {url} in ${source} - Response code: ${state.getResponseCode()} - Checked: ${String.format('%tF %<tT', state.getLastCheckedTime())}") 68 + } 69 +} 70 + 71 +// Register against the Observation Manager 72 +def observation = Utils.getComponent(ObservationManager.class) 73 +observation.removeListener("myLinkListener") 74 +def listener = new MyLinkListener(xwiki, xcontext) 75 +observation.addListener(listener) 76 +{{/groovy}} 77 + 78 + 79 + 80 +Glossary test: {{glossaryReference glossaryId="Glossary" entryId="OTE"}}OTE{{/glossaryReference}} is an entry, but OTP is not. 81 + 5 5 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! 6 6 7 7 {{info}} ... ... @@ -116,7 +116,7 @@ 116 116 117 117 You can insert images in your wiki pages: 118 118 119 -image:XWikiLogo.png 196 +[[image:XWikiLogo.png]] 120 120 121 121 = Macros = 122 122 ... ... @@ -128,7 +128,7 @@ 128 128 box 129 129 {{/box}} 130 130 131 -{{box title="Title"}} 208 +{{box title="**Title**"}} 132 132 box 133 133 {{/box}} 134 134 ... ... @@ -138,7 +138,7 @@ 138 138 Error 139 139 {{/error}} 140 140 141 -{{error title="Title"}} 218 +{{error title="**Title**"}} 142 142 Error 143 143 {{/error}} 144 144 ... ... @@ -148,7 +148,7 @@ 148 148 Info 149 149 {{/info}} 150 150 151 -{{info title="Title"}} 228 +{{info title="**Title**"}} 152 152 Info 153 153 {{/info}} 154 154 ... ... @@ -158,7 +158,7 @@ 158 158 Success 159 159 {{/success}} 160 160 161 -{{success title="Title"}} 238 +{{success title="**Title**"}} 162 162 Success 163 163 {{/success}} 164 164 ... ... @@ -168,7 +168,7 @@ 168 168 Hello World 169 169 {{/warning}} 170 170 171 -{{warning title="Title"}} 248 +{{warning title="**Title**"}} 172 172 Hello World 173 173 {{/warning}} 174 174