Information Catalog Manager Programming Guide and Reference

FLGImport

Imports metadata from a flat file in tag language format into the Information Catalog Manager.

Authorization

Administrator

Syntax



APIRET  APIENTRY   FLGImport( PSZ              pszTagFileID,
                              PSZ              pszLogFileID,
                              PSZ              pszIcoPath,
                              FLGRESTARTOPTION RestartOpt,
                              PFLGEXTCODE      pExtCode );

Parameters

pszTagFileID (PSZ) -- input
Identifies the tag language file. This parameter is required.

This parameter contains the drive, directory path, and file name, and must be valid for a FAT or HPFS file. This drive can be a removable drive. The file name and extension, excluding the drive and directories, cannot exceed 240 characters. If you type only the file name, the Information Catalog Manager assumes that the tag language file is on the drive and path pointed to by the DGWPATH environment variable.

The file identified by pszTagFileID contains the Information Catalog Manager objects and related metadata to be imported.

pszLogFileID (PSZ) -- input
Specifies the location and name of the log file. This parameter is required.

This parameter contains the drive, directory path, and file name, and must be valid for a FAT or HPFS file. The drive cannot be a removable drive. If you specify only a file name, the Information Catalog Manager places the log file on the drive and path pointed to by the DGWPATH environment variable.

If the log file specified in this parameter does not exist, a new file is created. If the log file specified in this parameter already exists, then the Information Catalog Manager appends to it.

The file identified by pszLogFileID contains logging information as well as warnings and errors detected during processing of the FLGImport API call.

pszIcoPath (PSZ) -- input
Specifies the location of the OS/2 and Windows icon files. This parameter contains the drive and directories, and must be valid for a FAT or HPFS file on a nonremovable drive. The maximum length for the icon path is 246 characters.

This parameter is optional. If you do not specify this parameter, icon files are not imported, even when the tag language file contains instructions to import icons associated with object types.

When specified, the import function searches this path for any icon files referenced within the tag language file identified by pszTagFileID. If the tag language file indicates that icons are to be associated with an object type, and the icons do not reside in the icon path, a warning is recorded in the log file.

RestartOpt (FLGRESTARTOPTION) -- input
Specifies whether the Information Catalog Manager processes the input tag language file from the beginning or from a checkpoint. Valid values are:

B
Beginning

The tag language file is processed from the beginning, even if the same tag language file was already specified at a previous time and only partially processed because of run-time errors.

C
Checkpoint

The same tag language file was processed, but only partially. The system saved the checkpoint label information where execution is to resume for this file. In this case, the tag language file is searched for the saved checkpoint label and, if a match is found, importing resumes from that point. If a match is not found, then the FLGImport API call fails.

If C is specified for the RestartOpt, but the tag language file was not previously processed, then the Information Catalog Manager processes the tag language file from the beginning.

pExtCode (PFLGEXTCODE) -- output
Points to an extended code associated with the reason code. See Appendix D, Information Catalog Manager reason codes to see if a meaningful extended code is associated with the returned reason code.

Reason code (APIRET)
Represents the execution result of this API call.

See Appendix D, Information Catalog Manager reason codes for an explanation of the returned reason codes.

Usage

Debugging import errors

The Information Catalog Manager creates a log file and an echo file when importing a tag language file.

The log file records what happens during the import process. It includes the times and dates when the import process started and stopped. It also includes any warning or error messages for problems that occur during the process. The log file is identified by the pszLogFileID parameter.

The echo file lists the tags that have been processed by the Information Catalog Manager. The echo file has the same name as the import tag language file, and is stored in the same directory and path as the log file, but has the .ech file extension.

You can use the echo file and log file to find the tag that is causing the import error. The last one or two tags of an echo file tell you which tag in your tag language file caused the import process to stop.

Importing a delete history tag file

To protect against erroneous deletions in other information catalogs, you should examine the contents of a delete history tag file before importing it to any other information catalog, especially if you have deleted Grouping object instances, or object types.

Linking your VisualAge(R) C++ program when it imports from diskettes

If your C language program issues an FLGImport call that imports the Information Catalog Manager information from diskettes, link your program with an application type of WINDOWAPI so that the Information Catalog Manager can use the PM interface to display messages that prompt the user for diskettes when necessary.

You can perform this linking using one of these methods:

Committing changes before using FLGImport

The Information Catalog Manager rolls back the database when FLGImport encounters errors. Your program should issue FLGCommit before issuing FLGImport to ensure that the Information Catalog Manager does not also roll back uncommitted changes that occurred before the FLGImport call.

Examples

The sample code in Figure 82 imports a tag language file named TAGFILE1.TAG. The Information Catalog Manager logs the processing information in TAGFILE1.LOG.

Figure 82. Sample C language call to FLGImport

 
 APIRET           rc;                                   // Declare reason code
 UCHAR            pszTagFileID[FLG_TAG_FILE_ID_MAXLEN+1];  // ID for Tag Language file
 UCHAR            pszLogFileID[FLG_LOG_FILE_ID_MAXLEN+1];  // ID for Log file
 UCHAR            pszIconPath[FLG_ICON_PATH_MAXLEN+1];  // Path for Icon files
 FLGRESTARTOPTION RestartOpt;                           // Restart option
 FLGEXTCODE       ExtCode=0;            // Returned extended code
   .
   .  /* Importing the Tag Language file TAGFILE1.TAG               */
   .
 
 strcpy (pszTagFileID,"c:\\DGdata\\TAGFILE1.TAG");
 strcpy (pszLogFileID,"c:\\DGdata\\TAGFILE1.LOG");
 strcpy (pszIconPath,"c:\\DGdata");
 RestartOpt = FLG_RESTART_BEGIN;
 
 rc = FLGImport (pszTagFileID,
                 pszLogFileID,
                 pszIconPath,
                 RestartOpt,
                 &ExtCode);        // Pass extended code by reference
 


[ Top of Page | Previous Page | Next Page ]