PreviousPortability Issues Publishing ApplicationsNext

Chapter 3: Publisher Set-up

Before you can use Publisher to publish applications, you need to:

  1. Create a Net Express project for your application. This might be a completely new project, or a project based on existing source files. See the Net Express help for information on creating applications and using projects.

    If you want to create an application based on an existing UNIX application, you will need to import the application into Net Express; see the chapter Importing UNIX Applications into Net Express for details.

  2. Set up the UNIX system:

Once you have created a project and set up the UNIX system, you can use Publisher Setup to configure Publisher for your project.


Note: The Publisher Set-up dialogs described below contain several text-areas in which you need to enter directory or file information for the UNIX system; for example, the build directory, the copyfile directory, and so on. These filenames and directories can be either absolute (starting with a slash (/)) or relative. Relative paths are relative to the home directory of the specified user. For example, if user foo has the home directory /usr/foo, then that user could specify the build directory as /usr/foo/mybuildir or as mybuilddir; both are equivalent.

Also note that there is no environment variable or wildcard expansion performed on paths passed to the server.


The following description assumes a new set-up. Publisher Set-up can also be used to edit an existing configuration, in which case any values set previously are displayed as defaults.

  1. Click the UNIX menu in the IDE.

  2. Click Setup. A dialog box is displayed:

    Click a tab to create settings for:

When you click a tab, a form is displayed into which you enter the details for each configuration. If you have previously created set-up details for a configuration, then the values for that configuration are displayed.

For each project you can set up different servers to which a project can be published. For each server you can supply different configuration information.

3.1 Setting Project Details

To enter set-up information for the project, click the Project tab on the UNIX Option Setup dialog, if necessary (this tab is the default tab).

The first field displays the current active server configuration. If no server is currently selected, None selected is displayed in this field. If you want to publish a CGI application to the UNIX system check Enable CGI Support.

The buttons enable you to set further detail; they are described in the following sections.

3.1.1 Filename Mapping

Use the Define Filename Mapping button to specify the filename, location and type of each file when they are published to the UNIX system. You might need to do this to match filenames entered on statements such as CALL statements.

The Mapped Name column specifies the actual case sensitive name of the file when copied to UNIX. The default value is the case of the filename as determined by the Windows file system.

The Logical Name column shows the filenames as displayed by Net Express. These are always in uppercase and you cannot edit them.

For example, suppose a program has the call statement call "MYapp". The filename mapping procedure enables you to explicitly state that the file known to Windows as Myapp.cbl should be created on the UNIX system as MYapp.cbl.

All files created from the mapped name, as part of the build process, have the same case mapping. For example, MYapp.cbl would result in MYapp.int, and MYAPP.cbl would result in MYAPP.int.

You cannot use the File Mapping Configuration dialog to change the filename; for example, to change Myapp.cbl to change Myapp.cbl to Myapp2.cbl.

See the section Case Sensitivity in the chapter Introduction for more information on filename mapping and case-sensitivity issues.

The Target Directory column specifies which logical directory the file will be copied to. The logical directories are defined on the Logical Directories dialog.

The File Type column specifies whether the file will be transfered to the UNIX server as a binary file or as a text file. The default for new files is text.

If a file is specified as text, then it :


Note:Ensure that you do not define any binary files in your project as text files. If you do, the files will be corrupted on the server.


The Select pulldown enables you to quickly select a series of files that match a predefined pattern, for example, all COBOL files (*.cbl), or to define your own selection pattern.

You can edit the file mapping information items in two ways:

3.1.2 Setting Additional Build Options

You can specify, for a selected project, Compiler directives that are added to the cob command line when the project is built, by clicking the Additional Build Options button. The directives set here apply to all servers defined for the current project. A dialog is displayed, into which you can enter the required directives.

The Target column is the logical name that is being created; for example, CGIPRG1.INT.

The Dependents column lists the logical names that are used to create the target; for example, CGIPRG1.CBL.

The Directives column is a field that in which you can specify additional cob command line options. To edit the setting, select the row you want to edit, then click within the Directives column on the selected row. Alternatively, right click with the mouse on the row you wish to edit and select the Edit Options menu item.


Note: The directives you enter are not checked by the Publisher and are passed unchanged through to the cob command line.


3.1.3 Setting Logical Directories

You can add and remove logical directory names for the project. Click the Logical Directories button on the Project tab. A dialog is displayed that enables you to enter logical directories:

There are two special logical directories which are always present and cannot be removed:

By right clicking within the list control, you can create or delete logical directories. The logical directory names are free-format text and can contain any valid text characters.

The logical directories are a project-wide setting. They are used by the Filename Mapping dialog to specify where, logically, files should be copied, and they are assigned real values, on a server-by-server basis, in the Directory Specification tab of the Server Settings dialog.


Note: If you delete a logical directory, any filename mapping entries that used this value are updated to use [BuildDir] instead.


3.1.4 Setting Search and Replace Patterns for Specific Projects

To edit and replace patterns for specific projects, click the Search/Replace button. A list of current search/replace patterns, and the files to which they apply, is displayed. For example:

The Search Pattern column specifies a regular expression as defined in the appendix Regular Expressions.

The Replace Pattern column specifies the replacement text when the search pattern is successful. Replacement metacharacters are defined in the appendix Regular Expressions.


Note:: Even if a filename matches a file defined in the File Specification column, it will not be processed unless it is also defined as a text file in Filename Mapping Configuration.


The patterns are executed during the Publish operation in the order in which they are shown within the list box. To change the order of the patterns, select a row and, and drag and drop the pattern in the desired position.

To edit a pattern, select it with the cursor and then left-click. For example, to edit a search pattern:

  1. Select it using the mouse

  2. Left click

  3. Edit the pattern

You can also edit a pattern, or create a new pattern, by right-clicking. To create a new pattern and add it to the end of the list:

  1. Right-click in a blank area of the screen. A dialog is displayed:

  2. Enter your new pattern into the dialog

  3. Click OK

The new pattern is added at the end of the list of patterns in the Set Search/Replace list.

To create a new pattern and add it at a specific point in the list:

  1. Right-click in one of the fields of the row before which you want to add your new pattern. You are asked whether you want to add a new pattern, or edit the current pattern

  2. Enter your new pattern into the dialog

  3. Click OK

To edit a pattern using the right mouse button:

  1. Right-click on a row containing the pattern you want to change. This time, the fields in the dialog box are already filled with the patterns and file specification defined in the row

  2. Edit the patterns or file specifications as you require

  3. Click OK

3.2 Setting Server Details

To enter set-up information for the server, click the Server tab. The following form is displayed:

The list box displays any servers that have currently been defined. If you select one of these, then any changes you make using the buttons in this tab are made to the selected server. The entry New Server enables you to define a new server. If you select this entry, a dialog is displayed that enables you to specify a new server name.

The buttons on this tab enable you to set further details. These are described in the following sections.

3.2.1 Server Settings

When you click the Server Settings button a tabbed dialog is displayed:

Click a tab to create settings for:

3.2.1.1 Setting Server Details

To set the server details, click the Server tab on the Server Settings dialog, if necessary (this is the default tab). The settings you supply here apply only to the specified server.

Enter the following details:

User Id The login identifier to use when contacting the server specified above. By default, this is the user-id you used to log in to Windows
UNIX COBOL Directory The directory on the UNIX system that contains Micro Focus COBOL for UNIX. After you have entered details in this field, the Server Capabilities button on the UNIX Option Setup dialog is enabled.
Build Directory The directory on the UNIX system to which the project will be published. After you have entered details in this field, the Server Lock Control button on the UNIX Option Setup dialog is enabled.
Enable Target Directory Build Check this if you want the application built in the subdirectory specified by the Net Express target type; for example, Debug. This directory will be created under the directory specified in Build Directory
Build On Server Uncheck this if you want to copy the files to the UNIX system without rebuilding them.
EUC Support Check this if you want to enable EUC support on the UNIX system.
Publish Int Code Only Check this if you want your project built from intermediate code rather than source code.
Source Verify On Publish Check this if you want the source verified on each publish operation. This scans for changed files on the UNIX system.

3.2.1.2 Specifying Directories

To set directory details, click the Directories tab on the Server Settings dialog. The following dialog is displayed:

A list box is displayed. This contains any logical directories you defined in Logical Directories dialog (from the Project tab), and the actual physical directories on the current server.

The [BuildDir] value always matches the value entered on the Server tab; changes to one are automatically reflected in the other.

If any of the logical directories do not have a value, they are automatically assigned the value of the current [BuildDir] at the time they are first used. Once this value has been assigned, any changes to [BuildDir] does not result in a change to the other logical directory values.

3.2.1.3 Setting Prebuild and Postbuild Commands

You can define a command or series of commands that will be executed before and after the project is built. To define prebuild commands, click the Prebuild tab on the Server Settings dialog; to define postbuild commands, click the Postbuild tab.


Note: Due to the way the UNIX make program operates, each command line is executed in a separate shell environment. This means you cannot set a value on one line and read this value later in the prebuild or postbuild command sequence. If you need to do something like this, including such things as a for loop, you need to either create a script on the server, or execute the commands in a subshell.


3.2.2 Deleting Server Names

Use the Delete button to delete the currently selected server from the server list.

To delete a server name:

  1. Select from the pull-down list in the Current Server box the server name you want to delete

  2. Click the Delete button. You are asked to confirm deletion.

3.2.3 Change Server Lock

You can specify whether the build directory on the UNIX system is locked or unlocked by clicking the Server Lock Control button. A dialog is displayed that shows you the current lock status, and enables you to lock or unlock the build directory.

3.2.4 Verify Server Settings

Click Verify Server Settings to:

3.2.5 Setting Additional Build Options

You can specify, for a selected server, directives that are added to the cob command line when the project is built by clicking the Additional Build Options button. The directives set here apply to the current server. A dialog is displayed, into which you can enter the required directives.

The Target column is the logical name that is being created; for example, CGIPRG1.INT.

The Dependents column lists the logical names that are used to create the target; for example, CGIPRG1.CBL.

The Directives column is a field that in which you can specify additional cob command line options. To edit the setting, select the row you want to edit, then click within the Directives column on the selected row. Alternatively, right click with the mouse on the row you wish to edit and select the Edit Options menu item.


Note: The directives you enter are not checked by the Publisher and are passed unchanged through to the cob command line.


3.2.6 Setting Search and Replace Patterns for Specific Servers

You can specify, for a selected server, filename patterns and regular expressions that are processed when text files are published to the server. The patterns are created as a list, and executed in the order in which they are added to the list.

To edit and replace patterns, click the Set Search/Replace button. A list of current search/replace patterns, and the files to which they apply, is displayed. For example:

The Search Pattern column specifies a regular expression as defined in the appendix Regular Expressions.

The Replace Pattern column specifies the replacement text when the search pattern is successful. Replacement metacharacters are defined in the appendix Regular Expressions.


Note:: Even if a filename matches a file defined in the File Specification column, it will not be processed unless it is also defined as a text file in Filename Mapping Configuration.


The patterns are executed during the Publish operation in the order in which they are shown within the list box. To change the order of the patterns, select a row and, and drag and drop the pattern in the desired position.

To edit a pattern, select it with the cursor and then left-click. For example, to edit a search pattern:

  1. Select it using the mouse

  2. Left click

  3. Edit the pattern

You can also edit a pattern, or create a new pattern, by right-clicking. To create a new pattern and add it to the end of the list:

  1. Right-click in a blank area of the screen. A dialog is displayed:

  2. Enter your new pattern into the dialog

  3. Click OK

The new pattern is added at the end of the list of patterns in the Set Search/Replace list.

To create a new pattern and add it at a specific point in the list:

  1. Right-click in one of the fields of the row before which you want to add your new pattern. You are asked whether you want to add a new pattern, or edit the current pattern

  2. Enter your new pattern into the dialog

  3. Click OK

To edit a pattern using the right mouse button:

  1. Right-click on a row containing the pattern you want to change. This time, the fields in the dialog box are already filled with the patterns andfile specification defined in the row

  2. Edit the patterns or file specifications as you require

  3. Click OK

3.2.7 Verifying Source Code

You can verify the status of the source code between the version on the PC and the version on the UNIX system. You do this by clicking the Verify Source Code button. A list box is displayed:

The Status column shows the status of the file. The staus can be:

OK The publishing history of the file on the PC and the file on the UNIX system match.
Will be copied on next Publish The file has never been Published, or you have specified that you want the file coped at the next publish.
Server file out of date A file on the PC has been modified since the last publish.
Server file modified A file on the UNIX system has been modified since the last publish.
Server File not found The source file could not be found on the server

If you right-click on a line, a context menu enables you to force a copy of any files on the next publish.

3.3 Setting Miscellaneous Details

You can set miscellaneous details, which are neither specific to the project nor to the server, using the General tab of the Setup dialog. This tab is used to specify the terminal emulater used for remote terminal access from your PC to the UNIX system.

When you click the General tab the following dialog is displayed:

By default, the UNIX Option uses the PowerTerm terminal emulator. If you want to use a different terminal emulator:

  1. Uncheck the Use PowerTerm terminal emulator checkbox.

  2. In the entry field, specify the pathname and executable filename of the terminal emulator you want to choose. Use the Browse button if you are not sure of the location or filename of the required executable file. By default the system telnet program is selected if it exists.


Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousPortability Issues Publishing ApplicationsNext