Defining HTML Layouts

HTML layouts enable you to customize which data columns you present for Terminology Searches in the TMS Lite Browser. Layouts are dictionary-specific, and rely on user-defined functions that derive TMS data from the production tables.

There is no security placed on HTML Layouts. You can edit or delete any HTML Layouts in the database.

To delete a layout in this database, see Deleting a Layout.

This section includes the following subsections for creating HTML Layouts:

Defining HTML Layout Functions

Before you can define an HTML Layout in the TMS application, you must define a function that you will use to derive data for that layout.

This section describes how to structure data in a package specification and package body so that the function can be used by an HTML Layout. For full samples, see the TMS Knowledge page on the My Oracle Support website.

For more information, see:

Sample Package Specification

The package specification must include each function you want to use in an HTML Layout. This example for the package dmo_package includes just two functions, LayoutOne and LayoutTwo. You can define as many packages as you want, each containing as many functions as you want.

Example 7-1 Sample Package Specification for HTML Layouts

CREATE OR REPLACE PACKAGE dmo_package IS

  FUNCTION LayoutOne(
             pRec      IN sys_refcursor
           )
  RETURN Tms_qry_result_TypeSet PIPELINED
  ;

  FUNCTION LayoutTwo(
             pRec      IN sys_refcursor
           )
  RETURN Tms_qry_result_TypeSet PIPELINED
  ;


END dmo_package;
/
sho err
grant execute on dmo_package to rxclin_read;
exec opa_ddl.CreateDropPublicSynonym( 'dmo_package');

Defining an HTML Layout Function

HTML Layout functions handle data using reference cursors of the type Tms_qry_result_Type. You can use the columns in this cursor to specify which data are presented in HTML Layouts that use this function, and how this data should be presented. The column types are:

text_n columns: The fifteen text columns (text_1, text_2, …) describe which data columns you return to the layout. You can point directly to a specific data element such as the term name, or use TMS' data model to derive a related term record, like the term's parent.

description_n columns: The fifteen description columns (description_1, description_2, …), in a one-to-one relationship with the corresponding text_n columns, specify how each data element should be presented in the layout.

Defining the Layout Name and Function

An HTML Layout uses one TMS dictionary and one layout function. This unique linkage is necessary because layout functions are written to be very dictionary-specific. In this section, you specify the dictionary that will use this layout, and the layout function that will deliver data to the HTML Layout.

To define a layout name and its function:

  1. From the Definition menu, select Define HTML Layouts. The Define HTML Layouts window opens.
  2. Choose Dictionary as the Ref Type. This is currently the only choice available.
  3. From the Ref Name field, choose the dictionary to which you want to link this layout. You will only be able to use this layout in the TMS Lite Browser when this dictionary is selected.
  4. Enter a Display Name for this layout. This name appears in the Layout list in the TMS Lite Browser when the linked dictionary is selected.
  5. Enter the name of the function you want to use for this layout, in package_name.function_name format. To use LayoutOne from Example 7-1, enter dmo_package.LayoutOne.
  6. Save.

Proceed to Defining the Layout Columns to complete the layout definition.

Defining the Layout Columns

Defining the columns for a layout means specifying which columns will display in the layout, in which order, and the headings that will display for those columns. You can choose the columns that are made available in the layout function: if you want a particular layout column to display the term name, and the layout function handles this data in the term_6 column, enter "6" as the Col ID for this column. See Defining HTML Layout Functions for information on writing an HTML Layout function.

You should define the columns in the order that you want them to display in the layout. The first column you enter in the Columns block will be the leftmost column in the layout.

The names that you enter for the columns are the names that display as headings when you use the layout in the TMS Lite Browser. You can change column display names at any time.

To define the columns for a layout, choose the layout you want to modify from the upper block of the window, then repeat the following steps for each column in the layout.

  1. In the Columns block, click in an empty row or add a record.
  2. In the Col ID field, enter the number that corresponds to the data column you want to use in the layout function. If you want this column to display the term name, and the layout function handles this data in the term_6 column, enter "6" for this column.
  3. Enter the Display Name for this column. The TMS Lite Browser displays this name in the column heading when it displays results in this layout.
  4. Repeat for each additional column, then save. TMS makes this layout available to the TMS Lite Browser.

Deleting a Layout

You can remove HTML Layouts from the database by first deleting all of the layout's columns, then deleting the layout itself.