openSocial Plugin
Author: Patrick Hennig | Thomas Zimmermann
A plugin for easily creating openSocial Gadgets.
For installation type:
grails install-plugin openSocial
It works very easy, you just have to specify in your view, that this view will be a gadget. Then you have to specify which controller you want to load in your view at startup. After this you are able to view your usual Grails App as a openSocial Gadget.
openSocial uses a XML document to specify the gadget. The Plugin consists of a tag library, which automatically generates the XML document and its content.
Features
openSocial uses a XML document to specify the gadget. The Plugin consists of a tag library, which automatically generates the XML document and its content.
Using the tag library
The Plugin consists of a tag library, which automatically generates the XML document and its content
Gadget XML
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
<opensocial:gadget title="OPEN CANTEEN"> ... </opensocial:gadget> |
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
openSocial views
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:view controller="startPage" action="index"> </opensocial:view> ... |
different Gadget Views
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:view controller="startPage" action="index" viewName=”canvas”> </opensocial:view> ... |
enable to send the user to the controller
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:view controller="startPage" action="index" sendUser=”true”> </opensocial:view> ... |
use external JavaScript and Stylesheet files
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
...
<opensocial:view controller="startPage" action="index"
externalLinks="{js:['http://localhost/myJS.js',
‘http://locahost/another.js',],
css:['http:/localhost/mystyle.css']}'”>
</opensocial:view>
...
|
execute JavaScript at startup
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:view controller="startPage" action="index" js="window.alert(‘hallo’)”> </opensocial:view> ... |
openSocial links
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:link controller="startPage" action="eatOffer"> Go There </opensocial:link> ... |
send GET attributes to the controller
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
...
<opensocial:link controller="startPage" action="eatOffer"
attributes="{mykey:'myvalue'}">
Go There
</opensocial:link>
...
|
execute JavaScript on clicked Anchor
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:link controller="startPage" action="eatOffer" js="window.alert(‘you clicked’)"> Go There </opensocial:link> ... |
send a user name to the controller
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:link controller="startPage" action="eatOffer" user="myname"> Go There </opensocial:link> ... |
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom
openSocial submit
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:submit controller="startPage" action="addCanteen" value="Hinzufügen"/> ... |
send a user name to the controller
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:submit controller="startPage" action="addCanteen" value="Hinzufügen" user=”myname”/> ... |
execute JavaScript on clicked Anchor
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
| Code Block |
|---|
... <opensocial:submit controller="startPage" action="addCanteen" value="Hinzufügen" js=”window.alert(‘button was clicked’)”/> ... |
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and 1.0 for Atom if not supplied. Current tested feedType values are "rss" and "atom",
Testing the Gadget
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and
Additional Information
The feedType parameter is required. The feedVersion is optional and will default to 2.0 for RSS and