RemoteObjects Demo
This Demo is a test fixture which allows manual exercise of the RemoteObjects capabilities. The demo program has access to the following Ruby Modules::Classes on the server.- TestJsonXml::DataPatterns – Test cases for the basic JSON to XML conversion patterns.
- RemoteTest:: – Various test classes: Rtest, Stest, SOtest, SOItest (see code for description).
Here is the primary source code file for the demo program.
TestRemoteObjects Usage (0.0.2)
The program provides the ability to load remote classes and invoke their class methods or instantiate remote class objects and invoke their instance methods. The Debugger console displays data sent and received during testing as well as some useful processing info. The user interface is fairly self-explanatory. The following notes further explain how to control the processing.
To load a Remote Class:- Enter the ClassName or ModuleName::ClassName if necessary.
- Click the ‘Load’ button to load the Class into the client.
If the class load is successful a set of new rows will appear below the first set which control operations on the remote class (if multiple classes are loaded some may be hidden by the Debugger console which can be moved out of the way). The initial rows for the class contain:
- The class name.
- An input field for a method to call.
- An input field for any parameters to pass with the operation.
- Two buttons, to either ‘Invoke’ a method or to instantiate a ‘New’ object.
To call Class Methods:
- Enter the method name after the ‘Method’ label.
- Enter a comma separated list of parameters after the ‘Params’ label.
- Click the ‘Invoke’ button.
- Results of the call will be displayed in the debugger window.
- Enter any initialization parameters (comma separated) which might be needed.
- Click the ‘New’ button to create the new remote instance on the client and server.
- A successful ‘New’ operation creates a new group of items to the right of the new instance widgets. Multiple instances can be created resulting in more input widgets further to the right.
- Find the data entry fields and ‘Invoke’ button under the Instance Number and Object ID you want to invoke.
- Enter the ‘Method’ name to invoke.
- Enter any desired Parameters (separated by commas to pass to the method).
- Click the ‘Invoke’ button to invoke the method.
- Observe data sent and received in the Debugger Console.
- Enter any Dataoptions desired in the input text field at the top of the page. Use literal object syntax with curly brackets and double quotes around option keys, example: {“expand_array”: false}. See below for the options definitions.
- Click the ‘Data On’ button. The data binding will be applied to any subsequent Invoke operations.
- After an invoke which returns data, you may inspect the Dataset by clicking the “i” button to the right of the ‘Data On/Off’ button.
- To disable, Click the same button which is labeled the Data Off button when binding is in effect and Data On when it is off.
- “expand_array”: (true|false) – True means expand arrays into multiple nodes using the tag name of the parent at the parent level. Default value is true.
- “array_tag”: String – Tag name to use for arrays when not expanded. The tag name ‘item’ is used when ‘array_tag’ is not specified.
- “root_name”: String – Name to use for the root tag name instead of the default ‘element’.
- “bind_children”: (true|false) – True means bind the children of the root node to the Dataset, else bind the root node. Default value is false.