Changes for page API Reference
Last modified by Vincent Massol on 2020/12/28
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,18 +1,7 @@ 1 1 {{velocity}} 2 2 #set($versionStable = "6.4.2") 3 -#set($nameStable = $versionStable) 4 4 #set($versionDev = "7.0-milestone-2") 5 -#set($nameDev = "7.0 Milestone 2") 6 6 ##set($versionOldStable = "5.4.7") 7 -##set($nameOldStable = $versionOldStable) 8 - 9 -#macro(moduleJavadocUrl $repo $module $version) 10 -http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/${repo}/xwiki-${repo}-${module}/${version}/xwiki-${repo}-${module}-${version}-javadoc.jar/!/index.html 11 -#end 12 -#macro(fullModuleJavadocUrls $repo $module) 13 -[[$nameStable>>#moduleJavadocUrl($repo $module $versionStable)]] (stable)#if ($versionDev), [[$nameDev>>#moduleJavadocUrl($repo $module $versionDev)]] (dev)#{end}#if ($versionOldStable), [[$nameOldStable>>#moduleJavadocUrl($repo $module $versionOldStable)]] (super stable)#end 14 - 15 -#end 16 16 {{/velocity}} 17 17 18 18 XWiki's APIs are the methods that the XWiki development team consider safe for you to use (i.e. for which backward compatibility is guaranteed). They can be called from Java or directly from your wiki pages [[using a scripting language>>DevGuide.Scripting]] (Velocity, Groovy, Python, Ruby, etc). ... ... @@ -34,16 +34,38 @@ 34 34 35 35 == JavaDoc == 36 36 37 -XWiki is made of various extensions/modules and each module offers API for both developers coding in Java and for Scripts written in wiki pages. In the future our goal is to have Javadoc links directly from each extension page located in the [[Extensions Wiki>>extensions:Main.WebHome]]. Right now you'll needto findthe JavadocJAR correspondingto the extensionforwhich you'relookingfor APIdocumentation.26 +XWiki is made of various extensions/modules and each module offers API for both developers coding in Java and for Scripts written in wiki pages. In the future our goal is to have Javadoc links directly from each extension page located in the [[Extensions Wiki>>extensions:Main.WebHome]]. Right now we're listing below the Javadocs for all modules. 38 38 39 -For example: 40 40 {{velocity}} 41 -* OldCore Javadoc: #fullModuleJavadocUrls("platform" "oldcore") 42 -* Model Javadoc: #fullModuleJavadocUrls("platform" "model") 43 -* Observation Javadoc: #fullModuleJavadocUrls("commons" "observation-api") 44 -* [[Rendering Javadoc>>rendering:Main.JavaDoc]] 29 +#if ("$!request.versionId" != '') 30 + #set ($versionId = $request.versionId) 31 + #set ($versionName = $request.versionName) 32 +#else 33 + #set ($versionId = $versionStable) 34 + #set ($versionName = "stable") 35 +#end 36 + 37 +Javadoc for version $versionId ($versionName) ([[stable: $versionStable>>||queryString="versionId=$versionStable,versionName=stable"]]#if ($versionDev), [[dev: $versionDev>>||queryString="versionId=$versionDev,versionName=dev"]]#{end}#if ($versionOldStable), [[super stable: $versionOldStable>>||queryString="versionId=$versionOldStable,versionName='super stable'"]]#{end}): 45 45 {{/velocity}} 46 46 40 +{{groovy}} 41 +import groovy.xml.* 42 +import org.apache.commons.lang3.* 43 + 44 +def url = "http://nexus.xwiki.org/nexus/service/local/lucene/search?g=org.xwiki.*&v=6.4.2&p=jar&c=javadoc".toURL().text 45 +def root = new XmlSlurper().parseText(url) 46 + 47 +root.data.artifact.each { artifact -> 48 + // Extract the last part of the group id and consider it's the repo short name 49 + def groupId = artifact.groupId.text() 50 + def repo = StringUtils.substringAfterLast(groupId, ".") 51 + def artifactId = artifact.artifactId 52 + def version = artifact.version 53 + def javadocURL = "http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/org/xwiki/${repo}/${artifactId}/${version}/${artifactId}-${version}-javadoc.jar/!/index.html" 54 + println "* [[${artifactId}>>url:${javadocURL}]]" 55 +} 56 +{{/groovy}} 57 + 47 47 The [[full Javadoc>>http://maven.xwiki.org/site/docs/]] is also available ({{info}}but only for old versions, we need to fix this{{/info}}). 48 48 49 49 Older Javadocs of XWiki can be found in our [[Maven Release repository>>http://maven.xwiki.org/releases/]]. For example for XWiki Platform Core Javadocs, check the files suffixed by ##javadoc## for the version you wish under [[this directory>>http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-platform-oldcore/]].