Websydian v6.1 online documentationOnline documentation - Websydian v6.1

Server-Side Scripting with Websydian

Web Development with Server-Side Scripting

Server-side scripting is a popular approach to web application development and as described below, web application development with server-side scripting is fully implemented in Websydian.

In server-side scripting, the HTML pages of a web application are stored on a Script Server and each HTML page may contain a number of script expressions.  Each script expression specifies a piece of code generating HTML code and/or controlling the generation of HTML code on the page.

The script expressions are enclosed between <% and %> markers, which makes it possible for the Script Server to recognize and evaluate the script code.

An HTML page is requested from the web Script Server.  The Script Server evaluates any script expressions on the page, and the resulting HTML page is returned as response to the web browser.

Server-side scripting can be used to access data and/or procedures on a database server and in this way data from a database can be displayed in the resulting HTML page.  Script code being evaluated at the web server also provides a powerful way to control the visual appearance of generated HTML pages, e.g. by setting layout attributes or by including or omitting pieces of HTML code based on specified decisions.

Server-side scripting is supported by an increasing number of web servers, and programming languages that can be used for specifying scripting code include ASP (Active Server Pages), JSP (Java Server Pages), and PHP.

The Websydian Approach to Server-Side Scripting

Websydian is a tool aimed at development of stable and secure database-integrated web application using only a single set of skills.  With this in mind, the Websydian approach is slightly different from traditional scripting when accessing database data in a script environment.

In Websydian scripting, the Script Server will not directly access the database server.  Now, the script code no longer retrieves data directly from the database server - instead data is accessed from a Valuespace object generated by the Websydian application.

A Valuespace object is generated by the Websydian application and posted to the Script Server.  The Script Server then evaluates a script page template by accessing and inserting values from the Valuespace object, and the resulting HTML page is returned to the web user.

The Websydian application may be located on the same physical machine as the Script Server or on another machine.

The generated Valuespace contains the total set of data values to be included in the generated HTML page and after the Valuespace has been generated by the Websydian application, it is sent (by an HTTP POST) to the Script Server.

Server-Side Scripting Integrated in Websydian Architecture

The functions used for generating Valuespace objects are plain Page Generator functions.  Instead of generating an HTML page, a Page Generator now generates and posts a Valuespace object to the Script Server.

By specifying a single option, a Page Generator in this way will turn into a 'Valuespace Generator'.  The action diagram coding will be exactly the same as in a standard Websydian development (using the WsyDetails and WsyGrid variables).

In the same way, the Document Template Generator function will now generate Script Page Templates which correctly will access the received Valuespace object.

Advantages of the Websydian Approach to Scripting

The Websydian server-side scripting architecture gives a number of advantages:

  1. Producing the Valuespace object in a separate application than the Script Server provides a rubber-cell protection of the data in the back-end system.  Only the data contained in the Valuespace object can now be accessed by the script code which is evaluated by the Script Server.
  2. With the Websydian Scripting Architecture, the visual layout has been clearly separated from the specification of the business functionality.  The web designer can now concentrate on the visual design - the data retrieval has been done in advance, and the relevant data values are contained in the Valuespace object.
  3. Full advantage can still be taken of the Script environment by adding script code to the generated Template Pages.
  4. The model-based approach of Websydian is maintained.  Still, only a single skill-set is enough to develop web applications - also in a server-side scripting environment.

Websydian Scripting Limitations

The following limitations apply to the current Websydian Scripting architecture: