[RESOURCES]

The [RESOURCES] section of the assignment file identifies the locations where Uniface must look for Uniface runtime objects. A location may be a Uniface archive (UAR) file, a local directory that conforms to the standardized directory structure, or a remote server. The order of resource locations determines the order in which the Uniface application looks for its resources.

Syntax

[RESOURCES]
ResourceLocation ResourceLocationN

For example:

[RESOURCES]
myapp_updates_20210102.uar
myapp.uar 

Arguments

ResourceLocation—location of application resource files (runtime objects); one of:

  • ArchiveFile—path and name of a Uniface archive file. The path is relative to the current working directory, so if it is in another location, specify the complete path.
  • ResourcesDirectory—a directory that conforms to the standard resources directory structure. For more information, see Standardized Directory Structure.
  • ResourceServer—named path (as defined in [PATHS] section) to a Uniface Server on a remote host where application resources are located. See Accessing Remote Resources.

Wildcards (* and ?) are not supported.

Description

A [RESOURCES] section must be present in the assignment file..

Within the [RESOURCES] section, the search order is top-down—the first location is searched first.If a directory is specified, it must be the root of a standardized directory structure. It is also possible to specify a path logical, such as USYS:

;myapp.asn

[RESOURCES]
c:\MyCompany\myapp_updates_20210102.uar
USYS:myapp.uar

If a resource cannot be found in the locations specified in the client assignment file, Uniface looks in locations specified by usys.asn. Usually usys.uar is the only resource location in usys.asn.

Note: If you list a resource server, we recommend that both the server and the client refer to the same usys.uar, or that each usys.uar has exactly the same content.

There are several ways in which you can improve performance of resource searches:

  • Minimize the number of resource locations specified in the [RESOURCES] section of the assignment file. The lower the number of locations, the fewer places Uniface has to search.
  • If possible, have the application's resource locations available on the local machine, especially when network traffic might be a bottleneck.
    • If you need remote resource locations, consider using network shares rather than using a client-server connection.
    • If this is not possible, and you have several remote resources on the same machine, specify a plain network path as the resource location in the application's assignment file. This ensures that the search is delegated to the server, thereby reducing the need for separate network requests for each remote resource location.
  • Use UARs rather than directories for your resource locations.
    • However, if you use remote resource locations and your network has stability issues, use directories rather than UARs.

Updating a Deployed Application

You can deploy a new version of an application, or just a set of updated objects, without shutting down the Uniface Router and application servers. To do so, package the components in .uar files, and add the location of these files in the appropriate application or Uniface Server assignment files. For more information, see Update a Deployed Application.

The following example shows extracts from a usys.asn file and application assignment file for application MyApp, including the location of an application update (myapp_updates_20210102.uar).

; usys.asn

[RESOURCES]
usys:usys.uar
usys:usys@nl.uar
usys:usysicon.uar
; myapp.asn

[RESOURCES]			
C:\myapp\myapp_updates_20210102.uar
C:\myapp\myapp.uar
C:\myapp\myapp@usa.uar
C:\myapp\myapp@nl.uar
C:\myapp\myapp@gly.uar
C:\myapp\myapp@desc.uar

If Uniface can't find a requested resource in the application UARs, it will look for it in UARs specified in usys.asn.

Accessing Remote Resources

It is possible to specify a UAR file on a remote host. For example:

; myapp.asn
[PATHS]
$MYHOST =  TCP:ServerHost+13001|user|password|ust

[RESOURCES]			
C:\myapp\myapp_updates_20210102.uar
$MYHOST:myapp1.uar
$MYHOST:myapp2.uar

However, this can lead to excessive network traffic, especially if the object is in myapp2.uar.

Instead, if you have resources located in several locations on a remote server, you can delegate the search for resources to a resource server. To do so, specify the path name of the server in the client assignment file and the resource locations in the Uniface Server's assignment file. This essentially delegates the search to the server.

For example:

; client assignment file
[PATHS]
$REMOTE = TCP:ServerHost+13001|user|password|ust

[RESOURCES] C:\myapp\myapp_local.uar
$REMOTE:

The Uniface Server's assignment file can specify resource locations that are local to it:

; Remote Uniface Server assignment file
[RESOURCES] myapp.uar
lib/

In this case, when the client needs a specific resource, such as a message, it will first search the local UAR (myapp_local.uar), and if it is not found, it will direct a request to the remote Uniface Server. It too searches its resources in the specified order. Since each search attempt occurs locally on the server, it does not involve any network traffic between client and server, providing better performance than specifying multiple remote resources in the client.

When a client delegates the search for a global object to a resource server, the server only looks for the object in the specified library and language. It does not follow the normal search order for global objects, which falls back to other libraries and languages.

It is possible to mix and match local and remote resources. For example:

; client assignment file
[PATHS]
$REMOTE = TCP:ServerMachine+13001|user|password|UST

[RESOURCES] myapp_local.uar $REMOTE: myapp_local2.uar

Note: Take care when specifying the order of resources on both client and server. For example, if the resource server cannot find an object such as a message in myapp.uar or the /lib directory, it will look in its own usys.uar. If it finds the corresponding object there, it will use that and will not look in myapp_local2.uar, even if that UAR contains the object.

Redirecting Non-Uniface Files to Resources

You can use the $RES path setting to redirect non-Uniface files listed in the [FILES] section to the [RESOURCES] section. For example:

[FILES]
myfile.txt = $RES:TXT/*.txt

This assignment resolves the path of myfile.txt via the [RESOURCES] paths.

Related Topics