$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
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:
Valid only if ResourceType is |
ResourceType | String |
Either |
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.
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
|
Return Values
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.
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, ":")
Version | Change |
---|---|
10.3.02.038 | Introduced |