Abstract:
A method of controlling an application program that communicates information over a network ( 32 ) between a client ( 34 ) and a server ( 20 ) is provided. The application program has a previous state and a current state. At least two methods ( 24 ) are stored on the server ( 20 ). At the server ( 20 ), a request having a state indicator indicative of the previous state of the application program is received. One of the methods ( 24 ) is selected based upon the state indicator. Then, the requested method ( 24 ) is transmitted to the client ( 34 ).

Description:
BACKGROUND OF THE INVENTION  
         [0001]    1. Field of the Invention  
           [0002]    The present invention relates to the operational control of computer programs running on a client that is connected to a server via a data connection.  
           [0003]    2. Description of the Related Art  
           [0004]    With the introduction of the World Wide Web and its preferred protocol HTTP, the HTML page description language, and the general availability of browsers for viewing HTML documents sent via data connections using HTTP, it has become popular to program applications on this basis. The JAVA object-oriented programming language is particularly interesting in this context, since an application program called an applet can be contained in an HTML page, and loaded from a server onto a client and executed there. This applet generally uses objects from classes that are already present on the client, and which are dynamically loaded and linked via import mechanisms. By installing the appropriate class libraries on the client, it is therefore possible to provide application programs that are capable of controlling devices, as in the case of self-service terminals and cash dispensers in particular. This means that it is possible to modularize the application program.  
           [0005]    A non-trivial application, covering several HTML pages, therefore requires a set of JAVA applets. Each time the user moves to a different page, a further applet is loaded, and performs the operation associated with that page. The next page in each case can be referred to by means of hyperlinks that are explicitly encoded in the page concerned. Control lies implicitly with the user, who activates the relevant hyperlink.  
           [0006]    However, this elementary form of controlling HTML applications is inadequate in the context of complex applications, where user input is managed, checked and analyzed by the relevant JAVA applet. Depending on the results, which may reflect the data entered and feedback from device controls, it is then necessary to branch to this or that program section. This can be initiated by the JAVA applet, where a new HTML page is loaded via an object provided by the browser. In this way, all operations are controlled entirely by applets.  
           [0007]    However, the well-established advantage of ease of maintenance and compatibility is lost with this approach. If operational control takes place via hyperlinks that are activated by the user, then it is easy to adapt to the application concerned by linking the relevant pages with the associated applets in each case. It is not necessary to adapt the applets themselves, since these can be stored in class libraries that are changed relatively rarely, and which are also identical for different applications. This advantage is lost by transferring application control into the applets, since the corresponding applets would have to be modified for each variant, and a separate class library would have to be produced for each variant.  
           [0008]    The objective of the invention is therefore to provide a solution, in which the same class libraries can be used for different variants of operations, and where the operations are nonetheless controlled entirely by the applets.  
         SUMMARY OF THE INVENTION  
         [0009]    A method of controlling an application program that communicates information over a network between a client and a server is provided. The application program has a previous state and a current state. At least two methods are stored on the server. At the server, a request having a state indicator indicative of the previous state of the application program is received. One of the methods is selected based upon the state indicator. Then, the requested method is transmitted to the client.  
           [0010]    Further areas of applicability of the present invention will become apparent from the detailed description provided hereinafter. It should be understood that the detailed description and specific examples, while indicating the preferred embodiment of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.  
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0011]    The present invention will become more fully understood from the detailed description and the accompanying drawings, wherein:  
         [0012]    [0012]FIG. 1 illustrates a shell program employed in a first embodiment in accordance with the principles of the invention;  
         [0013]    [0013]FIG. 2 illustrates an HTML document employed in a first embodiment in accordance with the principles of the invention;  
         [0014]    [0014]FIG. 3 illustrates a chain function employed in a first embodiment in accordance with the principles of the invention;  
         [0015]    [0015]FIG. 4 illustrates a shell program that is used as a state function in a second embodiment in accordance with the principles of the invention;  
         [0016]    [0016]FIG. 5 illustrates a Java class GetState employed in a second embodiment in accordance with the principles of the invention;  
         [0017]    [0017]FIG. 6 illustrates an HTML page used for testing the GetState Java applet;  
         [0018]    [0018]FIG. 7 illustrates an HTML document employed in a second embodiment in accordance with the principles of the invention;  
         [0019]    [0019]FIG. 8 illustrates an executable function for modifying local program operation in accordance with the principles of the invention;  
         [0020]    [0020]FIG. 9 illustrates an evaluation function for dynamic control;  
         [0021]    [0021]FIG. 10 illustrates an HTML page that loads the executable and evaluation functions; and  
         [0022]    [0022]FIG. 11 illustrates a presently preferred embodiment of a remotely controlled network based program. 
     
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0023]    The following description of the preferred embodiment(s) is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses.  
         [0024]    Referring to FIG. 11, a presently preferred embodiment of a server system  20  employing the remote control technique is illustrated. The technique consists of activating the next operation step from within a subroutine by means of specifying the activation step via a query from the server through the existing network. The server system  20  includes an automatic switch  22  for activating one of several methods  24 . The methods include subroutines such as applets  24   a , web pages  24   b , executable functions  24   c , and evaluation functions  24   d.    
         [0025]    The server  20  is coupled to one or more clients  30  through a network  32 . Each client  30  preferably includes a Web browser for displaying information pages  34  received from the server  20 .  
         [0026]    Preferably, the automatic switch  22  is finite and may easily be represented by a table. This will become clear from the implementation examples described below. The code examples have been simplified considerably for the sake of clarity and, in some cases, also perform functions for which integrated resources are available. It is worth mentioning here that method calls in an object-oriented programming language such as JAVA are subroutine calls, in which a pointer to the occurrence of the relevant object is implicitly supplied as a parameter. In the context of inheritance, it may also be applicable to use a subroutine from another occurrence of another object, if the inheritance rules stipulate this.  
         [0027]    Implementation Examples  
         [0028]    The programs listed in FIGS.  1  to  3  provide a considerably simplified implementation example. The line numbers are provided as reference markers and are not part of the program.  
         [0029]    [0029]FIG. 1 is a shell program  40  that runs in the server as a CGI script. It is held as a file called “step” in the subdirectory “cgi-bin”, as is shown by the comment in Line  1 .  
         [0030]    [0030]FIG. 2 is an HTML document  42 , which is held under the name “step1.html” in the root directory for HTML documents, as specified in the comment in Line  1 . In this example, the widely used ‘apache’ server is used as an HTTP server, where “htdocs” is the standard directory for documents that are not specifically stored elsewhere, and “cgi-bin” is the standard directory for executable scripts.  
         [0031]    [0031]FIG. 3 is a simple JAVASCRIPT “chain” function  44 , which is stored in the root directory under “chain.js”.  
         [0032]    Let us assume that the HTML document “step — 1.html”  42  shown in FIG. 2 and held on the server “host” is loaded into the client by means of the URL “http://host/stepl.html”, for example. As mentioned above, Line  1  is a comment. Line  2  contains the minimum tags required for an HTML document. The body text starts in Line  3 , comprising the number  1  in this case, which represents part of the title line for Level  2 . Line  4  loads the Javascript “chain” function, which is shown in FIG. 3 and explained below. Lines  5  and  6  contain an input field as part of a form, namely a button with the label “ClickMe”.  
         [0033]    If this button is activated, then the previously defined “chain” function is called, as specified by the “onClick” parameter. The first and only parameter in this example is the name of the HTML page, namely the number “1”. The “chain” function  44  shown in FIG. 3 replaces the current HTML page with the page whose URL is made up from a fixed part “../cgi-bin/step?” and the parameter, i.e. the calling page. The shell script  40  from FIG. 1 is therefore called, and the data following the question mark is transferred to the global variable QUERY_STRING.  
         [0034]    The shell script  40  shown in FIG. 1 generates a header in Line  2 , which specifies that the following characters are an HTML document. A case distinction is used in Lines  3  to  7 , to act differently according to the parameter in the QUERY_STRING variable. If the parameter is “1”, then the “cat” command outputs the HTML page “step — 5.html”, and vice versa the page “step — 1.html” if the parameter is “5”. Line  6  only defines an error code for unknown parameters.  
         [0035]    For the sake of simplicity, the file “step — 5.html” (not shown) is identical to “step — 1.html”, except that the number “1” is replaced by the number “5” in Lines  1 ,  2 ,  3  and  6 . This has the following effect: if the user clicks on the button when the page “step — 1.html” is loaded, then the page “step — 5.html” is activated, and vice versa. The invention simply shows that this sequence can be changed by modifying the case distinction in Lines  4  or  5  of FIG. 1. For example, if “step — 5.html” in Line  4  of FIG. 1 is replaced by “step — 7.html”, then this page will be presented to the user. This change is completely independent of the HTML text in FIG. 2.  
         [0036]    In particular, a designer wishing to modify the graphical layout can change the HTML page without difficulty. He or she will not be aware of its operation, nor can the designer change its operation accidentally or on purpose.  
         [0037]    The minimal version of the invention shown here can generally be improved by making the JAVASCRIPT function in FIG. 3 significantly more extensive, so that it checks the input and performs other additional processes before the next page is loaded from the server. Furthermore, the page that is called in each case normally already includes function calls as well as the function definitions in the loaded JAVASCRIPT program.  
         [0038]    The implementation example described above still has the disadvantage that control flow takes place by means of changing HTML pages. A modified server is used to avoid this, and leave just a single sequence connection (also known as the state function) on the server. For the sake of simplicity and clarity, the HTTP protocol is also used for the server of the state function, so that the modified server is largely similar to that described above. In many application areas, a dedicated port with a TCP/IP connection is used for this purpose. As an alternative to the connection-oriented protocol TCP/IP, use of the datagram protocol UDP/IP is also effective, since each query can be handled in isolation and the data volumes are always very small. The only difference is in error handling, and this is not included in the examples provided in any case.  
         [0039]    [0039]FIG. 4 provides a shell script  46  as an example, and this can be used as a state function for the server. Once again, it expects the previous state number as a parameter in QUERY_STRING, and implements the state function by means of a ‘case’ statement. Unlike the shell program of FIG. 1, however, simple text (‘text/plain’) is returned instead of an HTML document (‘text/html’). This consists solely of the number that identifies the next state. Once again, State  1  is converted to State  5  and vice versa.  
         [0040]    However, due to security considerations when writing JAVASCRIPT, it is preferable to use JAVA in connection with the so-called ‘Live Connect’ component of the ‘Netscape Communicator’ browser, in order to interrogate the server in this variant of the invention. This component allows JAVA functions to be called from JAVASCRIPT.  
         [0041]    [0041]FIG. 5 shows a corresponding JAVA class ‘GetState’  48  with a single public function, namely ‘Chain’. This expects two parameters, namely the address of the server and the previous state. So that the ‘cgi-script’ shown in FIG. 4 can be used, the GET method of parameter transfer is applied once again, where the parameter is attached to the address by means of a question mark. This removes the need to program a write connection in FIG. 5, which would otherwise send the old state to the server as a parameter. In Line  7  of FIG. 5, the parameter is therefore added to the address of the server, and an HTTP connection is opened in Line  8 . In order to make this example as clear as possible, error handling is effectively ignored by means of rerouting in the ‘throws’ clause at Line  6 .  
         [0042]    The next step is to set up the buffered reader ‘nxt’ for this connection in Lines  9  to  11 , and the reply from the server is read into the variable ‘res’ in Line  13 . After this, the connection can be closed. This result is then returned as the value of the function call.  
         [0043]    [0043]FIG. 6 shows an HTML page  50 , in which the ‘GetState’ applet  48  is tested. The applet  48  is loaded in Lines  3 - 4 , and offers the ‘Chain’ function described in FIG. 5 via the ‘Live-Connect’. The page mainly consists of a form with two elements, namely the ‘data’ input field defined in Line  7  and the button defined in Lines  8 - 11 , which is not named. The button has an ‘onClick’ function, which replaces the content of the input field (i.e. ‘data.value’) with the value of the aforementioned ‘Chain’ function. Each time the button is clicked, the value is replaced by the next in accordance with the state function shown in FIG. 4. The first parameter, namely the URL of the state function according to FIG. 4, uses the computer name ‘localhost’ in the example, and this should be modified as appropriate.  
         [0044]    [0044]FIG. 7 shows the structure of the page in FIG. 2 if the JAVA applet is used. This is loaded in Lines  2  to  4 . The body of the resulting HTML page  52  comprises a form with a single button, which is defined in Lines  7  to  11 . When the button is clicked, the current page is replaced by a page whose name is made up of the fixed prefix ‘chain_’ and the fixed postfix ‘.html’, located on either side of the result of the ‘Chain’ function call, which contains both the URL of the state function as its first parameter and the number of the old state (the page in this case) as its second parameter.  
         [0045]    For testing purposes, the HTML page  52  shown in FIG. 7 is saved with the name “chain — 5.html”, and a copy is made with the name ‘chain — 1.html’ (not shown), in which the ‘5’ is replaced with a ‘1’. If the state function is expanded as per FIG. 4, then a corresponding number of pages should be set up. The selection of pages, which may be held on any server, is specified by the server defined in Line  10  of FIG. 7, specified as ‘localhost’ in the example.  
         [0046]    The example in FIG. 8, which has once again been radically simplified for the sake of clarity, shows how the result of the server query can be used to influence local program operation instead of loading a different document. In the local program control technique  54 , the JAVA applet offering the ‘Chain’ function is once again loaded in Lines  2 - 3 . Lines  5  to  24  show operational control consisting of an ‘exec’ function. Lines  25  to  30  show the body, consisting of a form with a single button (with the label ‘ClickMe’) and an ‘onClick’ result handler, which activates the ‘exec’ function each time the button is clicked.  
         [0047]    Line  6  in FIG. 8 defines and pre-assigns the address of the state server in the ‘url’ variable, and Line  7  defines and pre-assigns the ‘state’ state variable. Three colour values are defined in Lines  8  to  10 .  
         [0048]    In Line  12 , the new state ‘nstate’ is derived from the previous state ‘state’ when the ‘exec’ function is activated.  
         [0049]    If this has a value of ‘ 99 ’, then the change in Line  14  is dependent on user confirmation, which would normally have to occur after Line  17 . Lines  18  to  23  set the background colour depending on the ‘state’ state, and take the place of a complex operation.  
         [0050]    Therefore, based on the application in FIG. 8, the sequence of background colours is determined by the server, which specifies this change via the ‘cgi-script’ ‘chain’.  
         [0051]    Instead of the simple example shown above, it is now possible to implement a far more complex control sequence. In particular, the state function can accept complex parameters, where the present state does not just include the result of the last state change, but also a result from a current process. This is particularly useful in the context of user input or establishing the type of card that is currently inserted in a card reader. Access to the latter type of query normally takes place via JAVA class functions, which use recognized security measures to allow selective access to the computer&#39;s resources.  
         [0052]    With the Javascript ‘eval’ function, the result can also be used to determine the name of the calling function dynamically. FIG. 9 shows a JAVASCRIPT program  56 for dynamic control, with the ‘chain_ 1 ’ and ‘chain_ 5 ’ functions as well as the ‘exec’ function. FIG. 10 shows an HTML page  58 , which loads the APPLET with the CHAIN function in Lines  2 - 4 , loads the JAVASCRIPT program as per FIG. 9 in Line  5 , and has, in Lines  7 - 11 , a body like that in FIG. 8 Lines  20 - 25 , which calls the ‘exec’ function each time the button is clicked.  
         [0053]    This determines, absolutely in this instance, the new state from the old state with the ‘Chain’ function, and calls the corresponding function thus defined by means of the ‘eval’ function in Line  14  of FIG. 9. If necessary, the existence of this function can be verified by the ‘typeof’ operator, before loading the function dynamically, provided this is possible.  
         [0054]    It is clear that JAVA programming could be used throughout instead of JAVASCRIPT, which is only used here by way of an example. In particular, the ‘Chain’ function is not then restricted to returning just a number, which is converted to a function name, but could also return a complete class designation with function name. Since dynamic class loaders are customary for JAVA, it is possible to make operation fully dynamic and definable from the host, and still run locally. In particular, such a dynamic class loader can also include cache functions, so that classes are only loaded if required over the existing network. In each case, the invention makes it possible to implement fully autonomous coding for the state transition.  
         [0055]    Thus it will be appreciated from the above that as a result of the present invention a method and system for remotely controlling a program is provided by which the principal objectives, among others, are completely fulfilled. It will be equally apparent and is contemplated that modification and/or changes may be made in the illustrated embodiment without departure from the invention. Accordingly, it is expressly intended that the foregoing description and accompanying drawings are illustrative of preferred embodiments only, not limiting, and that the true spirit and scope of the present invention will be determined by reference to the appended claims and their legal equivalent.