Wiki source code of XWiki Contrib

Version 83.1 by Thomas Mortagne on 2016/05/11 11:21

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
49 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.
50
51 //Hint//: When in doubt, have a look at [[existing repository names>>https://github.com/xwiki-contrib]] for inspiration.
52
53 == README.md Template ==
54
55 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:
56
57 {{code language="none"}}
58 # <Pretty name of Extension, e.g. Flash Messages Application>
59
60 <Short Description of Extension, taken from the description element in the pom.xml>
61
62 * Project Lead: [<info taken from the jira project, e.g. Vincent Massol>](<url to user profile on xwiki.org)
63 <if single extension page>
64 * [Documentation & Download](<url on e.x.o, e.g. http://extensions.xwiki.org/xwiki/bin/view/Extension/Flash+messages+application>)
65 </if single extension page>
66 <if several extension pages>
67 * Documentation & Downloads:
68 ** [<pretty name of page1, e.g. My App API](<url1 on e.x.o)
69 ...
70 ** [<pretty name of pageN, e.g. My App API](<urlN on e.x.o)
71 </if several extension pages>
72 * [Issue Tracker](<url on jira.xwiki.org, e.g. http://jira.xwiki.org/browse/XAFLASHM>)
73 * 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>)
74 <if link pointing to all dev practices>
75 * [Development Practices](<URL pointing to a site defining the list of practices to be followed by contributors when contributing on this project>)
76 </if link pointing to all dev practices>
77 <if no single link pointing to all dev practices>
78 * Development Practices:
79 ** <best practice 1, possibly with some link>
80 ...
81 ** <best practice N, possibly with some link>
82 </if no single link pointing to all dev practices>
83 * Minimal XWiki version supported: <taken from the pom.xml, e.g. XWiki 6.4.7>
84 * License: <license,taken from the pom.xml, e.g. LGPL 2.1>.
85 <if translation is used>
86 * [Translations](<url on l10n to translations for this extension>)
87 </if translation is used>
88 <if translation is not used>
89 * Translations: N/A
90 </if translation is not used>
91 <if sonar is used>
92 * [Sonar Dashboard](<url to the project’s dashboard on sonar.xwiki.org, e.g. http://sonar.xwiki.org/dashboard/index/10464>)
93 </if sonar is used>
94 <if sonar is not used>
95 * Sonar Dashboard: N/A
96 </if sonar is not used>
97 <if ci is used>
98 * 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>/)
99 </if ci is used>
100 <if ci is not used>
101 * Continuous Integration Status: N/A
102 </if ci is not used>
103
104 <optional>
105 ## Whatever
106 ...
107 </optional>
108 {{/code}}
109
110 Here's [[an example>>https://github.com/xwiki-contrib/application-antispam/blob/master/README.md]].
111
112 == For ##xwiki-contrib## GitHub Admins ==
113
114 When creating a new ##xwiki-contrib## repository on GitHub please make sure to:
115
116 * Uncheck the "wiki" and "issues" checkboxes in the settings
117 * Add the ##xwikiorg## group in the Collaborators settings
118 * Add an email service pointing to notifications AT xwiki DOT org for notifications
119 * 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}}.
120
121 = Requesting snapshot builds for your project =
122
123 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.
124
125 Your can ask for your project to be added to the continuous build by sending a mail to the devs list:
126
127 * First you need to use the XWiki parent pom to have the correct distribution management information:(((
128 {{code language="xml"}}
129 <project>
130 ...
131 <parent>
132 <groupId>org.xwiki.commons</groupId>
133 <artifactId>xwiki-commons-pom</artifactId>
134 <version>see the building section below to choose the version</version>
135 </parent>
136 ...
137 </project>
138 {{/code}}
139 )))
140 * [[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:(((
141 {{code language="none"}}
142 [Contrib] Add <myproject> to the CI
143
144 Hi XWikiers,
145
146 I'm working on <myproject> and I'd like to have it built by XWiki.org's CI. Could it be added?
147
148 Thanks,
149 <your name>
150 {{/code}}
151 )))
152
153 = Release the project =
154
155 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:
156
157 * Use ##org.xwiki.contrib## as ##groupId## in your maven module
158 * 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).
159 * Once you've received your credentials put them in (((
160 ~~/.m2/settings.xml##{{code language="xml"}}
161 <settings>
162 ...
163 <servers>
164 ...
165 <server>
166 <id>xwiki-staging</id>
167 <username>username</username>
168 <password>********</password>
169 </server>
170 ...
171 </servers>
172 ...
173 </settings>
174 {{/code}}##
175 )))
176 * Put the following configuration in your project (((
177 pom.xml
178
179 {{code language="xml"}}
180 <project>
181 ...
182 <scm>
183 <connection>scm:git:git://github.com/xwiki-contrib/{extensionrepository}.git</connection>
184 <developerConnection>scm:git:[email protected]:xwiki-contrib/{extensionrepository}.git</developerConnection>
185 <url>https://github.com/xwiki-contrib/{extensionrepository}</url>
186 </scm>
187 ...
188 <distributionManagement>
189 <repository>
190 <id>xwiki-staging</id>
191 <name>XWiki Staging Repository</name>
192 <url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
193 </repository>
194 </distributionManagement>
195 ...
196 </project>
197 {{/code}}####Where ##{extensionrepository}## is the name of the repository in http://github.com/xwiki-contrib/.
198 )))
199 * Release the project with the maven release plugin(((
200 {{code language="none"}}
201 mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare
202 {{/code}}
203
204 {{info}}
205 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.
206 {{/info}}
207
208 {{error}}
209 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:
210
211 {{code language="none"}}
212 mvn release:perform -Darguments="-Dxwiki.enforcer.skip=true"
213 {{/code}}
214 {{/error}}
215
216 {{warning}}
217 If the application has also tests and you want to release the modules, but not run the tests, you should:
218
219 {{code language="none"}}
220 mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare -Pintegration-tests -Darguments="-DskipTests" -DskipTests
221 {{/code}}
222
223 If you want to skip the enforcer plugin, use:
224
225 {{code language="none"}}
226 mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare -Pintegration-tests -Darguments="-DskipTests -Dxwiki.enforcer.skip=true" -DskipTests
227 {{/code}}
228
229 {{/warning}}
230 )))
231 * 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.(((
232 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).
233
234 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:
235
236 * Overwrite the settings of the gpg plugin in your pom to disable signing:(((
237 {{code}}
238 <profiles>
239 <profile>
240 <id>release</id>
241 <build>
242 <plugins>
243 <plugin>
244 <groupId>org.apache.maven.plugins</groupId>
245 <artifactId>maven-gpg-plugin</artifactId>
246 <configuration>
247 <skip>true</skip>
248 </configuration>
249 </plugin>
250 </plugins>
251 </build>
252 </profile>
253 </profiles>
254 {{/code}}
255 )))
256 * Configure your setup to sign properly. To do that, you will have to:
257 ** 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.
258 ** 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(((
259 {{code}}
260 ...
261 <profile>
262 <id>xwiki</id>
263 <properties>
264 <gpg.passphrase>PASSWORD</gpg.passphrase>
265 </properties>
266 ...
267 {{/code}}
268 )))
269 )))
270 * You're done now, you can go on releasing(((
271 {{code language="none"}}
272 mvn org.apache.maven.plugins:maven-release-plugin:2.5:perform
273 {{/code}}
274
275 {{info}}
276 On Windows you can use this command to successfully perform the release:
277
278 {{code language="none"}}
279 mvn org.apache.maven.plugins:maven-release-plugin:2.5:perform -Darguments="-Dgpg.passphrase="YourGpg4winPassword" -Dxwiki.enforcer.skip=true"
280 {{/code}}
281
282 but be careful to replace "YourGpg4winPassword" with the actual password chosen when creating a GPG key with [[Gpg4win>>http://www.gpg4win.org/]].
283
284 {{/info}}
285
286 {{info}}
287
288 On Windows, when you have this issue:
289
290 {{code language="none"}}
291 gpg: no default secret key: secret key not available
292 gpg: signing failed: secret key not available
293 {{/code}}
294
295 * Add this to your settings.xml:
296
297 {{code}}
298 ...
299 <profile>
300 <id>xwiki</id>
301 <properties>
302 <gpg.keyname>your_user_id</gpg.keyname>
303 <gpg.homedir>path_to_your_key</gpg.homedir>
304 <gpg.passphrase>PASSWORD</gpg.passphrase>
305 </properties>
306 ...
307 {{/code}}
308
309 {{/info}}
310
311 {{info}}
312 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.
313 {{/info}}
314
315 {{warning}}
316 If the application has also tests and you want to release the modules, but not run the tests, you should:
317
318 {{code language="none"}}
319 mvn org.apache.maven.plugins:maven-release-plugin:2.5:perform -Pintegration-tests -Darguments="-DskipTests -Pintegration-tests" -DskipTests
320 {{/code}}
321
322 {{/warning}}
323 )))
324 * Note that you'll need to push the changes done by the release plugin: {{code}}git push origin master{{/code}}
325 * 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:
326 ** Select the repository to validate in the Staging Repositories list
327 ** Click the "Close" button to close it. Wait a few seconds since it's done asynchronously.
328 ** Make sure to test your extension from the closed staging repo first since a released repo cannot be removed!
329 ** 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.
330 * 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
331 * If your project is using JIRA, release the version in JIRA and add a new version label for the next version.
332 * 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.
333
334 = Recovering from a failed Release =
335
336 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! :)
337
338 To rollback you need to call the following:
339
340 {{code language="none"}}
341 mvn org.apache.maven.plugins:maven-release-plugin:2.5:rollback
342 {{/code}}
343
344 {{warning}}
345 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.
346 {{/warning}}
347
348 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]]:
349
350 * Rollback the changes done by the ##release:prepare## call by reverting the changes in Git
351 * 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}}).
352
353 = Publishing on extensions.xwiki.org =
354
355 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.
356
357 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).
358
359 {{info}}
360 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.
361 {{/info}}
362
363 = Implementing your Maven build =
364
365 {{info}}
366 You can find [[reference documentation for the XAR Plugin>>dev:Community.XARPlugin]].
367 {{/info}}
368
369 Here's an example of how your ##pom.xml## should look like (adapt to your need) if you're contributing an application (XAR):
370
371 {{code language="xml"}}
372 <?xml version="1.0" encoding="UTF-8"?>
373
374 <!--
375 *
376 * See the NOTICE file distributed with this work for additional
377 * information regarding copyright ownership.
378 *
379 * This is free software; you can redistribute it and/or modify it
380 * under the terms of the GNU Lesser General Public License as
381 * published by the Free Software Foundation; either version 2.1 of
382 * the License, or (at your option) any later version.
383 *
384 * This software is distributed in the hope that it will be useful,
385 * but WITHOUT ANY WARRANTY; without even the implied warranty of
386 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
387 * Lesser General Public License for more details.
388 *
389 * You should have received a copy of the GNU Lesser General Public
390 * License along with this software; if not, write to the Free
391 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
392 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
393 *
394 -->
395
396 <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">
397 <modelVersion>4.0.0</modelVersion>
398 <parent>
399 <groupId>org.xwiki.commons</groupId>
400 <artifactId>xwiki-commons-pom</artifactId>
401 <version>4.5</version>
402 </parent>
403 <groupId>org.xwiki.contrib</groupId>
404 <artifactId>your-extension-id</artifactId>
405 <version>1.0-SNAPSHOT</version>
406 <name>Your extension's name</name>
407 <packaging>xar</packaging>
408 <description>Your extension's description</description>
409 <scm>
410 <connection>scm:git:git://github.com/xwiki-contrib/(your extension id).git</connection>
411 <developerConnection>scm:git:[email protected]:xwiki-contrib/(your extension id).git</developerConnection>
412 <url>https://github.com/xwiki-contrib/(your extension id)</url>
413 </scm>
414 <developers>
415 <developer>
416 <id>scm id of developer 1</id>
417 <name>Full Name of developer 1 as registered on xwiki.org, e.g. Vincent Massol</name>
418 </developer>
419 ...
420 <developer>
421 <id>scm id of developer N</id>
422 <name>Full Name of developer N as registered on xwiki.org, e.g. Vincent Massol</name>
423 </developer>
424 </developers>
425 <properties>
426 <!-- Don't check for API backward-compatibility here since there's no Java code. -->
427 If you're using a xwiki-commons parent POM that is >= 8.1M1 then you need to use:
428 <xwiki.revapi.skip>true</xwiki.revapi.skip>
429 Otherwise you should use:
430 <xwiki.clirr.skip>true</xwiki.clirr.skip>
431 <!-- The Extension name. If not defined, the <name> property is used -->
432 <xwiki.extension.name>Your extension's name</xwiki.extension.name>
433 <!-- The extension's category -->
434 <xwiki.extension.category>application</xwiki.extension.category>
435 </properties>
436 <build>
437 <!-- Needed to add support for the XAR packaging -->
438 <extensions>
439 <extension>
440 <groupId>org.xwiki.commons</groupId>
441 <artifactId>xwiki-commons-tool-xar-handlers</artifactId>
442 <version>${commons.version}</version>
443 </extension>
444 </extensions>
445 <plugins>
446 <!-- The XAR packaging uses the XAR plugin and thus we need to define what version to use -->
447 <plugin>
448 <groupId>org.xwiki.commons</groupId>
449 <artifactId>xwiki-commons-tool-xar-plugin</artifactId>
450 <version>${commons.version}</version>
451 </plugin>
452 </plugins>
453 </build>
454 <distributionManagement>
455 <repository>
456 <id>xwiki-staging</id>
457 <name>XWiki Staging Repository</name>
458 <url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
459 </repository>
460 </distributionManagement>
461 <issueManagement>
462 <system>jira</system>
463 <url>http://jira.xwiki.org/jira/browse/(your jira project id)</url>
464 </issueManagement>
465 </project>
466 {{/code}}
467
468 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]]:
469
470 * Extension id
471 * Name
472 * Description
473 * Developers
474 * {{info}}New{{/info}} Category (using ##<xwiki.extension.category>##). Valid values are [[listed here>>extensions:Extension.Repository Application#HCategories]].
475 * {{info}}New{{/info}} SCM
476 * {{info}}New{{/info}} Issue Management
477
478 You'll also need to set the SCM information since using the Maven Release plugin will require those to be set.
479
480 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##:
481
482 {{code language="xml"}}
483 <properties>
484 ...
485 <!-- Old names of this module used for retro compatibility when resolving dependencies of old extensions -->
486 <xwiki.extension.features>tdelafosse:meeting-application</xwiki.extension.features>
487 ...
488 </properties>
489 {{/code}}
490
491 {{info}}
492 In addition you need to pay attention to the version of the dependencies you're going to use (for example the parent POM dependency to ##org.xwiki.commons:xwiki-commons-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.
493 {{/info}}
494
495 = Application Design =
496
497 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.
498
499 * 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:(((
500 {{image reference="spaces.png"/}}
501 )))
502 * 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(((
503 {{image reference="hidden.png"/}}
504 )))
505 * Make sure you add a User Interface Extension (UIX) for the Application Panel extension point. This registers your application into the Application Panel:(((
506 {{image reference="applications-panel.png"/}}
507
508 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:
509 {{image reference="application-uix.png"/}}
510
511 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):
512
513 {{code}}
514 {{include document="XWiki.UIExtensionSheet" /}}
515 {{/code}}
516 )))
517
518 = Documenting =
519
520 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.
521
522 {{warning}}
523 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...
524 {{/warning}}
525
526 Verify the value of the fields filled automatically by the import, namely:
527
528 * The page name
529 * The description
530 * The authors
531
532 If they're wrong you'll need to publish a new version of your extension and re-import it.
533
534 Edit it and provide nice user-friendly documentation. We recommend the following elements to be present:
535
536 * Description of what the extension does and the features it has (briefly). Provides an overview screenshot if it makes sense.
537 * Usage: explains how to use it
538 * Document each feature with some text but very importantly with a screenshot
539 * Fill the "General Compatibility" section with the minimal version of XWiki your extension requires to be installed
540 * 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.
541
542 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).
543
544 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.
545
546 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