Sign in to edit and +1 items.
Login required
Download

Jabber plugin

(0)
Author(s) glen_a_smith
Current Release 0.1   (2 years ago)
Grails Version 1.1.1 > *
Tags
Dependency
compile ":jabber:0.1"
Last updated by admin 2 years ago
grails install-plugin jabber
Last updated by glen_a_smith 2 years ago
The Jabber plugin is a tiny Grails plugin for interacting with Jabber services (such as Google talk). You can send messages to Jabber from all your controllers and services, and you can optionally registered a listener in one of your service classes to be notified of incoming messages.

There is a little configuration required in your /conf/Config.groovy file. Add the following section and point it to your jabber server of choice:

chat {
        serviceName = "local.decaf"
        host = "localhost"
        port = 5222
        username = "glen"
        password = "password"
    }

If you’re using it with Google Talk, you’ll want your settings to be something like:

chat {
    serviceName = "gmail.com"
    host = "talk.google.com"
    port = 5222
    username = "yourid@gmail.com"
    password = "your_password"
}

Once that’s in, you can happily invoke sendJabberMessage(userId, content) from any of your controllers or services:

sendJabberMessage("glen@decaf.local", "Just a tester....")

If you’d like to listen for incoming Jabber messages, you need to add an ‘expose’ list similar to the JMS and Remoting plugin (which I used as the sample template for my plugin) to one of your service classes.

class DemoService {

static expose = [ 'jabber' ]

def onJabberMessage = {msg ->

println "Eeek a message.. From ${msg.from} with body ${msg.body}"

} }

And you’re off and running!

Last updated by avtarsingh 1 year ago
I am developing web application using Grails . I required this plug in based on user...... Like If user1 login to the application than user one is online and if user2 is login than user2 is online using the same application. I am using openfire server for chatting. client will connect using the web application and server is using the SPARK chat application.

Problem is that how to distinguish the user per login . this configuration is working perfectly for one user.... but I want to develop an application that all logged user online. all online user will be displayed at the admin SPARK application.

What to do ???

:-(

mail - a.suchariya@gmail.com

Last updated by admin 2 years ago