Dynamische Feldprüfung in HTM -Seiten Dynamic field check in HTM pages
Die Erfindung betrifft die dynamische Feldprüfung in HTML- Seiten durch Computerprogramme.The invention relates to dynamic field testing in HTML pages by computer programs.
In einer großen Anzahl von Computerprogrammen ist es zweck- mäßig, sowohl die Anzeige von Daten als auch die Eingabe von Daten durch den Benutzer durch Seiten einer Markierungssprache wie HTML zu gestalten, weil damit ein betriebssystemunabhängiges und leicht konfigurierbares System entsteht. Dies wird dadurch unterstützt, daß die Anzei- geprogramme, im folgenden Browser genannt, eine Programmierung innerhalb der Seite zulassen.In a large number of computer programs, it is expedient to design both the display of data and the input of data by the user by means of a marking language such as HTML, because this creates an operating system-independent and easily configurable system. This is supported by the fact that the display programs, called browsers in the following, allow programming within the page.
Hierfür sind die Programmsysteme JavaScript, ActiveX und JAVA der Firmen Netscape, Microsoft und Sun allgemein bekannt und werden von den üblichen Browsern wie Netscape Communicator, Microsoft Internet Explorer oder Opera unterstützt. Insbesondere JavaScript unterstützt eine Ereignisbehandlung, bei der in einem Formular durch das Verlassen eines Feldes (OnBlur1) oder dessen Veränderung (OnChan- ge') ein JavaScript-Unterprogramm aufgerufen wird.The program systems JavaScript, ActiveX and JAVA from the companies Netscape, Microsoft and Sun are generally known for this and are supported by the usual browsers such as Netscape Communicator, Microsoft Internet Explorer or Opera. JavaScript in particular supports event handling in which a JavaScript subroutine is called in a form by leaving a field (OnBlur 1 ) or changing it (OnChange ').
Es ist bekannt, daß durch solche Unterprogramme die Inhalte solcher Formularfelder überprüft werden können. Die dazu verwendeten JavaScript Unterpogramme (Funktionen) sind meistens Teil der das Formular enthaltenenen Seite, weil so der Programmierer sowohl das Formular als auch die Prüfpro- gramme in derselben Quelle hat. Alternativ können die JavaScript-Funktionen auch von einer beliebigen, durch eine URL bestimmten, Quelle geladen werden. Diese Technik wird besonders bei Internet-Anwendungen verwendet.
In einigen Anwendungen ist diese Kopplung von Steuerung und Prüfung mit der Darstellung jedoch nicht erwünscht. Dies ist insbesondere immer dann der Fall, wenn die optische Gestaltung eine besondere Rolle spielt und daher von der Ablaufsteuerung getrennt sein soll . In diesen Fällen wird eine Methode benötigt, bei der die Ereignisbehandlung einerseits einheitlich und möglichst einfach angesprochen werden kann und andererseits eine komplexe Überprüfung und Steuerung möglich sein soll. Das gilt in besonderem Maße dann, wenn ein Browser für die Ablaufsteuerung bei einem Selbstbedienungsterminal oder Geldautomaten benutzt wird.It is known that the contents of such form fields can be checked by such subroutines. The JavaScript sub-programs (functions) used for this are mostly part of the page containing the form, because the programmer has both the form and the test programs in the same source. Alternatively, the JavaScript functions can also be loaded from any source specified by a URL. This technique is used particularly in Internet applications. In some applications, however, this coupling of control and testing with the display is not desirable. This is always the case in particular when the optical design plays a special role and should therefore be separated from the sequence control. In these cases, a method is required in which, on the one hand, the event handling can be addressed uniformly and as simply as possible, and on the other hand, complex checking and control should be possible. This is particularly true when a browser is used to control the flow of a self-service terminal or ATM.
Die Lösung besteht zunächst darin, Anzeigeseite und Steuerseite voneinander zu trennen, so daß in der Anzeigeseite nur noch Funktionsaufrufe für die Ereignisbehandlung er- scheinen. Es zeigt sich, daß diese dann für alle Felder gleich gestaltet werden können und somit einfach handhabbar sind. Die Steuerseite hingegen lädt ein Programmmodul, dessen Unterprogramme komplexe Prüfungen durchführen können und das über dynamische Aktivierung von Unterprogrammen, gesteuert durch Konfigurationsdateien, frei konfigurierbar ist, ohne daß dies in der Gestaltung der Anzeigeseite sichtbar wird.The solution initially consists of separating the display side and the control side from one another, so that only function calls for event handling appear on the display side. It turns out that these can then be made the same for all fields and are therefore easy to handle. The control side, on the other hand, loads a program module, the subroutines of which can carry out complex tests and which can be freely configured via dynamic activation of subroutines, controlled by configuration files, without this being visible in the design of the display page.
Weitere Merkmale und Vorteile der Erfindung ergeben sich aus der folgenden Beschreibung, welche in Verbindung mit den beigefügten Zeichnungen die Erfindung an Hand eines Ausführungsbeispiels erläutert .Further features and advantages of the invention will become apparent from the following description, which in connection with the accompanying drawings explains the invention using an exemplary embodiment.
Es zeigenShow it
Fig. 1 den HTML-Code für eine Steuerseite,1 shows the HTML code for a control page,
Fig. 2 den HTML-Code für eine Anzeigeseite,
Fig. 3 den JAVA-Code für ein Prüfprogrammmodul .2 the HTML code for a display page, 3 shows the JAVA code for a test program module.
Die im folgenden dargestellten Ausführungsformen der Erfindung beginnen zugunsten der Übersichtlichkeit mit einem wesentlich vereinfachten Beispiel, dessen Potential sich durch die darauf folgenden Erweiterungen darstellt. Insbesondere sind Fehlerbehandlung und -Vermeidung nicht ausprogrammiert .For the sake of clarity, the embodiments of the invention shown below begin with a substantially simplified example, the potential of which is shown by the subsequent extensions. In particular, error handling and avoidance are not programmed.
Die in Fig. 1 bis Fig. 3 dargestellten Progammzeilen sind, wie üblich, mit vorgestellen Zeilennummern versehen, die der Bezugnahme dienen und nicht Teil der Programme sind.The program lines shown in FIGS. 1 to 3 are, as usual, provided with prefixed line numbers which are used for reference and are not part of the programs.
In Fig. 1 ist der Programmcode für eine Steuerseite in HTML mit eingebettetem Javascript gezeigt. Die Zeilen 101 und 119 enthalten die in HTML vorgeschriebenen Klammerungen des Haupttteils. In den Zeilen 102 bis 115 sind JavaScript- Anweiseungen enthalten, die weiter unten besprochen werden. In Zeile 116 beginnt der Körper der Steuerseite, dem als Ereignisbehandlung der Funktionsaufruf 'init();' zugeordnet ist. Diese Funktion wird dann aufgerufen, wenn die Seite vollständig geladen ist und insbesondere die nachfolgend spezifizierte Aktivierung eines JAVA-Moduls abgeschlossen ist .1 shows the program code for a control page in HTML with embedded Javascript. Lines 101 and 119 contain the parentheses of the main part prescribed in HTML. Lines 102 through 115 contain JavaScript instructions that are discussed below. Line 116 begins the body of the control side, which receives the function call 'init ();' assigned. This function is called when the page is fully loaded and in particular the activation of a JAVA module specified below has been completed.
In den Zeilen 117 und 118 wird ein JAVA-Applet geladen und mit dem Bezeichner 'chkcode' versehen. Als Quelle wird in Fig. 1 eine absolute URL angegeben; alternativ kann auch durch ' src=chkcode.class ' eine relative URL benutzt werden. Letztere wird dann von derselben Quelle geladen, von der auch die Steuerseite geladen wird.A JAVA applet is loaded in lines 117 and 118 and given the identifier 'chkcode'. An absolute URL is given as the source in FIG. 1; alternatively, a relative URL can also be used with 'src = chkcode.class'. The latter is then loaded from the same source from which the control side is loaded.
In den Zeilen 109 bis 111 wird die Funktion *init()' definiert, die gemäß Zeile 116 nach dem Laden der Seite und dem
Laden des JAVA-Moduls aufgerufen wird. In diesem Beispiel wird lediglich durch die Funktion 'window. open ( ) ' eine weiteres Fenster geöffnet, in dem eine Anzeigeseite dargestellt wird, die über die relative URL 'chkUIl.html' gela- den wird. Eine Referenz auf diese Seite wird in der Variablen 'winShow' abgelegt.In lines 109 to 111 the function * init () 'is defined, which according to line 116 after loading the page and the Loading of the JAVA module is called. In this example the function 'window. open () 'opens another window, in which a display page is shown, which is loaded via the relative URL' chkUIl.html '. A reference to this page is stored in the 'winShow' variable.
Eine solche Anzeigeseite ist als Beispiel in Fig. 2 dargestellt . Sie besteht in bekannter Art aus der Klammerung in den Zeilen 200 und 213, einer Überschrift in Zeile 202 und einem Formular in den Zeilen 203 bis 212. Das Formular besteht aus festem Text in den Zeilen 206, 209 und 211 sowie drei Feldern in den Zeilen 204, 207 und 210 sowie einer Schaltfläche in Zeile 212. Das Eingabefeld von Zeile 204 enthält einen Bezeichner 'Amount' und als Ereignissteuerung bei Änderung des Feldes den Funktionsaufruf 'ope- ner.checkField(this.name, this.value) ; ' .Such a display page is shown as an example in FIG. 2. As is known, it consists of the brackets in lines 200 and 213, a heading in line 202 and a form in lines 203 to 212. The form consists of fixed text in lines 206, 209 and 211 and three fields in the lines 204, 207 and 210 as well as a button in line 212. The input field on line 204 contains an identifier 'Amount' and as event control when changing the field the function call 'opener.checkField (this.name, this.value); '.
Gleiches gilt für das zweite Feld, das sich hier im Beispiel nur durch den Feldnamen 'Account' anstelle von Α- ount ' unterscheidet. Die Bezeichner 'this.name' und 'this.value' sind, gemäß der JavaScript-Definition, Bezüge auf den jeweiligen Feldnamen und den jeweiligen Feldinhalt. Die ' onChange ' -Angaben sind also für beide Felder identisch. Der Präfix 'opener. ' in den Angaben für die Ereignisbehandlung zeigt an, daß die Funktion 'chkFieldO' in der Steuerseite zu finden ist.The same applies to the second field, which differs in the example only by the field name 'Account' instead of Α- ount '. The identifiers 'this.name' and 'this.value' are, according to the JavaScript definition, references to the respective field name and the respective field content. The 'onChange' specifications are therefore identical for both fields. The prefix 'opener. 'in the event handling information indicates that the' chkFieldO 'function can be found on the control page.
Das dritte Feld in Zeile 210 ist im Beispiel als Nachrichtenfeld konzipiert, in das aus der Steuerseite heraus Meldungen geschrieben werden. Diese Programmtechnik ist zur Zeit nur mit dem Internet Explorer der Fa. Microsoft, ins- besondere der Version 5.5, funktionsfähig. Für den Netscape
Navigator kann die vordefinierte Funktion 'alert' verwendet werden oder die Nachricht der Variablen 'defaultStatus ' zugewiesen werden.In the example, the third field in line 210 is designed as a message field, in which messages are written from the control side. This program technology can currently only be used with Microsoft's Internet Explorer, especially version 5.5. For the Netscape Navigator can use the predefined 'alert' function or assign the message to the 'defaultStatus' variable.
Die Anzeigeseite wird durch die Angabe ' fullscreen=yes ' in Zeile 110 (Fig. 1) formatfüllend angezeigt, so daß die Steuerseite nicht sichtbar ist. Alternativ ist die Benutzung von Frames, die hier nicht dargestellt wird. Die Anzeigeseite wird in dem Beispiel von der gleichen Quelle geladen wie die Steuerseite. Durch Angabe einer absoluten URL in Zeile 110 (Fig. 1) wird erreicht, daß die Anzeigeseite anderswoher geladen wird. Dies ist insbesondere dann sinnvoll, wenn die Steuerseite lokal, d.h. von dem den Browser ausführenden, Rechner geladen wird, aber die Anzeigeseite über ein Netzwerk bereitgestellt wird. Da die Erfindung es gerade ermöglicht, die Anzeigeseite weitgehend von der'Fullscreen = yes' in line 110 (Fig. 1) shows the display page in full format, so that the control page is not visible. An alternative is the use of frames, which is not shown here. In the example, the display page is loaded from the same source as the control page. By specifying an absolute URL in line 110 (FIG. 1) it is achieved that the display page is loaded elsewhere. This is particularly useful if the tax side is local, i.e. from which the computer executing the browser is loaded, but the display page is provided via a network. Since the invention makes it possible, the display page largely from the
Steuerseite und der Feldüberprüfung zu entkoppeln, können so Änderungen im Layout einfach auf dem Server bereitgestellt werden, ohne daß die Zuverlässigkeit leidet.To decouple the control side and the field check, changes in the layout can easily be made available on the server without the reliability being impaired.
Wird eines der beiden Felder 'Amount' bzw. 'Account' in der Anzeigeseite gemäß Fig. 2 geändert, so wird die Funktion 'chkFieldO ' in der Steuerseite aufgerufen, die in Zeile 105 bis 107 (Fig. 1) definiert ist. Diese ruft nunmehr in Zeile 106 die Funktion 'chkcode' des bei Start geladenen JAVA-Applets auf, wobei die beiden Parameter für Feldname und Feldinhalt weitergereicht werden. Das Ergebnis dieser Funktion ist im Beispiel der Text 'OK' oder eine Fehlermeldung. Dieser Text wird einerseits in der in Zeile 104 definierten Variablen 'res' abgelegt und andererseits in Zeile 107 in die Anzeigeseite übertragen. Alternativ kann durch die vom Browser bereitsgestellte Standardfunktion ' alert ()' eine Anzeige erfolgen, wenn das Resultat nicht 'OK' ist.
Aktiviert der Benutzer die in Zeile 212 (Fig. 2) definierte Schaltfläche, so wird die Funktion 'done() ' aufgerufen, die in Zeile 112 bis 113 (Fig. 1) definiert ist. In diesem Beispiel wird lediglich die Variable 'res' abgefragt, ob ein Fehlercode der letzten Feldüberprüfung vorliegt. Ist das nicht der Fall, wird das Anzeigefenster geschlossen. In realistischen Anwendungen werden andere Inhalte geladen, die dann weiterhin sich der Funktionen der Steuerseite insbesondere zur Feldprüfung bedienen können.If one of the two fields 'Amount' or 'Account' on the display page according to FIG. 2 is changed, the function 'chkFieldO' is called up on the control page, which is defined in lines 105 to 107 (FIG. 1). This now calls the function 'chkcode' of the JAVA applet loaded at start in line 106, whereby the two parameters for field name and field content are passed on. In the example, the result of this function is the text 'OK' or an error message. This text is stored on the one hand in the variable 'res' defined in line 104 and on the other hand transferred in line 107 to the display page. Alternatively, the standard function 'alert ()' already provided by the browser can be used to display if the result is not 'OK'. If the user activates the button defined in line 212 (FIG. 2), the function 'done ()' is called, which is defined in lines 112 to 113 (FIG. 1). In this example, only the variable 'res' is queried whether there is an error code from the last field check. If this is not the case, the display window is closed. In realistic applications, other content is loaded, which can then continue to use the functions of the control side, in particular for field testing.
In Fig. 3 ist eine einfache Version eines JAVA-Applets gezeigt, das insbesondere die in Zeile 106 (Fig. 1) aufgerufene Funktion chkField in Zeile 303 definiert. Als Beispiel wird abhängig von dem Feldnamen eine Überprüfung der Zahlenbereiche durch eine gemeinsame Funktion 'chkRange' vor- genommen, die in den Zeilen 310 bis 320 definiert ist und dem mit JAVA vertrauten Programmierer unmittelbar verständlich sein sollte. Diese Funktion gibt entweder 'OK1 bei Werten innerhalb des angegebenen Bereichs oder sonst eine Fehlermeldung zurück.FIG. 3 shows a simple version of a JAVA applet, which in particular defines the chkField function called in line 106 (FIG. 1) in line 303. As an example, depending on the field name, a check of the number ranges is carried out by a common function 'chkRange', which is defined in lines 310 to 320 and should be immediately understandable to programmers familiar with JAVA. This function either returns' OK 1 for values within the specified range or otherwise an error message.
Selbstverständlich könnte diese einfache Funktionalität, möglicherweise sogar bequemer, auch direkt in JavaScript in der Steuerseite nach Fig. 1 programmiert werden. Die gezeigte indirekte Methode über die Kopplung von JavaScript mit JAVA erlaubt jedoch eine Reihe von vorteilhaften Maß- nahmen.Of course, this simple functionality, possibly even more convenient, could also be programmed directly in JavaScript in the control page according to FIG. 1. However, the indirect method shown via the coupling of JavaScript with JAVA allows a number of advantageous measures.
Zum einen kann, wie durch Angabe einer absoluten URL mit 'localhost' als Rechneradresse in Zeile 117 (Fig. 1) gezeigt, das JAVA-Applet von dem jeweiligen Rechner geladen werden, auf dem der Browser ausgeführt wird. Im Falle eines Selbstbedinungsterminals bedeutet dies, daß die Steuerseite
über ein Netzwerk von einem zentralen Server bestimmt wird, die Prüfroutinen jedoch letztlich lokal bestimmt sind. Da für JAVA über das 'java native interface ' (JNI) eine Einbindung von Unterprogrammen in anderen Programmiersprachen möglich ist, können so auch in JAVA nicht direkt unterstützte Geräte, hier insbesondere Kartenleser für Magnet- streifen- oder Chipkarten, angesprochen werden.On the one hand, as shown by specifying an absolute URL with 'localhost' as the computer address in line 117 (Fig. 1), the JAVA applet can be loaded from the respective computer on which the browser is running. In the case of a self-service terminal, this means that the tax side is determined via a network from a central server, but the test routines are ultimately determined locally. Since it is possible for JAVA to integrate subroutines in other programming languages via the 'java native interface' (JNI), devices that are not directly supported in JAVA, in particular card readers for magnetic stripe or chip cards, can also be addressed.
Da zum anderen JAVA bereits über eine vollständige Schnittstelle für den Aufruf von IP-Protokollen wie TCP/IP ver- fügt, kann die Überprüfung der Feldinhalte, z.B. einer Bankleitzahl, durch eine NetzWerkverbindung erfolgen.On the other hand, since JAVA already has a complete interface for calling IP protocols such as TCP / IP, the field contents can be checked, e.g. a bank sort code, through a network connection.
Weiterhin bietet JAVA die Möglichkeit, Unterprogramme dynamisch zu laden. Diese werden als 'class' bezeichnet und durch die Methode 'newlnstance () ' aktiviert. In einer tat- sächlichen Implementation werden dann dynamische Assoziativlisten aufgebaut und die Zeilen 304 bis 307 (Fig. 3) durch eine Suche in solchen Listen ersetzt. Die Listen werden bevorzugt durch Konfigurationsdateien bestimmt, die den Feldnamen die Bezeichner von Klassen-Methoden zuordnen und mit der Aktivierung des JAVA-Programms aufgebaut werden. Die ensprechende Programmiertechnik darf als dem Fachmann bekannt vorausgesetzt werden und wird daher nicht gezeigt.
Furthermore, JAVA offers the possibility to load subroutines dynamically. These are called 'class' and are activated by the 'newlnstance ()' method. In an actual implementation, dynamic associative lists are then built up and lines 304 to 307 (FIG. 3) are replaced by a search in such lists. The lists are preferably determined by configuration files that assign the names of class methods to the field names and are built up when the JAVA program is activated. The corresponding programming technology may be assumed to be known to the person skilled in the art and is therefore not shown.