Wiki source code of API Reference

Last modified by Thomas Mortagne on 2024/03/27

Show last authors
1 {{velocity}}
2 #set ($versionStable = "16.2.0")
3 ##set ($versionDev = "16.2.0-rc-1")
4 #set ($versionLTS = "15.10.8")
5 {{/velocity}}
6
7 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>>Documentation.DevGuide.Scripting.WebHome]] (Velocity, Groovy, Python, Ruby, etc).
8
9 {{info}}
10 As users of the XWiki API you need to be aware of some important points:
11
12 * You should never use a class having ##internal## in its package. It means this class is not a public API and XWiki developers can change it at any time. If you depend on such a class you're on your own and the XWiki Development Team doesn't guarantee its stability.
13 * You should pay attention to the ##@Unstable## annotation. When you see code marked with this annotation it means it's a new public API that it still considered unstable and that can change at any time too. See [[Unstable Annotation>>dev:Community.DevelopmentPractices||anchor="H40UnstableAnnotation"]] for more details.
14 {{/info}}
15
16 == Scripting Reference Documentation ==
17
18 In order to know the full list of APIs that you can use you can:
19
20 * (//Recommended//) Install the [[Scripting Documentation Application>>extensions:Extension.Scripting Documentation Application]] in your wiki.
21 * [[Browse a version of it installed on xwiki.org>>ScriptingDocumentation.WebHome]] (but beware, it'll show the Scripting API available on the XWiki version installed for xwiki.org, which may differ from your locally installed XWiki version).
22
23 == How to find a class ==
24
25 You can get the maven module where to find a Java class by using [[XWiki Nexus Search page>>http://nexus.xwiki.org/nexus/index.html#nexus-search;classname~~]]. Put the complete class name and you will get all modules containing it. Nexus also allows you to see what's in those artifacts and read the JavaDoc.
26
27 == JavaDoc ==
28
29 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]].
30
31 {{velocity}}
32 Right now we're providing all JavaDocs for all modules:
33 #if ($versionStable)
34 * [[JavaDoc for XWiki ${versionStable} (stable)>>Javadoc||queryString="versionId=$versionStable&versionName=stable"]]
35 #end
36 #if ($versionDev)
37 * [[JavaDoc for XWiki ${versionDev} (dev)>>Javadoc||queryString="versionId=$versionDev&versionName=dev"]]
38 #end
39 #if ($versionLTS)
40 * [[JavaDoc for XWiki ${versionLTS} (LTS)>>Javadoc||queryString="versionId=$versionLTS&versionName='LTS'"]]
41 #end
42 * (((
43 {{html}}
44 <form action="$xwiki.getURL('Documentation.DevGuide.Javadoc')" class="xformInline">
45 <label for="javadocVersionId">Older version:</label>
46 <input id="javadocVersionId" type="text" size="30" name="versionId" class="withTip" value="e.g., 3.2.1, 4.1-milestone-1, 5.1-rc-1"/>
47 <input type="hidden" name="versionName" value="LTS"/>
48 <input class="button" type="submit" value="View"/>
49 </form>
50 {{/html}}
51 )))
52 {{/velocity}}
53
54 The [[full JavaDoc>>http://maven.xwiki.org/site/docs/]] is also available ({{info}}but only for old versions, we need to fix this{{/info}}).
55
56 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/]].

Get Connected