Search Order for Global Objects

Uniface searches for global objects in libraries. Uniface searches for a fallback resource if it cannot find the requested one.

The libraries and the order in which they are searched depend on the type of global object. Some of these objects also have a language, which also affects the search order.

The $VARIATION assignment setting specifies the library to be used by an application and the $LANGUAGE setting defines the language. The language, in combination with the library selected, determines the global messages, help texts, menu bars, menus, and glyphs that are used.

The $language and $variation ProcScript statements can be used to override the assignment settings.

Fallback Searching for Library Objects

Uniface searches for a fallback resource if it cannot find the requested one of the following global objects:

  • Message
  • Menu
  • Glyph
  • Panel
  • Keyboard Translation Table
  • Device Translation Table

Fallback search order for library objects:

  1. If Uniface cannot find a resource in the specified library (other than the default USYS), Uniface searches for a fallback resource in the USYS library.
  2. For objects that have a language (messages, menus, and glyphs), if Uniface still cannot find the resource, and that resource has a language other than the default USA, Uniface searches for a fallback resource with the originally requested library, but with language USA.
  3. Finally, if Uniface still cannot find the resource, it searches for the object in the USYS library with language USA.

If the search still does not yield the desired object, Uniface applies a type-specific search for a fallback resource, as described in the following sections.

Search Order for Language Objects

The following table shows the order in which Uniface searches libraries for global objects when $LANGUAGE and $language specify the same language. If it cannot find the object in that language variation, it repeats the search for objects with language variation USA. The numbers indicate the order the library and language are searched.

Search Order for Global Objects of a Specific Language

Library

Language

Object

 

Messages

Menus

Menu bars

Glyphs

$VARIATION

$LANGUAGE

1

1

1

1

USYS

$LANGUAGE

2

2

2

2

$VARIATION

USA

3

3

3

3

USYS

USA

4

4

4

4

Component library

$LANGUAGE

  5 5

5

Component library

USA

  6 6

6

Note: If a client delegates the search for a global object to a resource server (by listing the server in the [RESOURCES] section of the client assignment file), it only looks for the object in the first location. For more information, see [RESOURCES].

Glyphs

When an application needs a glyph, Uniface searches for it using the generic search mechanism, specifying application's current values of $variation and $language.

If that search fails, Uniface attempts to find a fallback glyph with the variation set to the name of the component library.

Menus

Uniface searches for menus (including menu bars) using the generic resource search mechanism. If Uniface can't find a requested menu bar, it will attempt to find a fallback menu bar using the component library instead of the specified variation, again using the generic search mechanism.

Search Order for Non-Language Objects

In the following table, the number indicates the order in which Uniface searches the libraries for objects that have no language.

Search Order for Non-Language Objects
Object Component Library Application Library SYSTEM_LIBRARY $VARIATION USYS
(If Defined)
Global ProcScript 1 2 3    
Global Variables Library 3 2 1    
Panels       1 2
Keyboard translation Tables       1 2
Device Translation Tables       1 2

Global ProcScripts

When calling global ProcScript modules, it is possible to explicitly specify the library in which ProcScript is located, using the format Library::ProcName. In this case, Uniface always looks in the specified library first, and if the ProcScript cannot be found there, returns an error. For more information, see #include and call.

If the library is not explicitly specified in the call statement, Uniface searches for the Global ProcsScript in the following order:

  1. The library of the component from which the Global ProcScript is called
  2. The library of the application shell
  3. The library SYSTEM_LIBRARY

When a global ProcScript module contains a call to another global ProcScript module, and the library is not specified, Uniface first looks for the called module in the calling global ProcScript itself, then in the same library as the calling global ProcScript.

Global Variables

Global variables libraries are loaded early. The SYSTEM_LIBRARY and the application shell library are loaded at application start-up. Component libraries are loaded when the component is initialized.

The search order for global variables is:

  1. SYSTEM_LIBRARY
  2. Application shell library
  3. {Global ProcScript’s library, if the global variable is used in a global ProcScript}
  4. Component library

Related Topics