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 Note that projects not having an active maintainer are moved to the [[Attic>>https://github.com/organizations/xwiki-attic]] (The definition of "active" is left to the community and anyone can propose to move inactive projects to the Attic).
12
13 = Hosting tools =
14
15 The project hosting forge can provide contributors with some or all of the following tools:
16
17 * A **GitHub repository**, under http://github.com/xwiki-contrib
18 * A **JIRA project** for tracking bugs and feature requests, at https://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).
19 * 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.
20 * A **Forum** for your project. Note that for the moment, all the projects share the [[Development category of the forum>>https://forum.xwiki.org/c/Dev]].
21 * **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.
22 * A **CI job** on http://ci.xwiki.org for building the project automatically on each commit (more specifically see [[XWiki Contrib jobs>>http://ci.xwiki.org/view/Contrib/job/XWiki%20Contrib/]]).
23 * A **Sonar project report** on http://sonar.xwiki.org to analyze the project's quality with various metrics.
24 * **Translations**, under the [[l10n platform>>http://l10n.xwiki.org]].
25
26 = Contributing to an existing project =
27
28 If you're interested to contribute to an existing project on http://github.com/xwiki-contrib, please send a post to the [[Forum (dev category)>>https://forum.xwiki.org/c/Dev]], 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! :)
29
30 = Why join XWiki Contrib =
31
32 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:
33
34 * 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.
35 * 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).
36 * You get some tools setup for your project (GitHub repository, Issue tracker, Wiki pages)
37
38 = Requesting a project =
39
40 The contrib project is open for anyone who wish to start a new project. Simply send a post on the [[Forum (dev category)>>https://forum.xwiki.org/c/Dev]] using the ##contrib## in your post. 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).
41
42 == Choosing the name ==
43
44 When picking the GitHub name please follow the existing conventions:
45
46 * ##application-<xxx>## for apps
47 * ##macro-<xxx>## for macros only (if you project provides a macro but also provides other wiki pages then it's considered an app)
48 * ##api-<xxx>## for APIs only (same as for macro, if it contains UI as well, then you should call it an app instead)
49 * ##displayer-<xxx>## for custom displayers
50 * ##syntax-<xxx>## for rendering syntaxes
51 * ##authenticator-<xxx>## for authenticators
52 * ##skin-<xxx>## for skins
53
54 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.
55
56 Special cases:
57
58 * ##icon-themes##. This is a reserved name and it's also the name of a [[special repository containing all Icon Themes>>>https://github.com/xwiki-contrib/icon-themes]]. If you want to contribute a new Icon theme, you should add a new ##icon-theme-<yyy>## directory in this repository. We release all Icon Themes together with the same version as we consider them too small to be released separately.
59 * ##color-themes##. This is a reserved name and it's also the name of a [[special repository containing all Color Themes>>>https://github.com/xwiki-contrib/color-themes]]. If you want to contribute a new Color theme, you should add a new ##color-theme-<yyy>## directory in this repository. We release all Color Themes together with the same version as we consider them too small to be released separately.
60
61 //Hint//: When in doubt, have a look at [[existing repository names>>https://github.com/xwiki-contrib]] for inspiration.
62
63 Please try to avoid using the ##xwiki-## prefix since this one is used by XWiki GitHub organization repositories (i.e. Core modules).
64
65 == README.md Template ==
66
67 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:
68
69 {{code language="none"}}
70 # <Pretty name of Extension, e.g. Flash Messages Application>
71
72 <Short Description of Extension, taken from the description element in the pom.xml>
73
74 * Project Lead: [<info taken from the jira project, e.g. Vincent Massol>](<url to user profile on xwiki.org)
75 <if single extension page>
76 * [Documentation & Download](<url on e.x.o, e.g. http://extensions.xwiki.org/xwiki/bin/view/Extension/Flash+messages+application>)
77 </if single extension page>
78 <if several extension pages>
79 * Documentation & Downloads:
80 * [<pretty name of page1, e.g. My App API](<url1 on e.x.o)
81 ...
82 * [<pretty name of pageN, e.g. My App API](<urlN on e.x.o)
83 </if several extension pages>
84 * [Issue Tracker](<url on jira.xwiki.org, e.g. https://jira.xwiki.org/browse/XAFLASHM>)
85 * Communication: [Forum](<url, e.g. https://forum.xwiki.org/c/Devs>), [IRC](<url, e.g. http://dev.xwiki.org/xwiki/bin/view/Community/IRC>)
86 <if link pointing to all dev practices>
87 * [Development Practices](<URL pointing to a site defining the list of practices to be followed by contributors when contributing on this project>)
88 </if link pointing to all dev practices>
89 <if no single link pointing to all dev practices>
90 * Development Practices:
91 * <best practice 1, possibly with some link>
92 ...
93 * <best practice N, possibly with some link>
94 </if no single link pointing to all dev practices>
95 * Minimal XWiki version supported: <taken from the pom.xml, e.g. XWiki 6.4.7>
96 * License: <license,taken from the pom.xml, e.g. LGPL 2.1>.
97 <if translation is used>
98 * [Translations](<url on l10n to translations for this extension>)
99 </if translation is used>
100 <if translation is not used>
101 * Translations: N/A
102 </if translation is not used>
103 <if sonar is used>
104 * [Sonar Dashboard](<url to the project’s dashboard on sonar.xwiki.org, e.g. http://sonar.xwiki.org/dashboard/index/10464>)
105 </if sonar is used>
106 <if sonar is not used>
107 * Sonar Dashboard: N/A
108 </if sonar is not used>
109 <if ci is used>
110 * Continuous Integration Status: [![Build Status](http://ci.xwiki.org/job/XWiki%20Contrib/job/<job name on ci.xwiki.org>/job/master/badge/icon)](http://ci.xwiki.org/job/XWiki%20Contrib/job/<job name on ci.xwiki.org>/job/master/)
111 </if ci is used>
112 <if ci is not used>
113 * Continuous Integration Status: N/A
114 </if ci is not used>
115
116 <optional>
117 ## Whatever
118 ...
119 </optional>
120 {{/code}}
121
122 Here's [[an example>>https://github.com/xwiki-contrib/application-antispam/blob/master/README.md]].
123
124 {{info}}
125 In order to find the build status URL for the badges, you should navigate to your project on ci.xwiki.org and then click on the "Embeddable Build Status" link ([[example>>http://ci.xwiki.org/view/Contrib/job/XWiki%20Contrib/job/application-antispam/job/master/badge/]]). Use the "Markdown (with view)" and "unprotected" links.
126 {{/info}}
127
128 == For XWiki Admins ==
129
130 You have to create 2 things:
131
132 * A GitHub repository
133 * a JIRA project
134
135 === GitHub Repository Creation ===
136
137 When creating a new ##xwiki-contrib## repository on GitHub please make sure to:
138
139 * Uncheck the "wiki" and "issues" checkboxes in the settings
140 * Add the ##xwikiorg## group in the Collaborators settings. Make sure to select the "Write" permission (it's "Read" by default).
141 * Add an email service pointing to notifications AT xwiki DOT org for notifications
142 * 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}}.
143
144 === JIRA Project Creation ===
145
146 * Go to the [[JIRA project view>>https://jira.xwiki.org/secure/project/ViewProjects.jspa]]
147 * Click "Create Project" and select "Create with shared configuration" as on:(((
148 {{image reference="jira.png" width="350px"/}}
149 )))
150 * Select the "LATEX" project to copy the config from since it's one project that is known to have the right config.
151 * After it's been created it's nice to add a ##1.0## version
152 * Also make sure to check that the Category is set to "XWiki Contributed Projects - Others" (it's located in "Details" or simply click "Edit" on the [[JIRA project view>>https://jira.xwiki.org/secure/project/ViewProjects.jspa]]).
153
154 ==== Permissions, Groups & Roles ====
155
156 * Contrib committers (##xwiki-contrib## GitHub Organization) must be added to the ##contrib-committers## group
157 * XWiki committers (##xwiki## GitHub organization) must be added to the ##xwiki-committers## group
158
159 When you copy the LATEX jira project you inherit from these rules:
160
161 * Projects must have the ##Committers## role be including ##contrib-committers## and ##xwiki-committers## groups
162 * Projects must have the ##contrib-committers## and ##xwiki-committers## groups added to the ##Administrators## role so that Contrib & XWiki committers can release the projects in JIRA (in addition to being able to release at the SCM level).
163 * Project permissions must be using the ##Committers## role to decide what user are allowed to access.
164 * TODO: Add rules about special contributors.
165
166 = Requesting CI / Snapshot builds for your project =
167
168 XWiki.org has a [[continuous build>>dev:Community.ContinuousBuild]] which builds maven projects each time they are modified on GitHub and put the resulting artifact in our [[snapshots Maven repository>>http://nexus.xwiki.org/nexus/content/groups/public-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.
169
170 To have your project added to the continuous build follow thes steps:
171
172 * First you need to use the XWiki parent pom to have the correct distribution management information. For example for a projects depending on ##xwiki-platform## (See [[Parent POM>>https://github.com/xwiki-contrib/parent]] for more details):(((
173 {{code language="xml"}}
174 <project>
175 ...
176 <parent>
177 <groupId>org.xwiki.contrib</groupId>
178 <artifactId>parent-platform</artifactId>
179 <version>see the building section below to choose the version</version>
180 </parent>
181 ...
182 </project>
183 {{/code}}
184 )))
185 * Add a [[##Jenkinsfile##>>https://jenkins.io/doc/book/pipeline/jenkinsfile/]] to the root of your module. Here's a simple example that should work fine:(((
186 {{code language="groovy"}}
187 /*
188 * See the NOTICE file distributed with this work for additional
189 * information regarding copyright ownership.
190 *
191 * This is free software; you can redistribute it and/or modify it
192 * under the terms of the GNU Lesser General Public License as
193 * published by the Free Software Foundation; either version 2.1 of
194 * the License, or (at your option) any later version.
195 *
196 * This software is distributed in the hope that it will be useful,
197 * but WITHOUT ANY WARRANTY; without even the implied warranty of
198 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
199 * Lesser General Public License for more details.
200 *
201 * You should have received a copy of the GNU Lesser General Public
202 * License along with this software; if not, write to the Free
203 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
204 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
205 */
206
207 // It's assumed that Jenkins has been configured to implicitly load the vars/xwikiModule.groovy library which exposes
208 // the "xwikiModule" global function/DSL.
209 // Note that the version used is the one defined in Jenkins but it can be overridden as follows:
210 // @Library("[email protected]<branch, tag, sha1>") _
211 // See https://github.com/jenkinsci/workflow-cps-global-lib-plugin for details.
212
213 xwikiModule {
214 }
215 {{/code}}
216
217 If you wish to see what this ##Jenkinsfile## will do and how to configure it, check the [[xwikiModule source code>>https://github.com/xwiki/xwiki-jenkins-pipeline/blob/master/vars/xwikiModule.groovy]].
218 )))
219
220 {{warning}}
221 At the moment, we still need to trigger a rescan of the GitHub organization to make a new project appear on the [[CI page for XWiki Contrib>>http://ci.xwiki.org/view/Contrib/job/XWiki%20Contrib/]]. Please ping a dev on IRC or on the [[Forum>>https://forum.xwiki.org/c/Dev]].
222 {{/warning}}
223
224 = Release the project =
225
226 There are 3 main steps to release your project:
227
228 {{toc scope="local"/}}
229
230 == JIRA Release ==
231
232 * If your project is using JIRA, release the version in JIRA and add a new version label for the next version.
233 * If you're using a [[Contrib Parent POM>>https://github.com/xwiki-contrib/parent]] then you can configure your POM to [[auto-release on JIRA>>https://github.com/xwiki-contrib/parent#enable-automatic-jira-release]].
234
235 == Release using Maven ==
236
237 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:
238
239 * Use ##org.xwiki.contrib## as ##groupId## in your maven module
240 * Request for an account on [[Nexus>>http://nexus.xwiki.org]] by sending a post on the [[Forum>>https://forum.xwiki.org/c/Dev]], mentioning the username you'd wish to have (you could also mention which extension you're planning to release to provide contextual information).
241 * Once you've received your credentials put them in(((
242 ##~~/.m2/settings.xml##
243
244 {{code language="xml"}}
245 <settings>
246 ...
247 <servers>
248 ...
249 <server>
250 <id>xwiki-staging</id>
251 <username>username</username>
252 <password>********</password>
253 </server>
254 ...
255 </servers>
256 ...
257 </settings>
258 {{/code}}
259 )))
260 * If you're using a [[Contrib Parent>>https://github.com/xwiki-contrib/parent]] in your POM under ##<parent>## and if you have configured the JIRA plugin to do automatic releases, make sure to also [[update your ##settings.xml## with JIRA credentials>>https://github.com/xwiki-contrib/parent#enable-automatic-jira-release]].
261 * Put the following configuration in your project(((
262 ##pom.xml##
263
264 {{code language="xml"}}
265 <project>
266 ...
267 <scm>
268 <connection>scm:git:git://github.com/xwiki-contrib/{extensionrepository}.git</connection>
269 <developerConnection>scm:git:[email protected]:xwiki-contrib/{extensionrepository}.git</developerConnection>
270 <url>https://github.com/xwiki-contrib/{extensionrepository}/tree/master</url>
271 </scm>
272 ...
273 </project>
274 {{/code}}
275
276 Where ##{extensionrepository}## is the name of the repository in [[http://github.com/xwiki-contrib/]].
277 )))
278 * Release the project with the maven release plugin (notice the ##integration-tests## profile that is needed when there are functional tests but that you should always use since it doesn't harm)(((
279 {{code language="none"}}
280 mvn release:prepare -Pintegration-tests -Darguments="-DskipTests" -DskipTests
281 {{/code}}
282
283 {{warning}}
284 If you want to skip the enforcer plugin, use:
285
286 {{code language="none"}}
287 mvn release:prepare -Pintegration-tests -Darguments="-DskipTests -Dxwiki.enforcer.skip=true" -DskipTests
288 {{/code}}
289 {{/warning}}
290 )))
291 * 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.(((
292 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).
293
294 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:
295
296 * Overwrite the settings of the gpg plugin in your pom to disable signing:(((
297 {{code}}
298 <profiles>
299 <profile>
300 <id>release</id>
301 <build>
302 <plugins>
303 <plugin>
304 <groupId>org.apache.maven.plugins</groupId>
305 <artifactId>maven-gpg-plugin</artifactId>
306 <configuration>
307 <skip>true</skip>
308 </configuration>
309 </plugin>
310 </plugins>
311 </build>
312 </profile>
313 </profiles>
314 {{/code}}
315 )))
316 * Configure your setup to sign properly. To do that, you will have to:
317 ** 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.
318 ** 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(((
319 {{code}}
320 ...
321 <profile>
322 <id>xwiki</id>
323 <properties>
324 <gpg.passphrase>PASSWORD</gpg.passphrase>
325 </properties>
326 ...
327 {{/code}}
328 )))
329 )))
330 * You're done now, you can go on releasing(((
331 {{code language="none"}}
332 mvn release:perform
333 {{/code}}
334
335 {{info}}
336 On Windows you can use this command to successfully perform the release:
337
338 {{code language="none"}}
339 mvn release:perform -Darguments="-Dgpg.passphrase="YourGpg4winPassword" -Dxwiki.enforcer.skip=true"
340 {{/code}}
341
342 but be careful to replace "YourGpg4winPassword" with the actual password chosen when creating a GPG key with [[Gpg4win>>http://www.gpg4win.org/]].
343 {{/info}}
344
345 {{info}}
346
347 On Windows, when you have this issue:
348
349 {{code language="none"}}
350 gpg: no default secret key: secret key not available
351 gpg: signing failed: secret key not available
352 {{/code}}
353
354 * Add this to your settings.xml:
355
356 {{code}}
357 ...
358 <profile>
359 <id>xwiki</id>
360 <properties>
361 <gpg.keyname>your_user_id</gpg.keyname>
362 <gpg.homedir>path_to_your_key</gpg.homedir>
363 <gpg.passphrase>PASSWORD</gpg.passphrase>
364 </properties>
365 ...
366 {{/code}}
367
368 {{/info}}
369
370 {{info}}
371 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.
372 {{/info}}
373
374 {{warning}}
375 If the application has also a special module that execute UI tests and you want to release the modules, but not run the tests, you should:
376
377 {{code language="none"}}
378 mvn release:perform -Pintegration-tests -Darguments="-DskipTests -Pintegration-tests" -DskipTests
379 {{/code}}
380
381 {{/warning}}
382 )))
383 * Note that you'll need to push the changes done by the release plugin: {{code}}git push origin master{{/code}}
384 * By default the extension will be automatically released on ##nexus.xwiki.org##. In case you have configured your extension's POM so that it's not the case then ask for someone (on the [[Forum>>https://forum.xwiki.org/c/Dev]] or on IRC) to validate your release from the staging repository on [[Nexus>>http://nexus.xwiki.org]] to make your extension available on ##nexus.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:
385 ** Select the repository to validate in the Staging Repositories list
386 ** Click the "Close" button to close it. Wait a few seconds since it's done asynchronously.
387 ** Make sure to test your extension from the closed staging repo first since a released repo cannot be removed!
388 ** 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.
389 * After that your release will be available for download on ##nexus.xwiki.org## and anyone will be able to use it as a dependency for his own project
390
391 == Documentation ==
392
393 * 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 sections for more.
394 * Announce the new release on the [[Forum>>https://forum.xwiki.org/c/News]] (in the News category).
395
396 = Recovering from a failed Release =
397
398 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! :)
399
400 To rollback you need to call the following:
401
402 {{code language="none"}}
403 mvn release:rollback
404 {{/code}}
405
406 {{warning}}
407 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 see the rollback call you will still need to perform step 2 of the manual process below.
408 {{/warning}}
409
410 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]]:
411
412 * Rollback the changes done by the ##release:prepare## call by reverting the changes in Git
413 * Remove the local and remote tag created by the ##release:prepare## call ({{code language="none"}}git tag --delete the_local_tag{{/code}} and {{code language="none"}}git push origin :the_remote_tag{{/code}}).
414
415 = Publishing on extensions.xwiki.org =
416
417 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.
418
419 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).
420
421 {{info}}
422 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.
423 {{/info}}
424
425 = Implementing your Maven build =
426
427 See [[Building a XAR with Maven>>platform:DevGuide.CreatingExtensions.WebHome#HBuildingaXARwithMaven]].
428
429 = Application Design =
430
431 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.
432
433 * 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:(((
434 {{image reference="spaces.png"/}}
435 )))
436 * 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(((
437 {{image reference="hidden.png"/}}
438 )))
439 * Make sure you add a User Interface Extension (UIX) for the Application Panel extension point. This registers your application into the Application Panel:(((
440 {{image reference="applications-panel.png"/}}
441
442 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:
443 {{image reference="application-uix.png"/}}
444
445 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):
446
447 {{code}}
448 {{include document="XWiki.UIExtensionSheet" /}}
449 {{/code}}
450 )))
451
452 = Documenting =
453
454 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.
455
456 {{warning}}
457 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...
458 {{/warning}}
459
460 Verify the value of the fields filled automatically by the import, namely:
461
462 * The page name
463 * The description
464 * The authors
465
466 If they're wrong you'll need to publish a new version of your extension and re-import it.
467
468 Edit it and provide nice user-friendly documentation. We recommend the following elements to be present:
469
470 * Description of what the extension does and the features it has (briefly). Provides an overview screenshot if it makes sense.
471 * Usage: explains how to use it
472 * Document each feature with some text but very importantly with a screenshot
473 * Fill the "General Compatibility" section with the minimal version of XWiki your extension requires to be installed
474 * 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.
475
476 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).
477
478 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.
479
480 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