Changes for page Home
Last modified by Jesse Veentjer on 06-5-2024 05:01
From version 118.1
edited by Jesse Veentjer
on 31-10-2022 11:40
on 31-10-2022 11:40
Change comment:
There is no comment for this version
To version 120.2
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,11 +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 -(% class="wbtoc" %) 21 -((( 22 -{{toc scope="page" /}} 23 -))) 20 +{{documentTree showWikis="true" showSpaces="true" showTranslations="false" showAttachments="false" showChildDocuments="false"/}} 24 24 22 +{{velocity}} 23 +## Escape special characters in macro parameter values. 24 +#set ($openToDoc = $doc.documentReference.toString().replaceAll('([~"])', '~$1')) 25 +## Apply the configured page exclusions. 26 +#set ($config = $xwiki.getDocument('PanelsCode.NavigationConfiguration')) 27 +#set ($exclusions = $collectiontool.set) 28 +#set ($defaultDocumentName = $services.model.getEntityReference('DOCUMENT', 'default').name) 29 +## Exclude top level extension pages. 30 +#if ($config.getValue('excludeTopLevelExtensionPages') == 1) 31 + #set ($query = $services.query.hql('select space.name from XWikiSpace space where space.parent is null')) 32 + #set ($discard = $query.addFilter('hidden/space')) 33 + #foreach ($result in $query.execute()) 34 + #set ($documentReference = $services.model.createDocumentReference($NULL, $result, $defaultDocumentName)) 35 + #set ($installedExtensions = $services.extension.xar.getInstalledExtensions($documentReference)) 36 + #if ($installedExtensions && $installedExtensions.size() > 0 37 + && !$services.extension.xar.isEditAllowed($documentReference)) 38 + #set ($discard = $exclusions.add("space:$services.model.escape($result, 'SPACE')")) 39 + #end 40 + #end 41 +#end 42 +## Exclude top level application pages. 43 +#if ($config.getValue('excludeTopLevelApplicationPages') == 1) 44 + #set ($statement = 'select space.name ' 45 + + 'from XWikiSpace as space, Document as doc, doc.object(AppWithinMinutes.LiveTableClass) as app ' 46 + + 'where space.parent is null and doc.space = space.reference') 47 + #set ($query = $services.query.xwql($statement).addFilter('hidden/space')) 48 + #foreach ($result in $query.execute()) 49 + #set ($discard = $exclusions.add("space:$services.model.escape($result, 'SPACE')")) 50 + #end 51 +#end 52 +## Inclusions are treated as exceptions to the dynamic exclusion filters. 53 +#if ($config.getValue('excludeTopLevelExtensionPages') == 1 || $config.getValue('excludeTopLevelApplicationPages') == 1) 54 + ## FIXME: This panel is cached and the cache is not invalidated by default when an extension is installed or 55 + ## uninstalled and neither when an application is created, deleted or renamed. Ideally we should invalidate the cache 56 + ## whenever a top level page is created or modified but we can't do this ATM so the next best thing is to invalidate 57 + ## the cache whenever a page (anywhere in the page hierarchy) is modified. 58 + #set ($discard = $services.async.useEntity("wiki:$xcontext.database")) 59 + #foreach ($inclusion in $config.getValue('inclusions')) 60 + #set ($documentReference = $services.model.resolveDocument($inclusion)) 61 + ## Dynamic exclusion filters target only top level pages and thus inclusions, which are treated as exceptions to 62 + ## those filters, should target also top level pages. 63 + #set ($discard = $exclusions.remove("space:$services.model.serialize($documentReference.lastSpaceReference, 64 + 'local')")) 65 + #end 66 +#end 67 +## Other page exclusions. 68 +#foreach ($exclusion in $config.getValue('exclusions')) 69 + #set ($exclusionReference = $services.model.resolveDocument($exclusion)) 70 + #if ($exclusionReference.name == $defaultDocumentName) 71 + #set ($exclusionReference = $exclusionReference.lastSpaceReference) 72 + #end 73 + #set ($discard = $exclusions.add($exclusionReference.type.lowerCase + ':' 74 + + $services.model.serialize($exclusionReference, 'local'))) 75 +#end 76 +#set ($exclusions = $stringtool.join($exclusions, ',')) 77 +{{documentTree showTranslations="false" showAttachments="false" compact="true" openTo="document:$openToDoc" 78 + exclusions="$exclusions" /}} 79 +{{/velocity}} 25 25 26 26 27 27 {{velocity}}