Command Reference > Working with pmrep Files > Object Import Control File Examples
  

Object Import Control File Examples

The parameters you specify in the control file code determine the actions that take place when you run the ObjectImport command in pmrep. The following examples discuss instances in which you use the ObjectImport command with a control file to import repository objects. The elements and attribute names that are key to performing the described tasks are designated with comments in the code.
The following table provides a description of sample object import control files:
Function
Description
Import source objects.
Use the TYPEFILTER element to import only source objects.
Import multiple objects into a folder.
Use the IMPORTPARAMS and FOLDERMAP elements to import multiple objects.
Check in and label imported objects.
Use the CHECKIN_AFTER_IMPORT and APPLY_LABEL_NAME attributes of the IMPORTPARAMS element to label imported objects.
Retain Sequence Generator and Normalizer transformation values.
Use the RETAIN_GENERATED_VALUE attribute of the IMPORTPARAMS element to retain Sequence Generator and Normalizer values when you import objects.
Import objects and local shortcut objects to the same repository.
Use all attributes of the FOLDERMAP element to import objects and local shortcut objects that reference the objects.
Import shortcut objects from another repository.
Use all attributes of the FOLDERMAP element to import shortcut objects from another repository.
Import objects to multiple folders.
Use all attributes of the FOLDERMAP element to import objects to multiple folders.
Import specific objects.
Use the TYPEFILTER element to import specific objects.
Reuse and replace dependent objects.
Use the OBJECTTYPENAME and RESOLUTION attributes of the TYPEOBJECT element to reuse and replace dependent objects.
Replace invalid mappings.
Use the QUERYOBJECT element to replace invalid mappings.
Rename objects.
Use the RESOLUTION attribute of the SPECIFICOBJECT element to rename objects.
Copy SAP mappings and SAP program information.
Use the COPY_SAP_PROGRAM attribute of the IMPORTPARAMS element to copy SAP mappings and SAP program information.
Apply default connection attributes.
Use the APPLY_DEFAULT_CONNECTION attribute of the IMPORTPARAMS element to apply default connection attributes.
Resolve object conflicts.
Use the RESOLVECONFLICT element to resolve object conflicts.

Importing Source Objects

You can import source objects. For example, you want to replace all the duplicate objects labeled “Monthend” in the target folder. However, you want to rename conflicting source objects that contain “Yr_End” in the object name. You have a query called “yr_end_qry” that finds these objects.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<IMPORTPARAMS CHECKIN_AFTER_IMPORT ="NO">
<FOLDERMAP SOURCEFOLDERNAME ="OLD_ACCOUNTING"
SOURCEREPOSITORYNAME ="OLD_REPOS"
TARGETFOLDERNAME ="NEW_ACCOUNTING"
TARGETREPOSITORYNAME ="NEW_REPOS"/>

<!-- use the TYPEFILTER element to import only source objects -->
<TYPEFILTER TYPENAME ="SOURCE"/>
<RESOLVECONFLICT>
<LABELOBJECT LABELNAME ="Monthend"
RESOLUTION = "REPLACE"/>
<QUERYOBJECT QUERYNAME ="yr_end_qry"
RESOLUTION ="RENAME"/>
</RESOLVECONFLICT>
</IMPORTPARAMS>

Importing Multiple Objects into a Folder

You can import multiple objects into a folder, check them in, and label them. For example, you want to import the objects to folder SRC_F1 and apply the label LABEL_IMPORT_NEW to the objects.
You might create a control file with the following attributes:
<xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<!--apply label name LABEL_IMPORT_NEW to imported objects-->
<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="NEWOBJECTS" APPLY_LABEL_NAME="LABEL_IMPORT_NEW">
<FOLDERMAP SOURCEFOLDERNAME="SRC_F1" SOURCEREPOSITORYNAME="SRC_REPO1" TARGETFOLDERNAME="TGT_F1" TARGETREPOSITORYNAME="TGT_REPO1"/>
</IMPORTPARAMS>

Checking In and Labeling Imported Objects

You can import objects into a folder, check them in, label them, and resolve the conflict between session configuration objects. For example, you want to export the objects from folder SRC_F1 and import them into folder TGT_F1. The Repository Service creates a session configuration in the target folder by default. You include the APPLY_LABEL_NAME attribute in the IMPORTPARAMS element to label the imported objects, and the RESOLVECONFLICT element in the control file to resolve the conflict.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<!--enter VERSION1 as the comment for the object you check in-->
<!--apply label name LABEL_IMPORT_NEW to imported objects-->

<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="VERSION1" APPLY_LABEL_NAME="LABEL_IMPORT_NEW">
<FOLDERMAP SOURCEFOLDERNAME="SRC_F1" SOURCEREPOSITORYNAME="SRC_REPO1" TARGETFOLDERNAME="TGT_F1" TARGETREPOSITORYNAME="TGT_REPO1"/>
<RESOLVECONFLICT>
<TYPEOBJECT OBJECTTYPENAME="SessionConfig" RESOLUTION="REUSE"/>
</RESOLVECONFLICT>
</IMPORTPARAMS>

Retaining Sequence Generator and Normalizer Values

You can retain the values of Sequence Generator and Normalizer transformations when you import objects and replace all objects in the target folder.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<!--enter YES as the value for the RETAIN_GENERATED_VALUE attribute -->
<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="VERSION1" APPLY_LABEL_NAME="LABEL_IMPORT_NEW" RETAIN_GENERATED_VALUE="YES">w
<FOLDERMAP SOURCEFOLDERNAME="SRC_F1" SOURCEREPOSITORYNAME="SRC_REPO1" TARGETFOLDERNAME="TGT_F1" TARGETREPOSITORYNAME="TGT_REPO1"/>
<RESOLVECONFLICT>
<TYPEOBJECT OBJECTTYPENAME="ALL" RESOLUTION="REPLACE"/>
</RESOLVECONFLICT>
</IMPORTPARAMS>

Importing Objects and Local Shortcut Objects to the Same Repository

You can import objects and their respective local shortcut objects to the same repository. For example, you have folders named SRC_SHARED_F1 and SRC_NONSHARED_F1. The SRC_NONSHARED_F1 folder is not shared and contains local shortcut objects that reference objects in the SRC_SHARED_F1 folder. You want to import the objects to different folders in the target repository, and you want the shortcut objects in folder TGT_NONSHARED_F1 to point to the objects in TGT_SHARED_F1.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<IMPORTPARAMS CHECKIN_AFTER_IMPORT="NO">

<!-- import objects from SRC_SHARED_F1 to TGT_SHARED_F1, and shortcut objects from SRC_NONSHARED_F1 to TGT_NONSHARED_F1-->
<FOLDERMAP SOURCEFOLDERNAME="SRC_SHARED_F1" SOURCEREPOSITORYNAME="SRC__REPO1" TARGETFOLDERNAME="TGT_SHARED_F1" TARGETREPOSITORYNAME="TGT_REPO1"/>
<FOLDERMAP SOURCEFOLDERNAME="SRC_NONSHARED_F1" SOURCEREPOSITORYNAME="SRC_REPO1" TARGETFOLDERNAME="TGT_NONSHARED_F1" TARGETREPOSITORYNAME="TGT_REPO1"/>
</IMPORTPARAMS>

Importing Shortcut Objects from Another Repository

You can import objects from other repositories. For example, you have folders in a local repository that contain shortcuts to objects in a global repository. You want to import the global shortcut objects to a repository that is registered to the global repository and maintain shortcuts to the original objects in the global repository.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="global objects" APPLY_LABEL_NAME="LABEL_IMPORT_GLOBAL_SHORTCUT">

<!--import the shortcut objects from source folder SRC_SHARED_F1 in source repository SRC_GDR_REPO1 to source folder SRC_SHARED_F1 in target repository SRC_GDR_REPO2 -->

<FOLDERMAP SOURCEFOLDERNAME="SRC_SHARED_F1" SOURCEREPOSITORYNAME="SRC_GDR_REPO1" TARGETFOLDERNAME="SRC_SHARED_F1" TARGETREPOSITORYNAME="SRC_GDR_REPO2"/>
<FOLDERMAP SOURCEFOLDERNAME="SRC_NONSHARED_F1" SOURCEREPOSITORYNAME="SRC_LDR_REPO1" TARGETFOLDERNAME="TGT_NONSHARED_F1" TARGETREPOSITORYNAME="SRC_LDR_REPO2"/>
</IMPORTPARAMS>

Importing Objects to Multiple Folders

You can import objects to multiple folders that were exported from multiple folders. For example, you exported objects from folders SRC_F1, SRC_F2, and SRC_F3, and you want to import them to target folders TGT_F1, TGT_F2, TGT_F3 in repository TGT_REPO1.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="mulfolders" APPLY_LABEL_NAME="L1">

<!-- import objects from source folders SRC_F1, SRC_F2, and SRC_F3 to target folders TGT_F1, TGT_F2, and TGT_F3 in repository TGT_REPO1 -->
<FOLDERMAP SOURCEFOLDERNAME="SRC_F1" SOURCEREPOSITORYNAME="SRC_REPO1" TARGETFOLDERNAME="TGT_F1 TARGETREPOSITORYNAME="TGT_REPO1"/>
<FOLDERMAP SOURCEFOLDERNAME="SRC_F2" SOURCEREPOSITORYNAME="SRC_REPO2" TARGETFOLDERNAME="TGT_F2" TARGETREPOSITORYNAME="TGT_REPO1"/>
<FOLDERMAP SOURCEFOLDERNAME="SRC_F3" SOURCEREPOSITORYNAME="SRC_REPO3" TARGETFOLDERNAME="TGT_F3" TARGETREPOSITORYNAME="TGT_REPO1"/>
<RESOLVECONFLICT>
<TYPEOBJECT OBJECTTYPENAME = "SESSIONCONFIG" RESOLUTION="REUSE"/>
</RESOLVECONFLICT>

</IMPORTPARAMS>

Importing Specific Objects

You can choose the objects you want to import. For example, you exported multiple object types to an XML file. You want to import only mappings, and respective sources and targets, to a folder.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="PMREP_IMPORT_TYPEFILTER" APPLY_LABEL_NAME="LABEL_MAPPING_TYPEFILTER">
<FOLDERMAP SOURCEFOLDERNAME="SRC_F1" SOURCEREPOSITORYNAME="REPO_EX_1" TARGETFOLDERNAME="TGT_F1" TARGETREPOSITORYNAME="REPO_EX1_"/>

<!-- use the TYPENAME attribute to import only mappings -->
<TYPEFILTER TYPENAME="MAPPING"/>
</IMPORTPARAMS>

Reusing and Replacing Dependent Objects

You can import sessions, replace the mappings, and reuse the existing sources and targets in the target folder. For example, you want to replace the mappings and reuse the source definitions, target definitions, and session configuration objects.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">

<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="PMREP_IMPORT_TYPEFILTER" APPLY_LABEL_NAME="LABEL_SESSION_TYPEFILTER">
<FOLDERMAP SOURCEFOLDERNAME="PMREP_CHECKED_OUT" SOURCEREPOSITORYNAME="REPO_EX_1" TARGETFOLDERNAME="PMREP_CHECKED_OUT_IMPORT_TYPEFILTER_SESSION" TARGETREPOSITORYNAME="REPO_EX_1"/>
<TYPEFILTER TYPENAME="SESSION"/>
<RESOLVECONFLICT>

<!-- replace all mappings -->
<TYPEOBJECT OBJECTTYPENAME = "MAPPING" RESOLUTION="REPLACE"/>

<!-- reuse source definitions, target definitions, and sessionconfigs -->
<TYPEOBJECT OBJECTTYPENAME = "SOURCE DEFINITION" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME = "TARGET DEFINITION" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME = "SESSIONCONFIG" RESOLUTION="REUSE"/>

<!-- replace some object types and reuse remaining objects-->
<TYPEOBJECT OBJECTTYPENAME = "ALL" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME = "SOURCE DEFINITION" RESOLUTION="REPLACE"/>
<TYPEOBJECT OBJECTTYPENAME = "MAPPING" RESOLUTION="REPLACE"/>

</RESOLVECONFLICT>
</IMPORTPARAMS>

Replacing Invalid Mappings

You can replace invalid mappings and associated child objects that are returned by a query. For example, you want to replace objects returned by the query QUERY_PARENT_RENAME.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">

<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES"

CHECKIN_COMMENTS="PMREP_IMPORT_QUERY_PARENT_REPLACE_CHILD_REUSE" APPLY_LABEL_NAME="LABEL_QUERY_PARENT_RENAME_CHILD_REUSE">
<FOLDERMAP SOURCEFOLDERNAME="PMREP_CHECKED_OUT" SOURCEREPOSITORYNAME="REPO_EX_1" TARGETFOLDERNAME="PMREP_CHECKED_OUT" TARGETREPOSITORYNAME="REPO_EX_1"/>
<RESOLVECONFLICT>

<!--replace the objects returned by the query QUERY_PARENT_RENAME -->
<QUERYOBJECT QUERYNAME="QUERY_PARENT_RENAME" RESOLUTION="REPLACE"/>
</RESOLVECONFLICT>
</IMPORTPARAMS>

Renaming Objects

You can rename specific objects when object conflicts occur. For example, you want to the rename the objects ADDRESS, ADDRESS1, R_LKP, MAP_MLET, R_S3, WF_RS1. The Repository Service appends the object names with a number.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">

<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="PMREP_IMPORT_SPECIFICOBJECT_RENAME" APPLY_LABEL_NAME="LABEL_IMPORT_SPECIFIC_OBJECT_RENAME">
<FOLDERMAP SOURCEFOLDERNAME="SRC_FOLDER1" SOURCEREPOSITORYNAME="REPO_EX_1" TARGETFOLDERNAME="TGT_FOLDER1" TARGETREPOSITORYNAME="REPO_EX_1"/>

<RESOLVECONFLICT>

<!-- rename the objects ADDRESS, ADDRESS1, R_LKP, MAP_MLET, R_S3, WF_RS1 -->

<SPECIFICOBJECT NAME="ADDRESS" DBDNAME="sol805" OBJECTTYPENAME="Source Definition" FOLDERNAME="PMREP_CHECKED_OUT" REPOSITORYNAME="REPO_EX_1" RESOLUTION="RENAME"/>
<SPECIFICOBJECT NAME="ADDRESS1" OBJECTTYPENAME="Target Definition" FOLDERNAME="PMREP_CHECKED_OUT" REPOSITORYNAME="REPO_EX_1" RESOLUTION="RENAME"/>
<SPECIFICOBJECT NAME="R_LKP" OBJECTTYPENAME="Lookup Procedure" FOLDERNAME="PMREP_CHECKED_OUT" REPOSITORYNAME="REPO_EX_1" RESOLUTION="RENAME"/>
<SPECIFICOBJECT NAME="MAP_MLET" OBJECTTYPENAME="Mapping" FOLDERNAME="PMREP_CHECKED_OUT" REPOSITORYNAME="REPO_EX_1" RESOLUTION="RENAME"/>
<SPECIFICOBJECT NAME="R_S3" OBJECTTYPENAME="Session" FOLDERNAME="PMREP_CHECKED_OUT" REPOSITORYNAME="REPO_EX_1" RESOLUTION="RENAME"/>
<SPECIFICOBJECT NAME="WF_RS1" OBJECTTYPENAME="Workflow" FOLDERNAME="PMREP_CHECKED_OUT" REPOSITORYNAME="REPO_EX_1" RESOLUTION="RENAME"/>
</RESOLVECONFLICT></IMPORTPARAMS>

Copying SAP Mappings and SAP Program Information

You can copy SAP program information when you import SAP mappings. For example, you want to import the SAP mappings and copy the program information associated with the object you are importing to folder TGT_F1.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">

<!-- enter YES as the value for the COPY_SAP_PROGRAM attribute to copy SAP mappings and SAP program information -->

<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="Version2 of objects" APPLY_LABEL_NAME="LABEL71_REPLACE_FOLDER" COPY_SAP_PROGRAM="YES">
<FOLDERMAP SOURCEFOLDERNAME="SRC_F1" SOURCEREPOSITORYNAME="REPO_EX_1" TARGETFOLDERNAME="TGT_F1" TARGETREPOSITORYNAME="REPO_EX_1"/>
</IMPORTPARAMS>

Applying Default Connection Attributes

You can apply a default connection attribute to a session if a connection is not present in the target repository. For example, no connection exists in target repository REPO_EX_1.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">

<!-- enter YES as the value of the APPLY_DEFAULT_CONNECTION element to apply a default connection attribute -->
<IMPORTPARAMS CHECKIN_AFTER_IMPORT="NO" APPLY_DEFAULT_CONNECTION="YES">
<FOLDERMAP SOURCEFOLDERNAME="SRC_F1" SOURCEREPOSITORYNAME="REPO_EX_1" TARGETFOLDERNAME="TGT_F1" TARGETREPOSITORYNAME="REPO_EX_1"/>
<RESOLVECONFLICT>
<SPECIFICOBJECT NAME="R_S3" OBJECTTYPENAME="Session" FOLDERNAME="PMREP_CHECKED_OUT" REPOSITORYNAME="REPO_EX_1" RESOLUTION="REPLACE"/>
<RESOLVECONFLICT>
</IMPORTPARAMS>

Resolving Object Conflicts

You can resolve object conflicts for labeled objects in the target repository. For example, you have mappings, mapplets, sources, and targets labeled LBL_MPNG_MPLTS_SRCS_TGTS. You want to replace these objects and label them REPLACE_LBL_MPNG_MPLTS_SRCS_TGTS and reuse all transformations.
You might create a control file with the following attributes:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE IMPORTPARAMS SYSTEM "impcntl.dtd">
<IMPORTPARAMS CHECKIN_AFTER_IMPORT="YES" CHECKIN_COMMENTS="PMREP_IMPORT_LABEL_REPLACE" APPLY_LABEL_NAME="REPLACE_LBL_MPNG_MPLTS_SRCS_TGTS" >
<FOLDERMAP SOURCEFOLDERNAME="SRC_F1" SOURCEREPOSITORYNAME="REPO_EX_1" TARGETFOLDERNAME="TGT_F1" TARGETREPOSITORYNAME="REPO_EX_1"/>

<!-- use the RESOLVECONFLICT element in conjunction with the RESOLUTION attribute of the OBJECTTYPENAME element to resolve conflicts when you import objects -->
<RESOLVECONFLICT>
<LABELOBJECT LABELNAME="LBL_MPNG_MPLTS_SRCS_TGTS" RESOLUTION="REPLACE"/>
<TYPEOBJECT OBJECTTYPENAME="Lookup Procedure" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Stored Procedure" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Expression" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Filter" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Aggregator" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Rank" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Normalizer" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Router" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Sequence" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Sorter" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="update strategy" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Custom Transformation" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Transaction control" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="External Procedure" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="Joiner" RESOLUTION="REUSE"/>
<TYPEOBJECT OBJECTTYPENAME="SessionConfig" RESOLUTION="REUSE"/>
</RESOLVECONFLICT>

</IMPORTPARAMS>