version 2004 (Modified)
4D in local mode, 4D in remote mode and 4D Server include a Web Server engine that enables you to publish 4D databases or any type of HTML page on the Web. The principal characteristics of the 4D Web Server engine are:
You can start or stop publication of the database on the Web at any time. To do so, you just need to choose a menu command or execute a language command.
Contextual and Non-contextual mode
The 4D Web server can operate in two distinct modes: contextual mode and non-contextual mode. You can use the 4D Web server in either of these modes and you can pass from one mode to the other on the fly in accordance with your needs.
- contextual mode (available only with the Web server of 4D in local mode and 4D Server) consists of a unique and unequaled feature. In this mode, 4D manages Web browsers as standard database clients. Your database is published directly on the Web. You do not need to develop a database, a Web site and then a CGI interface between the two. Your database is your Web site. Any modification made to the structure or data of the database is immediately passed on to all the browsers connecting to it. 4D converts database menu bars, forms and methods into HTML on the fly: it is not necessary to know HTML to be able to publish a 4D database on the Web. 4D automatically maintains a data use context for each Web browser (selections, variables, etc.). Note that in return, Web navigation in contextual mode includes specific constraints. For more information, refer to the Using the Contextual Mode section.
- Used in non-contextual mode (standard mode), the 4D Web server is a completely standard HTTP server: Web pages are sent without it being necessary to maintain context. You can access the data of the 4D database and build "semi-dynamic" HTML pages on the fly that include both static data and data coming from the database, before sending them on to the Web browsers. You can also send static Web pages that do not require any processing by the Web server.
Dedicated database methods
On Web Authentication Database Method and On Web Connection Database Method are the entry points of requests in the Web server; they can be used to evaluate and route any type of request.
Use of special tags and URLs
The 4D Web server offers numerous mechanisms that enable interaction with user actions, in particular:
- special tags can be included in Web pages in order to initiate processing by the Web server at the time when they are sent to browsers.
- special URLs that enable 4D to be called in order to execute any action.
- these URLs can also be used as form actions to trigger processing when the user posts HTML forms.
Several automatic configuration options allow you to grant specific access authorizations to Web browsers or to use the password system integrated into 4D. You can define a "Generic Web User" to simplify access management within the database.
The On Web Authentication Database Method allows you to evaluate any request before it is processed by the Web server. Moreover, the ability to define a default HTML root folder allows you to restrict access to files on disk.
Finally, you must designate individually the project methods that may be executed via the Web.
Your 4D Web server can communicate with browsers in secured mode through the SSL protocol (Secured Socket Layer). This protocol, compatible with most Web browsers, authenticates the sender and receiver and guaranties the confidentiality and integrity of the exchanged information.
Extended support for Internet formats
The 4D Web server is HTTP/1.1 compatible and supports XML documents and WML (Wireless Markup Language) technology.
The 4D Web Server can call CGIs in a very simple way, as well as be called by other HTTP servers through CGIs.
Simultaneous operation of databases
4D in local mode and the Web
If you publish a 4D database on the Web using 4D in local mode, you can simultaneously:
Use the database locally with 4D
Connect to the database using Web browsers.
4D Server and the Web
If you publish a 4D database on the Web using 4D Server, you can simultaneously connect to and operate the 4D database, using:
4D remote workstations
4D Open-based applications
4D client and the Web
When a 4D database is published on the Web with 4D client, it is possible to connect to the 4D database and to simultaneously use it:
- via 4D remote machines
- via applications using 4D Open
- via Web browsers. In this case, if the database is also published with 4D Server, the Web browsers can connect to the published database via a 4D client machine or via 4D Server. Moreover, this allows different data access modes to be handled (public, administration, etc.).
The basic mechanisms of the 4D Web server are used in a similar manner by 4D in remote mode, with the exception of the contextual mode. In fact, it is not possible to use the contextual mode with the Web server of 4D in remote mode (for more information about this mode, refer to the Using the Contextual Mode section).
Similarly, the operation of language commands is usually identical, whether the command be executed on 4D in local mode, 4D Server or 4D in remote mode. The main point is that commands are applied to the Web site of the machine on which they are executed. You must manage this using the Execute on server / EXECUTE ON CLIENT commands.
Load balancing with 4D clients: since any 4D machine in remote mode can be used as a Web server, you can set up a dynamic Web server system with a load balancer. This offers extensive development possibilities, including, more particularly:
- the setting-up of a load-balancing system in order to optimize the performance of the 4D Web server: using a mirror of the Web site that is installed on each 4D Web server, a load balancer (hardware or software) will send requests to the client machines on the basis of their current load.
- the setting-up of a fault tolerance Web server: the 4D Web site is mirrored on two or more 4D client machines. If one 4D Web server fails, another one takes over.
- the creation of different views of the same data, for instance depending on the origin of the requests. Within a company network, a Web server on a protected 4D client machine can serve Intranet requests and a Web server on another 4D client machine, located beyond the firewall, will serve Internet requests.
- the distribution of tasks between Web servers on different 4D client machines: one 4D Web server can be in charge of SOAP requests, another can handle standard requests, and so on.
Connection Security, SEND HTML FILE, SET HOME PAGE, SET HTML ROOT, SET WEB DISPLAY LIMITS, SET WEB TIMEOUT, STOP WEB SERVER, Using CGIs, Using SSL Protocol, Using the Contextual Mode, Web Server Settings.