Wiki source code of XWiki Contrib

Version 63.4 by Eduard Moraru on 2014/09/12 13:47

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 The **XWiki Contrib Project** provides hosting for projects related to XWiki. 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 projects is available on the [[##xwiki-contrib## user on GitHub>>https://github.com/organizations/xwiki-contrib]].
10
11 |=Project Name|=What is it?
12 |[[Curriki>>http://www.curriki.org]]|Open Source Curriculum Sharing and Editing based on the XWiki Platform.
13 |[[XWiki Office>>extensions:Extension.XWiki Office]]|MS Office Integration.
14 |[[XWiki Eclipse>>extensions:Extension.XWiki Eclipse]]|Remote/offline browsing of XWiki data in a standalone application or as an Eclipse plugin.
15 |[[XCLAMS>>xclams:Main.WebHome]]|Asset Management System and Social Network software for the Education Community.
16
17 = Hosting tools =
18
19 The project hosting forge can provide contributors with some or all of the following tools :
20
21 * A **GitHub repository**, under http://github.com/xwiki-contrib
22 * 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).
23 * 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.
24 * **Project pages** on extensions.xwiki.org to describe and document the project. When the project reaches a certain visibility and size it can have its own wiki on 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 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! :)
29
30 = Why join XWiki Contrib =
31
32 You could very well develop your XWiki extension in your own GitHub organization and you 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 with a project that request it. Simply send us an email at **##devs AT xwiki.org##** using "**[Contrib]**" at the beginning of your email's subject. Let us know the name and a short description of your project. If your project has already been made available for download on extensions.xwiki.org, please precise 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 listed tools 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 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
47 = Requesting snapshot builds for your project =
48
49 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.
50
51 Your can ask for your project to be added to the continuous build by sending a mail to the devs list:
52
53 * First you need to use the xwiki parent pom to have the correct distribution management information:(((
54 {{code language="xml"}}
55 <project>
56 ...
57 <parent>
58 <groupId>org.xwiki.commons</groupId>
59 <artifactId>xwiki-commons-pom</artifactId>
60 <version>See https://github.com/xwiki/xwiki-commons/blob/master/pom.xml</version>
61 </parent>
62 ...
63 </project>
64 {{/code}}
65 )))
66 * Send a [[vote>>http://dev.xwiki.org/xwiki/bin/view/Community/Committership#HVoting]] on the [email protected] mailing list to discuss the addition of your project in the continuous build(((
67 {{code language="none"}}
68 [VOTE] Add myproject to the continuous build
69
70 Hi XWikiers,
71
72 I'm working on myproject and since it's used as a
73 dependency by someotherproject it'd be convenient
74 if it was built continuously.
75
76 Here's my +1.
77
78 Thanks,
79 Me.
80 {{/code}}
81 )))
82
83 = Release the project =
84
85 XWiki.org allows you to release your project on its maven repository as long as you follow the following steps:
86
87 * Use org.xwiki.contrib as groupId in your maven module
88 * Request for an account on http://nexus.xwiki.org on [email protected]
89 * Once you've received your credentials put them in ~~/.m2/settings.xml(((
90 {{code language="xml"}}
91 <settings>
92 ...
93 <servers>
94 ...
95 <server>
96 <id>xwiki-staging</id>
97 <username>username</username>
98 <password>********</password>
99 </server>
100 ...
101 </servers>
102 ...
103 </settings>
104 {{/code}}
105 )))
106 * Put the following configuration in your project pom.xml(((
107 {{code language="xml"}}
108 <project>
109 ...
110 <scm>
111 <connection>scm:git:git://github.com/xwiki-contrib/{extensionrepository}.git</connection>
112 <developerConnection>scm:git:[email protected]:xwiki-contrib/{extensionrepository}.git</developerConnection>
113 <url>https://github.com/xwiki-contrib/{extensionrepository}</url>
114 </scm>
115 ...
116 <distributionManagement>
117 <repository>
118 <id>xwiki-staging</id>
119 <name>XWiki Staging Repository</name>
120 <url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
121 </repository>
122 </distributionManagement>
123 ...
124 </project>
125 {{/code}}
126
127 Where ##{extensionrepository}## is the name of the repository in http://github.com/xwiki-contrib/.
128 )))
129 * Release the project with the maven release plugin(((
130 {{code language="none"}}
131 mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare
132 {{/code}}
133
134 {{info}}
135 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.
136 {{/info}}
137
138 {{error}}
139 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:
140
141 {{code language="none"}}
142 mvn release:perform -Darguments="-Dxwiki.enforcer.skip=true"
143 {{/code}}
144 {{/error}}
145 )))
146 * In the recent versions of xwiki, we started signing the produced artifacts ([[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.(((
147 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).
148
149 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:
150
151 * Overwrite the settings of the gpg plugin in your pom to disable signing:(((
152 {{code}}
153 <profiles>
154 <profile>
155 <id>release</id>
156 <build>
157 <plugins>
158 <plugin>
159 <groupId>org.apache.maven.plugins</groupId>
160 <artifactId>maven-gpg-plugin</artifactId>
161 <configuration>
162 <skip>true</skip>
163 </configuration>
164 </plugin>
165 </plugins>
166 </build>
167 </profile>
168 </profiles>
169 {{/code}}
170 )))
171 * Configure your setup to sign properly. To do that, you will have to:
172 ** 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.
173 ** 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(((
174 {{code}}
175 ...
176 <profile>
177 <id>xwiki</id>
178 <properties>
179 <gpg.passphrase>PASSWORD</gpg.passphrase>
180 </properties>
181 ...
182 {{/code}}
183 )))
184 )))
185 * You're done now, you can go on releasing(((
186 {{code language="none"}}
187 mvn org.apache.maven.plugins:maven-release-plugin:2.5:perform
188 {{/code}}
189
190 {{info}}
191 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.
192 {{/info}}
193 )))
194 * Note that you'll need to push the changes done by the release plugin: {{code}}git push origin master{{/code}}
195 * Ask for someone (on the devs mailing list or on IRC) to promote 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-sect-managing-staging.html]]. To perform promotion do the following:
196 ** Select the repository to promote in the Staging Repositories list
197 ** Click the "Close" button to close it. Wait a few seconds since it's done asynchronously.
198 ** Make sure to test your extension from the closed staging repo first since a released repo cannot be removed!
199 ** 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.
200 * 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
201 * If your project is using JIRA, release the version in JIRA and add a new version label for the next version.
202 * 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.
203
204 = Publishing on extensions.xwiki.org =
205
206 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.
207
208 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).
209
210 = Implementing your Maven build =
211
212 {{info}}
213 You can find [[reference documentation for the XAR Plugin>>dev:Community.XARPlugin]].
214 {{/info}}
215
216 Here's an example of how your ##pom.xml## should look like (adapt to your need) if you're contributing an application (XAR):
217
218 {{code language="xml"}}
219 <?xml version="1.0" encoding="UTF-8"?>
220
221 <!--
222 *
223 * See the NOTICE file distributed with this work for additional
224 * information regarding copyright ownership.
225 *
226 * This is free software; you can redistribute it and/or modify it
227 * under the terms of the GNU Lesser General Public License as
228 * published by the Free Software Foundation; either version 2.1 of
229 * the License, or (at your option) any later version.
230 *
231 * This software is distributed in the hope that it will be useful,
232 * but WITHOUT ANY WARRANTY; without even the implied warranty of
233 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
234 * Lesser General Public License for more details.
235 *
236 * You should have received a copy of the GNU Lesser General Public
237 * License along with this software; if not, write to the Free
238 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
239 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
240 *
241 -->
242
243 <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">
244 <modelVersion>4.0.0</modelVersion>
245 <parent>
246 <groupId>org.xwiki.commons</groupId>
247 <artifactId>xwiki-commons-pom</artifactId>
248 <version>4.5</version>
249 </parent>
250 <groupId>org.xwiki.contrib</groupId>
251 <artifactId>your-extension-id</artifactId>
252 <version>1.0-SNAPSHOT</version>
253 <name>Your extension's name</name>
254 <packaging>xar</packaging>
255 <description>Your extension's description</description>
256 <scm>
257 <connection>scm:git:git://github.com/xwiki-contrib/(your extension id).git</connection>
258 <developerConnection>scm:git:[email protected]:xwiki-contrib/(your extension id).git</developerConnection>
259 <url>https://github.com/xwiki-contrib/(your extension id)</url>
260 </scm>
261 <developers>
262 <developer>
263 <id>scm id of developer 1</id>
264 <name>Full Name of developer 1 as registered on xwiki.org, e.g. Vincent Massol</name>
265 </developer>
266 ...
267 <developer>
268 <id>scm id of developer N</id>
269 <name>Full Name of developer N as registered on xwiki.org, e.g. Vincent Massol</name>
270 </developer>
271 </developers>
272 <properties>
273 <!-- Don't run CLIRR here since there's no Java code. -->
274 <xwiki.clirr.skip>true</xwiki.clirr.skip>
275 </properties>
276 <build>
277 <!-- Needed to add support for the XAR packaging -->
278 <extensions>
279 <extension>
280 <groupId>org.xwiki.commons</groupId>
281 <artifactId>xwiki-commons-tool-xar-handlers</artifactId>
282 <version>${commons.version}</version>
283 </extension>
284 </extensions>
285 <plugins>
286 <!-- The XAR packaging uses the XAR plugin and thus we need to define what version to use -->
287 <plugin>
288 <groupId>org.xwiki.commons</groupId>
289 <artifactId>xwiki-commons-tool-xar-plugin</artifactId>
290 <version>${commons.version}</version>
291 </plugin>
292 </plugins>
293 </build>
294 <distributionManagement>
295 <repository>
296 <id>xwiki-staging</id>
297 <name>XWiki Staging Repository</name>
298 <url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
299 </repository>
300 </distributionManagement>
301 </project>
302 {{/code}}
303
304 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]]:
305
306 * Extension id
307 * Name
308 * Description
309 * Developers
310
311 You'll also need to set the SCM information since using the Maven Release plugin will require those to be set.
312
313 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##:
314
315 {{code language="xml"}}
316 <properties>
317 ...
318 <!-- Old names of this module used for retro compatibility when resolving dependencies of old extensions -->
319 <xwiki.extension.features>tdelafosse:meeting-application</xwiki.extension.features>
320 ...
321 </properties>
322 {{/code}}
323
324 {{info}}
325 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.
326 {{/info}}
327
328 = Application Design =
329
330 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.
331
332 * 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:(((
333 {{image reference="spaces.png"/}}
334 )))
335 * 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(((
336 {{image reference="hidden.png"/}}
337 )))
338 * Make sure you add a User Interface Extension (UIX) for the Application Panel extension point. This registers your application into the Application Panel:(((
339 {{image reference="applications-panel.png"/}}
340
341 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:
342 {{image reference="application-uix.png"/}}
343
344 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):
345
346 {{code}}
347 {{include document="XWiki.UIExtensionSheet" /}}
348 {{/code}}
349 )))
350
351 = Documenting =
352
353 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.
354
355 {{warning}}
356 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...
357 {{/warning}}
358
359 Verify the value of the fields filled automatically by the import, namely:
360
361 * The page name
362 * The description
363 * The authors
364
365 If they're wrong you'll need to publish a new version of your extension and re-import it.
366
367 Edit it and provide nice user-friendly documentation. We recommend the following elements to be present:
368
369 * Description of what the extension does and the features it has (briefly). Provides an overview screenshot if it makes sense.
370 * Usage: explains how to use it
371 * Document each feature with some text but very importantly with a screenshot
372 * Fill the Compatibility section with the minimal version of XWiki your extension requires or has been tested with
373
374 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).
375
376 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.
377
378 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