Wiki source code of XWiki Contrib

Version 45.1 by Vincent Massol on 2014/05/07 15:33

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 = Requesting a project =
31
32 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).
33
34 = Requesting snapshot builds for your project =
35
36 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.
37
38 Your can ask for your project to be added to the continuous build:
39
40 * First you need to use the xwiki parent pom to have the correct distribution management information:(((
41 {{code language="xml"}}
42 <project>
43 ...
44 <parent>
45 <groupId>org.xwiki.commons</groupId>
46 <artifactId>xwiki-commons-pom</artifactId>
47 <version>See https://github.com/xwiki/xwiki-commons/blob/master/pom.xml</version>
48 </parent>
49 ...
50 </project>
51 {{/code}}
52 )))
53 * 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(((
54 {{code language="none"}}
55 [VOTE] Add myproject to the continuous build
56
57 Hi XWikiers,
58
59 I'm working on myproject and since it's used as a
60 dependency by someotherproject it'd be convenient
61 if it was built continuously.
62
63 Here's my +1.
64
65 Thanks,
66 Me.
67 {{/code}}
68 )))
69
70 = Release the project =
71
72 XWiki.org allows you to release your project on its maven repository as long as you follow the following steps:
73
74 * Use org.xwiki.contrib as groupId in your maven module
75 * Request for an account on http://nexus.xwiki.org on [email protected]
76 * Once you've received your credentials put them in ~~/.m2/settings.xml(((
77 {{code language="xml"}}
78 <settings>
79 ...
80 <servers>
81 ...
82 <server>
83 <id>xwiki-staging</id>
84 <username>username</username>
85 <password>********</password>
86 </server>
87 ...
88 </servers>
89 ...
90 </settings>
91 {{/code}}
92 )))
93 * Put the following configuration in your project pom.xml(((
94 {{code language="xml"}}
95 <project>
96 ...
97 <scm>
98 <connection>scm:git:git://github.com/xwiki-contrib/{extensionrepository}.git</connection>
99 <developerConnection>scm:git:[email protected]:xwiki-contrib/{extensionrepository}.git</developerConnection>
100 <url>https://github.com/xwiki-contrib/{extensionrepository}</url>
101 </scm>
102 ...
103 <distributionManagement>
104 <repository>
105 <id>xwiki-staging</id>
106 <name>XWiki Staging Repository</name>
107 <url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
108 </repository>
109 </distributionManagement>
110 ...
111 </project>
112 {{/code}}
113
114 Where ##{extensionrepository}## is the name of the repository in [[http://github.com/xwiki-contrib/>>http://github.com/xwiki-contrib/]].
115 )))
116 * Release the project with the maven release plugin(((
117 {{code language="none"}}
118 mvn release:prepare
119 {{/code}}
120
121 {{error}}
122 If the project you're releasing is transitively using a version of the Maven Release Plugin < 2.5 and you're using Git 1.9+ then it's going to fail. To avoid this this issue you need to force using version 2.5 of the Maven Release Plugin as follows:
123
124 {{code language="none"}}
125 mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare
126 {{/code}}
127 {{/error}}
128 )))
129 * 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.(((
130
131 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).
132
133 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:
134
135 * Overwrite the settings of the gpg plugin in your pom to disable signing:(((
136 {{code}}
137 <profiles>
138 <profile>
139 <id>release</id>
140 <build>
141 <plugins>
142 <plugin>
143 <groupId>org.apache.maven.plugins</groupId>
144 <artifactId>maven-gpg-plugin</artifactId>
145 <configuration>
146 <skip>true</skip>
147 </configuration>
148 </plugin>
149 </plugins>
150 </build>
151 </profile>
152 </profiles>
153 {{/code}}
154 )))
155 * Configure your setup to sign properly. To do that, you will have to:
156 ** 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 win and/or mac, you can use tools like [[GNUPG>>http://www.coresecure.com/v5/gnupg.html]] or [[GPGTools>>http://www.gpgtools.org/installer/index.html]]. If you don't know what to fill in for the options requested by the tool, keep the defaults.
157 ** 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(((
158 {{code}}
159 ...
160 <profile>
161 <id>xwiki</id>
162 <properties>
163 <gpg.passphrase>PASSWORD</gpg.passphrase>
164 </properties>
165 ...
166 {{/code}}
167 )))
168 )))
169 * You're done now, you can go on releasing(((
170 {{code language="none"}}
171 mvn release:perform
172 {{/code}}
173
174 {{error}}
175 If the project you're releasing is transitively using a version of the Maven Release Plugin < 2.5 and you're using Git 1.9+ then it's going to fail. To avoid this this issue you need to force using version 2.5 of the Maven Release Plugin as follows:
176
177 {{code language="none"}}
178 mvn org.apache.maven.plugins:maven-release-plugin:2.5:perform
179 {{/code}}
180 {{/error}}
181 )))
182 * Note that you'll need to push the changes done by the release plugin: {{code}}git push origin master{{/code}}
183 * Ask for someone to promote your release (ie. make it available on maven.xwiki.org) in the thread you've created earlier
184 * 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
185
186 = Publishing on extensions.xwiki.org =
187
188 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.
189
190 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).
191
192 = Implementing your Maven build =
193
194 {{info}}
195 You can find [[reference documentation for the XAR Plugin>>dev:Community.XARPlugin]].
196 {{/info}}
197
198 Here's an example of how your ##pom.xml## should look like (adapt to your need) if you're contributing an application (XAR):
199
200 {{code language="xml"}}
201 <?xml version="1.0" encoding="UTF-8"?>
202
203 <!--
204 *
205 * See the NOTICE file distributed with this work for additional
206 * information regarding copyright ownership.
207 *
208 * This is free software; you can redistribute it and/or modify it
209 * under the terms of the GNU Lesser General Public License as
210 * published by the Free Software Foundation; either version 2.1 of
211 * the License, or (at your option) any later version.
212 *
213 * This software is distributed in the hope that it will be useful,
214 * but WITHOUT ANY WARRANTY; without even the implied warranty of
215 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
216 * Lesser General Public License for more details.
217 *
218 * You should have received a copy of the GNU Lesser General Public
219 * License along with this software; if not, write to the Free
220 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
221 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
222 *
223 -->
224
225 <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">
226 <modelVersion>4.0.0</modelVersion>
227 <parent>
228 <groupId>org.xwiki.commons</groupId>
229 <artifactId>xwiki-commons-pom</artifactId>
230 <version>4.5</version>
231 </parent>
232 <groupId>org.xwiki.contrib</groupId>
233 <artifactId>your-extension-id</artifactId>
234 <version>1.0-SNAPSHOT</version>
235 <name>Your extension's name</name>
236 <packaging>xar</packaging>
237 <description>Your extension's description</description>
238 <scm>
239 <connection>scm:git:git://github.com/xwiki-contrib/(your extension id).git</connection>
240 <developerConnection>scm:git:[email protected]:xwiki-contrib/(your extension id).git</developerConnection>
241 <url>https://github.com/xwiki-contrib/(your extension id)</url>
242 </scm>
243 <developers>
244 <developer>
245 <id>id of developer 1</id>
246 <name>Full Name of developer 1 as registered on xwiki.org, e.g. Vincent Massol</name>
247 </developer>
248 ...
249 <developer>
250 <id>id of developer N</id>
251 <name>Full Name of developer N as registered on xwiki.org, e.g. Vincent Massol</name>
252 </developer>
253 </developers>
254 <properties>
255 <!-- Don't run CLIRR here since there's no Java code. -->
256 <xwiki.clirr.skip>true</xwiki.clirr.skip>
257 </properties>
258 <build>
259 <!-- Needed to add support for the XAR packaging -->
260 <extensions>
261 <extension>
262 <groupId>org.xwiki.commons</groupId>
263 <artifactId>xwiki-commons-tool-xar-handlers</artifactId>
264 <version>${commons.version}</version>
265 </extension>
266 </extensions>
267 <plugins>
268 <!-- The XAR packaging uses the XAR plugin and thus we need to define what version to use -->
269 <plugin>
270 <groupId>org.xwiki.commons</groupId>
271 <artifactId>xwiki-commons-tool-xar-plugin</artifactId>
272 <version>${commons.version}</version>
273 </plugin>
274 </plugins>
275 </build>
276 <distributionManagement>
277 <repository>
278 <id>xwiki-staging</id>
279 <name>XWiki Staging Repository</name>
280 <url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
281 </repository>
282 </distributionManagement>
283 </project>
284 {{/code}}
285
286 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]]:
287
288 * Extension id
289 * Name
290 * Description
291 * Developers
292
293 You'll also need to set the SCM information since using the Maven Release plugin will require those to be set.
294
295 = Application Design =
296
297 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.
298
299 * 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:(((
300 {{image reference="spaces.png"/}}
301 )))
302 * 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(((
303 {{image reference="hidden.png"/}}
304 )))
305 * Make sure you add a User Interface Extension (UIX) for the Application Panel extension point. This registers your application into the Application Panel:(((
306 {{image reference="applications-panel.png"/}}
307
308 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:
309 {{image reference="application-uix.png"/}}
310
311 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):
312
313 {{code}}
314 {{include document="XWiki.UIExtensionSheet" /}}
315 {{/code}}
316 )))
317
318 = Documenting =
319
320 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.
321
322 Verify the value of the fields filled automatically by the import, namely:
323
324 * The page name
325 * The description
326 * The authors
327
328 If they're wrong you'll need to publish a new version of your extension and re-import it.
329
330 Edit it and provide nice user-friendly documentation. We recommend the following elements to be present:
331
332 * Description of what the extension does and the features it has (briefly). Provides an overview screenshot if it makes sense.
333 * Usage: explains how to use it
334 * Document each feature with some text but very importantly with a screenshot
335 * Fill the Compatibility section with the minimal version of XWiki your extension requires or has been tested with
336
337 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).
338
339 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.
340
341 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