« Back

Jabber integration

Company Blogs June 16, 2011 By Bruno Farache Staff

We just integrated our Chat portlet with Jabber!

This means portal users can now choose their preferred desktop chat client (such as Pidgin, Trillian or Adium) to chat with other users, here's an interesting conversation between me and Eduardo:


The beta version is in plugins trunk and will be available on 6.1.

More details on installation and setup can be found here:

http://www.liferay.com/community/wiki/-/wiki/Main/Jabber+integration

Threaded Replies Author Date
looks great!!!! but wiki link seems to bee broken Aritz Galdos June 16, 2011 8:15 AM
thanks Aritz, should be fixed now. Bruno Farache June 16, 2011 8:29 AM
Looks great! Thanks, Bruno. Jonas Yuan June 16, 2011 9:50 AM
Great news! Chatting from a web page is... Amos Fong June 16, 2011 11:06 PM
Great job, guys! Joshua Asbury June 17, 2011 10:19 AM
Great job. Sohui Gu June 17, 2011 6:52 PM
Cool feature Bruno..Thanks for sharing this.. Jay Patel June 20, 2011 8:30 PM
will this work for msn messenger? great work... Gabriel Leon Leyva June 22, 2011 11:41 AM
Gabriel, I don't think MSN messenger can... Bruno Farache June 22, 2011 11:48 AM
Very nice - continues to show our ability to... Paul Hinz June 22, 2011 2:09 PM
Bruno, about msn messenger, I think I didn't... Gabriel Leon Leyva June 28, 2011 9:14 AM
Got it Gabriel. The chat portlet in Liferay can... Bruno Farache June 28, 2011 11:27 AM
Thanks Bruno. Gabriel Leon Leyva June 28, 2011 12:03 PM
beau travail Dominique Magré July 3, 2011 1:57 AM
Bruno, are you real LOL ; - ) I always thought... Fuad Efendi July 4, 2011 7:29 AM
haha, thanks for calling me an alien, Fuad. Bruno Farache July 4, 2011 5:29 PM
Thanks for the post! Looking at this it would... az eol July 6, 2011 5:41 AM
Need to get this running to play with it. So... az eol July 6, 2011 11:14 AM
facebook supports jabber Gabriel Leon Leyva July 6, 2011 3:22 PM
http://developers.facebook.com/docs/chat/ Gabriel Leon Leyva July 6, 2011 3:46 PM
Hi, We needed to use the latest trunk... az eol July 19, 2011 8:32 AM
Couldn't attach patch files, please email me if... az eol July 19, 2011 8:32 AM
Hi, Bruno! Great Work! I work at Câmara dos... Expedito Júnior August 12, 2011 11:14 AM
Oi Expedito! Essa integração foi incluída na... Bruno Farache August 12, 2011 3:25 PM
Looks good. Will the chat portlet support chat... Ken Sperow August 19, 2011 10:18 AM
do we have a version that runs on 6.0.6? ken ken August 30, 2011 9:58 AM

looks great!!!! but wiki link seems to bee broken
Posted on 6/16/11 8:15 AM.
thanks Aritz, should be fixed now.
Posted on 6/16/11 8:29 AM in reply to Aritz Galdos.
Looks great! Thanks, Bruno.
Posted on 6/16/11 9:50 AM in reply to Bruno Farache.
Great news! Chatting from a web page is difficult...
Posted on 6/16/11 11:06 PM.
Great job, guys!
Posted on 6/17/11 10:19 AM in reply to Amos Fong.
Posted on 6/17/11 6:52 PM.
Cool feature Bruno..Thanks for sharing this..
Posted on 6/20/11 8:30 PM.
will this work for msn messenger?

great work thanks !!
Posted on 6/22/11 11:41 AM.
Gabriel, I don't think MSN messenger can connect to Jabber.
Posted on 6/22/11 11:48 AM in reply to Gabriel Leon Leyva.
Very nice - continues to show our ability to give you features out of the box while we also plug in to whatever you already have.
Posted on 6/22/11 2:09 PM.
Bruno, about msn messenger, I think I didn't express the right idea, as we know any jabber program like spark can comunicate thru the jabber server to the msn protocol. That is the right question will liferay comunicate thru the jabber server to msn protocol? Thanks emoticon have a nice day.
Posted on 6/28/11 9:14 AM in reply to Paul Hinz.
Got it Gabriel. The chat portlet in Liferay can communicate using the Jabber protocol only.

The portlet is a chat client, just like Spark, except that it supports only one protocol, Jabber.
Posted on 6/28/11 11:27 AM in reply to Gabriel Leon Leyva.
Thanks Bruno.
Posted on 6/28/11 12:03 PM in reply to Bruno Farache.
beau travail
Posted on 7/3/11 1:57 AM.
Bruno, are you real LOL ; - )
I always thought you are from another planet...
Posted on 7/4/11 7:29 AM.
haha, thanks for calling me an alien, Fuad.
Posted on 7/4/11 5:29 PM in reply to Fuad Efendi.
Thanks for the post!

Looking at this it would appear that we could just point "jabber.host" to one of Googles SRV records for xmpp-client for our google apps corporate account, which should permit users in our liferay install with matching emails/passwords to chat within our google apps domain. Correct? Meaning I don't really see anything here preventing that (nothing openfire specific). Correct?

Secondly this is still a short polling based system right? Any plans to move to comet/BOSH?
Posted on 7/6/11 5:41 AM in reply to Bruno Farache.
Need to get this running to play with it.

So I've got the portal trunk (6.1) and plugins trunk (generated the 6.1 sdk) running and starting up OK in Dev Studio 1.2 on a clean database. The portal is up and running OK via a clean startup. I successfully did a build-service for the chat-portlet in the trunk + deployed it ok. It says available for use, but in the menus on the running 6.1 liferay instance I don't see it showing up to add it to a page? How do I get the chat portlet to show up somewhere?
Posted on 7/6/11 11:14 AM in reply to az eol.
facebook supports jabber
Posted on 7/6/11 3:22 PM in reply to az eol.
http://developers.facebook.com/docs/chat/
Posted on 7/6/11 3:46 PM in reply to Gabriel Leon Leyva.
Hi,

We needed to use the latest trunk chat-portlet sooner than later, and as part of that, we had to make some modifications for it to work for us.

Below they are described and included in a patch file, and hopefully these changes can be included/supported in the official 6.1 release whenever it comes out.

Please note the patch file also includes some service generation code which is not different than the trunk. The primary changes are all in the jabber.* package.

In general our use case is that we needed to use it with Google Apps corporate accounts. Our users have corresponding accounts in our google apps corporate account and there are more than one @domainname (sub-domains) under our google apps account so assumptions currently in the trunk about all user's screen names existing within one domain, or screen name reliance only, does not work with Smack -> Google Talk for a corporate account.

Overall we are asking that configurable support for the changes we made be rolled into the planned mainline release of the chat-portlet so that we do not have to maintain our own branch of it.

-------------------------------------------------------------
OVERVIEW OF CHANGES WE MADE
-------------------------------------------------------------

(#1) Changed JabberImpl's sendMessage() to set the TO (destination user's) jabberId = the user's email address rather than just the screen name.

Can an config option be added for this behavior?

(i.e.) String jabberId = toUser.getEmailAddress();



(#2) Altered JabblerImpl.connect()'s Smack ConnectionConfiguration to set the service name equal to the user's email domain (right side of @) which is what is needed to work with google apps accounts.

Can an config option be added for this kind of behavior?

ConnectionConfiguration config = getConnectionConfiguration();
String serviceName = StringUtil.extractLast(user.getEmailAddress(), StringPool.AT);
config.setServiceName(serviceName);
connection = new XMPPConnection(config);



(#3) Altered the JabberImp.connect()'s smack connection login call to pass email address instead of screen name

Can an config option be added for this kind of behavior? Likely could read from the same config for the above.

connection.login(user.getEmailAddress(), password, PortletPropsValues.JABBER_RESOURCE);



(#4) Adjusted JabberMessageListener.processMessage() to retrieve the sender user by email address rather than screen name due to screen names being different (potentially) than the email for the user (which must match the jabberid MINUS the /resource). This change also added a new method on the Jabber interface: public String getEmailAddress(String jabberIdWithResource); plus on the implementing classes. Again the use of looking up by email might need to be controlled by a config property.



(#5) Adjusted the JabberImpl's getStatuses() method to fetch by email instead of screen name (same reasons as above) as well as catch Exceptions and do a null check in calls to "UserLocalServiceUtil.getUserByEmailAddress()" when a user returned by the XMPP server does not exist in the local liferay install. It seems legitimate that someone might connect this to an XMPP server where users in someone's roster are not in the local Liferay install. This should fail without error, (log/warn maybe) but not cause it to bomb out. Just filter the user from the roster returned. (i.e. _log.warn("XMPP Roster user: " + rosterEntry.getUser() + " not in local Liferay... skipping adding to chat roster..");)



(#6) We front our liferay install via an SSO mechanism and have a custom AuthLogin hook implemented. Subsequently the LoginPostAction in com.liferay.chat.hook.events.LoginPostAction has no password available to us for Smack to consume in its login calls. We made a modification in our copy to fetch it via other means as Smack requires it. However it would be nice if the official chat-portlet release had access to the password OR provided another hook that would permit us to get it via another means available in our AuthLogin hook. Is the login.events.post configuration configurable outside of the portlet WAR? If so this may suffice.



(#7) We backported this to run in 6.0 EE SP1. To do that we had to modify various timer/delay related JS calls in main.js to use AUI DelayedTask instead of the newer debounce methods.


(#8) To work with google talk our portlet.properties ended up looking like this

jabber.enabled=true
jabber.import.user.enabled=false
jabber.host=talk.l.google.com
jabber.port=5222
jabber.resource=
jabber.service.name=
jabber.sock5.proxy.enabled=f­alse
jabber.sock5.proxy.port=-1
Posted on 7/19/11 8:32 AM in reply to Gabriel Leon Leyva.
Couldn't attach patch files, please email me if you need them. Thanks
Posted on 7/19/11 8:32 AM in reply to az eol.
Hi, Bruno! Great Work!
I work at Câmara dos Deputados in Brazil and we are working hard on Liferay to get it working as soon!
We are using spark (openfire server connected with MS Active Directory) as our instant messenger app. So we are trying to use chat-portlet to connect to our openfire server but having no success. Do you know if its possible to do this with Liferay 6.0.6?? If no, and using this trunk?
Thank you!
Posted on 8/12/11 11:14 AM.
Oi Expedito! Essa integração foi incluída na Community Edition 6.1, que ainda não foi lançada. A versão Enterprise 6.0 já possui ela, no entanto.
Posted on 8/12/11 3:25 PM in reply to Expedito Júnior.
Looks good. Will the chat portlet support chat rooms or would users have to use desktop clients? I work for the National Weather Service in the US and we have a jabber server already running call NWSChat that we should be able to tie into, but we need the ability to have multi-user chats. Thanks!
Posted on 8/19/11 10:18 AM.
do we have a version that runs on 6.0.6?
Posted on 8/30/11 9:58 AM in reply to Ken Sperow.