ezAJAX Server Command Specifications
The ezAJAX Server has been constructed to respond to specific “commands”. Each “command” is a String Object instance of any length desired.
A typical invocation of an ezAJAX Server Command is as follows:
“oAJAXEngine.doAJAX('sampleAJAXCommand', 'handleSampleAJAXCommand', 'parm1', 'parm1-value', 'parm2', 'parm2-value', 'parm3', 'parm3-value', 'parm4', 'parm4-value');” or “oAJAXEngine.doAJAX('sampleAJAXCommand', 'simplerHandleSampleAJAXCommand', 'parm1', 'parm1-value', 'parm2', 'parm2-value', 'parm3', 'parm3-value', 'parm4', 'parm4-value');”.
Consider the following: “oAJAXEngine.doAJAX('sampleAJAXCommand', 'handleSampleAJAXCommand', 'parm1', 'parm1-value', 'parm2', 'parm2-value', 'parm3', 'parm3-value', 'parm4', 'parm4-value');”
The function being called is the “oAJAXEngine.doAJAX()” function which is an instance method for the ezAJAXEngine Object. The “doAJAX()” method would therefore be sent to the oAJAXEngine Object instance. The ezAJAX Community Edition is limited to only one instance of the ezAJAXEngine at a time however the Enterprise Edition does not have this limitation.
The ezAJAX Server Command specification is “'sampleAJAXCommand'” which is a String Object instance that specifies the String literal of “sampleAJAXCommand”. More will be said about the ezAJAX Server Command specification in later sections that describe how to code the back-end of the ezAJAX Server.
The ezAJAX Complex Model Call-Back specification is “'handleSampleAJAXCommand'” which is a String Object instance that specifies the String literal of “handleSampleAJAXCommand” that references a Function Object instance that in this case for this example, as taken from the code that was shipped with the product, is a Complex Model Call-Back.
The remaining arguments comprise a list of argument-name and argument-value specifications as follows: “'parm1', 'parm1-value'” where “'parm1'” is a String Object instance that specifies the String literal of “parm1” and “'parm1-value'” is a String Object instance that specifies the String literal of “parm1-value”. A total of four (4) such arguments were specified by the sample ezAJAX Server Command as shown above in this section.
You may notice there is no difference between the Simpler Model Call-Back, as shown above which is as follows: “oAJAXEngine.doAJAX('sampleAJAXCommand', 'simplerHandleSampleAJAXCommand', 'parm1', 'parm1-value', 'parm2', 'parm2-value', 'parm3', 'parm3-value', 'parm4', 'parm4-value');” and the Complex Model Call-Back we just discussed as they both use the same ezAJAX Server Command format. This allows the programmer to dynamically change the Call-Back Model used without having to recode the Server Command specifications. This too makes the ezAJAX and easy product to use going forward.
|