sinmple chat in Serovy

Anyone build allready a simple chatprogram inside Servoy?

I am qurious about the approach/setup.

Once, a long, long time ago, I was working on it… it never finilized…

But, if you would want to do something like it, you’d have to build a plugin for it. With Java’s RMI, you can setup such a chat system. In this scenaria, every Client has to become a RMI server in itself.

The system uses the RMI server on de Servoy Server to setup the connection between clients and from there onwards, the Clients talk directly with eachother.

Just google around on keyword java, chat, program and you should find some simple examples.

Paul

No plugin, just in Servoy itself.
I think it is doable.

To whom do you want to chat then?

I have my own user-database and login-system!

Sure, but you want users to send eachother messages, so send messages between different Servoy Clients?

I guess you can store the messages in a table and in that way have them available to other Clients, but I guess you would then have to run a scheduled process on the clinets to see if a new messages (record in the table) is available and take action based on that.

Or the user should check himself…

Or am I completely missing the picture here?

Paul

I guess you would then have to run a scheduled process on the clinets

That is an interesting feature for the scheduler plugin (something like plugins.scheduler.createJobForClient(clientUserName, solution)). My problem is: you can set reminders all over the place but you can also set reminders for different users. Since I check for reminders (and schedule them) on solution startup, I have a problem if somebody else creates a reminder for another user on the same day. The only solution I see for this is to check for reminders every five minutes or so on the client which is not so nice. If I could schedule something remotely (if the client is running, else not) that’d be neat! And the chat could also work!

Patrick

pbakker:
Sure, but you want users to send eachother messages, so send messages between different Servoy Clients?

I guess you can store the messages in a table and in that way have them available to other Clients, but I guess you would then have to run a scheduled process on the clinets to see if a new messages (record in the table) is available and take action based on that.

Or the user should check himself…

Or am I completely missing the picture here?

Paul

No way, if you add a (related) record the records is shown instantly the other side. Or you can add a line in e textfield and save it, the other client should see the line instantly.

Hee, I am answering my own question!! :o :lol:

Mmm, that is an interesting way :)

So, you create a relation with two globals on the left side, with current userid and the userid of the user you’re chatting with, a table with three columns: your_user_id, chat_user_id and text.

You could add a date into there, so one text field only contains the entire chat of the day…

:D pretty cool

anyway, if this

plugins.scheduler.createJobForClient(clientUserName, solution)

was possible, that would be nice, wouldn’t it?

Guess there are very nice things you could do with it :)

One of the setbacks of the technique just thought of above is that if the user is not looking at the chat window, he/she never knows someone is chating to him/her.

There is no way of notifying the other client… I think that an onDataChange is not fired when the data is changed in another client…

Paul

If you can send a user a message via the server admin page, then you should be able to incorporate the same functionality somehow, couldn’t you?

Technically yes, but that logic is not exposed in the the Developer nor the plugin API.

So, you either hack into the not supported API, maybe breaking stuff, you do not know and if you get something to work, it might not work with a new release, or you build your own functionality in a plugin, which would be the RMI stuff I talked about earlier.

Paul

Just my little contribution to this thread:

schedule a method to see if someone wrote to you…If there is a new messages use the plugin agent to show the alert (or the message). The speaking-parrot does not capture the focus from your current window… so… is a nice way to show the message!

How heavy would such a scheduled method be on the system? Because you would like to run it, lets say every second or so if you want to have a chat system.

And I think that the scheduled method does block the GUI, doesn’t it?

Paul