JBoss.orgCommunity Documentation
An gadget is a mini web application running on a platform and you can put it in a web page. This is a small application that helps users to do some private actions.
GateIn Portal supports some gadgets such as: Todo gadget, Calendar gadget, Calculator gadget, Weather Forecasts, RSS Reader gadget.
Todo: This mini - application helps you to organize your day and work group.
Calendar: A cool calendar to keep track of date in style.
Calculator: This is the coolest calculator for your page.
RSS Reader: This gadget lets you het a sneak preview of your favourite feeds around web
Weather Forecasts: This gadget notifies you of current weather condition and gives tomorrow's forecast.
After referencing the gadget successfully, then import it into the local repository.
GateIn recommend you to setup 2 different virtual hosts because it's the basis of the security model of gadgets. Having the gadget running on a different domain than the container (the website that 'contains' the app), the gadget can't read / modify / do anything nasty to GateIn Portal (like adding spam messages, stealing your cookies, whatever).
For example you can server the portal from http://www.sample.com and the gadgets from http://www.samplemodules.com
To do this, we need to configure a parameter with the name is gadgets.hostName , the value is the path/to/gadgetServer in GadgetRegisteryService service like following:
<component> <key>org.exoplatform.application.gadget.GadgetRegistryService</key> <type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type> <init-params> <value-param> <name>gadgets.hostName</name> <description>Gadget server url</description> <value>http://localhost:8080/GateInGadgetServer/gadgets/</value> </value-param> </init-params> </component>
It's possible to have multiple rendering servers. That would help to balance the load across multiple servers.
If you still want to deploy it on the same server, make sure that it starts before anything that use the gadgets (for example the webapp GateInGadgets that use org.exoplatform.application.gadget.GadgetRegister)
A file key.txt has to be generated for every installation of GateIn to be secure . This file contains a secret key used to crypt the security token used for authenticating the user. On Linux this can be generated such as:
dd if=/dev/random bs=32 count=1 | openssl base64 > /tmp/key.txt
These servers have to be on the same domain as the gadget server. You can configure it in: eXoGadgetServer:/WEB-INF/classes/containers/default/container.js
.
"gadgets.content-rewrite" : { "include-urls": ".*", "exclude-urls": "", "include-tags": ["link", "script", "embed", "img", "style"], "expires": "86400", "proxy-url": "http://localhost:8080/eXoGadgetServer/gadgets/proxy?url=", "concat-url": "http://localhost:8080/eXoGadgetServer/gadgets/concat?" },