$ude ("archive")

Copy resources (compiled runtime objects) to a Uniface archive (UAR) file. Resources can be added as a list:

$ude("archive", "list", ListOfResources, ArchiveFile{, OptionList})

Or by type of resource:

$ude("archive",ResourceType, ResourceName,ArchiveFile {, OptionList})

Example: vResult=$ude("archive","list", "type=form!;name=main_form;type=service!;name=object_service", "myarchive.uar")

Parameters

Parameters
Parameter Data Type Description
ListOfResources String

Associative Uniface list specifying the resources to be added to the UAR in which each item is a sub-list with the following format:

type=ResourceType!;name=ResourceName{!;library=LibraryName!;{language=Language}{!:class=Class}}

Valid only if ResourceType is list. See Resource List.

ResourceType String

Either "list", or the type of compiled runtime object. See Resource Types.

ResourceName String Name of the compiled name; valid only if ResourceType is not list
OptionList String Associative list containing at least one option and value appropriate to the type of resource. See Options.

Resource Types

Use Gold separators in specifying specific types of runtime objects. Depending on the object type, you may need to specify additional options.

Supported Resource Types
Resource Type Syntax
List list
Application shells application
Signatures signature
Components

 

 

 

 

 

 

dynamic_server_page
server_page
form
report
service
entity_service
session_service
Global variables variables
Global ProcScript proc
Menus, menu bars, and menu items menu
Panels panel
Messages and help texts message
Glyphs glyph
Drag and drop formats format
Entity descriptor entity_descriptor
DTD dtd
Device translation table device_table
Translation tables translation_table

Options

The OptionList enables you to influence how the operation works based on the type of resource. For example, you can provide additional details about the objects you want to archive, such as the library and language of global objects.

Options
Option Description
library=LibraryName Mandatory if ResourceType is a global object.
language=Language Mandatory if ResourceType is message | glyph | format | menu
class=Class Mandatory if ResourceType is glyph. Specifies the size and GUI platform.
model=EntityModel Specify the model if ResourceType is entity_descriptor.
description=Description Description of the UAR file (max. 511 characters); valid only if ResourceType is list
append=true | false

append=true—resource is appended to an existing archive.

append=false—an existing archive is overwritten

Return Values

Values Returned by $ude ("archive")
Value Description
>=1 Number of resources added to archive when using ResourceType is list
1 The specified resource has been added to the UAR
0 Specified object does not exist.

If $status returns <0, an error occurred. $procerror contains the exact error and $procerrorcontext provides the details.

Use

$ude ("archive") requires a fully configured Repository to be available.

Note:  The $ude functions can only be used in components or applications that are run on Windows, and they rely on functionality that is provided in the ide.uar. To use $ude functions, run components and applications with ide.exe, or configure the application to include usys:ide.uar in its resources.

Allowed in all component types except self-contained Services.

Description

Use $ude ("archive") to copy compiled runtime objects from the resource output path ($RSO) to UAR.

If you specify "list" as the ResourceType:

  • Uniface initializes a new archive file, or overwrites an existing file

    Caution: An existing ArchiveFile is overwritten with no prompt unless the option "append=true" is specified.

  • You can provide a description, which is stored in the file \uar\ArchiveFile.ver.

If you specify a ResourceType other than list:

  • The resources can be added to the UAR one at a time.
  • The archive file is kept open so each call to $ude("archive") adds an object to the file. To close the file and complete the transaction, use flush or lflush.

Resource List

If the ResourceType is list, the resources to be put in the archive need to be specified as a list in which each item consists of a sub-list that specifies the resource.

Sub-List Items when ResourceType is list
Item Description
type=ResourceType Type of compiled runtime object. See Resource Types (excluding list).
name=ResourceName Name of the resource
library=LibraryName Mandatory if type= a global object.
language=Language Mandatory if type=message | glyph | format | menu
class=Class Mandatory if type=glyph . Specifies the size and GUI platform.

Use putitem to add multiple objects to the list. For example:

putitem/id vResource, "type", "form"
putitem/id vResource, "name", "myform" putitem vResourceList, -1, vResource
putitem/id vResource, "type", "message"
putitem/id vResource, "name", "mymessage123"
putitem/id vResource, "library", "mylibrary"
putitem/id vResource, "language", "usa"
putitem vResourceList, -1, vResource

Example: Add Lists of Resources to UAR

You can use $ude ("lookup") to get a list of compiled runtime objects that can be used with $ude ("archive", "list").

Note: When adding multiple lists of compiled runtime objects make sure to use the option "append=true":

vResourceList=$ude("lookup","resources_output;application", "*","","")
vReturn=$ude("archive","list", vResourceList,"MyArchive.uar","description=MyArchive") vResourceList=$ude("lookup","resources_output;form", "*","","")
vReturn=$ude("archive","list", vResourceList,"MyArchive.uar","append=true") vResourceList=$ude("lookup","resources_output;service", "*","","")
vReturn=$ude("archive","list", vResourceList,"MyArchive.uar","append=true")

Example: Add Resource Objects to UAR

The following code shows how to add individual objects to a UAR, by first creating a list of objects (in this case messages), and then processing the list to add each resource to the archive file.

The archive file is kept open so each call to $ude ("archive") adds an object to the file. To close the file and complete the transaction, use flush or lflush.

operation addObjectsToUar
variables
  string vResourceList, vArchive, vObject, vType,  vName, vOptions, vReturn
endvariables

; Create list of resources (runtime objects)
vResourceList = $ude("lookup", "resources_output;message", "*", "library=my_lib;language=usa")

; Loop though the list of resources to add them to a UAR
vArchive = "my_lib_msg.uar"
forlist vObject in vResourceList
  vType = $valuepart($itemnr(1, vObject)) ; TYPE
  vName = $valuepart($itemnr(2, vObject)) ; NAME
  putitem/id vOptions, "LIBRARY", $valuepart($itemnr(3, vObject))
  putitem/id vOptions, "LANGUAGE", $valuepart($itemnr(4, vObject))
  putitem/id vOptions, "CLASS", $valuepart($itemnr(5, vObject))
  vReturn = $ude("archive", vType, vName, vArchive, vOptions)
endfor

; Close the file  and complete the open transaction
lflush $concat(vArchive, ":")
History
Version Change
10.3.02.038 Introduced

Related Topics