How Do I Transfer Objects from One Project to Another? (Magic xpa 3.x)
Prerequisite: If the objects involved have no dependencies, then copying them is not a problem. However, if one object is dependent on another, the project files must be identical in terms of the dependencies. For instance, suppose you are copying program 21 from project A to project B. Program 21 uses models 3, 18, and 24, and also calls program 46.
When you import program 21 to project B, models 3, 18, and 24 must be identical in the two projects, and program 46 must also be the same.
In this example, we will be exporting the models from one project, to use in starting another project.
-
Select File->Export (Ctrl+Shift+E).
-
For Operation, select Export.
-
For Type, select the repository you want to export (models, data sources, programs, help screens, rights, menus, components, application properties, or the entire project).
-
Select one folder, if you want, or a from/to range, to limit how many objects get exported. You can zoom from the from/to fields to select from a list. By default, all objects of the type you chose will be exported.
-
Enter a file name, if you want. By default, the file will be created in the Exports subdirectory of the working directory.
-
Click OK.
A new file will be created. In this example, the file Models.xml was created.
Now let’s import those models into our new empty project.
-
Select File->Export (Ctrl+Shift+E).
-
For Operation, select Import.
-
Enter the file name with path of the XML file you just exported.
-
Click OK.
The objects you exported will now be located in your project. They will import sequentially underneath the items that are already in that object repository.
Hint: Import/export is generally used to move programs between two versions of the same project, to import items into an empty project (such as generic models), or to copy simple generic routines. In general, if you need to share objects between several projects, it is better to use a component. Components are truly reusable objects that are easily shared.
How Do I Reuse Magic xpa Objects Across Projects?