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="http://widget.pagesjaunes.fr/uwa/index.html" 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="http://www.nytimes.com/services/xml/rss/nyt/GlobalBusiness.xml" type="RSS"/>
Here is an example of a library containing three categories
<library> <group> <label i18n="true">application:GADGETS_GROUP_OFFICE_TOOLS</label> <gadget url="http://www.google.com/ig/modules/dictionary.xml"/> <gadget url="http://bbs.cnnas.com/igoogle/datetimemulti.xml"/> <gadget url="http://www.labpixies.com/campaigns/converter/converter.xml"/> <gadget url="http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=ft_india" type="UWA"/> </group> <group> <label i18n="true">application:GADGETS_GROUP_GAMES</label> <gadget url="http://www.google.com/ig/modules/horoscope.xml"/> <gadget url="http://hosting.gmodules.com/ig/gadgets/file/102462998830435293579/dradio.xml"/> <gadget url="http://throttled.org/googlegadgets/youtubesearch.xml"/> <gadget url="http://hosting.gmodules.com/ig/gadgets/file/117375892785445698801/flickr-photos-search.xml"/> <gadget url="http://hosting.gmodules.com/ig/gadgets/file/100080069921643878012/facebook.xml"/> <gadget url="http://www.labpixies.com/campaigns/trio/trio.xml"/> <gadget url="http://www.programme.tv/webmaster/google/tv.xml"/> </group> <group> <label i18n="true">application:GADGETS_GROUP_NEWS</label> <gadget url="http://bbcnewsgadget.googlecode.com/svn/trunk/Gadget/bbc_igoogle_ukedition12.xml"/> <gadget url="http://hosting.gmodules.com/ig/gadgets/file/116551734240963456629/cnn-tech.xml"/> <gadget url="http://www.weatheronline.co.uk/rss/igoogle"/> <gadget url="http://widget.pagesjaunes.fr/uwa/index.html" type="UWA"/> <gadget url="http://localhost:8080/samplecontainer/iframe.html" type="HTML"/> <gadget url="http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=lefigaro" type="UWA"/> <gadget url="http://www.nytimes.com/services/xml/rss/nyt/GlobalBusiness.xml" type="RSS"/> </group> </library>
Warning: if you change the library, the server must be restarted!
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="http://www.voyages-sncf.com/design/daily/deals/widget/uwa/expbooking/uwa_expbooking.html" type="UWA" dynamic_height="true"/>
Fixed: to be used if the width of the gadget is known
<gadget url="http://www.voyages-sncf.com/design/daily/deals/widget/uwa/expbooking/uwa_expbooking.html" type="UWA" height="270"/>
Default
<gadget url="http://www.voyages-sncf.com/design/daily/deals/widget/uwa/expbooking/uwa_expbooking.html" type="UWA"/>
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:
Example of a gadget in an iframe :
HTML gadget page (http://localhost:80/sample/ametys_en.html)
<?xml version="1.0" encoding="UTF-8"?> <html> <head> <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="support@anyware-services.com" name="author_email"/> <meta content="http://localhost:8080/samplecontainer/ametys.jpg" name="screenshot"/> <meta content="http://localhost:8080/samplecontainer/ametys.jpg" name="thumbnail"/> <style> body { font-size: 11px; font-family: Arial,Helvetica,sans-serif; } h1 {color: #812281;} </style> </head> <body> <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> <ul> <li>If you have any questions, go and ask the community on <a target="blank" href="http://www.ametys.org/forum">forum</a> (in french)</li> <li>The <a target="blank" href="https://wiki.ametys.org">Wiki</a> stores documentations and initiatives related to Ametys</li> <li><a target="blank" href="https://issues.ametys.org/secure/Dashboard.jspa">JIRA</a> allows issues and suggestions gathering and tracking</li> </ul> <p>All this information and other on <a target="blank" href="http://www.ametys.org">www.ametys.org</a>.</p> </body> </html>
Once everything has been set up, restart the server.