Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

LiveTableServiceWorker - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Changes for page LiveTableServiceWorker

Last modified by bougault on 2022/03/22 17:19

From version 2.5
edited by bougault
on 2022/03/21 10:57
Change comment: There is no comment for this version
To version 4.1
edited by bougault
on 2022/03/21 11:52
Change comment: There is no comment for this version

Summary

Details

Page properties
Parent
... ... @@ -1,0 +1,1 @@
1 +Main.WebHome
Content
... ... @@ -1,0 +1,27 @@
1 +{{velocity}}
2 +$response.setContentType("application/x-json")
3 +##limit default
4 +#set ($limit = 5)
5 +#if($request.limit)
6 + #set ($limit = $util.parseInt($request.limit))
7 +#end
8 +#set($hql = "where doc.name != null order by doc.date desc")
9 +#set($documents= $xwiki.searchDocuments($hql, $limit, 0))
10 +{"nbarticles": $limit ,
11 + "documents": [
12 +#set ($i = 0)
13 +#foreach($item in $documents)
14 +#set ($i = $i+1)
15 +#set ($recentDoc = $xwiki.getDocument($item).getTranslatedDocument())
16 + {"fullName": "$recentDoc.fullName",
17 + "url": "$recentDoc.getExternalURL("view",$recentDoc.context)",
18 + "author": "$recentDoc.contentAuthor",
19 + "date": "$recentDoc.date",
20 + "comment": "$recentDoc.comment"
21 + }#if($i != $limit)
22 +,
23 +#end
24 +#end
25 +]
26 +}
27 +{{/velocity}}
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,5 +1,6 @@
1 1  self.addEventListener("install" , evt => {
2 - evt.waitUntil(caches.open("main_cache").then(cache => cache.addAll(["/", "/something"])));
2 + //evt.waitUntil(caches.open("main_cache").then(cache => cache.addAll(["/", "/something"])));
3 + console.log(evt);
3 3  
4 4   self.skipWaiting();
5 5  });