The Web DataWindow Container project wizard

In PowerBuilder, you can use the Web DataWindow Container project wizard to create a project that deploys a custom version of the Web DataWindow server component (HTMLGenerator105) to EAServer with all the DataWindow objects in your library list built into the deployed PBD.

Because you are using a custom component instead of the preinstalled HTMLGenerator105 component, you can set properties for your component in EAServer Manager. Setting properties reduces the number of method calls required to configure the component and can result in improved performance, maintainability, and scalability.

Using the wizard

When you have defined the DataWindow objects you need, start the Web DataWindow Container wizard from the Project page of the New dialog box and follow the instructions in the wizard.

The choices you make in the wizard are similar to those you make for other EAServer components, such as whether to support instance pooling or live editing. The package and component can have any names you want, with the exception that you cannot name the package DataWindow (the name of the package that contains the preinstalled HTMLGenerator105 component). You cannot set component type or transaction support properties.

Building the Web DataWindow Container project presets some of the properties of the component that you would otherwise need to set in scripts or in EAServer Manager. You can specify a database profile in the wizard or Project painter to set the com.sybase.datawindow.trans.dbms and other database transaction properties. If you want calls to component methods to be written to the server log, select Enable Trace to set the com.sybase.datawindow.trace property.

NoteConnection cache Specifying a profile sets database transaction properties for the component, but you still need to create a connection cache in EAServer Manager for the database the component will access.

Service classes

You can add a custom class user object to your project to perform any special processing you require. This object acts as a service class. The custom class user object must be in the same library as the DataWindow objects or on the target’s library list. When you build the Web DataWindow Container project, select the class in the Select Objects dialog box in the Project painter.

For more information, see “Using service classes”.

Instantiating the container component

When you create an instance of the container component, you must either provide a Java proxy for the component or pass DataWindow/HTMLGenerator105 as the last argument to the CreateComponent method. This specifies that the component uses the proxy provided for the generic component. For example:

dwObj = java.CreateComponent
		("ContainerPkg/ContComponent",
		"iiop://testMachine:9000", "Jagadmin", "",
		"DataWindow/HTMLGenerator105" );

This is the same way you instantiate custom components. For more information on custom components, see “Instantiating the custom component”.

Selecting a DataWindow from the container component

To select a DataWindow from the container component, you must use the SetDWObjectEx method rather than the SetDWObject method:

//Only the DW is needed, as package already specified //above when connecting
retVal = dwObj.SetDWObjectEx("d_mydw"); document.write("SetDwObject = " + retVal);

For more information on the SetDWObject method, see “Loading the DataWindow object” and the DataWindow Reference.

Using the component with the Web DataWindow DTC

You can select the container component when you use the Web/JSP DataWindow Page wizard to create a new Web page. On the Choose EAServer Profile page in the wizard, check the Use Custom Web DW Component check box. Then, when you click Next, the wizard prompts you for the component name and the DataWindow in the component that you want to include on your Web page.

On the DataWindow page of the Web DataWindow DTC property sheet, you can also specify a container component and the DataWindow in the container component that you want to use on a Web page. Selecting a container component on the DataWindow page automatically selects it on the HTML Generator page of the DTC property sheet. (If you want, it is possible just to use the container component to generate XHTML or HTML for a DataWindow that you select from a PBL, PSR, or SRD file).

StepsTo use the container component with the Web DataWindow DTC

  1. Select the Web DataWindow Container Component radio button on the DataWindow page of the Web DataWindow DTC property sheet.

  2. Click the browse button (...) next to the Component text box.

    The Web DataWindow Container Component dialog box displays. It has a list box with nodes for each EAServer profile defined in PowerBuilder.

  3. Expand the node for the server and package that contains the container component you want to use.

    Select the container component and click OK.

    The Web DataWindow DTC property sheet redisplays. The server name and the container package and component are displayed in the Server and Component text boxes on the DataWindow page of the property sheet.

  4. Select a DataWindow from the DataWindow drop-down list.

    The drop-down list displays all the DataWindows in the container component.

  5. (Optional) Click the Connection tab and override the database connection property stored by the component.

    This is recommended only for testing purposes. If you want to change the connection property, you can do it directly from EAServer Manager.

  6. (Optional) Click the Control tab and override the weight settings stored with the DataWindow.

  7. Click OK.