PowerBuilder 6.0 Realizing the Prerequisites for the "Web Browser - Database Server" scheme is to build a distributed application system. Bringing the PowerBuilder6.0 application to the Internet structure, that is, put the PowerBuilder 6.0 client application to the web server, when the browser client issues a service request to the web server, the web server automatically calls the PowerBuilder application software system, thereby achieving each Internet structure function of business software.
First, form a module structure of the Browser / Server structure.
The various Internet-based applications developed by PowerBuilder6. 0 are implemented using PowerBuilder6.0, which is implemented using PowerBuilder6.0 and PowerScripts programming technology, which is equivalent to writing server applications in a distributed application environment. For example, PowerScripts language environment, data window technology, etc. Its production process and working principle are:
1. Establish and configure the web server. O'Reilly Based on WindowsNT 3.51, PowerBuilder, 32-bit multi-threaded personal web server Website 1.1 version of WINDOWSNT 3.51 and Win 95/98. The web server provides a complete web service creation, management environment, and security mechanism.
2. Create an executable (Web.PB) on the web server. The main function of the web.pb (pbcgi60.exe) is to call the preset handler in the PowerBuilder application server, including analysis of user functions in the user object, feedback HTML control flow and generating interpretation plug programs.
Web.PB is used to develop a web application based basic part, which is itself a gateway application on the web. The tool provides access from the web server to the PowerBuilder application server, allowing users to perform nearly complete manipulation of databases over Web under Internet and intranet. At the same time, through web.pb, dynamically create an HTML document is also possible. The web.pb program is a bridge connected to the web server and the PowerBuilder application server. Build a web application using Web.PB has the following advantages:
a. Support CGI, ISAPI, NSAPI, MSAPI and other gateway program interfaces.
b. Support for reference to data windows in PowerBuilder.
c. Easy to transfer the previously writerbuilder application to the web environment.
d. Easy to create an HTML file embedded in the PowerBuilder application, the application server will dynamically generate the HTML syntax according to user requirements, and release fully dynamic information.
e. Support database connections. The database that PowerBuilder can be connected can be accessed by the browser user, so that the Web service is integrated with the database service through Powerbuilder 6.0.
3. Establish a PowerBuilder application server. The PowerBuilder application server is primarily some class library programs for activating the PowerBuilder6.0 business application. When creating the PowerBuilder application server shown in the image, you must reference the PowerBuilder6.0 web class library. Five custom class user objects are defined in the class library, encapsulate functions, structures, and instances required to create HTML syntax and transaction management. A variety of entities can be used to create an HTML syntax, manage the status of the client browser connection. Powerbuilder 6.0 Application Server is equivalent to a client application in a distributed application to issue a call request to the PowerBuilder6.0 business app. The implementation method is: After the PowerBuilder6.0 application server monitors the request of Web.PB, start the PowerBuilder application server that has predefined business handler in the PowerBuilder application server.
For example, when a user uses a web browser (IE or Netscape) to browse the page, the web server can automatically activate the web.pb application by embedding the element embedded in the HTML page. The event web server first calls the WEB.PB class program for PowerBuilder6.0. As the client application in the PowerBuilder distributed application, establish a connection to the PowerBuilder 6.0 application server, then call the various business features defined in the PowerBuilder6.0 application server, That is, user functions encapsulated in user custom objects, including database access and file processing and other data processing functions. 4. Establish a PowerBuilder business application. In a user-defined object, create a user-defined function. Functional requirements are based on the needs of the browser-end users, and the processing results are used in the HTML page format, feedback to the web.pb program, often used in personnel management, financial management, information data processing and system management. Powerbuilder business applications have inserts (PLUG_INs) and embedded HTML files. The use of Plug-Ins (inserts) is divided into two kinds of Window Plug-Ins and DataWindow Plug-Ins.
The way the Window Plug-INS inserts to prepare the business program is to embed and display the window object of the Child type in PowerBuilder6.0 on the HTML page. You can place the data window (dataWindow), TreeView, TAB page, etc. A colorful control type, enriching the expression of the HTML page. When the client browsses the page with the browser, the web server uninstalls the PSR file or PBD file to the customer. The client browser receives the PSR file and the PBD file, embed the Child window object in the web page, if embedding the window object, The functions defined on the window can also be used in the browser environment. If the function of the database manipulation is defined on the window, the browser client can directly connect the manipulation database. Plug-Ins play a role in embed PowerBuilder6.0 objects into the page, and the data window has a rich display style, users are more welcome to "Powerbuilder Child Class Data Window" data performance forms on the browser.
Write the use of Window ActiveX Similar to Window Plug-Ins, which is used to embed and display a window object in the PowerBuilder in the HTML page. This component can interact with VBScripts and JavaScripts in HTML.
The method of simply embedding the HTML file is the popular programming trend, that is, if you don't have to insert products, the client only needs to install a regular web browser, you can realize the real "thin" Browser / Client / Server structure system.
In summary, the PowerBuilder6.0 application server returns the execution result of the service handler in the HTML format to the web server. The web server releases HTML to the user, and the client browser receives the result on the browser.