Specifying file names for exported objects

When you export objects from a company, an extra file that is called NameMapping.xml is created. This file provides a mapping for the objects that are exported and the names of the corresponding files that are created. You can provide your own mapping XML file by using an optional parameter for the mapping file path of the exportEnv script operation.

Procedure

To use the name mapping feature, you must add a parameter to the exportEnv script operation in the export script. This parameter provides the path for the name mapping file.
For example,
var result = exportEnv(envObjList, "export_20090519_125511.zip", "C:/mapping_files/NameMapping_ip.xml");
For more information about how to write your script, see Scripts for company deployment.

Example

You can use the sample mapping file to create your own name mapping file.

The following sample has a few object types. The name mapping file that is created by the export generates elements for the object types. Some of these elements can be default file names for the objects. While you are creating the input name mapping file, you must create a similar file with specific file names required for the objects.

<?xml version="1.0" encoding="UTF-8"?>
<NameMapList CreatedDate="Mon May 18 17:01:20 PDT 2009" name="" version="6.1.0 ">
    <ObjectType type="HIERARCHY_MAPS">
        <Mapping>
            <ObjectName>HIERARCHY_MAPS</ObjectName>
            <FileName>HIERARCHY_MAPS.xml</FileName>
        </Mapping>
    </ObjectType>
    <ObjectType type="SEARCH_TEMPLATES">
        <Mapping>
            <ObjectName>SEARCH_TEMPLATES</ObjectName>
            <FileName>SEARCH_TEMPLATES.xml</FileName>
        </Mapping>
    </ObjectType>
        <ObjectType type="LKP_SPEC">
        <Mapping>
            <ObjectName>LKP_SPEC1</ObjectName>
            <FileName>LKP_SPEC_1.xml</FileName>
        </Mapping>
        <Mapping>
            <ObjectName>LKP_SPEC2</ObjectName>
            <FileName>LKP_SPEC_2.xml</FileName>
        </Mapping>
        <Mapping>
            <ObjectName>LKP_SPEC3</ObjectName>
            <FileName>LKP_SPEC_3.xml</FileName>
        </Mapping>
        
    </ObjectType>
    <ObjectType type="MKT_SPEC">
        <Mapping>
            <ObjectName>dest spec</ObjectName>
            <FileName>MKT_SPEC_1.xml</FileName>
        </Mapping>
    </ObjectType>
    <ObjectType type="CATALOG_MKT_MAP">
        <Mapping>
            <ObjectName>destmap1</ObjectName>
            <FileName>CATALOG_MKT_MAP_2208.xml</FileName>
        </Mapping>
    </ObjectType>
    <ObjectType type="FILE_CATALOG_MAP">
        <Mapping>
            <ObjectName>fileMap</ObjectName>
            <FileName>FILE_CATALOG_MAP_2209.xml</FileName>
        </Mapping>
    </ObjectType>
    <ObjectType type="CATALOG_CONTENT">
        <Mapping>
            <ObjectName>Lkp1</ObjectName>
            <FileName>Lkp1.xml</FileName>
        </Mapping>
        <Mapping>
            <ObjectName>Lkp2</ObjectName>
            <FileName>Lkp2.xml</FileName>
        </Mapping>
        <Mapping>
            <ObjectName>Catalog1</ObjectName>
            <FileName>CTG_1.xml</FileName>
        </Mapping>
        <Mapping>
            <ObjectName>Catalog2</ObjectName>
            <FileName>CTG_2.xml</FileName>
        </Mapping>
    </ObjectType>
    <ObjectType type="PRIMARY_SPEC">
        <Mapping>
            <ObjectName>PRIMARY_SPEC1</ObjectName>
            <FileName>PRIMARY_SPEC_1.xml</FileName>
        </Mapping>
        <Mapping>
            <ObjectName>PRIMARY_SPEC2</ObjectName>
            <FileName>PRIMARY_SPEC_2.xml</FileName>
        </Mapping>
    </ObjectType>
    <ObjectType type="CATALOG">
        <Mapping>
            <ObjectName>CATALOG</ObjectName>
            <FileName>CATALOG.xml</FileName>
        </Mapping>
    </ObjectType>
    <ObjectType type="SUB_SPEC">
        <Mapping>
            <ObjectName>test_subspec1</ObjectName>
            <FileName>test_subspec_1.xml</FileName>
        </Mapping>
    </ObjectType>
</NameMapList>