Zmeny dokumentu License JSON
Naposledy upravil Admin-metais MetaIS 2025/05/28 21:41
Z verzie 1.1
upravil Admin-metais MetaIS
-
-
Zmeniť komentár:
Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.26]
Do verzie 2.1
upravil Admin-metais MetaIS
-
-
Zmeniť komentár:
Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.29]
Súhrn
-
Vlastnosti stránky (1 modified, 0 added, 0 removed)
Podrobnosti
- Vlastnosti stránky
-
- Obsah
-
... ... @@ -1,7 +1,14 @@ 1 1 {{include reference="Licenses.Code.VelocityMacros"/}} 2 2 3 3 {{velocity output="false"}} 4 -#macro (addPaidExtensionRow $extension $rows) 4 +#macro(getExtensionParentNames $licensedExtensionParents $extensionParentNames) 5 + #set ($extensionParents = $collectiontool.set) 6 + #foreach ($parent in $licensedExtensionParents) 7 + #set ($discard = $extensionParents.add($parent.getExtensionName())) 8 + #end 9 + #set ($extensionParentNames = $stringtool.join($extensionParents, ', ')) 10 +#end 11 +#macro (addPaidExtensionRow $extension $rows $licensedDependenciesMap) 5 5 #set ($license = $services.licensing.licensor.getLicenseForExtension($extension.id)) 6 6 ## 7 7 ## Expiration Date ... ... @@ -63,7 +63,9 @@ 63 63 #end 64 64 #set ($namespaces = $collectiontool.sort($namespaces)) 65 65 ## 66 - ## Other 73 + ## Extension name. A warning will be displayed for extensions installed as depedencies.Note 74 + ## that we consider optional depedencies as being not covered by the license of the parent 75 + ## extension, as they can be uninstalled, so a warning will be displayed for them. 67 67 ## 68 68 #set ($queryString = $escapetool.url({ 69 69 'instanceId': $services.instance.instanceId, ... ... @@ -74,14 +74,28 @@ 74 74 'email': $ownerObj.getValue('email') 75 75 })) 76 76 #set ($documentationURL = "${storeAccessURL}?${queryString}") 86 + #set ($extensionName = "<a href=""$documentationURL"" target='_blank'>$extension.name</a>") 87 + #set ($licensedExtensionParents = $licensedDependenciesMap.get($extension.id.id)) 88 + #if ($licensedExtensionParents && $licensedExtensionParents.size() > 0) 89 + #getExtensionParentNames($licensedExtensionParents $extensionParentNames) 90 + #set ($requiredByTitle = $escapetool.xml($services.localization.render( 91 + 'licensor.installedAsDependency.value.requiredBy')) + $extensionParentNames) 92 + #set ($extensionNameValue = "$services.icon.renderHTML('warning') ${extensionName}") 93 + #set ($extensionName = "<span class='required-by-info' data-parent-extensions=""$extensionParentNames"" 94 + title=""$requiredByTitle"">${extensionNameValue}</span>") 95 + #end 96 + ## 97 + ## Rows 98 + ## 77 77 #set ($discard = $rows.add({ 78 78 'doc_viewable': true, 79 - 'name': $extension .name,101 + 'name': $extensionName, 80 80 'name_url': $documentationURL, 81 81 'version': $extension.id.version.toString(), 82 82 'status': $expDate, 83 83 'support': $support, 84 84 'userLimit': $userLimit, 107 + 'installedAsDependency': $installedAsDependency, 85 85 'wiki': $stringtool.join($namespaces, ', '), 86 86 'actions': "#licenseActions($license $extension)" 87 87 })) ... ... @@ -92,16 +92,19 @@ 92 92 #if ($xcontext.action == 'get') 93 93 #set ($discard = $response.setContentType('application/json')) 94 94 #end 95 -#if ($request.showAllPaidExtensions == 'true') 118 +#getVisiblePaidExtensions 119 +#if ($request.showTopLevelExtensions == true) 120 + #set ($extensions = $visiblePaidExtensions) 121 +#else 96 96 #getPaidExtensions 97 97 #set ($extensions = $paidExtensions) 98 -#else 99 - #getVisiblePaidExtensions 100 - #set ($extensions = $visiblePaidExtensions) 101 101 #end 125 +#set ($licensedDependenciesMap = $services.licensing.licensor.getLicensedExtensionManager().getLicensedDependenciesMap()) 102 102 #set ($rows = []) 103 103 #foreach ($extension in $extensions) 104 - #addPaidExtensionRow($extension $rows) 128 + #if ($extension.type != 'jar') 129 + #addPaidExtensionRow($extension $rows $licensedDependenciesMap) 130 + #end 105 105 #end 106 106 #set ($rows = $collectiontool.sort($rows, 'name')) 107 107 #set ($offset = $mathtool.sub($numbertool.toNumber($request.offset).intValue(), 1))