Wiki source code of XWiki Contrib

Version 86.1 by Thomas Mortagne on 2016/06/13 12:00

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 **XWiki Contrib** is a community dedicated to collaborative development of XWiki related projects and extensions in the spirit of wiki communities. These projects are not part of the official XWiki distributions and are not maintained by the XWiki development team.
6
7 = Contrib Project List =
8
9 The full list of Contrib projects is available [[on GitHub>>https://github.com/organizations/xwiki-contrib]].
10
11 = Hosting tools =
12
13 The project hosting forge can provide contributors with some or all of the following tools:
14
15 * A **GitHub repository**, under http://github.com/xwiki-contrib
16 * A **JIRA project** for tracking bugs and feature requests, at http://jira.xwiki.org/ and under the "XWiki Contributed projects" category. Note that each project should have its own JIRA project (we used to have a single generic JIRA project with different ##components## but this was creating difficulties).
17 * A generic **maven groupId**: ##org.xwiki.contrib## (or ##org.xwiki.contrib.<module name>## if the project has several modules). That's until the project reaches a certain size and visibility, in which case it can have its own maven group id.
18 * A **Mailing list** for your project. Note that for the moment, all the projects share [[common mailing lists>>dev:Community.MailingLists]].
19 * **Project pages** on [[extensions.xwiki.org>>extensions:Main.WebHome]] to describe and document the project. When the project reaches a certain visibility and size it can have its own wiki on xwiki.org.
20 * A **CI job** on http://ci.xwiki.org for building the project automatically on each commit.
21 * A **Sonar project report** on http://sonar.xwiki.org to analyze the project's quality with various metrics.
22 * **Translations**, under the [[l10n wiki>>http://l10n.xwiki.org]].
23
24 = Contributing to an existing project =
25
26 If you're interested to contribute to an existing project on http://github.com/xwiki-contrib, please send an email to **##devs AT xwiki.org##** (after having [[subscribed>>dev:Community.MailingLists]]), introducing yourself and explaining what you wish to do. Make sure to create an account on GitHub and mention this id in the email so that we can give you access. Thanks for helping out! :)
27
28 = Why join XWiki Contrib =
29
30 You could very well develop your XWiki extension in your own GitHub organization and you might wonder why put your project on XWiki Contrib. Some reasons:
31
32 * You join a Community, the XWiki open source community. We value a lot the community notion and we want to be more like the Apache Software Foundation (strong sense of community) rather than Source Forge (list of independent projects, little community). In particular, this is why we ask you to introduce yourself when requesting a project.
33 * This makes your extension visible to the XWiki community and thus other contributors may want to join you in participating to the development of your extension (contribute on code, discussions, promotion, etc).
34 * You get some tools setup for your project (GitHub repository, Issue tracker, Wiki pages)
35
36 = Requesting a project =
37
38 The contrib project is open for anyone who wish to start a new project. Simply send us an email at **##devs AT xwiki.org##** using "**[Contrib]**" at the beginning of your email's subject (after having [[subscribed>>dev:Community.MailingLists]]). Let us know the name and a short description of the project. If your project has already been made available for download on extensions.xwiki.org, please mention it and point us to its page (If it is not, then no need to hurry, you will make it available once it's ready). Finally, let us know which of the tools listed above you need. For GitHub access, you will need to register a user on http://github.com and let us know about it (a best practice is to have a username composed of the first letter of your first name immediately followed by your last name, the whole with no capital letter, for example **jdoe** if your name is John Doe).
39
40 == Choosing the name ==
41
42 When picking the GitHub name please follow the existing conventions:
43
44 * ##application-<xxx>## for apps
45 * ##macro-<xxx>## for macros only (if you project provides a macro but also provides other wiki pages then it's considered an app)
46 * ##api-<xxx>## for APIs only (same as for macro, if it contains UI as well, then you should call it an app instead)
47 * ##displayer-<xxx>## for custom displayers
48 * ##syntax-<xxx>## for rendering syntaxes
49 * ##authenticator-<xxx>## for authenticators
50
51 For the actual project name part (##<xxx>## of the git repository name) it is preferred to use a single word (e.g. ##application-forum##). However, sometimes that is not descriptive enough, so you can either use multiple words next to each other (e.g. ##application-filemanager##) if that makes sense and looks natural enough or, if not, you should separate the words with a dash (e.g. ##displayer-multiselect-suggest##). Whatever you decide, please try to keep it as short and descriptive as possible.
52
53 //Hint//: When in doubt, have a look at [[existing repository names>>https://github.com/xwiki-contrib]] for inspiration.
54
55 == README.md Template ==
56
57 It's very useful for projects to have a ##README.md## file providing various information (who the lead is, the best practices for contributing to this project, etc). We recommend using the following template:
58
59 {{code language="none"}}
60 # <Pretty name of Extension, e.g. Flash Messages Application>
61
62 <Short Description of Extension, taken from the description element in the pom.xml>
63
64 * Project Lead: [<info taken from the jira project, e.g. Vincent Massol>](<url to user profile on xwiki.org)
65 <if single extension page>
66 * [Documentation & Download](<url on e.x.o, e.g. http://extensions.xwiki.org/xwiki/bin/view/Extension/Flash+messages+application>)
67 </if single extension page>
68 <if several extension pages>
69 * Documentation & Downloads:
70 * [<pretty name of page1, e.g. My App API](<url1 on e.x.o)
71 ...
72 * [<pretty name of pageN, e.g. My App API](<urlN on e.x.o)
73 </if several extension pages>
74 * [Issue Tracker](<url on jira.xwiki.org, e.g. http://jira.xwiki.org/browse/XAFLASHM>)
75 * Communication: [Mailing List](<url, e.g. http://dev.xwiki.org/xwiki/bin/view/Community/MailingLists>), [IRC](<url, e.g. http://dev.xwiki.org/xwiki/bin/view/Community/IRC>)
76 <if link pointing to all dev practices>
77 * [Development Practices](<URL pointing to a site defining the list of practices to be followed by contributors when contributing on this project>)
78 </if link pointing to all dev practices>
79 <if no single link pointing to all dev practices>
80 * Development Practices:
81 * <best practice 1, possibly with some link>
82 ...
83 * <best practice N, possibly with some link>
84 </if no single link pointing to all dev practices>
85 * Minimal XWiki version supported: <taken from the pom.xml, e.g. XWiki 6.4.7>
86 * License: <license,taken from the pom.xml, e.g. LGPL 2.1>.
87 <if translation is used>
88 * [Translations](<url on l10n to translations for this extension>)
89 </if translation is used>
90 <if translation is not used>
91 * Translations: N/A
92 </if translation is not used>
93 <if sonar is used>
94 * [Sonar Dashboard](<url to the project’s dashboard on sonar.xwiki.org, e.g. http://sonar.xwiki.org/dashboard/index/10464>)
95 </if sonar is used>
96 <if sonar is not used>
97 * Sonar Dashboard: N/A
98 </if sonar is not used>
99 <if ci is used>
100 * Continuous Integration Status: [![Build Status](http://ci.xwiki.org/buildStatus/icon?job=<url-encoded job name on ci.xwiki.org>)](http://ci.xwiki.org/job/<url-encoded job name on ci.xwiki.org>/)
101 </if ci is used>
102 <if ci is not used>
103 * Continuous Integration Status: N/A
104 </if ci is not used>
105
106 <optional>
107 ## Whatever
108 ...
109 </optional>
110 {{/code}}
111
112 Here's [[an example>>https://github.com/xwiki-contrib/application-antispam/blob/master/README.md]].
113
114 == For ##xwiki-contrib## GitHub Admins ==
115
116 When creating a new ##xwiki-contrib## repository on GitHub please make sure to:
117
118 * Uncheck the "wiki" and "issues" checkboxes in the settings
119 * Add the ##xwikiorg## group in the Collaborators settings
120 * Add an email service pointing to notifications AT xwiki DOT org for notifications
121 * Add a default ##.gitignore## file (or tell the project owner to add one), by copying the {{scm project="xwiki-commons" path=".gitignore"}}##.gitignore from ##xwiki-commons##{{/scm}}.
122
123 = Requesting snapshot builds for your project =
124
125 XWiki.org has a [[continuous build>>http://dev.xwiki.org/xwiki/bin/view/Community/ContinuousBuild]] which builds maven projects each time they are modified on GitHub and put the resulting artifact in our [[snapshots repository>>http://maven.xwiki.org/snapshots/]]. This is useful when you want people using your project as a dependency to continuously benefit from the improvements or to tell users of your Extension try it out before it's released.
126
127 Your can ask for your project to be added to the continuous build by sending a mail to the devs list:
128
129 * First you need to use the XWiki parent pom to have the correct distribution management information:(((
130 {{code language="xml"}}
131 <project>
132 ...
133 <parent>
134 <groupId>org.xwiki.commons</groupId>
135 <artifactId>xwiki-commons-pom</artifactId>
136 <version>see the building section below to choose the version</version>
137 </parent>
138 ...
139 </project>
140 {{/code}}
141 )))
142 * [[Send a mail on the [email protected] mailing list>>dev:Community.MailingLists]] to ask for the addition of your project to the continuous build. Example mail:(((
143 {{code language="none"}}
144 [Contrib] Add <myproject> to the CI
145
146 Hi XWikiers,
147
148 I'm working on <myproject> and I'd like to have it built by XWiki.org's CI. Could it be added?
149
150 Thanks,
151 <your name>
152 {{/code}}
153 )))
154
155 = Release the project =
156
157 XWiki.org allows you to release your project on the [[XWiki Maven Remote Repository>>http://nexus.xwiki.org]] as long as you follow these steps:
158
159 * Use ##org.xwiki.contrib## as ##groupId## in your maven module
160 * Request for an account on [[Nexus>>http://nexus.xwiki.org]] by sending a mail to the [[Developer's list>>dev:Community.MailingLists]] mentioning the username you'd wish to have (you could also mention which extension you're planning to release to provide contextual information).
161 * Once you've received your credentials put them in(((
162 ##~~/.m2/settings.xml##
163
164 {{code language="xml"}}
165 <settings>
166 ...
167 <servers>
168 ...
169 <server>
170 <id>xwiki-staging</id>
171 <username>username</username>
172 <password>********</password>
173 </server>
174 ...
175 </servers>
176 ...
177 </settings>
178 {{/code}}
179 )))
180 * Put the following configuration in your project(((
181 ##pom.xml##
182
183 {{code language="xml"}}
184 <project>
185 ...
186 <scm>
187 <connection>scm:git:git://github.com/xwiki-contrib/{extensionrepository}.git</connection>
188 <developerConnection>scm:git:[email protected]:xwiki-contrib/{extensionrepository}.git</developerConnection>
189 <url>https://github.com/xwiki-contrib/{extensionrepository}</url>
190 </scm>
191 ...
192 <distributionManagement>
193 <repository>
194 <id>xwiki-staging</id>
195 <name>XWiki Staging Repository</name>
196 <url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
197 </repository>
198 </distributionManagement>
199 ...
200 </project>
201 {{/code}}
202
203 Where ##{extensionrepository}## is the name of the repository in [[http://github.com/xwiki-contrib/]].
204 )))
205 * Release the project with the maven release plugin(((
206 {{code language="none"}}
207 mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare
208 {{/code}}
209
210 {{info}}
211 In case you're wondering why we force using this Maven Release plugin version, it's because versions < 2.5 of this plugin have a bug when using Git 1.9+ which leads to not resolving properly SNAPSHOT versions when tagging.
212 {{/info}}
213
214 {{error}}
215 If you are releasing from ##Microsoft Windows## and inherit from standard ##XWiki Commons root pom## < 6.2 you might have issues performing the release (see http://jira.xwiki.org/browse/XCOMMONS-553 for details). The workaround is to skip the enforcer plugin:
216
217 {{code language="none"}}
218 mvn release:perform -Darguments="-Dxwiki.enforcer.skip=true"
219 {{/code}}
220 {{/error}}
221
222 {{warning}}
223 If the application has also tests and you want to release the modules, but not run the tests, you should:
224
225 {{code language="none"}}
226 mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare -Pintegration-tests -Darguments="-DskipTests" -DskipTests
227 {{/code}}
228
229 If you want to skip the enforcer plugin, use:
230
231 {{code language="none"}}
232 mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare -Pintegration-tests -Darguments="-DskipTests -Dxwiki.enforcer.skip=true" -DskipTests
233 {{/code}}
234
235 {{/warning}}
236 )))
237 * The released XWiki artifacts are signed ([[http:~~/~~/en.wikipedia.org/wiki/Digital_signature>>http://en.wikipedia.org/wiki/Digital_signature]]). This helps downloaders check that indeed the binary is what was initially put in there, and was not replaced by an intruder.(((
238 The signing maven plugin is configured in the toplevel pom ( {{code}}<groupId>org.xwiki.commons</groupId><artifactId>xwiki-commons</artifactId>{{/code}} ) so any module that's inheriting from that will have the gpg plugin configured by default. To find out, get the effective pom of your module ( {{code}}mvn help:effective-pom{{/code}} ) and check if the gpg maven plugin is there (maven-gpg-plugin).
239
240 If you're gonna try to release like that, it will probably fail since the gpg plugin expects you to have a gnupg key with a password. You now have 2 options:
241
242 * Overwrite the settings of the gpg plugin in your pom to disable signing:(((
243 {{code}}
244 <profiles>
245 <profile>
246 <id>release</id>
247 <build>
248 <plugins>
249 <plugin>
250 <groupId>org.apache.maven.plugins</groupId>
251 <artifactId>maven-gpg-plugin</artifactId>
252 <configuration>
253 <skip>true</skip>
254 </configuration>
255 </plugin>
256 </plugins>
257 </build>
258 </profile>
259 </profiles>
260 {{/code}}
261 )))
262 * Configure your setup to sign properly. To do that, you will have to:
263 ** generate a gpg key which will be stored in your home folder and will be used by maven. On linux you can do that using the default gpg command ({{code}}gpg --gen-key{{/code}}, read the man page if you want to know more about the options). On Windows you can use [[Gpg4win>>http://www.gpg4win.org/]], while on Mac you have the [[GPG Suite>>https://gpgtools.org/]]. If you don't know what to fill in for the options requested by the tool, keep the defaults.
264 ** Tell maven the passphrase of this key (the one you entered upon key generation), either in the command line when performing the release {{code}}mvn release:perform -Darguments=-Dgpg.passphrase=PASSWORD{{/code}} or set it in your maven settings.xml like this(((
265 {{code}}
266 ...
267 <profile>
268 <id>xwiki</id>
269 <properties>
270 <gpg.passphrase>PASSWORD</gpg.passphrase>
271 </properties>
272 ...
273 {{/code}}
274 )))
275 )))
276 * You're done now, you can go on releasing(((
277 {{code language="none"}}
278 mvn org.apache.maven.plugins:maven-release-plugin:2.5:perform
279 {{/code}}
280
281 {{info}}
282 On Windows you can use this command to successfully perform the release:
283
284 {{code language="none"}}
285 mvn org.apache.maven.plugins:maven-release-plugin:2.5:perform -Darguments="-Dgpg.passphrase="YourGpg4winPassword" -Dxwiki.enforcer.skip=true"
286 {{/code}}
287
288 but be careful to replace "YourGpg4winPassword" with the actual password chosen when creating a GPG key with [[Gpg4win>>http://www.gpg4win.org/]].
289
290 {{/info}}
291
292 {{info}}
293
294 On Windows, when you have this issue:
295
296 {{code language="none"}}
297 gpg: no default secret key: secret key not available
298 gpg: signing failed: secret key not available
299 {{/code}}
300
301 * Add this to your settings.xml:
302
303 {{code}}
304 ...
305 <profile>
306 <id>xwiki</id>
307 <properties>
308 <gpg.keyname>your_user_id</gpg.keyname>
309 <gpg.homedir>path_to_your_key</gpg.homedir>
310 <gpg.passphrase>PASSWORD</gpg.passphrase>
311 </properties>
312 ...
313 {{/code}}
314
315 {{/info}}
316
317 {{info}}
318 In case you're wondering why we force using this Maven Release plugin version, it's because versions < 2.5 of this plugin have a bug when using Git 1.9+ which leads to not resolving properly SNAPSHOT versions when tagging.
319 {{/info}}
320
321 {{warning}}
322 If the application has also tests and you want to release the modules, but not run the tests, you should:
323
324 {{code language="none"}}
325 mvn org.apache.maven.plugins:maven-release-plugin:2.5:perform -Pintegration-tests -Darguments="-DskipTests -Pintegration-tests" -DskipTests
326 {{/code}}
327
328 {{/warning}}
329 )))
330 * Note that you'll need to push the changes done by the release plugin: {{code}}git push origin master{{/code}}
331 * Ask for someone (on the devs mailing list or on IRC) to validate your release from the staging repository on [[Nexus>>http://nexus.xwiki.org]] to make your extension available on maven.xwiki.org. Alternatively if you've been granted the permissions you can do this yourself by understanding [[Nexus Staging>>http://books.sonatype.com/nexus-book/reference/staging-repositories.html]]. To perform promotion do the following:
332 ** Select the repository to validate in the Staging Repositories list
333 ** Click the "Close" button to close it. Wait a few seconds since it's done asynchronously.
334 ** Make sure to test your extension from the closed staging repo first since a released repo cannot be removed!
335 ** Once you want to move your extension from the Staging Repository to the Public Repository click the "Release" button. Wait a few seconds since it's done asynchronously.
336 * After that your release will be available for download on maven.xwiki.org and anyone will be able to use it as a dependency for his own project
337 * If your project is using JIRA, release the version in JIRA and add a new version label for the next version.
338 * Update the documentation for your project (or create it if there's none) on the [[Extensions Wiki>>extensions:Main.WebHome]] and make sure to add release notes information. See the next section for more.
339
340 = Recovering from a failed Release =
341
342 It may happen that the ##release:perform## fails. In this case you'll want to rollback, fix the problem and release again. Maven generates temporary files in your module's directory. Don't remove them! :)
343
344 To rollback you need to call the following:
345
346 {{code language="none"}}
347 mvn org.apache.maven.plugins:maven-release-plugin:2.5:rollback
348 {{/code}}
349
350 {{warning}}
351 The document for the [[##release:rollback## mojo>>http://maven.apache.org/maven-release/maven-release-plugin/examples/rollback-release.html]] says that currently the deletion of the created tag is not implemented. Thus even if you se the rollback call you may still need to perform step 2 of the manual process below.
352 {{/warning}}
353
354 Now if you have already deleted those files, don't panic! It's still easy to recover. You'll just need to do manually [[what the ##release:rollback## does>>http://maven.apache.org/maven-release/maven-release-plugin/examples/rollback-release.html]]:
355
356 * Rollback the changes done by the ##release:prepare## call by reverting the changes in Git
357 * Remove the local and remote tag created by the ##release:prepare## call ({{code language="none"}}git branch -d the_local_tag{{/code}} and {{code language="none"}}git push origin :the_remote_tag{{/code}}).
358
359 = Publishing on extensions.xwiki.org =
360
361 The first step is to [[release>>||anchor="HReleasetheproject"]] your extension in the XWiki Maven Remote Repository. Then go the [[Extension wiki home page>>extensions:Main.WebHome]] and click on the [[Import>>extensions:ExtensionCode.ImportExtension]] button located inside the Contribute box (you'll need to be logged in). Then fill in your extension id (the format is ##<maven groupId>:<maven artifactId>##), select the ##maven-xwiki## repository and press the import button.
362
363 If you have already created an extension page manually on extensions.xwiki.org, the import will locate it (provided you've filled the correct extension id in your extension page, you can edit it in Object mode to fill it if that's not the case) and will overwrite data that it finds in your extension's ##pom.xml## file, preserving the rest of the information you've manually entered (like the description).
364
365 {{info}}
366 If you have already imported your Extension and you've just published a new version in nexus.xwiki.org and you wish to update the version seen on extensions.xwiki.org you should know that this is automatically done every night by a scheduler job so you don't have to do anything. However if you wish to force it, go to your extension page and click the refresh icon located at the top right corner of that page.
367 {{/info}}
368
369 = Implementing your Maven build =
370
371 {{info}}
372 You can find [[reference documentation for the XAR Plugin>>dev:Community.XARPlugin]].
373 {{/info}}
374
375 Here's an example of how your ##pom.xml## should look like (adapt to your need) if you're contributing an application (XAR):
376
377 {{code language="xml"}}
378 <?xml version="1.0" encoding="UTF-8"?>
379
380 <!--
381 *
382 * See the NOTICE file distributed with this work for additional
383 * information regarding copyright ownership.
384 *
385 * This is free software; you can redistribute it and/or modify it
386 * under the terms of the GNU Lesser General Public License as
387 * published by the Free Software Foundation; either version 2.1 of
388 * the License, or (at your option) any later version.
389 *
390 * This software is distributed in the hope that it will be useful,
391 * but WITHOUT ANY WARRANTY; without even the implied warranty of
392 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
393 * Lesser General Public License for more details.
394 *
395 * You should have received a copy of the GNU Lesser General Public
396 * License along with this software; if not, write to the Free
397 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
398 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
399 *
400 -->
401
402 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
403 <modelVersion>4.0.0</modelVersion>
404 <parent>
405 <groupId>org.xwiki.contrib</groupId>
406 <artifactId>parent-platform</artifactId>
407 <version>7.4-3</version>
408 </parent>
409 <groupId>org.xwiki.contrib</groupId>
410 <artifactId>your-extension-id</artifactId>
411 <version>1.0-SNAPSHOT</version>
412 <name>Your extension's name</name>
413 <packaging>xar</packaging>
414 <description>Your extension's description</description>
415 <scm>
416 <connection>scm:git:git://github.com/xwiki-contrib/(your extension id).git</connection>
417 <developerConnection>scm:git:[email protected]:xwiki-contrib/(your extension id).git</developerConnection>
418 <url>https://github.com/xwiki-contrib/(your extension id)</url>
419 </scm>
420 <developers>
421 <developer>
422 <id>scm id of developer 1</id>
423 <name>Full Name of developer 1 as registered on xwiki.org, e.g. Vincent Massol</name>
424 </developer>
425 ...
426 <developer>
427 <id>scm id of developer N</id>
428 <name>Full Name of developer N as registered on xwiki.org, e.g. Vincent Massol</name>
429 </developer>
430 </developers>
431 <properties>
432 <!-- Don't check for API backward-compatibility here since there's no Java code. -->
433 If you're using a xwiki-commons parent POM that is >= 8.1M1 then you need to use:
434 <xwiki.revapi.skip>true</xwiki.revapi.skip>
435 Otherwise you should use:
436 <xwiki.clirr.skip>true</xwiki.clirr.skip>
437 <!-- The Extension name. If not defined, the <name> property is used -->
438 <xwiki.extension.name>Your extension's name</xwiki.extension.name>
439 <!-- The extension's category -->
440 <xwiki.extension.category>application</xwiki.extension.category>
441 </properties>
442 <distributionManagement>
443 <repository>
444 <id>xwiki-staging</id>
445 <name>XWiki Staging Repository</name>
446 <url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
447 </repository>
448 </distributionManagement>
449 <issueManagement>
450 <system>jira</system>
451 <url>http://jira.xwiki.org/jira/browse/(your jira project id)</url>
452 </issueManagement>
453 </project>
454 {{/code}}
455
456 It's very important that you set the following information as they'll be used when you publish your extension on [[extensions.xwiki.org>>extensions:Main.WebHome]]:
457
458 * Extension id
459 * Name
460 * Description
461 * Developers
462 * {{info}}New{{/info}} Category (using ##<xwiki.extension.category>##). Valid values are [[listed here>>extensions:Extension.Repository Application#HCategories]].
463 * {{info}}New{{/info}} SCM
464 * {{info}}New{{/info}} Issue Management
465
466 You'll also need to set the SCM information since using the Maven Release plugin will require those to be set.
467
468 If you've modified the ##groupId## or ##artifactId## of the extension you need to tell it to the Extension Manager so that it can handle upgrades and understand it's the same extension being upgraded. For example if the extension previously had an extension id of ##tdelafosse:meeting-application## and you're now using another id, you need to add the following property to your ##pom.xml##:
469
470 {{code language="xml"}}
471 <properties>
472 ...
473 <!-- Old names of this module used for retro compatibility when resolving dependencies of old extensions -->
474 <xwiki.extension.features>tdelafosse:meeting-application</xwiki.extension.features>
475 ...
476 </properties>
477 {{/code}}
478
479 {{info}}
480 In addition you need to pay attention to the version of the dependencies you're going to use (for example the version of your parent POM). If you wish your extension to be used by the maximum number of XWiki users you need to use the oldest dependencies version for which you extension still works. This is because your extension will only be able to be installed in XWiki versions satisfying those dependencies you expressed.
481
482 LTS are always provided for https://github.com/xwiki-contrib/parent, in case the version you want is not listed you can either ask for it to be released in the Mailing List or use ##org.xwiki.commons:xwiki-commons-pom## instead.
483 {{/info}}
484
485 = Application Design =
486
487 This section provides suggested best practices for writing an application. It is there to ensure your application is nice and easy to use by XWiki users.
488
489 * Put all your pages in a space dedicated for your application. This makes your application nicely compartmented. Pick a short space name (e.g. ##UserDirectory##). Examples of space names:(((
490 {{image reference="spaces.png"/}}
491 )))
492 * Ensure that all technical pages of your application are marked as ##hidden## so that users don't see them by default. To do so, edit those pages and tick the ##hidden## checkbox(((
493 {{image reference="hidden.png"/}}
494 )))
495 * Make sure you add a User Interface Extension (UIX) for the Application Panel extension point. This registers your application into the Application Panel:(((
496 {{image reference="applications-panel.png"/}}
497
498 This is done by adding an object of type ##XWiki.UIExtensionClass## in a page in your application space. We recommend having a page named ##<your space>.ApplicationsPanelEntry## (e.g. ##Blog.ApplicationPanelEntry##). For example:
499 {{image reference="application-uix.png"/}}
500
501 In order to have a nice-looking UIX page, We also recommend to have the following content on that page (insert it in wiki edit mode):
502
503 {{code}}
504 {{include document="XWiki.UIExtensionSheet" /}}
505 {{/code}}
506 )))
507
508 = Documenting =
509
510 After you've published your extension in the XWiki Maven Remote Repository, import it on [[extensions.xwiki.org>>extensions:Main.WebHome]] (click on "Import" on that page, you'll need to be logged in after registering yourself). This creates an extension page. Verify that your extension is marked as "Installable with the Extension Manager". This makes it easy for users to install it from within their XWiki instances.
511
512 {{warning}}
513 If you've already created the page on [[extensions.xwiki.org>>extensions:Main.WebHome]] prior to importing the extension then make sure you've used the correct extension id on your extension page as otherwise the import will not be able to import your extension data on the right page and instead it'll create another page and you'll find yourself with 2 pages...
514 {{/warning}}
515
516 Verify the value of the fields filled automatically by the import, namely:
517
518 * The page name
519 * The description
520 * The authors
521
522 If they're wrong you'll need to publish a new version of your extension and re-import it.
523
524 Edit it and provide nice user-friendly documentation. We recommend the following elements to be present:
525
526 * Description of what the extension does and the features it has (briefly). Provides an overview screenshot if it makes sense.
527 * Usage: explains how to use it
528 * Document each feature with some text but very importantly with a screenshot
529 * Fill the "General Compatibility" section with the minimal version of XWiki your extension requires to be installed
530 * Fill the "Tested On" section with the versions of XWiki you've tested your extension on. Never remove any existing data from this section since they represent past tests and we need to keep the history.
531
532 Make sure to follow the [[Documentation guide>>dev:Community.DocGuide]]. For example take a special care to follow the [[Image best practices>>dev:Community.DocGuide#HScreenshots2FImages]] (use the {{{{{image}}}}} macro and don't take large screenshots as mentioned).
533
534 Make sure that you add documentation for your extension as soon as it's published on [[extensions.xwiki.org>>extensions:Main.WebHome]]. Otherwise nobody is going to start using it and people will start wondering what it's about.
535
536 Generally speaking check out documentation of existing extensions and try to mimic what you see (don't hesitate to go beyond the quality of what you see; you want your extension to be the most used, right? :) Documentation goes a long way towards achieving this!).

Get Connected