Application Development


Chapter 10 . Accessing Libraries

Prolifics's libraries and repositories store screens, reports, binary JPL files, and other application components. To ensure that all members of your development and design team have access to the same information and sets of standards, you want to allow everyone access to these libraries and repositories. For the purpose of this discussion, the term library describes both libraries and repositories.

The development process often depends on coordinating write-access to these files—allowing access by several people and providing a means of knowing when changes were made.

In addition to providing its own mechanism for controlling multi-user access to libraries and repositories, Prolifics also supports and provides an interface to source control management systems, specifically SCCS and PVCS, that let you take advantage of these management systems while in the editor environment.

Prolifics provides:

Libraries provide a convenient way to distribute a large number of screens with an application, and improves efficiency by eliminating paths searches at runtime and the number of files that are open. You can have multiple Prolifics libraries open during development time and at runtime. As for repositories, while you can create multiple repositories, you can only have one open at a time during an editor session, and its contents should be accessible to the entire development team.


Configuring Your Library Access

Two-tier applications
For two-tier applications, application objects are stored in libraries, such as client.lib. To provide access to the entire team, store the libraries on a common file server.

JetNet and BEA Tuxedo applications
For the JetNet and BEA Tuxedo middleware adapters, there are three basic libraries: client.lib, common.lib, server.lib.

You can open the appropriate libraries for the application servers, application clients, and developers with SMFLIBS.

During development, the libraries can be stored on the application server and accessed remotely by the developers, in order to be available to the entire development team. For remote access, the application must be configured with a file access server (devserv). For more information on configuring servers, refer to Chapter 3, "Configuring the Enterprise," in JetNet/BEA Tuxedo Guide.

COM and MTS applications
For COM/MTS applications, a client library (by default client.lib) contains the user interface elements of the application. A server library (by default server.lib) contains the service components and is generally located in the application directory. For more information, refer to Chapter 5, "Deploying COM Components," in COM/MTS Guide.

Managing Library Access

Accessing Library Members Outside of Source Control

If you do not use or have a source control management system, Prolifics provides support for controlling multi-user access to screens, reports, menus, and JPL modules in libraries.

Prolifics's approach to multi-user access is to inform rather than enforce. To prevent inadvertent damage, Prolifics informs you if another user currently has a "reservation" on (that is, write-access to) a file you are trying to open, save, or delete; but you are given the opportunity to "steal" the reservation.

This method pre-supposes a high degree of communication and cooperation among the members of your development team. For example, a user who initially has a reservation on a screen might later find, when attempting to save or delete it, that another user now has the reservation. The first user can, of course, steal the reservation back, but stealing reservations without adequate communication between users can result in the loss of someone's work.

While Prolifics provides enough information to prevent inadvertently damaging another's work in progress, it does not enforce file locking. Users are responsible for checking with the holder of a reservation before deciding whether or not to steal it.

If you require a more secure file-locking method to control multi-user access, use one of the third-party source control management systems that Prolifics supports.

Opening Library Members

Prolifics warns you if you choose to open a library member (screen, report, JPL module, or menu file) that is being edited (open with read/write privileges) by another user. You can choose to steal the reservation or open the library member with read-only privileges. If you choose Yes to steal the reservation; the requested library member opens with read and write privileges; choose No to open the member with read-only privileges.

A read-only library member is displayed with the last saved changes. If you edit a read-only file, you can use FileSave As to save the library member with a different name.

Closing Library Members

When you choose to close a library member (having read-write privileges) that you have been editing, Prolifics displays the following message:

Do you want to release your reservation of <filename@lib>?

Choose Yes to release the reservation; the library member closes and is available for editing (write-access) by other developers.

Choose No to keep the reservation; the library member closes and can be open as read-only by other developers.

Releasing a Reservation

To automatically release a reservation whenever you close library members, choose OptionsAuto Release on Screen Close. The message for releasing a reservation no longer displays; the reservation is automatically removed and the closed screen is available with read_write privileges to other developers.

Maintaining Libraries Under Source Control

The process of putting a library under source control places the contents—its library members—under source control management. Therefore, you must check library members into a source controlled library (more on check-in later) to actually place the individual members under source control. For the purpose of this discussion, it is assumed that library members or repository entries—screens, reports, JPL modules, or menu files—when checked in, are stored under the source control management system.

Use of all supported source control management systems requires that your path specify the Prolifics utility f2asc. This utility converts the screens and reports to ASCII before checking them in. Additionally, users of PVCS must set the VCSID and VCSCFG variables. For more information, refer to your vendor's documentation.

Before putting a library under source control, you must have a new or populated library (created within the screen editor or with formlib with the -c option).

How to Provide an Interface to Your Source Control Manager

  1. From the command line, type:
    formlib -g "sourceMgr mgrArgs" library

    For example, for SCCS support, use:

    formlib -g "sccs devdir" dev.lib

    Or for PVCS, use:

    formlib -g "pvcs c:\DEV\ARCHIVE" dev.lib

    sourceMgr

    Name of the installed source control management driver—either sccs or pvcs (lowercase).

    mgrArgs

    Any string that is useful to the sourceMgr-specified driver:

    For SCCS, supply the name of the source control directory— either relative to the library's directory or an absolute path—where the application-related files are to be stored.

    For PVCS, supply the name of the archive directory—either relative to the library's directory or an absolute path—where the screens and revised files are to be stored.

    library

    Name of the Prolifics library or repository that you are putting under source control management.

  2. If the library already contains members, invoke the screen editor so that you can check in screens to the source control management system:
  3. If you want to check in a screen from another library:

Library Members Under Source Control Management

There are three features of source control management available to you when you open a library whose contents are being maintained under source control management. You can open a copy of a file so that you can edit it or you can open it read-only. You can also check changes in and take full advantage of the features offered by your source control manager to monitor those changes.

The following options are available from within the editors' workspace so that you can update and view library members (screen, reports, menus, styles, and JPL modules) by choosing the desired option:

How to Edit a Library Member Under Source Control Management

  1. If the library or repository is not open, choose FileOpenLibrary or Repository.
  2. Select the desired library/repository to view its contents.

    All members of the selected library/repository are listed in the appropriate Open dialog. Those members currently checked out are listed along with the name of the user and date and time of check out.

    Figure 10-1 Checked out library members are identified on the Open dialog boxes.

    Note: Ownership information, that is, the user who has the library member checked out, might not reflect the latest source control management status. This is due to the fact that source control can be executed outside Prolifics. Prolifics updates the status once you make a selection.

  3. Select the desired member from the list. If multiple revisions of the library member are stored in the source management directory, you can choose which revision to open.
  4. Edit the library member as required.

    You can make changes, and save (choose FileSave) those changes as often as you need to without checking the member back into source control. As long as the member is checked out to you, other users can only retrieve a read_only copy. Moreover, the read_only copy is created from the last check_in; it does not reflect the latest changes saved to the library. Once you are done with the library member, and are satisfied with the edits, you can check it back into the source control management system.

    Note: Choosing FileSave does not perform a check into source control. You must proceed to step 5 to update the source copy.

  5. Choose FileSource MgmtCheck In. The library member closes and the lock is released.

    If you made changes since the member was last saved, you are prompted to save those changes to the library:

How to Save a Read-only Library Member and Store It Under Source Control Management

  1. Make sure the open repository or selected library is under source control management (converted with the formlib utility).
  2. Choose the appropriate FileSave As option. The Save As dialog box opens.
  3. Enter a name for the library member. If you want to save the member with the name as one that already exists, enter the name or select it from the list.
  4. If there are multiple revisions of the member in source control, you can choose which revision should get the latest changes. Choose OK.

    Note: Saving a library member does not check it into the source control management system.

  5. Choose FileSource MgmtCheck In.

How to Delete a Library Member that Is Under Source Control

You can remove the working version of a screen (or other member) from the library under source control, but the source (previous versions) are not removed. To remove all traces of an entry, you must access your source control management system directly (outside of Prolifics).

Cancelling a Check Out

When you open a library member that is in a library under source control management, a write-lock is enforced on that member. Another user cannot edit the file.

In the event that you do not want to edit the member, or you don't want to save the changes you've made since you checked it out, choose FileSource MgmtCancel Check Out.

A cancelled check out means that your current edits, even saved edits, are not saved to the source control management system. The library member in source control management remains unchanged. The write-lock is removed and another user can now check out the member.

Note: Choosing FileRevert restores a screen to its last saved copy as it exists in the library; it does not restore to the copy that was last checked into the source control management system.