Power Builder 7

6
PowerBuilder7.0 in Internet Application Print View by: iSee Total views: 229 Word Count: 3655 Date: Wed, 22 Apr 2009 Time: 7:26 AM With the Internet / Intranet development and the World Wide Web (www) the emergence of the traditional client / server mode (c / s) gradually to the browser-Web server - the database (bwd) approach the transition. Compared with the former the latter easy to learn and use, interoperability, in that they can expand and maintain the good. Powerbuilder article on the Internet and intranet application development, available in several ways: The most simple Web Application, sybase EA Studio, WEB.PB, Plugin and ActiveX, such as from the basic principles and interactive process, development methodology, the main lack of features and made a more detailed explanation. In specific applications, according to the demand for and use of the flexibility to choose the state of the environment. As the world's most widely used database application development environment, as well as one of MIS development tool, Sybase's PowerBuilder applications for its excellence in the development of staff who won the time-honored reputation. Recently, with the increasing popularity of Internet applications under the impetus of the current popular browser-based Web applications and thin- client system (that is, a browser such as IE does not install any plug-ins), PowerBuilder provides the Sysbase a series of solution method. 1. The most simple Web applications, only a data window to display data. From more than Powerbuilder5.0 in support of the data window (Data Window) save the data in the form of HTML tables, of the specific approach can be in the brush in the data window / preview / File / Save Bank as / Save as type / HTML forms. Evaluation: only static data to display a window. II. Sysbase provide enterprise-class Web, distributed and client / server application solutions. Sybaese products use the latest Sybase Enterprise Application Studio, which is to provide users with a comprehensive set of enterprise-class Web, distributed and client / server application solutions, application development and submission of tool kits. Sybase Enterprise Application Studio products mainly include the following: Powerbuilder7.0, PowerSite3.0, PowerDynamo3.0, Jaguar CTS3.0. Distributed system because the Internet has the business activities across the company's firewall, external to the enterprise. Web technology has been proven in the dynamic aspects of information release is simple and effective, but the dynamic page server (usually referred to as Web application servers) to ensure data integrity transaction processing capacity is limited, can not call a good reusable business logic. Web application server itself can not satisfy a complete business application system in the scalability, operational efficiency, interoperability and security requirements. Sybase EA Studio 3.0 is Sybase's latest distributed computing and Web- oriented multi-tier computing products mixed computing environment programs, supports a variety of standard components and interfaces, with powerful and flexible development capabilities and the development of high efficiency . EA Studio 3.0 core products - Sybase EA Server 3.0 is to give full play to the component-based multi-tier architecture and the characteristics of the application of specially designed high-performance on the Environment. It integrates user-friendly and powerful Web application server PowerDynamo 3.0 and high-performance transaction processing server components of the Jaguar CTS 3.0. The use of PowerDynamo, enterprises can use HTML and javascript to create a simple application of the thin client. When the browser when called, PowerDynamo can deal effectively with the display contains the logic and database connection information template, the rapid generation of HTML pages. PowerDynamo templates and scripting language to deal with any data and business logic, client requests and generate HTML page to the Web server. PowerDynamo template through the embedded SQL commands to access the data, Jaguar CTS components by calling the method of complex business logic. Transaction Processing PowerDynamo the ActiveX component to run in the Jaguar CTS in, EA Server by calling them to the implementation of enterprise business operations. Jaguar CTS can be used to reduce the complexity of distributed application development, and the elimination of the development on the clues (threading), locking (locking), transaction processing and memory management concerns. A typical production process can be as follows: 1. To set up a data window. To set up a data window with PowerBuilder or DataWindow Builde the PowerSite to set up a data window. 2. PowerSite Insert or DataWindow DTC in PowerSite insert HTML DataWindow DTC, select a data window, and to establish the database connection, thus the data window is displayed in Web pages. Specific steps are: PowerSite in the menu, select Insert / components / ActiveX / Design-Time commands, you can select Insert or DataWindow DTC insert HTML DataWindow DTC, the DTC Properties

Transcript of Power Builder 7

Page 1: Power Builder 7

PowerBuilder7.0 in Internet ApplicationPrint View by: iSee Total views: 229 Word Count: 3655 Date: Wed, 22 Apr 2009 Time: 7:26 AM

With the Internet / Intranet development and the World Wide Web (www) the emergence of the traditional client /

server mode (c / s) gradually to the browser-Web server - the database (bwd) approach the transition. Compared

with the former the latter easy to learn and use, interoperability, in that they can expand and maintain the good.

Powerbuilder article on the Internet and intranet application development, available in several ways: The most

simple Web Application, sybase EA Studio, WEB.PB, Plugin and ActiveX, such as from the basic principles and

interactive process, development methodology, the main lack of features and made a more detailed explanation. In

specific applications, according to the demand for and use of the flexibility to choose the state of the environment.

As the world's most widely used database application development environment, as well as one of MIS

development tool, Sybase's PowerBuilder applications for its excellence in the development of staff who won the

time-honored reputation. Recently, with the increasing popularity of Internet applications under the impetus of the

current popular browser-based Web applications and thin-client system (that is, a browser such as IE does not

install any plug-ins), PowerBuilder provides the Sysbase a series of solution method.

1. The most simple Web applications, only a data window to display data. From more than Powerbuilder5.0 in

support of the data window (Data Window) save the data in the form of HTML tables, of the specific approach can be

in the brush in the data window / preview / File / Save Bank as / Save as type / HTML forms. Evaluation: only static

data to display a window.

II. Sysbase provide enterprise-class Web, distributed and client / server application solutions. Sybaese products use

the latest Sybase Enterprise Application Studio, which is to provide users with a comprehensive set of enterprise-

class Web, distributed and client / server application solutions, application development and submission of tool kits.

Sybase Enterprise Application Studio products mainly include the following: Powerbuilder7.0, PowerSite3.0,

PowerDynamo3.0, Jaguar CTS3.0.

Distributed system because the Internet has the business activities across the company's firewall, external to the

enterprise. Web technology has been proven in the dynamic aspects of information release is simple and effective,

but the dynamic page server (usually referred to as Web application servers) to ensure data integrity transaction

processing capacity is limited, can not call a good reusable business logic. Web application server itself can not

satisfy a complete business application system in the scalability, operational efficiency, interoperability and security

requirements. Sybase EA Studio 3.0 is Sybase's latest distributed computing and Web-oriented multi-tier computing

products mixed computing environment programs, supports a variety of standard components and interfaces, with

powerful and flexible development capabilities and the development of high efficiency . EA Studio 3.0 core products

- Sybase EA Server 3.0 is to give full play to the component-based multi-tier architecture and the characteristics of

the application of specially designed high-performance on the Environment. It integrates user-friendly and powerful

Web application server PowerDynamo 3.0 and high-performance transaction processing server components of the

Jaguar CTS 3.0. The use of PowerDynamo, enterprises can use HTML and javascript to create a simple application

of the thin client. When the browser when called, PowerDynamo can deal effectively with the display contains the

logic and database connection information template, the rapid generation of HTML pages. PowerDynamo templates

and scripting language to deal with any data and business logic, client requests and generate HTML page to the Web

server. PowerDynamo template through the embedded SQL commands to access the data, Jaguar CTS components

by calling the method of complex business logic. Transaction Processing PowerDynamo the ActiveX component to

run in the Jaguar CTS in, EA Server by calling them to the implementation of enterprise business operations. Jaguar

CTS can be used to reduce the complexity of distributed application development, and the elimination of the

development on the clues (threading), locking (locking), transaction processing and memory management concerns.

A typical production process can be as follows:

1. To set up a data window. To set up a data window with PowerBuilder or DataWindow Builde the PowerSite to set

up a data window.

2. PowerSite Insert or DataWindow DTC in PowerSite insert HTML DataWindow DTC, select a data window, and to

establish the database connection, thus the data window is displayed in Web pages.

Specific steps are: PowerSite in the menu, select Insert / components / ActiveX / Design-Time commands, you can

select Insert or DataWindow DTC insert HTML DataWindow DTC, the DTC Properties dialog box by ... button to select

a data window menu command to choose the project / database connectivity, set up the parameters to connect to.

:DataWindow DTCHTML DataWindow DTC,,。 Means that the data can not really appear in the Web window, if

you would like to see their face, you can only wait until the debugging phase of the project will be submitted to a

project to support the debugging of the server before it in the browser will be displayed. (A lot of work to do after

buying Web page do not see the data in the data window, are not able to enjoy the joy of success, say that it is a

regret)

Page 2: Power Builder 7

3. If you want to increase the Web page more interactive, will be in the Web page PowerSite insert some ActiveX

controls, and the preparation of common JavaScript scripts, ActiveX controls need to install to run transaction

processing server to support the Jaguar CTS 3.0. Such as: would like to use the Web to select the button combination

to a Web page, Web pages will be added to the select button control or form, and the preparation of JavaScript

scripts; script can also be prepared to allow users to fill out the form or control to update database.

4. PowerDynamo application server settings, the author works, and debug the project. Debugging works only with

the general application server PowerDynamo. Submit a completed application will be a document migration from

development environment to the appropriate operating environment (typically refers to a Web application server)

process. In PowerSite, the return to service providers view of the project, in the name of the project works, click the

right mouse button and the pop-up menu, select Deploy Setup command to submit settings, the choice of a good

server type, this is PowerDynamo, Web site configuration information form, in view of the project name on project

right-click and order from the menu to Deploy.

Debugging: The PowerSite, in the menu select Debug / Project Go command, will open the IE browser window, the

initial page load works.

5. Formally submitted. To debug the application of good works submitted to the Web application servers, application

servers here in the Internet, not necessarily PowerDynamo application server, or it may be Microsoft's asp

application server, Microsoft Active Service Pages or ASP is integrated in the Web server in IIS. Network

administrators need to submit the project authority.

Evaluation: A thin client mode, client-side browser in addition to other things there is no need to add any software,

powerful Web pages in the PowerBuilder application in the realization of almost all the features such as Web pages

in the database to add, update, multi-database query filter conditions, such as combinations is suitable for

information processing enterprises. However, the need for server Jaguar CTS3.0 (free site is not currently available),

PowerDynamo or ASP support, adding more interactive JavaScript script to be prepared, the project must be

submitted to the network administrator permissions.

III. WEB.PB way

WEB.PB based on multi-tier distributed applications (client - application server - database server)-based. It that the

client-side applications (WEB.PB dedicated client program) distribution to the Web server as a gateway program

(CGI). Web call through Powerbuilder application server to define the method to achieve the relevant business logic

and data processing.

WEB.PB browser embedded in the HTML document (mainly through the data collection forms and hypertext links),

Web server to activate WEB.PB. Distributed WEB.PB as a Powerbuilder application with Powerbuilder client server

applications to establish a link between, and then call the function which is defined and methods (such as database

access and document processing, etc.), for data processing, and the results will be Hypertext (HTML) syntax to

return to the Web server, which will then return the results to the user.

In addition, as a result of a number of browsers can visit the Web server, a single user across multiple pages, and

the HTTP protocol has no memory, so business logic in order to ensure consistency and continuity of user access,

Powerbuilder provides specialized Webpb.pbl class library and webpb database, using the definition of which

Usession, Utransaction user object for the session and transaction management.

Manner with WEB.PB development, mainly based on business needs to develop server applications, and then select

the appropriate communication mechanism (such as TCP / IP, anonymous pipes, etc.), and modify documents PB.INI

in order to conduct WEB.PB communications. Now we come to a brief description of a simple example. This case,

users select products FORM type, SUBMIT to submit forms with, WEB.PB specific products will be returned.

First of all, the development of server applications, to be divided into the following steps:

a. with application brush to create a new application of purchase, in the Library Properties page will Web.PB class

Library to join the class library file search path webpb.pbl.

b. use of window brushes to create a window object wserver, used to start the server application WEB.PB service.

Join in its "start server", "server shut down" command button, in the "start server" and click the type of case

examples of the definition of transport variables and assignment, monitor calls from the request Web.PB.

Transport cotransport

cotransport = create transport

cotransport.driver = "winsock" / / using the TCP / IP protocol, and communication WEB.PB

Page 3: Power Builder 7

cotransport.location = "136.158.188.12" / / server applications of the IP address

cotransport.application = "12560" / / server applications the TCP port number

cotransport.Listen () / / server applications started, monitor the request from WEB.PB

c. brush to create user object with non-visual (NvO) user object uoproduct, in its construct event-based business

object with two global variables, respectively, and webpb through ODBC database (WEB.PB call for the session and

transaction management) , applications connect to the database. Events in the destructor, the disconnected and the

destruction of business object (in this process is abbreviated).

d. create a user object function fretrieveproduct

① Create fretrieveproduct required in the query window object data dwproduct. Datawindow brush with select choice

of data sources and grid display.

② the definition of a user object function fretrieveproduct, function parameters sproducttype (character, value,)

Return value of character.

string returnhtml

long lldwrow

datastore datastore

datastore. dataobject = "dwproduct"

datastore.settransobject (utransaction)

lldwrow = datastore.retrieve (sproducttype)

if lldwrow> 0 then

returnhtml = returnhtml + datastore.object.datawindow.data.htmltable

else

return html = "did not retrieve data"

end if

return returnhtml

The role of function is based on user-selected product type to call the data window for data query and return results

in HTML format.

So far we have completed the development of server applications, the following documents Pbweb.ini modify, add

on the location information server applications section of the purchase are as follows:

[purchase]

driver = winsock

application = 12560

location = 136.158.188.12

Finally, FRONTPAGE, such as a text editor to customize web pages to add, in its <FORM

ACTION="//scripts/pbisa60.dll/purchase/uoproduct/fretrieveproduct">

<P> Please select product type:

<SELECT NAME="sproducttype">

<OPTION> Stylus printer

Page 4: Power Builder 7

<OPTION> Inkjet printer

<OPTION> Laser printer </ SELECT>

<P> <INPUT TYPE="submit"> <INPUT TYPE="reset"> </ FORM>

At this point, all of the work completed. In the actual run-time, start Web server and purchase a server, users can

get the query results.

Evaluation: WEB.PB is a thin client mode, client-side browser in addition to other things there is no need to add any

software to support the Window, Unix,, Macintonish such as multiple platforms, suitable for Internet / Intranet

development, but relatively speaking its function is limited, can not play all the features of Powerbuilder, not very

friendly user interface, business logic is also relatively simple. Such as to carry out more complex application

development must be Java, java Applet, etc. together.

IV. PLUG_IN way

Inserts was first proposed by Netscape, and later by the large number of browser vendors to develop recognition of

plug-ins to a variety of ways to expand the functions of the browser. NPPBA60.DLL and NPPBS60.DLL is developed by

Powersoft documentation plug-ins. It is divided into the window (Window) and the data window (Datawindow) two,

from the safety point of view can also be divided into normal mode and safe mode. Safe Mode restricts the insertion

of pieces of Powerbuilder client applications in addition to print almost all activities outside. Plug-ins in the way, we

can use all the controls Powerbuilder, function and methods to play it almost all the features. In fact, the only way to

insert pieces of the traditional client / server architecture used in Web on one of the forms.

Browser to be embedded Web server plug-ins window after the HTML document, browser embed element identified

by its WIDTH and HEIGHT properties of the page for the plug-ins required to set aside space for the request to the

Web server to uninstall. PBD. Web server has to pass PBD browser MIME types of documents (application / vnd.

Powerbuilder6) and PBD file. Browser Plugin in its subdirectory, find and call NPPBA60.DLL, then run by the dynamic

library calls Powerbuilder. In this way, by inserting a sub-window display in a browser on the location of the

provisions and the implementation of its Open event handler, and then began to respond to user actions, for event

handling. When the user to another Web document, PBD documents be removed from memory.

Way with the development of plug-ins with the common Client / Server development process similar to, but to do

some adjustments, including: ① Child embedded window must be the type of programming must be used in this,

parent, etc. and not to invoke it by direct reference to its name; ② Application object can be used within the

definition of global variables, but can not use the Application object events; ③ the use of an external file and the ole

control in the browser must ensure the existence of the client. Generated. PBD documents, hung in a suitable

position Web directory. Still above examples illustrate how the development process. First of all, the development of

Powerbuilder applications:

① application with the application of brush to create a new purchase.

② window with the type of brush to create a child window wchildpurchase, there are data for the browser window

dwproduct data, the drop-down list to choose ddlbtype product type, cbretrieve button to seizure data.

③ WEB.PB data objects and the same window.

④ wchildpurchase the open in the incident, and applications to connect to the database.

Sqlca.database = "odbc"

Sqlca.dbparm = "connectstrng = 'DSN = purchase; UID = dba; PWD = sql"

Connect using sql;

⑤ cbretrieve of clicked in the incident, to carry out inquiries

parent.dwproduct.retrieve (ddlb1.text)

After completion of the work, the project generated pen purchase .. pbd file, into the Web directory (such as .. \

pbembed directory), and then edit the HTML document, embed the following code:

<P> <EMBED SRC ="../ pbembed / purchase.pbd "WIDTH = 400 HEIGHT = 250

WINDOW = "wchildpurchase"

Page 5: Power Builder 7

APPLICATION = "purchase">

Finally, in the Web server plug-ins for the MIME type settings. Web server operating system where different methods

are not the same registration. To Windows NT as an example, start the Registry Editor (regedt32.exe) and open

HKEYLOCALMACHINE \ SYSTEM \ CurrentControlSet \ Services \ InetInfo \ Parameters \ MimeMa-p, to add value for

the MIME mapping: application / vnd. Powerbuilder, 5. This PBD documents can be correctly transmitted and

downloaded to a browser client.

Browser in order to harmonize the environment, it is best not to sub-or less from the child window and then open the

other window. Usually can use a few plug-ins (ie, child window), the function of the completion of each plug-less. For

more complex applications, you can also use Javascript to coordinate synchronization between plug-ins [3].

Plug-ins is a fat client approach, in addition to client-side browser, but also must be equipped with dynamic runtime

Powerbuilder, therefore limited access for the Internet is not entirely suitable. As for the work environment and

requirements are known for the more appropriate Intranet, function better, to achieve user-friendly and good

maintainability.

5. ActiveX

Powerbuilder the ActiveX methods and Plugin is basically the same as the principle means for the sake of brevity,

where the main differences between them. When a browser from the server to download ActiveX embedded in HTML

documents, encountered OBJECT tag, the first space will be reserved for, and then the browser will find the ActiveX

control locally incorporated if there is such a registration number, if there will be direct display, or as their security

needs from the Web server to download ActiveX controls (the CODEBASE attribute in the OBJECT given), and

registered in the local machine and then use the. Approach to development with ActiveX and Plugin basically the

same document in HTML editor used by the different elements (for OBJECT), the above case as an example:

<P> <OBJECT ID = "purchase" WIDTH = 400 HEIGHT = 250

CLASSID = "CLSID: CEC58653-C842-11CF-A6FB-0805FA8669E>

<PARAM NAME="Version",VALUE="65536">

<PARAM NAME="Extentx",VALUE="9440">

<PARAM NAME="Extenty" VALUE="7112">

<PARAM NAME="StockProps" VALUE="0">

<PARAM NAME="PBWindow" VALUE ="wchildpurchase">

<PARAM NAME="LibList",VALUE="../pbembed/purchase.pbd>

<PARAM NAME="PBApplication" VALUE="purchase">

Finally, in Windows 95, Windows NT to use the following command registered OCX controls: Regsvr32.exe

pbrx60.ocx.

ActiveX is a fat client mode, client side in addition to the browser as well as outside the PBRX60.OCX and

Powerbuilder support dynamic runtime. In addition, ActiveX support only Windows platform, so ActiveX is not

suitable for Internet development, and application needs and environment of the Intranet applications are known to

be appropriate. Compared with the Plugin, we can also use pbrx60.ocx way TriggerPbevent () and InvokePbfunction

(), etc. Javascipt and vbscipt through ActiveX controls and other interactive, more complex control and development.

We must pay attention to the development of security options on the browser settings can not be too high, not

through the security check, PBRX60.ocx is the current development of IE3.0, IE4.0 on the use of the box jump

phenomenon.

Concluding remarks

In the above analysis and description of several of the main principle of development methods, development

methods and the use of the characteristics of attention when in use in accordance with the requirements and

development environment to choose.