Changes for page Home
Last modified by Jesse Veentjer on 06-5-2024 05:01
From version 120.1
edited by Jesse Veentjer
on 31-10-2022 11:42
on 31-10-2022 11:42
Change comment:
There is no comment for this version
To version 122.1
edited by Jesse Veentjer
on 31-10-2022 12:31
on 31-10-2022 12:31
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -17,8 +17,66 @@ 17 17 18 18 Hier kunnen we kennis, de laatste ontwikkelingen (nieuws), bestanden en ideeën plaatsen en delen. Klik[[ hier >>doc:.Werkwijze.Applicaties.Kennisbank.WebHome]]voor uitleg hoe een pagina aan te maken en wat de mogelijk is binnen een pagina. 19 19 20 -{{documentTree showWikis="true" showSpaces="true" showTranslations="false" showAttachments="false" showChildDocuments="false" /}} 20 +{{velocity}} 21 +## Escape special characters in macro parameter values. 22 +#set ($openToDoc = $doc.documentReference.toString().replaceAll('([~"])', '~$1')) 23 +## Apply the configured page exclusions. 24 +#set ($config = $xwiki.getDocument('PanelsCode.NavigationConfiguration')) 25 +#set ($exclusions = $collectiontool.set) 26 +#set ($defaultDocumentName = $services.model.getEntityReference('DOCUMENT', 'default').name) 27 +## Exclude top level extension pages. 28 +#if ($config.getValue('excludeTopLevelExtensionPages') == 1) 29 + #set ($query = $services.query.hql('select space.name from XWikiSpace space where space.parent is null')) 30 + #set ($discard = $query.addFilter('hidden/space')) 31 + #foreach ($result in $query.execute()) 32 + #set ($documentReference = $services.model.createDocumentReference($NULL, $result, $defaultDocumentName)) 33 + #set ($installedExtensions = $services.extension.xar.getInstalledExtensions($documentReference)) 34 + #if ($installedExtensions && $installedExtensions.size() > 0 35 + && !$services.extension.xar.isEditAllowed($documentReference)) 36 + #set ($discard = $exclusions.add("space:$services.model.escape($result, 'SPACE')")) 37 + #end 38 + #end 39 +#end 40 +## Exclude top level application pages. 41 +#if ($config.getValue('excludeTopLevelApplicationPages') == 1) 42 + #set ($statement = 'select space.name ' 43 + + 'from XWikiSpace as space, Document as doc, doc.object(AppWithinMinutes.LiveTableClass) as app ' 44 + + 'where space.parent is null and doc.space = space.reference') 45 + #set ($query = $services.query.xwql($statement).addFilter('hidden/space')) 46 + #foreach ($result in $query.execute()) 47 + #set ($discard = $exclusions.add("space:$services.model.escape($result, 'SPACE')")) 48 + #end 49 +#end 50 +## Inclusions are treated as exceptions to the dynamic exclusion filters. 51 +#if ($config.getValue('excludeTopLevelExtensionPages') == 1 || $config.getValue('excludeTopLevelApplicationPages') == 1) 52 + ## FIXME: This panel is cached and the cache is not invalidated by default when an extension is installed or 53 + ## uninstalled and neither when an application is created, deleted or renamed. Ideally we should invalidate the cache 54 + ## whenever a top level page is created or modified but we can't do this ATM so the next best thing is to invalidate 55 + ## the cache whenever a page (anywhere in the page hierarchy) is modified. 56 + #set ($discard = $services.async.useEntity("wiki:$xcontext.database")) 57 + #foreach ($inclusion in $config.getValue('inclusions')) 58 + #set ($documentReference = $services.model.resolveDocument($inclusion)) 59 + ## Dynamic exclusion filters target only top level pages and thus inclusions, which are treated as exceptions to 60 + ## those filters, should target also top level pages. 61 + #set ($discard = $exclusions.remove("space:$services.model.serialize($documentReference.lastSpaceReference, 62 + 'local')")) 63 + #end 64 +#end 65 +## Other page exclusions. 66 +#foreach ($exclusion in $config.getValue('exclusions')) 67 + #set ($exclusionReference = $services.model.resolveDocument($exclusion)) 68 + #if ($exclusionReference.name == $defaultDocumentName) 69 + #set ($exclusionReference = $exclusionReference.lastSpaceReference) 70 + #end 71 + #set ($discard = $exclusions.add($exclusionReference.type.lowerCase + ':' 72 + + $services.model.serialize($exclusionReference, 'local'))) 73 +#end 74 +#set ($exclusions = $stringtool.join($exclusions, ',')) 75 +{{documentTree showTranslations="false" showAttachments="false" compact="true" openTo="document:$openToDoc" 76 + exclusions="$exclusions" /}} 77 +{{/velocity}} 21 21 79 + 22 22 {{velocity}} 23 23 #if($isGuest) 24 24 #set($loginscherm = 'https://kennis.wardenburg.nl/login/XWiki/XWikiLogin')