Liferay 6: OpenSocial Gadgets

 Liferay 6 will feature an OpenSocial container based on Shindig. OpenSocial Gadgets present as first-class citizens via the "Add Application" menu, just like portlets.

To configure a Gadget in Liferay, all you need is the Gadget URL. In the screenshots below I've configured three gadgets:

  1. http://www.labpixies.com/campaigns/todo/todo.xml
  2. http://www.google.com/ig/modules/horoscope.xml
  3. http://localhost:8080/opensocial-portlet/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml (this is a sample Shindig gadget)

 

 

Blogs
Nice feature. Thank you, Michael!
Micheal, thanks for the info. Where does the data get saved when you use the new Gadget feature in Liferay?
Hi Philip, the portlet opensocial-portlet has its own database table to save the data (name and URL) as

create table OpenSocial_Gadget (
gadgetId LONG not null primary key,
companyId LONG,
createDate DATE null,
modifiedDate DATE null,
name VARCHAR(75) null,
url STRING null
);

Hope that it helps,

Thanks

Jonas
Nice feature! emoticon
Are open social gadgets for portal instance or portal wide, like themes?
I have downloaded LR 6 Beta CE, logged in as Bruno, but do not see this feature. Am I missing something ?

Thanks
Hi Tony, you need deploy opensocial portlet first.

You can find the portlet (opensocial-portlet-6.0.2.1.war) at http://liferay.cignex.com/palm_tree/book/0387/chapter12/.

Hope that it helps,

Thanks
Really nice feature. I just testing it and seems to work out of the box.
Well, i tried changing the view, and seems that feature is not yet available. do you have plans for his feature?
Carlos,

Thanks for checking that out. We're going to implement the views very soon. Which gadget(s) are you testing with?
Just testing some copy&paste examples.

I testing OpenSocial because i'm thinking about to integrate a .NET application with strong AJAX background an OpenSocial fits nicelly with that kind of integration.

It would be desirable also, the possibility available on regular portlets of redirect the view change to another page.

Really, i think that Liferay becames a OpenSocial container gives it a great future. OpenSocial overlaps in many ways Portlet specification, but the development lifecicle is fas simple. I'm really excited about it.
Gadgets now running in LifeRay :-) However they are removed when LifeRay is restarted. The portlet frame is left behind with following message in the content area:

'This portlet has been undeployed. Please redeploy it or remove it from the page.'
the same problem than Tony, when you restart the server the gadget dissapear from the add menu and the portlet is not available in the pages.
I'm testing in Liferay 6 RC2. the message is "Portlet is temporarily unavailable." and a nullpointer appears in the console.
I want to add a gadget dinamically from another application. What is the better way to do it?
Very nice and interesting feature . Thank You emoticon
Does this gadget work on Liferay 6.0 ? Because I can't use it on my Liferay's version....
I deployed the opensocial-portlet-6.0.2.1.war file (from the download link posted by @Jonas) on my liferay-6.0.4 bundled installation. I got the following error message in my server log. Sorry, I have to paste the log file content as I cannot attach it in the post.

16:31:10,623 INFO [AutoDeployDir:167] Processing opensocial-portlet-6.0.2.1.war
16:31:11,124 ERROR [AutoDeployDir:197] com.liferay.portal.kernel.deploy.auto.AutoDeployException: java.util.zip.ZipException: error in opening zip file
com.liferay.portal.kernel.deploy.auto.AutoDeployException: java.util.zip.ZipException: error in opening zip file
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isMatchingFile(BaseAutoDeployListener.java:76)
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isHookPlugin(BaseAutoDeployListener.java:40)
at com.liferay.portal.deploy.auto.HookAutoDeployListener.deploy(HookAutoDeployListener.java:38)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.processFile(AutoDeployDir.java:180)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.scanDirectory(AutoDeployDir.java:221)

at com.liferay.portal.kernel.deploy.auto.AutoDeployScanner.run(AutoDeployScanner.java:49)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.zip.ZipFile.<init>(ZipFile.java:131)
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isMatchingFile(BaseAutoDeployListener.java:61)
... 5 more
16:31:21,126 INFO [AutoDeployDir:172] Processing opensocial-portlet-6.0.2.1.war. This is attempt 2.

16:31:21,126 INFO [PortletAutoDeployListener:71] Copying portlets for C:\liferay-portal-6.0.4\deploy\opensocial-portlet-6.0.2.1.war
Expanding: C:\liferay-portal-6.0.4\deploy\opensocial-portlet-6.0.2.1.war into C:\liferay-portal-6.0.4\tomcat-6.0.26\temp\20101006163121298
Copying 1 file to C:\liferay-portal-6.0.4\tomcat-6.0.26\temp\20101006163121298\WEB-INF
Copying 1 file to C:\liferay-portal-6.0.4\tomcat-6.0.26\temp\20101006163121298\WEB-INF\classes
Copying 1 file to C:\liferay-portal-6.0.4\tomcat-6.0.26\temp\20101006163121298\WEB-INF\classes
Copying 1 file to C:\liferay-portal-6.0.4\tomcat-6.0.26\temp\20101006163121298\META-INF
Copying 145 files to C:\liferay-portal-6.0.4\tomcat-6.0.26\webapps\opensocial-portlet
Copying 1 file to C:\liferay-portal-6.0.4\tomcat-6.0.26\webapps\opensocial-portlet
Oct 6, 2010 4:31:46 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/opensocial-portlet]
Deleting directory C:\liferay-portal-6.0.4\tomcat-6.0.26\temp\20101006163121298
16:31:46,757 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
16:31:46,788 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
16:31:46,929 INFO [ExtHotDeployListener:205] Extension environment for opensocial-portlet will notbe undeployed
16:31:46,945 INFO [PortletHotDeployListener:406] Unregistering portlets for opensocial-portlet
16:31:46,976 INFO [PortletHotDeployListener:442] 2 portlets for opensocial-portlet was unregistered

16:31:48,211 INFO [PortletAutoDeployListener:81] Portlets for C:\liferay-portal-6.0.4\deploy\opensocial-portlet-6.0.2.1.war copied successfully. Deployment will start in a few seconds.
Oct 6, 2010 4:31:49 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [com.google.inject.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Oct 6, 2010 4:31:49 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type [null] (value [org.apache.shindig.common.xml.XmlUtil$2@75f0a3]) and a value of type [org.apache.xerces.jaxp.DocumentBuilderImpl] (value [org.apache.xerces.jaxp.DocumentBuilderImpl@10962b2]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
Oct 6, 2010 4:31:49 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type [null] (value [com.google.inject.InjectorImpl$1@12eb786]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@12f563]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
16:32:02,745 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
Loading file:/C:/liferay-portal-6.0.4/tomcat-6.0.26/webapps/opensocial-portlet/WEB-INF/classes/service.properties
16:32:02,964 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
16:32:10,497 INFO [PortletHotDeployListener:222] Registering portlets for opensocial-portlet16:32:10,528 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
16:32:10,575 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
16:32:11,372 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
16:32:11,466 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
Loading file:/C:/liferay-portal-6.0.4/tomcat-6.0.26/webapps/opensocial-portlet/WEB-INF/classes/portlet.properties
16:32:11,497 INFO [PortletHotDeployListener:376] 2 portlets for opensocial-portlet are available for use
Loading file:/C:/liferay-portal-6.0.4/tomcat-6.0.26/webapps/opensocial-portlet/WEB-INF/classes/service.properties
16:32:12,044 INFO [DialectDetector:69] Determining dialect for HSQL Database Engine 1
16:32:12,044 WARN [DialectDetector:84] Liferay is configured to use Hypersonic as its database. DoNOT use Hypersonic in production. Hypersonic is an embedded database useful for development and demo'ing purposes. The database settings can be changed in portal.properties.
16:32:12,060 INFO [DialectDetector:49] Using dialect org.hibernate.dialect.HSQLDialect
Loading file:/C:/liferay-portal-6.0.4/tomcat-6.0.26/webapps/opensocial-portlet/WEB-INF/classes/service.properties
Oct 6, 2010 4:32:16 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 6, 2010 4:32:16 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/opensocial-portlet] startup failed due to previous errors
16:32:16,780 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
16:32:16,811 WARN [SAXReaderImpl:429] XSD validation is diasabled because org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
16:32:16,905 INFO [ExtHotDeployListener:205] Extension environment for opensocial-portlet will not be undeployed
16:32:16,905 INFO [PortletHotDeployListener:406] Unregistering portlets for opensocial-portlet
16:32:16,905 INFO [PortletHotDeployListener:442] 2 portlets for opensocial-portlet was unregistered

Oct 6, 2010 4:32:16 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [com.google.inject.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Possibly a dumb question but I have been googling for 30 min to find a directory of open social gadgets... anyone know where they are?
I created an OpenSocial gadget (6.0.6.1) with the URL that contains https and got an exception:

08:36:54,853 ERROR [PortletServlet:96] javax.portlet.PortletException: org.apache.shindig.gadgets.process.ProcessingException: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
javax.portlet.PortletException: org.apache.shindig.gadgets.process.ProcessingException: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.liferay.opensocial.portlet.GadgetPortlet.render(GadgetPortlet.java:88)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
.....
does anyone know what to be defined so that OpenSocial gadget can handle seccured URLs?

Thanks
Has anyone integrated Jira and Liferay using OAuth?

I created public/private key using keytool and exported the certificate into rsaSigningKey.pem. Placed this file in liferaydatafolder/opensocial/.

Configured Incoming authentication in Application Links of Jira with

Consumer key - www.myliferay.com

Consumer Name - Liferay

Public key - public key text from rsaSigningKey.pem file.

Public key greyed out and saved the configuration.

Added the OpenSocial gadget onto the Liferay page. Gave the url of activityStream of Jira and in Manage OAuth section selected RSA_private and gave the consumer key as www.myliferay.com. Saved the configuration.

My activity stream in Liferay shows empty. When I checked the liferay console, it shows an error of jodd.bean.BeanException: Simple property not found: oAuthConsumerId Invalid property: 'OAuthConsumerImpl#oAuthconsumerId (actual: 'OAuthConsumerImpl#oAuthConsumerId', forced=false)

Where am I going wrong? should the consumer key be the CN of public/private key creation?

Regards,
Kicha
Only the todo list is still working do you have any other examples?