On Tue, 06 Mar 2007 17:31:15 +0100, Angus <an*********@gmail.comwrote:
Hello
My question is a general web programming
question I suppose. We have a call centre web application which
receives data from the telephone system.
I initially thought that Java - using applets would be the way to do
what I need but not really sure. My idea on how to implement this was
as follows:
A) A Java applet embedded in a web page listens for data on a port
from a socket server. When incoming data is available we do a search
by creating our search url and simply posting to the web server.
B) Achieving A) I suppose should be doable but a requirement is that
the server will deliver subsequent call data (ie when call is
answered) and this data should be passed to the same database record.
That is fine because we can do a search for the required record via a
web URL. But what if a web page is open on that record on the
client. Using Java can we latch onto that web page, interrogate the
page to see what record it is (maybe via a form text box?) and then
perhaps save the record (How?) and then close the web page (How?).
It is the B) bit that troubles me most.
Is JavaScript a possible solution to any of this?
Is this possible? how?
Angus
If I'm reading this correctly you're asking about a classic client-server
data access problem: concurrent access (meaning more users could be
editing the same record at the same time). The most basic solution to this
would be to add a time-stamp as a versioning principal to your record: if
someone else tries to save the record it checks its own time-stamp to the
one on record and acts accordingly. Thus far the theory.
How to do this in practice? Yes, you can do it using javascript. But since
you already have a Java applet, why would you? If the Java applet can
listen to the data being changed, it can also read the versioning
principal. If it can listen to the data, why wouldn't it save it as well?
One of the reasons I can think of, is that a web client should be able to
change some information. That still shouldn't require Javascript; instead
an html form and a server-based checking and saving script should be used.
Obviously you could use Javascript to update the html form or make parts
of it visible as more data comes in from the Java applet, but that's
GUI-programming instead of data manipulation: a whole different ball game.
--
Using Opera's revolutionary e-mail client:
http://www.opera.com/mail/