Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/en/docs/refguide/modeling/app-explorer/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ In the **App Explorer**, you can do the following:
* **Collapse all documents** – click the right arrow in the upper-left corner of the **App Explorer** to collapse all documents
* **Expand or collapse an individual folder** – click the plus/minus icon or double-click the folder you want to expand or collapse
* **Perform actions specific to the selected folder** – right-click the selected folder to see what functions you can perform. The list of functions depends on the folder. For example, when right-clicking the **System** module, you can only find usages of this module, while when right-clicking **MyFirstModule** you can add a page, add a microflow, rename the module, export the module package, copy/paste documents, and much more.
* **Show or hide private documents** – right-click a module and select **Show private documents** or **Hide private documents**. For more information, see the [Showing and Hiding Private Documents](/refguide/import-visibility/#show-private-documents) section in *Import Visibility*.

## Read More

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,42 @@ Solution modules are always part of a solution, which is any Mendix app that is

You can mark a standard module (app module) as an add-on or solution module at any time, but it is recommended to do so right as you start developing. Mendix also recommends changing the module version for add-on and solution modules every time you make changes to them.

All the content in add-on and solution modules is set to be hidden from consumers by default (as modules have IP protection enabled). You can then decide what parts of the module you would like to make as usable, if any. For example, you can allow consumers to use certain entities and attributes.
Documents and elements in add-on and solution modules have an [import visibility](/refguide/import-visibility/). Only **Public** documents and elements are available to consumers. For example, you can allow consumers to use certain entities and attributes.

### Changing the Export Level of a Document/Element {#export-level}
{{% alert color="warning" %}}
In Studio Pro 11.18 and above, new documents and elements are **Public** by default. In Studio Pro 11.17 and below, all content of add-on and solution modules was hidden from consumers by default. Set everything that consumers should not use to **Private** before you export the module.
{{% /alert %}}

### Changing the Import Visibility of a Document/Element {#export-level}

Documents and some elements in the add-on and solution modules have the **Export level** property. This property defines whether the consumers are able to use a certain document/element in their app. For details on what documents and elements are supported for add-on and solution modules, see the [Supported Documents](#supported-documents) section below.
The **Import visibility** defines whether consumers are able to use a certain document or element in their app. For details on which documents and elements can be made available to consumers, see the [Supported Documents](#supported-documents) section below.

The **Export level** has two values:
The **Import visibility** has two values:

* **Hidden** – the document/element content is hidden from a consumer
* **Usable** – consumers are able to use the document/element in their apps (for example, you can mark some entities and their attributes as usable)
* **Public** – consumers are able to use the document or element in their apps (for example, you can mark some entities and their attributes as public)
* **Private** – the document or element is hidden from consumers

To change the **Export level** and mark documents/elements as **Usable**, do the following:
To change the import visibility of a document or element, do the following:

1. In the **App Explorer**, double-click **Settings** for the module you would like to set as an add-on or solution module.
1. In the **App Explorer**, double-click **Settings** for the module you would like to set as an add-on or solution module.
2. In the **Module settings** dialog box, select the type of the module and click **OK**.
3. Open the document/element that you would like to mark as **Usable**.
4. Navigate to its properties.
5. Set the **Export level** property to **Usable**:
3. Do one of the following:
* Right-click the document in the **App Explorer**, or the element in the domain model, and select **Set to private** or **Set to public**.
* Open the document or element, and set its **Import visibility** property.

{{< figure src="/attachments/refguide/modeling/app-explorer/modules/configure-add-on-and-solution-modules/export-level-property.png" class="no-border" >}}
{{< figure src="/attachments/refguide/modeling/app-explorer/modules/configure-add-on-and-solution-modules/export-level-property.png" alt="Import visibility of an entity and its attributes in the entity properties" width="795px" class="no-border" >}}

You can see that documents/elements that are marked as usable have an eye icon ({{% icon name="view" %}}). This means the document is a part of the API. The domain model gets an eye icon if any entity is usable.
Public documents and elements have an eye icon ({{% icon name="view" %}}), which means they are part of the API. Private documents and elements have the {{% icon name="view-off" %}} icon. The domain model gets an eye icon if any entity is public.

{{% alert color="info" %}}
In Studio Pro 11.17 and below, the property is called **Export level**, and its values are **Usable** and **Hidden**. When you open the module in Studio Pro 11.18, usable documents and elements become public, and hidden ones become private.
{{% /alert %}}

### Supported Documents {#supported-documents}

Not all documents/elements can be marked as **Usable** in add-on and solution modules. Some can only be **Hidden**.
Not all documents and elements can be made available to consumers of add-on and solution modules.

Below is the list of documents and elements that can be marked as **Usable**:
Below is the list of documents and elements that consumers can use when they are **Public**:

* Domain model:
* Entity and attributes (including external entities)
Expand All @@ -59,7 +67,7 @@ Below is the list of documents and elements that can be marked as **Usable**:
* Custom widgets

{{% alert color="info" %}}
Pages cannot be made **Usable**. Instead, a navigation microflow that opens the page can be made **Usable**.
Pages cannot be made available to consumers. Instead, make a navigation microflow that opens the page **Public**.
{{% /alert %}}

## Exporting Add-on Modules and Solutions {#export}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: "Import Visibility"
url: /refguide/import-visibility/
weight: 15
description: "Describes how to mark documents and domain model elements as private or public, and how private items are shown."
---

## Introduction

{{% alert color="info" %}}
Import visibility is available in Studio Pro 11.18 and above.
{{% /alert %}}

**Import visibility** defines whether a document or domain model element is meant to be used outside its own module. It has two values:

* **Public** *(default)* – the document or element is part of the module's interface, and other modules can use it.
* **Private** – the document or element is an internal part of the module.

You can set the import visibility for all documents, and for these domain model elements:

* [Entities](/refguide/entities/#export-level)
* [Attributes](/refguide/attributes/#export-level)
* [Associations](/refguide/association-properties/#export-level)
* [Annotations](/refguide/annotations/#import-visibility)

When you develop an [add-on or solution module](/refguide/configure-add-on-and-solution-modules/), the import visibility also decides what consumers of the module can use: only **Public** documents and elements are exposed.

## Marking Documents and Elements as Private or Public {#set-import-visibility}

To change the import visibility of a document, right-click it in the App Explorer and select **Set to private** or **Set to public**. You can select several documents at once.

{{< figure src="/attachments/refguide/modeling/app-explorer/modules/import-visibility/set-document-private.png" alt="Set to private in the context menu of a microflow in the App Explorer" width="450px" class="no-border" >}}

To change the import visibility of a domain model element, do one of the following:

* Right-click the entity, attribute, or association in the domain model and select **Set to private** or **Set to public**.
* Set the **Import visibility** property in the element's properties.

{{< figure src="/attachments/refguide/modeling/app-explorer/modules/import-visibility/set-element-private.png" alt="Set to private in the context menu of an association in the domain model" width="600px" class="no-border" >}}

{{% alert color="info" %}}
The import visibility cannot be changed for documents and elements of imported modules. The attributes of a private entity are always private, so their import visibility cannot be set separately.
{{% /alert %}}

## Showing and Hiding Private Documents {#show-private-documents}

Private documents are marked with the {{% icon name="view-off" %}} icon in the App Explorer.

You can choose per module whether private documents are shown. Right-click the module in the App Explorer and select **Show private documents** or **Hide private documents**. This option is available when the module contains private documents.

{{< figure src="/attachments/refguide/modeling/app-explorer/modules/import-visibility/hide-private-documents.png" alt="Hide private documents in the context menu of a module that contains a private microflow" width="600px" class="no-border" >}}

By default, private documents are shown for the modules of your app and hidden for imported modules and add-on modules. Your choice is stored per module in your local settings for the app, so it does not change the app for other team members.

The same choice also applies when you select a document, for example in a document selector or in the **Go To** dialog: hidden private documents are not offered.

## Showing and Hiding Private Elements in the Domain Model {#show-private-elements}

In the domain model editor, you can show or hide private elements with the **Private elements** option in the **View** menu of the toolbar. Private elements are marked with the {{% icon name="view-off" %}} icon.

{{< figure src="/attachments/refguide/modeling/app-explorer/modules/import-visibility/private-elements-view-option.png" alt="Private elements option in the View menu of the domain model editor" width="390px" class="no-border" >}}

When you open the domain model, this option follows the choice for private documents of the module. When you hide a private entity, its associations are hidden too. When you go to a private element, for example from **Find** results, private elements are shown automatically.

## Using Private Elements in Other Modules {#use-private-elements}

Private entities, attributes, and associations of a module are not suggested when you work in another module. This applies to entity and attribute selectors, and to auto-complete in expressions, XPath constraints, and OQL queries.

Private elements are still suggested in these cases:

* In their own module
* When they belong to the System module
* In other solution modules of the same solution

## Upgrading Apps to Studio Pro 11.18 {#upgrading}

Before Studio Pro 11.18, the export level of documents and elements was only used in add-on and solution modules, and its default was **Hidden**. The values have been renamed: **Hidden** is now **Private**, and **Usable** is now **Public**. The default is now **Public**.

When you open an app in Studio Pro 11.18, all documents and elements in the modules of your app are set to **Public**. In add-on and solution modules that you develop, the existing values are kept. Because the stored value changes, you will see the affected documents in the **Changes** pane.

{{% alert color="warning" %}}
New documents and elements in an add-on or solution module are now **Public** by default, so consumers can use them. Set the documents and elements that consumers should not use to **Private** before you publish the module.
{{% /alert %}}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ An app module is exported as a package file (*.mpk* ) that includes the full sou

An add-on module is a standalone module that is not dependent on other modules. It is used as a separate element (for example, as a connector).

An add-on module is exported as a module file (*.mxmodule*) that only exposes the elements with the **Usable** export level. For more information on export levels, see [Configuring Add-on and Solution Modules for Publishing](/refguide/configure-add-on-and-solution-modules/). Its source cannot be inspected by the consumer of the module.
An add-on module is exported as a module file (*.mxmodule*) that only exposes the elements whose [import visibility](/refguide/import-visibility/) is **Public**. For more information, see [Configuring Add-on and Solution Modules for Publishing](/refguide/configure-add-on-and-solution-modules/). Its source cannot be inspected by the consumer of the module.

If you are creating functionality that can be exported and used by other users separately and independently of the rest of the app, you can set your module to an add-on type.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ Page and microflow URL patterns must be unambiguous. If two patterns match the s

**Name** is the internal name of the microflow. You use this name to refer to the microflow in the app. It must be unique within the module, but you can have two microflows with the same name in different modules. When referring to the microflow, you normally prepend the name of the module to ensure uniqueness and allow you to use microflows in other modules.

#### Export Level
#### Import Visibility {#export-level}

{{% alert color="info" %}}
This property is only available for add-on and solution modules. For more information on types of modules, see the [Module Types](/refguide/modules/#module-types) section in *Modules*.
{{% /alert %}}

**Export level** allows you to define access level to this document on the consumer (customer) side when developing an add-on module or a solution.
**Import visibility** defines whether the microflow is meant to be used outside its module. For more information, see [Import Visibility](/refguide/import-visibility/).

| Value | Description |
| ------------------ | ------------------------------------------------------------ |
| Hidden *(default)* | The document/element content is hidden from a consumer. |
| Usable | Consumers can see the API and use the microflow in their app. They will not be able to see the contents of the microflow and how it is built. |
| Public *(default)* | Other modules can use the microflow. In an add-on or solution module, consumers can see the API and use the microflow in their app. They cannot see the contents of the microflow and how it is built. |
| Private | The microflow is internal to its module. It is hidden from consumers of an add-on or solution module. |

{{% alert color="info" %}}
In add-on and solution modules, this property is shown in the properties. In other modules, right-click the microflow in the App Explorer and select **Set to private** or **Set to public**. In Studio Pro 11.17 and below, this property is called **Export level**, and its values are **Hidden** (the default) and **Usable**.
{{% /alert %}}

#### Documentation

Expand Down
8 changes: 8 additions & 0 deletions content/en/docs/refguide/modeling/domain-model/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ For example, an order entity contains two decimal attributes, **TotalPrice** and
### Caption

The caption property contains the text of the annotation.

### Import Visibility {#import-visibility}

**Import visibility** defines whether the annotation is meant for use outside its module. The values are **Public** (the default) and **Private**. For more information, see [Import Visibility](/refguide/import-visibility/).

{{% alert color="info" %}}
This property is available in Studio Pro 11.18 and above.
{{% /alert %}}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ An example of the association properties is represented in the image below:
Associations have the following properties:

* [Name](#name)
* [Import visibility](#export-level)
* [Documentation](#documentation)
* [Multiplicity](#multiplicity)
* [Navigability](#navigability)
Expand All @@ -34,20 +35,20 @@ Associations have the following properties:

The name used to refer to the association. For example, in forms or microflows.

### Export Level
### Import Visibility {#export-level}

{{% alert color="info" %}}

This property is only available for add-on and solution modules. For more information on types of modules, see the [Module Types](/refguide/modules/#module-types) section in *Modules*.

{{% /alert %}}

**Export level** allows you to define access level to this document on the consumer (customer) side when developing an add-on module or a solution.
**Import visibility** defines whether the association is meant to be used outside its module. For more information, see [Import Visibility](/refguide/import-visibility/).

| Value | Description |
| ------------------ | ------------------------------------------------------------ |
| Hidden *(default)* | The document/element content is hidden from a consumer. |
| Usable | Consumers can see the association in the domain model and use it in their app. |
| Public *(default)* | Other modules can use the association. In an add-on or solution module, consumers can see the association in the domain model and use it in their app. |
| Private | The association is internal to its module. It is not suggested in other modules, and it is hidden from consumers of an add-on or solution module. |

A new association is private by default when one of the entities it connects is private.

{{% alert color="info" %}}
In Studio Pro 11.17 and below, this property is called **Export level** and is only available for add-on and solution modules. Its values are **Hidden** (the default) and **Usable**.
{{% /alert %}}

### Documentation {#documentation}

Expand Down
Loading