« Back

Liferay 6: OpenSocial Gadgets

Staff Blogs June 3, 2010 By Michael Young Staff

 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)

 

 

Threaded Replies Author Date
Nice feature. Thank you, Michael! Jonas Yuan June 3, 2010 5:53 PM
Micheal, thanks for the info. Where does the... Philip Buckley June 3, 2010 6:06 PM
Hi Philip, the portlet opensocial-portlet has... Jonas Yuan June 4, 2010 2:32 PM
Philip, App data is saved via Expando on a per... Michael Young June 4, 2010 2:35 PM
Nice feature! :) Are open social gadgets for... Jader Francia June 3, 2010 10:12 PM
Hi Jader, open social gadgets are... Jonas Yuan June 4, 2010 2:35 PM
Go go gadget Shepherd Ching June 5, 2010 4:47 PM
I have downloaded LR 6 Beta CE, logged in as... Tony Rogers June 7, 2010 8:49 AM
Hi Tony, you need deploy opensocial portlet... Jonas Yuan June 7, 2010 9:05 AM
Really nice feature. I just testing it and... Carlos Vicente June 8, 2010 8:07 AM
Carlos, Thanks for checking that out. We're... Michael Young June 8, 2010 9:01 AM
Just testing some copy&paste examples. I... Carlos Vicente June 8, 2010 11:16 AM
Gadgets now running in LifeRay :-) However... Tony Rogers June 8, 2010 10:22 AM
the same problem than Tony, when you restart... unai alba June 16, 2010 7:16 AM
I'm testing in Liferay 6 RC2. the message is... unai alba June 16, 2010 7:20 AM
Hi Unai, thanks. This is a bug. I can reproduce... Jonas Yuan June 16, 2010 7:27 AM
I want to add a gadget dinamically from another... Cesar William June 17, 2010 6:50 AM
Very nice and interesting feature . Thank You :) Bavithra Rajendran June 18, 2010 4:02 AM
Does this gadget work on Liferay 6.0 ? Because... Julien Leray July 9, 2010 1:06 PM
I deployed the opensocial-portlet-6.0.2.1.war... Kamal Pasha Shaikh October 6, 2010 9:59 AM
Possibly a dumb question but I have been... Ryan Terwedo June 14, 2011 3:33 PM
I created an OpenSocial gadget (6.0.6.1) with... Long N. August 5, 2011 6:58 AM
Has anyone integrated Jira and Liferay using... Kicha p February 28, 2012 3:44 AM
Only the todo list is still working do you have... Sharmila Wijeyakumar March 27, 2014 9:32 PM

Nice feature. Thank you, Michael!
Posted on 6/3/10 5:53 PM.
Micheal, thanks for the info. Where does the data get saved when you use the new Gadget feature in Liferay?
Posted on 6/3/10 6:06 PM in reply to Jonas Yuan.
Nice feature! emoticon
Are open social gadgets for portal instance or portal wide, like themes?
Posted on 6/3/10 10:12 PM.
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
Posted on 6/4/10 2:32 PM in reply to Philip Buckley.
Philip,

App data is saved via Expando on a per user / per app basis.
Posted on 6/4/10 2:35 PM in reply to Philip Buckley.
Hi Jader, open social gadgets are portal-instance wide, since company-Id is one of fields. right?
Posted on 6/4/10 2:35 PM in reply to Jader Francia.
Go go gadget
Posted on 6/5/10 4:47 PM.
I have downloaded LR 6 Beta CE, logged in as Bruno, but do not see this feature. Am I missing something ?

Thanks
Posted on 6/7/10 8:49 AM.
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
Posted on 6/7/10 9:05 AM in reply to Tony Rogers.
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?
Posted on 6/8/10 8:07 AM.
Carlos,

Thanks for checking that out. We're going to implement the views very soon. Which gadget(s) are you testing with?
Posted on 6/8/10 9:01 AM in reply to Carlos Vicente.
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.'
Posted on 6/8/10 10:22 AM.
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.
Posted on 6/8/10 11:16 AM in reply to Michael Young.
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.
Posted on 6/16/10 7:16 AM.
I'm testing in Liferay 6 RC2. the message is "Portlet is temporarily unavailable." and a nullpointer appears in the console.
Posted on 6/16/10 7:20 AM in reply to unai unai.
Hi Unai, thanks. This is a bug. I can reproduce the same. You may report this in JIRA.
Posted on 6/16/10 7:27 AM in reply to unai unai.
I want to add a gadget dinamically from another application. What is the better way to do it?
Posted on 6/17/10 6:50 AM.
Very nice and interesting feature . Thank You emoticon
Posted on 6/18/10 4:02 AM.
Does this gadget work on Liferay 6.0 ? Because I can't use it on my Liferay's version....
Posted on 7/9/10 1:06 PM in reply to Bavithra Rajendran.
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(Base­AutoDeployListener.java:76)
at com.liferay.portal.kernel.deploy.auto.BaseAutoDeployListener.isHookPlugin(BaseAu­toDeployListener.java:40)
at com.liferay.portal.deploy.auto.HookAutoDeployListener.deploy(HookAutoDeployListe­ner.java:38)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.processFile(AutoDeployDir.ja­va:180)
at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.scanDirectory(AutoDeployDir.­java:221)

at com.liferay.portal.kernel.deploy.auto.AutoDeployScanner.run(AutoDeployScanner.ja­va: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(Base­AutoDeployListener.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 (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 (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/c­lasses/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/c­lasses/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/c­lasses/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/c­lasses/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.
Posted on 10/6/10 9:59 AM in reply to Julien Leray.
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?
Posted on 6/14/11 3:33 PM.
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
Posted on 8/5/11 6:58 AM in reply to Ryan Terwedo.
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
Posted on 2/28/12 3:44 AM.
Only the todo list is still working do you have any other examples?
Posted on 3/27/14 9:32 PM.