Using the Editors |
The chapter describes basic editor tasks needed to build your application components:
Starting the Editor |
Do either of the following:
prodev
(or the full pathname of the Panther executable).
The editor workspace is displayed. It is in this space that you begin creating the interface to your application.
For a description of each workspace component, refer to Chapter 2, "Editor Workspace."
Figure 5-1 The editor workspace consists of a menu, toolbars, a new screen and an associated Properties window, and can display optional secondary windows.
Editor Startup options
prodev
supports the following startup options:
-a
—start in application mode.
-debug
—start in debug mode. See Chapter 39, "Using the Debugger," in Application Development Guide for details on using the Panther debugger.
-e
—start in Editor mode. This is the default when the -a
and -debug
options are not specified.
-ini
—in Windows, specifies the name of the Windows initialization file. See Chapter 3, "Windows Initialization File," in Configuration Guide for more information.
-ro
—open the screens initially specified in read-only mode (new in Panther 5.50).
The name of the screens, reports and/or components to be opened initially can also be specified.
Opening and Creating Application Components |
Your Panther application components are created in the editor and then stored in a library or a repository.
A new, untitled screen is open by default when you start up the editor. Now you can begin populating the screen with widgets, or create other types of application components.
To open an application component, the library that it lives in must be open. If you want to ensure that a library opens when you start up an editing session, specify the library's path in the SMFLIBS variable. However, if the library is not specified in SMFLIBS
, you can open the library via the File menu.
Once the library is open, there are two ways to access and open application components:
While you are working in the editor, you can:
Viewing the Library Table of Contents
How to Open the Library Table of Contents
Figure 5-2 You can access the library table of contents to open all types of application components.
The object opens in the workspace. The name is displayed in the title bar in the format: appComponent@libraryName
.
From the Library TOC, select the object and choose Delete. The following prompt is displayed:
Remove [appComponent] from library?
Opening and Creating a Library |
If you are responsible for creating libraries for the team, you must also ensure that the libraries open by default when you start up Panther. To open libraries, specify the library's path in the SMFLIBS variable. However, if you are a member of the team and you want to create and open a local library, then you can do so from the File menu option in the menu bar.
You can have more than one library open at a time.
.lib
) that you want to open and choose OK.
Note: You can also open a library from the library table of contents window.
(JetNet/Oracle Tuxedo only) You must have opened a middleware session and have a file access server (devserv
) running which enables access to libraries located on remote machines. For further information on the server types, refer to "Server Executables" in JetNet/Oracle Tuxedo Guide.
Note: You can also open a remote library from the library table of contents window.
If you are responsible for creating libraries for the team, then it is recommended that you create:
These libraries are provided by copying the distributed libraries, namely client.lib
, server.lib
, and common.lib
, from SMBASE/config
to your application development directory. The distributed libraries have copies of files you can modify which are needed for development.
How to Create a Library
*.lib
extension) and choose OK.(JetNet/Oracle Tuxedo only) You must be connected to the middleware and have a file access server (devserv
) running which provides access to remote machines. For further information on the server types, refer to "Server Executables" in JetNet/Oracle Tuxedo Guide.
*.lib
extension) and choose OK.Opening a Middleware Session |
In JetNet/Oracle Tuxedo applications, you open a middleware session to connect to a middleware and access the libraries and repositories on the application server. The middleware controls processes and communication between the application's clients and servers. To test an application screen that uses services, you must have a valid middleware connection.
Figure 5-3 Connect to the middleware for a client on a server machine, also called a local or native client.
For a client on a server machine, the Connect dialog box has the following fields and specifications:
For a client not on a server machine, the Connect dialog box has the following fields and specifications:
For a client not on a server machine, the Connect dialog box has the following fields and specifications:
Figure 5-4 Connect to the middleware for a client not on a server machine, also called a remote client.
DEVELOPMENT
).
If the application requires level-two authentication, then you must enter the application password in the Password field.
Note: The level of authentication is decided at design time. Thus, a user should be aware of the decided authentication level.
Opening a Database Connection |
While you are building your application components, you need a direct connection to the database server if you are:
In JetNet and Oracle Tuxedo applications, you can also connect to the database to test service components. (Refer to "Service Components" in Application Development Guide for instructions.)
Note:
During JetNet/Oracle Tuxedo development, making a direct connection to the database server does not affect a database connection made via server initialization.
How to Connect to the Database within the Editor
For information on connecting programmatically, refer to "Programmatically Connecting to the Database" in Application Development Guide.
Choose FileCloseDatabase or in test mode, choose DatabaseDisconnect. Both options close direct connections on a specified engine. They do not close connections that have been established via the application server.
Creating Widgets |
When you create widgets on a client screen, users see and use most of the widgets to enter data and display output. You can control how client screens and widgets respond to input and output by setting their properties.
In addition, you can populate application components with objects by simply dragging them from one to another, described in Chapter 9, "Manipulating Widgets."
For information on the Panther keyboard interface (using Panther without a mouse), refer to Appendix A, "Keyboard Interface."
Setting Properties |
The Properties window lists the property settings for selected objects; an object can be a screen, a widget, or several widgets. By default, an application component is selected when no widgets on the screen are selected. Do either of the following to deselect widgets:
You must select a widget or widgets to set properties at the widget-level. A selected widget is displayed with a changed border—on GUI platforms small, black boxes, or grab handles are displayed; in character mode, the widget is surrounded by square brackets ([ ]). A selected grid widget member is displayed in reverse video from unselected members.
Only certain properties can be set for a given widget type. As a result, the information that is displayed in the Properties window is dependent on what object or objects you have selected. If you use the screen wizard to create your client screens, reports, and service components, the wizard automatically sets certain properties for each.
The Properties window is open by default. To toggle the display of the window, select or deselect Properties Window from the View menu, or, whenever the Properties window is not visible, simply press Enter.
Using the Properties Window
How to Set Properties
y
for Yes).
Saving Your Work |
Screens, reports and service components in a Panther application must be saved to their appropriate libraries. For example, store client screens in the client library and service components in the server library. However, during development you might also store some application components in a repository to provide consistency and control throughout the entire application.
The appropriate libraries or repository must be open in order to save a client screen, service component, report or repository entry. If the development team is sharing libraries, it is the team leader's responsibility to create libraries for the team and to ensure that all the libraries open when you start up an editing session. However, if you are an independent developer working on a screen that you want to save in a local library, you must create the local library and open it via the file menu before saving the screen.
If you do not have the appropriate library open, choose the Open button or the Remote button. From the Open Library dialog box (or the Open Remote Library dialog box in JetNet and Oracle Tuxedo executables), select the library that you want to open and choose OK.
Note: In three-tier applications, it is recommended that you adopt a naming convention that identifies client screens with their corresponding service components or vice versa. Table 5-1 lists suggested file extensions.
The name, in the form appComponent@libraryName
, displays in the title bar.
HTML does not support overlapping widgets. As a result, Web browsers can render widgets in positions that differ from the appearance in the editor workspace. To ensure that widgets adhere to your original design and do not overlap:
When this option is active, any save operation (Save, Save As, Save All) forces the editor to check for overlapping widgets before actually saving the screen or screens affected by the save request.
Screen screenName
contains overlapping widgets. Save anyway?
To check for overlapping widgets before saving a screen:
Although the editor does not enforce naming conventions, the following standards are recommended for naming screens, libraries, and repositories:
Naming Conventions
_
), dollar sign ($
), and period.
In addition, your operating system and those you support may impose their own restrictions for filenames.
Panther does have default extensions for each file type which are used primarily as filter specifiers on Save and Save As dialog boxes as well as Open dialog boxes under some GUI platforms.
Table 5-1 contains general recommendations that you can apply which can help you distinguish one file type from another. You can also adopt your own naming conventions.
"hd:Desktop Folder:myfile"
Creating and Opening a Repository |
A repository has one or more entries, which originally could have been screens, reports, or service components. You can have multiple repositories; however, since you can have only one repository open at a time, it is recommended that you create one repository per application. If application development is a team effort, then a member of the team is responsible for creating and maintaining a repository to provide consistency across the application. If you are an independent developer working on an application, then you need to create your own repository.
Copying objects from a repository to your application components allows for an inheritance relationship between the copied objects. The wizards also store and use information in the open repository to build new screens and reports.
You must first create a repository in order to import or store screens as repository entries.
Note: Refer to Table 5-1 for recommendations on file names.
(JetNet/Oracle Tuxedo only) You must be connected to the middleware, and you must have a file access server (devserv
) running which provides access to create repositories on remote machines. For further information on the server types, refer to "Server Executables" in JetNet/Oracle Tuxedo Guide.
*.dic
extension) and choose OK.Creating a new repository automatically closes any repository that is currently open. You can now save a screen as a repository entry in this newly created repository by choosing Save AsRepository Entry.
While you are working in the editor, you can open a repository to gain access to its contents, so that you can copy repository objects to your application screens. Opening a repository automatically closes any repository that is already open.
Note:
The repository named data.dic
(or the repository identified in the setup variable SMDICNAME) is automatically opened on starting your editor session.
*.dic
) that contains the entry you want. Only one repository can be open at a time.
The default repository name is data.dic
and it opens by default for an editing session.
The repository entry opens. The name followed by the [Repository]
indicator is displayed in the title bar. The format is repositoryEntry@[Repository]
. Database tables that have been imported to a repository are named without a file extension, by default.
If the entry is being edited by someone else, Panther posts a warning message. If you choose Yes to steal the reservation, the entry is opened in your name and has read and write privileges. Since two people now have the entry open with write privileges, one of you could lose your changes. If you choose No, the entry opens with read-only privileges. If the repository and the entry are under source code management, you are presented with different options (refer to "Maintaining Libraries Under Source Control" in Application Development Guide for more information).
Note: If you choose to open a repository entry as a Template, a copy of the entry is created in the repository, but it does not by default inherit from the source repository entry.
To create a repository entry, refer to "How to Save a Repository Entry."
There are two ways to access and open repository entries:
How to Open the Repository Table of Contents
Figure 5-5 The Repository TOC lists all the repository entries and indicates whether the entry is currently in use.
The entry opens in the workspace. The name of the repository entry is displayed in the title bar in the format entry_name@[Repository]
.
From the Repository TOC, select the repository entry and choose Delete. The following prompt is displayed:
Remove [repository_entry] from repository?
Saving Application Components to a Repository |
A repository can store one or more entries. You can:
Regardless of how you create a repository entry, you use the entry and its objects to create your application components—dragging objects from the repository to the application component. This process creates an inheritance link between the parent, or original object, and its child, or copy. So, if you make changes to an object in the repository, those changes are propagated to all your application components derived from it.
Note:
Widgets stored in repository entries must be named to enable inheritance to child widgets. Specify a name in the Name property under Identity in the Properties window.
How to Save a Repository Entry
Note:
A repository, data.dic
or the one named in the SMDICNAME setup variable, is opened by default on starting your editor session.
Note: Use a naming convention that distinguishes entries you create from those created as a result of importing database tables (which by default have no extension).
A new entry opens with the given name in its title bar, in the format entry_name@[Repository]
.
You need to create or open either a repository or a remote repository before importing database objects to it. However, you must have a direct connection to the database to successfully import database objects to a repository. You can browse the contents of your database with Panther's database browser and then import tables and their column definitions to Panther. Through this process, screens are automatically created and stored in the open repository.
By default, when Panther displays the Import Database Objects window, only the database tables are displayed. However, the Options buttons displays a dialog box where you can select to display database views or synonyms.
You can import up to 1000 tables. The maximum number of columns per table is 255.
All tables in the current database are listed, up to a maximum of 1000. (If there are more than 1000 tables in the database, use the Filter field to control the display of table names.)
To select a table, click on the item in the Tables list. To select more than one table, do one of the following:
A repository screen is created for each table and is designated to inherit from the database as do all the widgets that make up the screen (the Inherit From property for the repository screen is set to @DATABASE
).
If a repository screen already exists for a database table, the screen is updated (refer to "Re-importing Database Tables" for details on re-importing).
To display the contents of the repository, choose ViewRepository TOC.
The import process:
Panther sets the Updatable property to Yes for all database objects—tables, views, and synonyms. However, be aware that a database view or synonym might not contain the primary key columns that are needed for database updates. If the primary key columns are not members of one of Panther's table views, the transaction manager gives an error.
Re-import database tables:
Updating Database Views
Re-importing Database Tables
Follow the same directions as described for importing tables the first time. If you have more than one database opened, Panther prompts you to choose which database to import from.
When you re-import, the process proceeds as follows:
How to Re-import Database Tables
@DATABASE
, Panther prompts you to choose whether to overwrite the repository entry or leave it unchanged.@DATABASE
. Controlling Inheritance |
When you copy a repository object to an application screen, all property values are automatically copied and most possess an inheritance relationship between the parent and child objects. You can control which properties will continue to maintain an inheritance relationship. You can:
To selectively turn inheritance on or restore it for a specific property:
How to Turn On Inheritance for a Property
The value for the selected property is now highlighted and set—provided that OptionsInherit is on—to match the property for the parent object specified in the Inherit From property for the selected object.
To change a property for a widget that inherits its property value:
The value is inherited! Remove inheritance?
Note: You can turn these inheritance reminders off by choosing OptionsFileSet Inherit Warnings.
To control the propagation of changes from parent objects to their children, use any of the following methods:
How to Restore Inheritance of All Property Values
Do you want to set all the properties inherited?
You can find a parent widget or screen (the one that inherits from) as well as find child widgets or screens (the ones that inherit). To find the parent, or source, of inheritance:
Note: If you have selected an object that does not have an Inherit From property value, the Parent menu option is disabled.
The parent repository screen, or the one containing the parent widget, is opened (if it currently is not). The parent widget, the source of inheritance, is selected.
To find the children of a parent object:
Note: If you have selected an object that is not in a repository, the Children menu option is disabled.
PATH
indicated in the SMPATH
variable (located in SMVARS or environment setup).
If matches are found, the Child List window opens.