__header__

Web Server

The Web Server tools are a set of three tools, HTTP Protocol, Extension Collection, and Domain Collection, that will collectively work to support a web page/site as its web server. The three tools work together to create the functions of the website as well as to communicate with the world wide web to allow anyone to view and use the website connected with it.

This service/program is still within the prototype stage, but the following information will explain how it will work when it is finished. 

Using the Web Server Tools

 To begin drag 'n' drop all three tools from the ROT Protocol Palette to the ROTMain Palette. The Domain Collection and the Extension Collection must be set up prior to using the HTTP Protocol.

The Domain Collection:
The Domain Collection allows the user to set the name of the website, alternate names, and the location that the server will find the website. The Domain will allow the user to set up other domains as well.
 Here is an example. Filled in is the minimum amount of data that the web server would need to communicate. This tool will eventually be inputted into the HTTP Protocol to be put into effect.





















Extension Collection:
The user will input where the extensions will be mapped to into this tool.
For example we only wanted to recognize and map Image, PHP, and HTML files. So we found different types of image files and mapped them all to the same place "FileMapperIMG". Then we did the same for the HTML and PHP files.
To do this you type the extension to be used in the top left box and select the File Mapper from the drop down menu. Once those choices are made select the "+" button.
If any extensions are listed that the user wishes to change or delete select the white "x" button.
Selecting the red "x" button will delete all the extensions on the page to give the user a fresh screen to start with.
When finished select "apply" to save any changes.
This tool will need to be inputted into the HTTP Protocol tool in order to be put into effect.








HTTP Protocol:
Once all of the information is inputted into the Domain and Extension Collection tools they can be inputted into the HTTP Protocol tool. This tool stores the final information to utilize all the information in the most appropriate and efficient way.
 To use, drag 'n' drop the Domain Collection and the Extension Collection from the ROTMain and drop them into the HTTP Protocol tools inputs page.
Next click on the PHP Executable tab. Enter in the Executable file name there. Use the "..." button to browse through possible files. Select "Apply" to save.


Once these steps are completed the Server can be initiated. As these steps are still within the prototype phase it can not be utilized or sold to individuals at this time.

Script Service

ScriptService (WKS tags in HTML Script)

A new DLL (webservices.dll) has been created to handle different types of web services (http://en.wikipedia.org/wiki/Web_Service) offered by the Automation Manager software. The web services dll currently has two objects:

Other useful protocols that might be of benefit to support as web services are REST (http://en.wikipedia.org/wiki/REST ) and SOAP (http://en.wikipedia.org/wiki/SOAP ).

New Interfaces How the ScriptService works

tService object is a ROTAddin and must be added to the ROT of a workspace that has the HTTP protocol running. If no file handler is found by the HTTP Protocol Object the ROT is searched for instances of IWebService. The web services is asked if it can handle the current user request and if so is then replicated and given the request to handle.

The ScriptService internally determines whether it can handle a request by examining the Service Location and Script Types Handled parameters.

Service Location is a URI that represents the web service’s endpoint. i.e. for a REST service the entry might be http://www.automationmanager.com/services/rest/

Script Types Handled is a string that gives the file extensions that must be parsed by the web service. i.e. for ScriptService the entry might be .syn,.spx

If the Enabled parameter is not checked then the web service is disabled and will not process requests.

Once the HTTP protocol has determined that the ScriptService can handle a user request it query for IFileMapperCGI interface and sets the environment variables and POST variables if present. The ScriptService stores all environment variable in parameters starting with ENV_. Users cannot set or overwrite ENV_ variables. POST variables are stored as ENV_POST_ and PARAM_ parameters. GET variables are stored as ENV_GET_ and PARAM_ parameters. The current user request is sent and loaded through IFileArchive interface. The ScriptService loads the given file and parses the data. Anything outside of tags is treated as output text and put into the output stream. This means that normal HTML can be placed anywhere in the file as long as it is not between the tags. The ScriptService parses text between the tags and outputs data dependant on the script between the tags.

The script between the tags is broken down into statements by the use of ‘;’ to denote the end of a statement. A statement consists of keywords, Automation Manager Protocol commands, operators and literal values.

The keywords that can be used are as follows:

The IVariant object is used to determine the type of variable being operated on and what comparison is valid. Currently integers and doubles are compared as doubles, strings and numbers cannot be compared and objects are not compared at all.

Literal Values: String are represented by double quotations e.g. “literal string” Numbers are represented by the literal number e.g. 45.67, 33.

Automation Manager Protocols:

If a command in a statement cannot be handled by the ScriptService then the ROT is searched for a WebServiceProxy object or a ProtocolManager object, that can handle the request, and is passed off. Any resulting output from the handler is returned and handled as determined by the script.

The commands passed into the ProtocolManager can contain script variables. A script variable in a protocol command is set by wrapping the script variable between {}. This enabled the ScriptService to replace the variable with the actual value before sending the request to the Protocol Manager.

NOTE: If a ProtocolManager other than HTTP Protocol is added to the ROT make sure that it is below the HTTP Protocol otherwise your web server will not work. The ProtocolManager interface has been edited to include a CanHandleRequest function allowing the ScriptService to check if the ProtocolManager can handle a request without having to initiate a process of the request.

Example Scripts

This script runs a sequence generating a random number and reads the number back into the script displaying the result to the user. A html form is also generated allowing the user to enter registration information. This script processes values provided from the HTML form in the previous example passing them to the ProtocolManager and getting the result of a Sequence upon those variables.

To test IE

http://localhost:88/index.syn