title | category | tags |
---|---|---|
Importing and Exporting Objects |
Integration |
Don't re-invent the wheel. Save time by importing modules others have already created, and exporting new modules for others to use. The App Store provides this functionality on a macro-level, but you can use the modeler's built-in import and export functions to share content between your own apps, import unofficial modules, and share entire projects.
This How-to covers the basics of how to import and export modeler objects: packages, modules, widgets, and module objects. Module objects include pages, microflows, image collections, event, document templates, constants, web services, layouts, menus, and loads more.
{{% alert type="warning" %}}
Be careful when importing objects, as you can overwrite your existing work. Pay attention to prompts and warnings along the way!
{{% /alert %}}
Mendix project packages are stored as Mendix Package (.mpk) files.
-
Click on the File menu in the modeler, and select Import Project Package...
-
Select your Mendix Package file and click Open.
Here, you have a few options:
- Determine the local folder where you would like to store your project.
- Decide whether you want to use Mendix Team Server for this project. Unless you have a good reason not to use Team Server, it is highly recommended that you leave this on.
- Decide whether to upload to a new repository (recommended) or to an existing repository.
- Finally, give your project a name. By default, it will be named as it was in the Mendix Package file.
-
Click OK, and you project will load in the modeler.
Mendix module packages are stored as Mendix Package (.mpk) files.
-
Right click on your project in the Project Explorer and select Import Module Package...
-
Select your Mendix Package file and click Open.
A dialogue box will open.
-
Choose a name for your module and select whether to replace an existing module or create a new one.
{{% alert type="info" %}}
If you replace a module with a new version, existing user data will be retained based on the names of entities, attributes, and associations. If you delete a module and then add a newer version of it, all user data will be lost.
{{% /alert %}}
-
Click Import. You may see another dialogue box, informing you of any included module dependencies that will be overwritten in your project.
-
Click OK. You will see your new or replaced module in the Project Explorer.
You will also see your changes in the Changes section of the modeler. Here, I've replaced my existing module and as you can see, it was deleted in favor of the newly imported module.
Mendix module object packages are stored as Mendix Package (.mpk) files. An object package can contain a page, microflow, image collection, event, document template, constant, web service, layout, menu, and more.
-
Right click on a module in the Project Explorer and select Import document package..._
_An Open File dialogue will appear.
-
Select your Mendix Package file containing the object you want to import, and click Open.
-
If an object with the same name already exists, you will see a dialogue box:
At this point, you can either Rename the object or Cancel.
-
Click Rename, and enter a new name for the object you are importing:
-
Click OK to import the object into your module:
{{% alert type="info" %}}
You may need to update the new object's permissions, depending on where it was originally exported from. For consistency, be sure to check permissions on any objects imported.
{{% /alert %}}
Mendix module packages are stored as Mendix Package (.mpk) files. However, you need to place the file in your project directory to import it.
-
Click on the Project menu, and select Show Project Directory in Explorer: _
_Your project directory will appear.
-
Open the widgets folder and paste your Mendix Package file here.
-
Open the Project menu and select Synchronize Project Directory to synchronize the changes in the project directory.
{{% alert type="info" %}}
You can also press F4 to synchronize your project directory.
{{% /alert %}}
-
Add your newly imported widget from the Toolbox or Add Widget context menu:
To learn more about importing content from the App Store, see Use App Store Content.
This part will go through the steps required to export projects.
- Click on the File menu in the modeler and select Export Project Package...
_
_
- A dialog will appear that enables you to set the export location and, if required, select data to export.
The option 'Existing snapshot' will only be available when a data snapshot was created earlier using the menu option Add snapshot of data from the Team menu. It is also possible to include a new snapshot based on the current state of the local database. This option is only available after the project has been started at least once.
- Click Export to create the package.
-
Right click on a module in the Project Explorer, and select Export module package...
If your module refers to other modules in the project (i.e., it is not self-contained), you will receive a dialogue box warning you about this.
-
Right click on your module in the Project Explorer and select Find usages of other user modules to view the references.
-
Click Continue exporting and you will see another dialogue box:
Here you can select files you would like to include in your package. This list includes any files in your userlib or resources folders in your project directory. If you don't want to include these files, you can uncheck the boxes.
{{% alert type="info" %}}
To quickly uncheck all files, press CTRL+a to select all of the items, then press the Spacebar key to uncheck all objects.
{{% /alert %}}
Widgets are already available in the widgets folder in your project directory as .mpk files.
Mendix module object packages are stored as Mendix Package (.mpk) files. An object package can contain a page, microflow, image collection, event, document template, constant, web service, layout, menu, and more.