sinmple chat in Serovy

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

sinmple chat in Serovy

Postby Harjo » Wed Mar 16, 2005 1:07 am

Anyone build allready a simple chatprogram inside Servoy?

I am qurious about the approach/setup.
Harjo Kompagnie
byKom B.V.
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby pbakker » Wed Mar 16, 2005 10:04 am

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Harjo » Wed Mar 16, 2005 10:50 am

No plugin, just in Servoy itself.
I think it is doable.
Harjo Kompagnie
byKom B.V.
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby pbakker » Wed Mar 16, 2005 10:55 am

To whom do you want to chat then?
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Harjo » Wed Mar 16, 2005 11:14 am

I have my own user-database and login-system!
Harjo Kompagnie
byKom B.V.
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby pbakker » Wed Mar 16, 2005 11:20 am

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby patrick » Wed Mar 16, 2005 11:28 am

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
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Harjo » Wed Mar 16, 2005 2:46 pm

pbakker wrote: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:
Harjo Kompagnie
byKom B.V.
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby pbakker » Wed Mar 16, 2005 2:53 pm

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby patrick » Wed Mar 16, 2005 3:40 pm

anyway, if this

plugins.scheduler.createJobForClient(clientUserName, solution)


was possible, that would be nice, wouldn't it?
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby pbakker » Wed Mar 16, 2005 3:47 pm

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby ebrandt » Wed Mar 16, 2005 4:17 pm

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?
ebrandt
 
Posts: 590
Joined: Tue Mar 30, 2004 6:54 pm
Location: largo, fl

Postby pbakker » Wed Mar 16, 2005 4:22 pm

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby automazione » Wed Mar 16, 2005 11:33 pm

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!
Enrico Arata
Servoy Italia
automazione
 
Posts: 366
Joined: Thu Apr 24, 2003 11:37 am
Location: Torino, Italy

Postby pbakker » Thu Mar 17, 2005 9:27 am

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 3 guests