integrating your website with google gdrive or google gtalk, a presentation by babson college

13
Integrating Google With Your Drupal Site Google Drive Google Talk (Gtalk)

Upload: acquia

Post on 15-Jan-2015

3.268 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Integrating Google With Your Drupal Site• Google Drive• Google Talk (Gtalk)

Page 2: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Google Drive / Droogle Module

The Droogle module: created for Babson College and in production presently. http://drupal.org/project/droogle

Pulls in all your documents and folders for display sitewide or within organic groups.

Babson pulls in Google drive documents for each course. Documents are uploaded via Blackboard into Google Drive, are displayed in Blackboard and Drupal.

Page 3: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Droogle Site-wide page

Page 4: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

DROOGLE Block Within Organic Group

Droogle Block

Page 5: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

The Droogle Settings Page

Page 6: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Gtalk and Drupal – The Jabber module

The Jabber module is available at http://drupal.org/project/jabber

Jabber integrates Drupal with any XMPP Jabber server. Gtalk, Facebook, and most major chat networks are using XMPP protocol

JABBER requires a punjab server, which is a BOSH server which integrates with any federated XMPP jabber server.

Page 7: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Jabber Notes

Jabber is working presently at Babson now for a few months successfully

If you show users pictures, be wary of having so many pictures on each page, use sprites if possible

Dynamically load photos upon opening the Jabber roster

Page 8: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Jabber Notes 2

Jabber connects securely via php first using the PHP Speaks XMPP library which I authored for Babson and published on github https://github.com/barnettech/PHP_SPEAKS_XMPP

After connecting via php the Jabber module “attaches” the returned rid and sid to the strophe.js library, and reuses this same session. In this way no username or password is passed insecurely over javascript on the client side

Page 9: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Jabber Notes 3

Strophe: http://strophe.im/

Strophe is a javscript based XMPP library which is popular, and very tested in the wild, and most importantly efficiently handles XMPP traffic.

To learn more about XMPP I recommend the book Professional XMLL Programming with Javascript and Jquery by Jack Motiff. Jack is also active in Google Groups supporting strophe and punjab, and he was extremely helpful along my journey to success in getting Jabber for Drupal working. His book is really really great, and XMPP is a really underutilized protocol and I recommend his book highly.

Page 10: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Jabber Screenshot

Page 11: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Jabber Screenshot 2

Page 12: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

Jabber tricks and tips

Since we know if you’re online in gtalk in the roster which is on the page, any mention of a username can have a “presence icon” by using some jquery and theme username http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_username/7

Basically in jabber roster if you give each username a class with their unique user name and then also use the same class in theme username, if one is green (online), red (busy), or grey (offline), all classes can be displaying presence wherever said username is on the page.

Page 13: Integrating Your Website With Google Gdrive or Google Gtalk, A presentation by Babson College

XMPP $xmlposts[] = '<body rid="'.$_jabber_rid_.'" xmlns="http://jabber.org/protocol/httpbind" sid="'.

$_jabber_sid_.'"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">'.$thepw.'</auth></body>';

$xmlposts[] = "<body rid='" . jabber_get_next_rid() . "' xmlns='http://jabber.org/protocol/httpbind' sid='$_jabber_sid_' to='babson.edu' xml:lang='en' xmpp:restart='true' xmlns:xmpp='urn:xmpp:xbosh'/>";

$xmlposts[] = "<body rid='" . jabber_get_next_rid() . "' xmlns='http://jabber.org/protocol/httpbind' sid='$_jabber_sid_'><iq type='set' id='_bind_auth_2' xmlns='jabber:client'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/></iq></body>";

$xmlposts[] = "<body rid='" . jabber_get_next_rid() . "' xmlns='http://jabber.org/protocol/httpbind' sid='$_jabber_sid_'><iq type='set' id='_session_auth_2' xmlns='jabber:client'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq></body>";

$xmlposts[] = "<body rid='" . jabber_get_next_rid() . "' xmlns='http://jabber.org/protocol/httpbind' sid='$_jabber_sid_'><message to='[email protected]' type='chat' xmlns='jabber:client'><body>test helloworld from my php xmpp api!</body><active xmlns='http://jabber.org/protocol/chatstates'/></message></body>";

$xmlposts[] = "<body rid='" . jabber_get_next_rid() . "' xmlns='http://jabber.org/protocol/httpbind' sid='$_jabber_sid_'><iq type='get'><query xmlns='jabber:iq:roster'/></iq></body>”;

$xml_response = jabber_send_xml($xmlposts);