$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 Uniface 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 subobjects.

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).

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")

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")

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.

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

Example: Exporting a Full Project including Referenced Objects

When exporting a project, referenced objects are only included if you use the FullProject OptionList parameter.

In this example, there are two projects, Project1 and Project2. Project1 contains two components (DSP1 and SVC1) as well as Project2. Project2 also contains two components: DSP2 and SVC2.

  • To export just Project1, without the objects it references, use:

    vResult  = $ude("export", "project", "project1", "export.xml")
  • To export any referenced entities, components, and libraries, specify the option FullProject.

    vResult  = $ude("export", "project", "project1", "export.xml", "FullProject=True")

    This exports:

    • Project1
    • References to DSP1, SVC1, and Project2
    • Objects DSP1 and SVC1
  • To also export Project2, specify the option RecursiveProject.

    vResult  = $ude("export", "project", "project1", "export.xml", "RecursiveProject=True")

    This exports:

    • Project1
    • References to DSP1, SVC1, and Project2
    • Project2
    • References to DSP2 and SVC2. Project2's objects are not exported.
  • To export everything, specify both FullProject and RecursiveProject.

    putitem/id vOptions, "FullProject", "true"
    putitem/id vOptions, "RecursiveProject", "true" vResult = $ude("export", "project", "project1", "export.xml", vOptions)

    This exports:

    • Project1
    • References to DSP1, SVC1, and Project2
    • Objects DSP1 and SVC1
    • Project2
    • References to its objects CPT2 and SVC2
    • Objects DSP2 and SVC2
History
Version Change
10.3.03.006 Added options FullProject and RecursiveProject
10.3.01 Removed library as an ObjectType. It is accepted but does nothing.
9.1.01 Introduced

Related Topics