Hi folks,

among 1 of the features which we would like to implement into our application is a simple "chat among a connected users within application".

Questions: 1. Any idea how can identify all active sessions? (to see who is connected, online) 2. Any idea how to pass an information - text - into different session? (to be able to pass an information to other user)

Or is there any maybe easier options?

Many thanks, Tomas

asked 26 Sep '12, 13:28

Tomeo's gravatar image

Tomeo
162148
accept rate: 3%


Ok, Guys,

a first version of formspider chat is running ;-)

alt text

A "problems":

  • a timer execution takes a user's focus for a second and changes a mouse pointer. This is annoying in case when timer is executed with higher frequency (what in this example is needed)

  • a PUSH messages would do a trick. Are you planning to implement something with PUSH messages?

link

answered 29 Sep '12, 14:44

Tomeo's gravatar image

Tomeo
162148
accept rate: 3%

Hi Tomas,

Very Nice! I have been thinking about building this. Push messages would be best, but at least the timer execution in the background will be a must for a smooth user experience. My vote for that one !

Michiel A.

(30 Sep '12, 02:59) Michiel A

Hi Tomas,

We are not planning to add a push feature to Formspider in the near future.

Regards, Ibrahim

(01 Oct '12, 04:19) Ibrahim Sand... ♦♦

I know there is web based chat software on the Internet. Both commercial and open source. Maybe you can install one to you application. We have no experience with any of them though.

If you decide to implement it yourself, there are to options for the infrastructure. You either push the messages to the clients or poll the server from the clients. Formspider cannot do push at this moment but it can poll the server. So every client can poll the server using the timer and retrieve any messages sent to him. Sending messages is easy. It is just a regular Formspider event.

If you develop the underlying mechanism in which you store the messages and who they are for and add polling using the timer mechanism you can develop a chat window in Formspider I guess.

link

answered 26 Sep '12, 21:58

Yalim%20K.%20Gerger's gravatar image

Yalim K. Gerger ♦♦
1914
accept rate: 20%

Hi Yalim,

Thanks for the reply. I don't want to use an external programs, as I would like to have all within formspider.

Based on your answer, at this stage it's not possible to notify a user with a PUSH message. Workaround is a timer which would run some action to check for unreceived messages from database which were sent to user.

OK, an is it possible to identify ACTIVE sessions? Currently I know all users who started a new session - after successful login. If user press a logout button, then this ends a session.

Is it possible to implement a session timeout functionality? If user left an application open for predefined time, then an automatic logout should occur. Then it will be easy to have list of active sessions => active users.

Thanks, Tomas

(26 Sep '12, 23:26) Tomeo

Hi Tomas,

It's possible to define a session timeout value for the application through the "Session Timeout" attribute (You can set this attribute through the application edit dialog, under the "Session" tab). Then, you can use the "Session Expired" event of your application, this is where your logout action will be called (you can assign an action to this event through the application edit dialog, under the "Events" tab).

However, Formspider does not push the session expiration information to the client, therefore, in your case, you should poll the server periodically using the timer in order to force the server to generate the session expired event if it's necessary.

I will prepare a demo application today.

Regards, Ibrahim

(27 Sep '12, 01:39) Ibrahim Sand... ♦♦

Hi Ibrahim,

thanks for an explanation and for your help.

Kind regards, Tomas

(27 Sep '12, 07:03) Tomeo

It is very very easy to identify the active sessionsand implement something like this.

1) Create a table to hold the messages: create table messages ( session_id number, msg_order number, message varchar2(1000) ); 2) create a procedure to query the formspider.t_bdf_applicationsession table and create messages: .... for i in (select bdf_websession_oid from formspider.t_bdf_applicationsession where bdf_application_oid = 123456 ) loop ord := findTheLastMesssageOrder(i.bdf_websession_oid); insert into messages(session_id, msg_order, message) values (i.bdf_websession_oid, ord+1, actual_message); --Do more jobs here..... end loop; .....

3) In the application implement a timer to refresh a datasource like this and process the results: select message from messages where bdf_websession_oid=api_application.getID order by msg_order

I didn't try it but I think it will work fine.

You can go more complex if you want to send messages to specific users but you have to do some processing on the login procedure.

Regards

link

answered 30 Sep '12, 02:11

Vlisidis%20Akis's gravatar image

Vlisidis Akis
163119
accept rate: 5%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×16
×7
×1

Asked: 26 Sep '12, 13:28

Seen: 2,439 times

Last updated: 01 Oct '12, 04:21


© Copyright Gerger 2017