Hi everybody, long time no see :D. During the past time, I have finished 2 other interesting tutorials, but this time I have to wait for a release from the eXo Documentation website. As noticed before, I won’t write anymore, instead, video tutorials will replace the old blogs.

Tell you what, this weekend was terrible for me since the weather was quite hot and my desktop was broken. I almost got mad just yesterday because I could not make a video. Maybe, I should wait for my brother bring back my laptop in a month. Sorry for this trouble. Today, this blog comes with a simple guide for how to create an eXo add-on. The detailed steps have been presented on the eXo documentation website at here so you can consult, in this blog, a specific add-on is used for illustration.

Do you know what is an eXo add-on? An eXo add-on is actually a portlet or gadget which complies standards of packaging, installing/uninstalling, and updating add-ons. In this tutorial, I’ll take an existing gadget to illustrate the way to package and deploy it as an add-on. If you have not had its source code yet, clone the project at: https://github.com/lannt-exoer/exo-gadget-auto-slideshow.git

Ok, we’ve already had a runnable gadget and now we will create an add-on from it. An add-on is packaged in a zip file which consists of wars, jars and other resource files. As showed in this tutorial, our gadget was deployed by a jar and a war, follow it to have this jar and war.

After that, compress these 2 files in a zip with name “exo-auto-slideshow-1.0.0”, where “exo-auto-slideshow” will be the add-on’s id and “1.0.0” will be the add-on version. Put this zip into a location such as: D:/add-on-sample/. Having done this step, you have had a complete add-on with its function (presenting images as a slideshow), its id (exo-auto-slideshow) and its version (1.0.0), that’s enough for an add-on.

Now you can locally deploy it into eXo platform. Create a local.json file under Platform_home_folder/add-ons/ with the below content:

[
 {
   "id": "exo-auto-slideshow",
   "version": "1.0.0",
   "name": "Auto image slideshow add-on",
   "description": "An example for how to create an add-on",
   "downloadUrl": "file://D:/add-on-sample/exo-auto-slideshow-1.0.0.zip",
   "vendor": "eXo platform",
   "license": "LGPLv3",
   "supportedDistributions": ["community","enterprise"],
   "supportedApplicationServers": ["tomcat","jboss"]
 }
]

Then, use the CLI to go to the Platform_home_folder and type this command: addon install exo-auto-slideshow:1.0.0

This command starts the eXo add-on manager which will follow the absolute link as indicated in “downloadUrl” of local.json to get the add-on package. This manager will take charge of copying the jars and wars respectively into lib and webapp folder of platform.

When copying is finished, you will see the message informing that you have successfully installed this add-on. Start platform and access to the Application Management -> Gadgets, you will see the gadget named “Memories!” available.

Well done! Now you know what is an eXo add-on and how to create one by yourself.

If you have not successfully installed it, do not hesitate to leave a message for me. 🙂

Advertisements