SII

Invoking the Table API

This chapter explains the basic functions of the Table Inserter API necessary for successful user interaction.

If you make any changes to an imported table in the document, they will be erased when the table is updated. As a general rule, you should not edit an imported table. If you discover errors in the table data, you should correct the source data file. If the table is not formatted correctly, you should refer to Chapter 3, ``Preparing Information for Table API'' or report error to your system support. Once the appropriate files have been corrected you should refresh the table.

Table Inserter Options

The Table API adds three new choices to the Special menu in the FrameMaker document:

This is shown in Figure 2-1 below.

  • External Graphics Special menu, with FM Table API options added.
 

Enter Table Directory Option

This option allows you to specify a table directory. This is the directory where the tables in your document are stored. See "How the API Locates Table Data Files" on page 2-4 for more information on table directories.

Choosing a table directory:

    1. Choose Enter Table Directory from Special menu. A dialog box will appear.

    2. Your current directory will be displayed in the dialog box. Select directory where tables are located, and click on Use. The name of the directory will be stored and will appear in the Insert Table dialog box when you select Insert Table.

Insert Table Option

This option allows you to insert a table into your document. Before adding any tables, decide whether or not you want to first choose a table directory. See "How the API Locates Table Data Files" on page 2-4. and "Enter Table Directory Option" on page 2-2

Adding a table

    1. Place your cursor in your document text where you want the table to be.

    2. Choose insert Table from the Special menu. A dialog box will appear.

    3. Your current directory or Table Directory, if you chose one, will be displayed in the dialog box. Select the table you wish to insert, and click OK. The table will appear at the location you selected.

    Deleting a table

Imported tables may be deleted in the same way as normal Frame tables. Highlight table and press Delete.

Refresh tables Option

This option allows you to update the information in all the tables in your document at once. This option should be used if changes have been made in the source data files.

When this option is selected, FM Table API searches for imported tables, deletes them, and inserts a new table. Markers in each title containing the filename of the table tell the Table API where to find the table.

Before selecting this option, make sure that all the imported tables in your document exist in the proper location and have not been moved. See ``How the API Locates Table Data Files'' on page 2-4.

Refreshing tables

Select Refresh tables from the Special menu.

When you select this option, the API will update all tables in the current document. No dialog box will appear.

Refreshing tables in a book file

The FM Table API allows the user to update all the tables in a book file at once. The API adds one new option to the File menu in a book file as shown below.

Selecting this option is equivalent to selecting the Refresh Tables option on the Special menu in each individual document. When this option is selected, Frame opens up each file in the book and performs the same operation as when Refresh Tables is selected from the document Special menu.

As the API opens each file, an icon for each will appear on your screen, and will close when the API is finished updating the tables in that file.

How the API Locates Table Data Files

There are two methods that the FM Table API uses to search for table data files.

Table Directory Method

The table directory is the directory where all the tables you plan to insert are stored. You should specify a table directory before inserting any tables. For example, if you specify the table directory as

/usr/docs/homework/biology

then each time you select Insert Table, the dialog box that appears will display the items in that directory, and you will only need to select the table name, such as table1, table2, etc.

Using a table directory becomes very useful when you need to move your table data files to a new directory. This often happens when a document moves from draft to final status.

If you change the table directory, the API assumes that all the tables in the original table directory have been moved to the new table directory. If the data files corresponding to the tables in your document are moved to a different directory, then you simply need to change the table directory before using Refresh Tables option.

Explicit file path

If all the tables in your document are not stored in the same directory, you may need to specify the exact location of the table when the Insert Table dialog box appears. For example,

/usr/docs/homework/civics/table1

The disadvantage is that if a table is moved to a different directory, the API will not know where to find the source data file when it tries to update the table.

If you do specify the exact location of a file that is later moved to another directory, and you wish to update the corresponding table, you must delete the table and reinsert it, specifying the new location of the source data file.

Markers

The Table API also creates a new marker type called Table Pointer. These markers are automatically inserted in the title of each imported table and act as pointers to the source data file.

Do not edit, tamper with, or delete these markers as it may cause serious problems with the API. As long as you do not edit the table title, you should not encounter these. More information on these markers is given in Appendix C.How the API uses Markers .


Table Inserter API: Contents Introduction Preparing Information Installation Error Messages Sample Initialization File How API uses Markers

[ Frame API's | SII Home Page | Contact Us ]