Showing posts with label library. Show all posts
Showing posts with label library. Show all posts

Friday, June 1, 2007

Design thoughts

There seems to be a few ways to get a browser app to talk to gtalk.

1. Ajax ------ punjab/tomcat/java servlet ------- Gtalk

The intermediary is because Ajax / Html is stateless and gtalk/jabber requires a statefull system. One success is by using java2script library which Hazrat has shown can connect to gtalk. One issue will be the latency introduced by the middle servlet module in java2script system.

(note the java2script client is on the left)

We will also need to build a conference bot to simulate chat in gtalk and the hops will be:

Ajax ------ tomcat -------- gtalk --------- conference bot

which will add additional latency.


2. Flash ----- Gtalk

Not sure if this needs an intermediary since Flash should be able to maintain state.
Potential libraries are Ignite's XIFF API and jabberflash.
They can talk to jabber servers, but not sure about gtalk yet. Hazrat ?
Since google's gtalk gadget is written in flash, this might be the way to go.

article on XIFF

3. Firefox extension ---- Gtalk

This has potential, though the application development could be tougher because parts of it have to be built in XUL & C (verify ?)
Potential library xmpp4moz.
Verify if it can talk to gtalk. Hazrat ?
Interesting links on programming Firefox

4. Java -- Gtalk
Ignite's Smack API
Interesting Bolinfest article on it.

This would be like the original OnChat and will suffer from the problems
of developing an attractive small java applet for the browser - not so keen on this approach.

Thursday, May 31, 2007

Java2Script

Its a great tool for Java expert to simply convert their existing java app into web-based app. We can easily use SWT (Standard Windows Toolkit), to create the UI part.

I've tried the J2S with 2 apps. the 1st one is a simple, console-based HELLO WORLD java app and 2nd one is the HELLO WORLD app using SWT. Both can be run successfully using Eclipse.

After that, I tried running both apps as J2S app. The simple (non-SWT) app run OK, but not the one using SWT. I've checked SWT version, the J2S, all docs and tutorial on the net, but to no avail. I even post on their google groups but there are still no response. Here's a screeen shot of the error:



I'm not sure where "Line: 25" refers to, as there are certainly less than 25 lines in my codes. It maybe part of the loader that is trying to load the supposedly created .js file.

I found out that, for the non-SWT app, J2S has converted it's code into a .js file. But there is no .js file for the app with SWT. There maybe clashes between those 2 libraries. Posted this issue in their group too.

I'm sure its an error related to my IDE, but I'm still trying to rectify it.

Wednesday, May 30, 2007

Punjab

I happened to have access to their SVN and using that, I've updated my Punjab to the latest version. When I tried to install punjab, it returns this error :
/python2.3/distutils/dist.py:227: UserWarning: Unknown distribution option: 'package_data'
warnings.warn(msg)

According to plone website, it may because Iwas trying to install it on Python 2.3 (That was the version of Python on our server). Maybe it would be ok if I run it on different version of Python. I have version 2.4 and 2.5, since it also requires modification on the server, I'll put it on hold for a while.

JabberHTTPBind

Tried JHB for a few hours. It can't work properly because I have not install any servlet container (ie: Tomcat). I will try to install Tomcat for Apache later, but for now, i'll try to figure out the simplest way to setup a connection between our server and GTalk, that didn't require major server modification.

The author has setup a website combining JWChat with JHB here. If you use the default server, then it'll work out OK. But when I try to connect to GTalk, multiple times with various settings, it won't work. I've post some question on the development blog here, and still waiting for the response.

Tools of Trade

Here are the tools that may help us:

Punjab :
- is a HTTP jabber client interface. It is a SOAP, XMLRPC, JEP-0025 or JEP-0124 server that allows persistent client connections to a jabber server. It can be used for many things, but its main purpose is to allow for stateless applications (ie web) a stateful connection to jabber. LINK
jwchat & Punjab

jabberHTTPBind (JHB) :
- is a java servlet implementing JEP-0124 (HTTP Binding) thus enabling you to connect to any Jabber™ server by way of HTTP Binding. LINK


Globsy :
- Globsy is a PHP bot framework for the Google Talk network that can be executed from a regular browser on a PHP enabled server, connect to the Google Talk network and continue running in the background, without the browser needing to remain open. LINK


Java2Script :
- java2Script (J2S) Pacemaker provides an Eclipse Java to JavaScript compiler plugin and an implementation of JavaScript version of Eclipse Standard Widget Toolkit (SWT) with other common utilities, such as java.lang.* and java.util.*. You can convert your SWT-base Rich Client Platform (RCP) into Rich Internet Application (RIA) by Java2Script Pacemaker. LINK