Live editing

To test or debug a component, you can use a feature of PowerBuilder called live editing that allows you to build the project automatically from the User Object painter. When live editing is enabled, PowerBuilder builds the project for an EAServer component each time you save the corresponding user object. The generator does not deploy PBDs to EAServer, but instead tells EAServer how to access the PBLs that contain the required object definition(s).

NoteService components You cannot use live editing to test a component that you have set up as a service component. Service components are always in use when the server is running, so the changes that you make in the User Object painter cannot be saved.

How to enable live editing

To enable live editing for a user object, you need to:

  1. Create a project that includes the user object for which you want to generate an EAServer component.

    You can use an existing PBL that allows for deployment to EAServer, or alternatively, you create a new project and use this just for testing purposes.

  2. Optionally modify the live editing library list for the project.

    When you are testing a component with a server that resides on a remote machine, you need to tell EAServer where to find the PBLs. To do this, you modify the library list on the Advanced page of the component’s property sheet in the Project painter, shown below:

    This example shows the library list on the Advanced page of the component’s property sheet in the Project painter. The page’s title is Properties for E A Server Component Generator. The Advanced tab, the rightmost one, is open and displays the path to two libraries from E A Server server for live editing. Closed tabs shown from left to right are General, E A Server Host, Libraries, and Components. A Bind Thread check box appears at the bottom and is checked.

    The library list you specify must contain fully qualified paths that use Universal Naming Convention (UNC) names. UNC names take the form: \\servername\sharename\path\file

    By default, the live editing library list is based on the application library list. You do not need to modify the live editing library list if your server is local.

  3. Specify the project that will be used to generate the component in the User object painter.

    Enter the project name in the EAServer Project field, which is located on the General property page of the user object property sheet shown below.

    The example shows the General property page of the user object property sheet. The title displays Properties and the name of the user object. On the General tab, there is an Auto Instantiate check box that is cleared, then a text input field labeled E A Server Project. The project name shown in the field is p _ math funcs _ e a s comps.

    The project name you specify must meet these requirements:

    • It must be an EAServer component project.

    • It must include the user object that you currently have open in the User Object painter.

    • The library list for the project must match the current application library list.

How to generate the component

To generate an EAServer component from the User Object painter, select File>Save.

What happens when you generate the component

When you build a project from the User Object painter, PowerBuilder performs these operations:

PowerBuilder builds the component just as it would at deployment time, except that it does not generate PBDs for the component. In addition, it sets the pb.live_edit property to TRUE and assigns the library list you specified for live editing to the pb.librarylist property.

If the project build results in errors, PowerBuilder displays the error messages in the Output window.

If instance pooling is enabled for the user object, the generator disables pooling for the current build. Pooling is not supported with live editing because PowerBuilder cannot save the user object if the PBL that contains the user object is locked by EAServer.