$ude ("export")

Export development object definitions from the Repository.

$ude ("export", ObjectType, ObjectProfile, {ZipArchive:}FileName {, OptionList} )

Example: vResult = $ude("export", "variables", "*", "D:\export\UGENERAL.xml", "append=true;library=UGENERAL")

Parameters

Parameters
Parameter Data Type Description
ObjectType String List of development object types. See Object Types.
ObjectProfile String String specifying an object name or retrieve profile for one or more objects of type ObjectType
ZipArchive String Optional name of a zip archive to contain one or more XML files, for example ziparchive.zip (the full string would be ziparchive.zip:myxmlfile.xml)

When a ZipArchive is specified, it is created in the Zip64 format.

FileName String String specifying the name of a Uniface XML file, for example myxmlfile.xml
OptionList String Associative list containing one or more options that are appropriate to the ObjectType.See Options.

Arguments can also be a field, variable, or function that evaluates to a string or list.

Results

Items are omitted if their value is 0 or an empty string.

Items Returned by $procreturncontext
Item Description
Context = Context Context of the information. For $ude("export"), the value is UDE Export.
InputRecords = Number Records to be exported.
OutputRecords = Number Records actually exported.
WriteErrorsContinues = Number Write errors encountered that did not stop the export action.
InputDescriptors=Number Descriptors to be exported. The same descriptor can occur more than once.
OutputDescriptors = Number Signatures actually exported. This can be less than the number of InputDescriptors if void mappings are encountered.
DETAILS = String Messages, warnings, and errors encountered during processing, structured as a list.

Use

$ude("export") 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("export") to export the definitions of main development objects, including their sub-objects.

The $ude("export") function enables you to create components that support your own development processes, for example, in automating exports and backups. (To export application data, use $ude("copy") or entitycopy.)

Uniface exports data as well-formed, well-defined XML in which objects that have aggregation relationships are nested. The export facility takes referential integrity constraints into account, ensuring that all the data applicable to an object definition is correctly exported.

Sort Order

Definitions are exported in order of primary key. However, the database collation setting of the DBMS also affects the sort order. For example, special characters such as the underscore _) may be sorted before numbers, or before letters, which can result in records being sorted as CPT1, CPT_1, CPT, and so on, or as CPT, CPT_1, CPT1.

This can be a problem when merging exports in a development team in which each developer uses a different DBMS for the Repository, or when switching to a new DBMS. To ensure that the sort order of export files is exactly the same regardless of the database used, ensure that the database collation setting of each database is the same (or compatible).

Example: Exporting Definitions

The following instruction exports all components whose names start with my to the mycomponents.xml XML file in the myzip.zip archive:

vResult  = $ude("export", "component", "my*", "xml:myzip.zip:mycomponents.xml")

The following instruction exports all IncludeScript in the mylib library to the includes.xml file in the myzip.zip archive:

vResult  = $ude("export", "include", "*", "xml:myzip.zip:includes.xml", "library=mylib")

The following instruction exports entity CUSTOMER and all entities whose names start with ORDER , with model name ACME, to the acme_customer.xml XML file in the myzip.zip archive:

vResult  = $ude("export", "entity", "customer;ORDER*", "xml:myzip.zip:acme_customer.xml", "model=acme")

Example: Exporting Library Definitions

Libraries are typed, meaning each library can only contain one type of object. However, libraries of different types can have the same name.

To export all object definition in the MUSIC library, you need to specify each type of object:

; *** export an entire library ***
vExport = $ude("export", "variables", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "proc", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "include", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "snippet","*", "musiclib.xml","append=true;library=MUSIC")
vExport = $ude("export", "device_table", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "translation_table", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "panel", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "message", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "glyph", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "format", "*", "musiclib.xml", "append=true;library=MUSIC")
vExport = $ude("export", "menu", "*", "musiclib.xml", "append=true;library=MUSIC")

Example: Exporting Global Constants

By specifying an object profile you can export a subset of library objects, or even a specific development object.

For example, in Uniface 10 global constants can be defined in the DEFPARAM IncludeScript of a library. To export global constants, you must therefore specify the specific IncludeScript:

vExport = $ude("export", "include", "DEFPARM", "globalConstants.xml", "append=true;library=MUSIC")

They are automatically exported when exporting all objects in an IncludeScript library.

Example: Exporting a Snippet Library

The following command exports all snippets in a snippet library called MY_SNIPLIB to a file called snippet.xml:

vResult  = $ude("export","snippet","","snippet.xml","library=my_sniplib")

Snippets can have a syntax (ProcScript, HTML, or text), which is reflected in the snippet extension. Thus, it is possible to have a snippets named mysnippet.proc, mysnippet.html, and mysnippet.text.

To export only the HTML snippets, specify the syntax option:

vResult = $ude("export","snippet","","snippet.xml","library=mysniplib;syntax=html
History
Version Change
10.3.01 Removed library as an ObjectType. It is accepted but does nothing.
9.1.01 Introduced

Related Topics