Hi Marshal,
is there a similar feature in
JAVAScript - or at least soem thing mroe flaxible than lines and lines
of assignments?
One possibility, and my personal preference, is to deploy a
TCP/IP Socket
managed by a JAVA Applet. As long as you
connect back to the same
code base
then no certificate signing is reqd. Server Affinity is completely under
your
control , and you can receive any number of rows, or
array elements, in
response. Unlike Ajax or a.n.other option, you can achieve a high
degree of
parallelism with the client JAVAScript enriching and adding value to rows,
and presenting them, while the server is busy filling the
queue with the
rest of the result set. Realtime visual status aids such as a Record Count
or a Diminishing Scrollbar can also help the user to feel that the server
has not forgotten about them. (I'm also quite excited about the prospect of
dynamic/animated chart building with Flash's "Data Binding" and the
streaming of periodic sales figures
down the
pipe - but I have not worked
that part out yet :-) Anybody with opinions/experiences of
JAVAScript+FABridge -vs- Native ActionScript Getters and Setters?)
Anyway, here is an example of what I'm talking about: -
http://manson.vistech.net/t3$examples/demo _client_web.html
Username: TIER3_DEMO
Password: QUEUE
I will post more demo instructions at the end of this but, to see the
bit you
want in action, just enter an
asterix "*" for the Queue Name and then click
the green "Get Job Info" button. You will see that the
<select> list is
populated from the server, one row/element at a time. I have tested this
with up to 3000 rows and
scalability does not seem to be an issue! The one
performance problem I experienced was the tear-down of the old/previous
option-collection before populating the results from the next query. Thanks
to RobG, the problem was solved with DOM Node Cloning and Replacing.
All of the client
source code can be found at:-
http://manson.vistech.net/t3$examples/
QUEUE_LOOKUP.HTML contains the code you'd be interested in specifically the
job Lookup() and getResponse() functions, although following the selectRef
and selectClone
object s through the code could be worthwhile. The driving
Applet is CornuCopiae.JAVA and the object definition can be found in
ConuCopiae.html. (The main Socket stuff being in Tier3Socket.JAVA) NB: All
Applet JAVA code is application-neutral and completely reusable. No JAVA
coding "need" be done for applications 2 to N.
If you'd prefer someone to have Mugabe(esque) totalitarian control over your
server interaction then I'd suggest Silverlight. (Or Flash's Data Management
Services - "All client-resident data in sync" - Yeah right. But at least
with Flash (and obviously JAVA) you get the choice!)
Although my code is, at present,
VMS -specific you could achieve similar
results with simple INETd server
process es, if you dropped the authorization
and were happy with one server process per user.
Cheers Richard Maher
PS. The code does not automatically check for versions, but does work on
recent versions of Mac OS X Safari (1.5 JDK),
Firefox ,
Windows Firefox and
IE 6 and 7, Opera,
Linux and Firefox. You must have JAVAScript enabled,
Applets enabled and a recent JVM. You also can not be behind a
firewall that
bans outgoing connections unless you
open up 5255.
Here's some of the functionality-catwalk highlights from the example: -
1) Full, one-time, context-specific, VMS User Authentication. No Cookies,
Session IDs, Password Caching or generic Work-Station or Browser
credentials! When you load the demo_client_web.html page into your browser,
a JAVA Applet is automatically activated that prompts the user for their VMS
Username and Password via a
modal dialogue box. If authorization fails, the
"Access Denied" page will be displayed and VMS Intrusion Detection (in
accordance with the policy set out by your System Manager) will be enforced,
and Login-Failures is incremented in SYSUAF. Alternatively, if authorization
is successful (and you left the "Display Logon Confirmation" box ticked)
then a Welcome dialog box will be displayed detailing last login times and
the number of unsuccessful login attempts (if any). Login-Failures is now
set to zero and last non-interactive login time is set to the current time.
If you refresh this page, or move to a different page, then the server
connection is broken and you must be re-authorised before continuing to
access the Demo Queue Manager application.
2) A Hot-Abort button! After you've pressed the "Get Job Info" button
you will notice that the "Abort Request" button becomes active and turns red.
(Actually you probably won't notice 'cos this query completes too quickly
:-) You can edit the DEMO_UARS.COB code and change the value of the
DEBUG_DELAY field if you want to see your 3GL Interrupt routine in action.)
In this case the cancel-flag I have set in the AST routine is picked up in the
mainline code, resulting in the graceful termination of the loop that
controls "next queue" (or "next row") retrieval.
Also, if you look at the getResponse() function in query_lookup.html, you
will see how the chan.setTimeout() method has been deployed to provide an
erstwhile "blocking"
socket Read with the ability to surrender the
event-thread for things like processing the Abort button and ticking over
the clock. (all of this, and much more, "infrastructure-code" is already
there and does not have to be re-invented)
3) Predictive text on the Queue Name field so that all matching VMS queues
are retrieved on-demand as the user types. As is now common-place with many
websites, a drop down select list of matching options is automatically
retrieved from the server and made available for the user to select from.
4) Result-set drill-down. Many database queries return a result-set of rows
for the user to scan through and possibly drill-down into for more detail.
I have provided a reasonably generic example of this, where all matching Job
Entries have been populated into a dynamic HTML select list. Once again the
user was able to see the select-list grow, the scroll-bar diminish, and
"Jobs Found" field tick over in real-time, whilst continually being
empowered (by the Abort button) to curtail the results at any time!
If you click on an entry in the Select List then the
<frame> changes and the
entry_details.html page appears. See the parent.entry_details.getReady()
call in queue_lookup.html to see how the handover to the new frame takes
place. (Also see goBack() in entry_details.html to see how simply that
operation is reversed.)
The user is now free to move forward, back, first, last, refresh, and delete
queue entries, or return to the previous frame. (Thanks to the deployment of
the VMS Persona functionality, the user is only permitted to see those queue
entries that the Username they signed in under is permitted to see. They can
also *only* delete those entries that this username is allowed to delete.)
5) Floating
<div>s. You will see that any queue names are highlighted in bold
and italics; if you mouseover any of these fields when they aren't blank
then the current status information for that queue will be retrieved from
the server and displayed in a quasi-popup DIV.
6) Local Result-Set Sort. If you click on the "header" or "first" row in the
Select List of queues, you'll get a popup prompting you for a sort key. If
you select one, the contents of the Select List are sorted in the chosen
order. (Try enter "*" for the Queue Name and then clicking "Get Job Info" to
wrote in message in
message
I'm working on an application that requires a lot of internal data -
short texts, numbers, switches etc. At the moment the only way I have
of loading these is long lines of Array[1,2,3 etc]=The Data. In the VB
version I read data in from text files - is there a similar feature in
JAVAScript - or at least soem thing mroe flaxible than lines and lines
of assignments?
> Marshal