Plugin Gadgets - Integration manual v1.3.0, v1.4.0, v1.5.0

  1. Installation
  2. Gadget library
    1. Example
    2. UWA gadgets
    3. I-frame containing a custom gadget
  3. End of integration


  • Stop the server
  • Download jars from plugin and add them (ametys-plugin-gadgets-1.3.0.jar and ametys- plugin-gadgets-resources-1 .3.0.jar) to your application's WEB-INF/lib directory. Ametys

  • plugin requires a number of external libraries to function. Download the zip file containing these libraries, and extract the files into your application's WEB-INF/lib directory. Ametys

  • The plugin gadget also depends on the javax.el package. Depending on your application server, it may or may not be included by default (if you use Tomcat, it should be).

Gadget library

You need to define your own library of gadgets that will be available to your visitors and contributors.

This library is defined in your application's WEB-INF/param/gadgets.xml file.

Gadgets are grouped by category.

The i18n keys contained in this file must be translated in the file WEB-INF\i18n\application .xml.

For each gadget you need to supply theurl Open Social or UWA definition, or theurl HTML of your own gadget, or theurl of a feed. RSS

  • for a UWA gadgetadd the attribute type="UWA"

    <gadget url="" type="UWA"/>
  • for your own gadget iframe, add the attribute type="HTML" :

    <gadget url="http://localhost:8080/samplecontainer/iframe.html" type="HTML"/>
  • for a feed rss, add the attribute type="RSS" :

    <gadget url="" type="RSS"/>


Here is an example of a library containing three categories

        <label i18n="true">application:GADGETS_GROUP_OFFICE_TOOLS</label>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url="" type="UWA"/>
        <label i18n="true">application:GADGETS_GROUP_GAMES</label>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url=""/>
        <label i18n="true">application:GADGETS_GROUP_NEWS</label>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url=""/>
        <gadget url="" type="UWA"/>
        <gadget url="http://localhost:8080/samplecontainer/iframe.html" type="HTML"/>
        <gadget url="" type="UWA"/>
            <gadget url="" type="RSS"/>

Warning: if you change the library, the server must be restarted!


UWA gadgets

There are 3 ways to define the height of UWA gadgets (in the file WEB-INF/param/gadgets.xml):

  • Dynamically: does not work for all gadgets

    <gadget url="" type="UWA" dynamic_height="true"/>
  • Fixed: to be used if the width of the gadget is known

    <gadget url="" type="UWA" height="270"/>
  • Default

    <gadget url="" type="UWA"/>



I-frame containing a custom gadget

You can define your own gadget: it consists of an XHTML page, accessible via the http://starting with <?xml version="1.0" encoding="UTF-8"?>

The page must contain a <title> and the <meta> for the gadget description:

  • title: gadget title
  • description: optional description of the gadget
  • thumbnail: used for the library
  • height: preferred height in pixels for displaying the gadget
  • author: the author of the gadget
  • author_email: the author's mail address
  • screenshot: an optional screenshot of the gadget

Example of a gadget in an iframe :

  • HTML gadget page (http://localhost:80/sample/ametys_en.html)

    <?xml version="1.0" encoding="UTF-8"?>
        <title>Ametys Smart Web CMS</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta content="A simple gadget provided by Anyware Services" name="description"/>
        <meta content="Anyware Services" name="author"/>
        <meta content="250" name="height"/>
        <meta content="" name="author_email"/>
        <meta content="http://localhost:8080/samplecontainer/ametys.jpg" name="screenshot"/>
        <meta content="http://localhost:8080/samplecontainer/ametys.jpg" name="thumbnail"/>
            body {
              font-size: 11px;
              font-family: Arial,Helvetica,sans-serif;
        h1 {color: #812281;}
            <h1>Ametys Smart Web CMS</h1>
        <img src="ametys.png" style="float:left; margin-right: 10px"/>
            <p>Ametys is an open source project distributed under the Apache open source license.
            The developers and users community has a set of tools allowing them to contribute to the project</p>
               <li>If you have any questions, go and ask the community on <a target="blank" href="">forum</a> (in french)</li>
               <li>The <a target="blank" href="">Wiki</a> stores documentations and initiatives related to Ametys</li>
               <li><a target="blank" href="">JIRA</a> allows issues and suggestions gathering and tracking</li>
            <p>All this information and other on <a target="blank" href=""></a>.</p>
  • Render the Gadget by adding it to the container

End of integration

Once everything has been set up, restart the server.

Back to top