ARSperl Manual - ars_Import

## `ars_Import(ctrl, importOption, importBuf, type, name, ...)`

Import objects of type `type` and name `name` from the importBuf.

On success
  Returns 1.
On failure
  Returns 0.

Example:

            $buf = `cat /tmp/importfile.arx`;
    	($a = ars_Import($ctrl,
    			 &ARS::AR_IMPORT_OPT_CREATE,
                             $buf, "Schema", "HD:HelpDesk",
    			 "Active_Link", "AL-FooBar")) ||
    		die "$ars_errstr";

`importOption` is one of:

> &ARS::AR_IMPORT_OPT_CREATE
> &ARS::AR_IMPORT_OPT_OVERWRITE

When compiling against an API version previous to 4.5, this option has no effect on the import operation but must still be specified. When compiled against an API version greater or equal to 4.5, this option specifies what to do if the object already exists (generate an error, or overwrite the existing object).

The above example will read an AR Export file (text file) into a scalar and will import Schemas and Active Links from that file into the ARSystem. Other object types are:

- "schema"
- "schema_defn"
- "schema_view"
- "schema_mail"
- "filter"
- "active_link"
- "admin_ext"
- "char_menu"
- "escalation"
- "dist_map"
- "schema_view_min"
- "container"
- "dist_pool"
- "schema_view_2"

Note that note all of the above types are available in earlier versions of ARSystem. The above list is valid as of ARSystem v4.5.

It's recommended that if you want to import schema definitions you should use "`schema`" and not use the other `schema_*` types.

If you are curious about what non-obvious types are used for, you should read the ARSystem Programmers Manual.

ars_Import was introduced in version 1.3 of ARSperl

Table of Contents