Skip to content

Commit

Permalink
Merge branch 'development' into lz-api-restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
Luyao-Zhang-1 committed Sep 30, 2024
2 parents 97d5ba6 + ffc6acc commit a405006
Show file tree
Hide file tree
Showing 293 changed files with 1,660 additions and 626 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ data/history.yml
mx-1-get-hugo-and-node.ps1
mx-2-install-dependencies.bat
mx-3-run-server.bat

content/en/docs/howto7/mobile/push-notifications/setting-up-google-firebase-cloud-messaging-server.md
15 changes: 13 additions & 2 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ a:not(.btn):not(.td-sidebar-link):not(.card-text a):visited {
}

// Add icon after external links in main content (but exclude some content)
main a[href*="https://"]:not(.btn):not(.td-breadcrumbs a):not(.get-started):not(.lp a)::after {
main a[href*="https://"]:not(.btn):not(.td-breadcrumbs a):not(.get-started):not(.lp-panel-list a)::after {
display: inline-block;
width: 1rem;
height: 1rem;
Expand All @@ -155,9 +155,20 @@ main a[href*="https://"]:not(.btn):not(.td-breadcrumbs a):not(.get-started):not(
filter: invert(14%) sepia(99%) saturate(4690%) hue-rotate(225deg) brightness(93%) contrast(95%); // Matches to $link-color (blue-8 from PDS). Keep updated with _variables_project.scss.
}

// Add icon after external links in lp-panel-list - need to be a different colour
.lp-panel-list a[href*="https://"]:not(.btn):not(.td-breadcrumbs a):not(.get-started)::after {
display: inline-block;
width: 1rem;
height: 1rem;
margin-left: .2rem;
vertical-align: sub;
content: url("/mx-icons/external.svg");
filter: invert(81%) sepia(55%) saturate(2783%) hue-rotate(181deg) brightness(103%) contrast(101%); // Matches to #8AC4FF specified in lp-panel-list in _front-page.scss. Keep updated with _variables_project.scss. Calculated using https://isotropic.co/tool/hex-color-to-css-filter/
}

// Change external link icon color upon hover
main a[href*="https://"]:hover::after {
filter: invert(15%) sepia(65%) saturate(5388%) hue-rotate(231deg) brightness(79%) contrast(121%); // Matches to $link-hover-color (blue-9 from PDS). Keep updated with _variables_project.scss.
filter: invert(15%) sepia(65%) saturate(5388%) hue-rotate(231deg) brightness(79%) contrast(121%); // Matches to $link-hover-color (blue-9 from PDS). Keep updated with _variables_project.scss.
}

.btn {
Expand Down
1 change: 1 addition & 0 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $enable-shadows: true; //TODO: consider removing this duplicate variable from th

// Changed almost all colors to better match Mendix palette
// Codes taken mostly from PDS (https://designsystem.mendix.com)
// See also filters in _styles_project.scss if any of these colours is changed

$primary: #146FF4; // MX Blue (Blue-7 from PDS) YL - updated the Mendix Blue color to its latest version in MX 10
$primary-light: #47A9FF; // DB - Blue-5 from PDS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ An object with the following key-value pairs:

#### Description

Requests the creation of an archive of a backup snapshot. The response is a JSON object containing the `archive_id` attribute which identifies an archive. use this `archive_id` in an API request to check the progress of the creation of this archive, and obtain a URL to allow you to download it.
Requests the creation of an archive of a backup snapshot. The response is a JSON object containing the `archive_id` attribute which identifies an archive. Use this `archive_id` in an API request to check the progress of the creation of this archive, and obtain a URL to allow you to download it.

```bash
HTTP Method: POST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ weight: 20
---

{{% alert color="warning" %}}
The Build API only works for apps which are deployed to the Mendix Cloud.
The Build API only works for apps which are deployed to Mendix Cloud.
{{% /alert %}}

## Introduction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ Then the Studio Pro UI for the property appears like this:

### Action {#action}

{{% alert color="info" %}}
The `defaultType` and `defaultValue` attributes for Action were introduced in Mendix [10.15](/releasenotes/studio-pro/10.15/).
{{% /alert %}}

The action property type allows a user to configure an action which can do things like call nanoflows, save changes, and open pages.

If a `dataSource` attribute is not specified, the client will receive an `ActionValue` representing the action or `undefined` if the **Do nothing** action was selected.
Expand All @@ -483,11 +487,13 @@ When a `dataSource` attribute is specified and configured by the user, it is pas

#### XML Attributes

| Attribute | Required | Attribute Type | Description |
|--------------|----------|----------------|-----------------------------------------------------------------------------------------|
| `type` | Yes | String | Must be `action` |
| `key` | Yes | String | See [key](#key) |
| `dataSource` | No | Property Path | Specifies path to a [`datasource`](#datasource) property linked to this action property |
| Attribute | Required | Attribute Type | Description |
|----------------|----------|----------------|---------------------------------------------------------------------------------------------------------|
| `type` | Yes | String | Must be `action` |
| `key` | Yes | String | See [key](#key) |
| `dataSource` | No | Property Path | Specifies path to a [`datasource`](#datasource) property linked to this action property |
| `defaultValue` | No | String | Default value for the property, the format should be `<ModuleId>.<DocumentId>` |
| `defaultType` | No | String | Default type for the property, supported values are `None`, `OpenPage`, `CallNanoflow`, `CallMicroflow` |

#### Studio Pro UI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ deprecated: true
## Introduction

{{% alert color="warning" %}}
This API is deprecated. If you are currently using this API or intend to start using it, please look at, and contribute to, [this idea in the Mendix Community](https://community.mendix.com/link/space/user-experience/ideas/3962). This will allow us to understand your use case and will help us to prioritize a new API that is fit for purpose.
This API is deprecated. If you are currently using this API or intend to start using it, please look at, and contribute to [this idea in the Mendix Community](https://community.mendix.com/link/space/user-experience/ideas/3962). This will allow us to understand your use case and will help us to prioritize a new API that is fit for purpose.

Alternatively, you can consider using the [Projects API](/apidocs-mxsdk/apidocs/projects-api/), which provides functionality to manage project memberships for platform users. Although it does not fully cover all kinds of platform users, it can still serve as a viable option for many use cases. Additionally, if you are using BYOIDP, you can restrict platform access to a designated group of users by creating a Mendix platform users group in your IdP. For more information, see [Set Up an SSO (BYOIDP)](/control-center/security/set-up-sso-byoidp/).
{{% /alert %}}

The User Management API allows your company's user management systems to integrate with the Mendix Platform. Through this API, you can create and manage user accounts in your company. Additionally you can create and manage groups. In the Mendix Platform, you can define group policies for groups which grant access to your company's applications to their members.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Here is a list of how-tos for you to begin with:
* [How to host some web content inside a modal dialog using a modal web view](/apidocs-mxsdk/apidocs/extensibility-api/create-modal-web-view/)
* [How to create microflows for calculations](/apidocs-mxsdk/apidocs/extensibility-api/create-microflows-for-calculations/)

## Advanced APIs

APIs for the Mendix platform's advanced users:

* [Untyped Model Access API](/apidocs-mxsdk/apidocs/extensibility-api/extensibility-api-howtos/untyped-model-access-api/)

## Learn More

You can dive into the following topics in depth:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ After you create some basic extensions, you want to interact with the Studio Pro

The easiest way to gain access to the model is by using the `CurrentApp` property of Extension class. All extension classes implement the [`Mendix.StudioPro.ExtensionsAPI.UI.UIExtensionBase`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.UI/UIExtensionBase.md) base class which provides this access.

The `CurrentApp` property exposes an implementation of [`IModel`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.Model/IModel.md). with a `IModel` reference you can gain access to any other model elements. However, any changes that you introduce must be contained within a model transaction.
The `CurrentApp` property exposes an implementation of [`IModel`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.Model/IModel.md). With a `IModel` reference you can gain access to any other model elements. However, any changes that you introduce must be contained within a model transaction.

## Interacting with Model Elements

Expand All @@ -22,9 +22,9 @@ Transactions do not provide a way to isolate changes, but to group them. That is

To create transaction you can call [`IModel.StartTransaction`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.Model/IModel/StartTransaction.md). This method will return a transaction object which implements [`ITransaction`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.Model/ITransaction.md).

For your changes to reflect within the model. you must first commit the transaction by calling [`ITransaction.Commit`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.Model/ITransaction/Commit.md).
For your changes to reflect within the model, you must first commit the transaction by calling [`ITransaction.Commit`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.Model/ITransaction/Commit.md).

Alternatively. if you wish to abort or revert your changes, you can call [`ITransaction.Rollback`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.Model/ITransaction/Rollback.md).
Alternatively, if you wish to abort or revert your changes, you can call [`ITransaction.Rollback`](https://github.com/mendix/ExtensionAPI-Samples/blob/main/API%20Reference/Mendix.StudioPro.ExtensionsAPI.Model/ITransaction/Rollback.md).

## Examples

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
title: "Use the Untyped Model Access API"
url: /apidocs-mxsdk/apidocs/extensibility-api/extensibility-api-howtos/untyped-model-access-api/
weight: 24
---

## Introduction

The Untyped Model Access API caters to the advanced users who are familiar with the internals of the Mendix platform. With the Untyped Model API, you can access the rich data of model elements.

When you need to use model elements, units, and property names in the Untyped Model API, you can reference the [Mendix Model SDK](https://apidocs.rnd.mendix.com/modelsdk/latest/index.html). Moreover, you can find the type names used by the Untyped Model Access API under the [structureTypeName](https://apidocs.rnd.mendix.com/modelsdk/latest/classes/Structure.html#structureTypeName) property of any model element.

{{% alert color="info" %}}
All methods provided by the Untyped Model API are recursive to reduce the amount of API calls necessary to get to the content you are looking for.
{{% /alert %}}

## Prerequisites

To see the Untyped Model API in action, as described in the examples in this document, you must create a microflow having the default name `MyFirstLogic` with an action, and add an entity to the domain model.

## Getting Started

To start using the Untyped Model API, import it:

```csharp
class Sample(IUntypedModelAccessService untypedModelAccessService)
{
}
```

## Gaining Access to the Model Root

To gain access to the model `Root`, request it from the newly added API service:

```csharp
class Sample2(IUntypedModelAccessService untypedModelAccessService, IModel currentApp)
{
public IModelRoot GetUntypedModelRoot() => untypedModelAccessService.GetUntypedModel(currentApp);
}

```

## Requesting Top-level Model Elements

To start going through the model elements, such as `Apps` and `Modules`, choose a starting point first:

```csharp
class Sample3(IUntypedModelAccessService untypedModelAccessService, IModel currentApp)
{
public IModelUnit GetProjectData() =>
untypedModelAccessService.GetUntypedModel(currentApp)
.GetUnitsOfType("Projects$Project")
.Single();

public IModelUnit GetMyModuleData() =>
untypedModelAccessService.GetUntypedModel(currentApp)
.GetUnitsOfType("Projects$Module")
.Single(unit => unit.Name == "MyFirstModule");
}
```

## Accessing Child Elements

It is possible to access the child elements of a model element, such as the actions of a microflow or entities of a domain model.

Using either `GetElements` or `GetElementsOfType`, can help you, for example, analyze these elements' properties to implement custom validation rules. See an example below:

```csharp
class Sample4(IUntypedModelAccessService untypedModelAccessService, IModel currentApp)
{
public IReadOnlyList<IModelElement> GetMicroflowActionActivities() =>
untypedModelAccessService.GetUntypedModel(currentApp)
.GetUnitsOfType("Projects$Module")
.Single(unit => unit.Name == "MyFirstModule")
.GetUnitsOfType("Microflows$Microflow")
.Single(unit => unit.Name == "MyFirstLogic")
.GetElementsOfType("Microflows$ActionActivity");

public IReadOnlyList<IModelElement> GetDomainModelEntities() =>
untypedModelAccessService.GetUntypedModel(currentApp)
.GetUnitsOfType("Projects$Module")
.Single(unit => unit.Name == "MyFirstModule")
.GetUnitsOfType("DomainModels$DomainModel").Single()
.GetElementsOfType("DomainModels$Entity");
}
```

## Getting Model Unit's Properties

In case you would like to extract data out of a model element or unit, you need to access its properties. See an example below:

```csharp
class Sample5(IUntypedModelAccessService untypedModelAccessService, IModel currentApp)
{
private IReadOnlyList<IModelProperty> GetProjectRuntimeSettingsProperties() =>
untypedModelAccessService.GetUntypedModel(currentApp)
.GetUnitsOfType("Settings$ProjectSettings")
.Single()
.GetElements()
.Single(element => element.Type == "Settings$RuntimeSettings")
.GetProperties();


public string? GetAfterStartupMicroflowId() =>
GetProjectRuntimeSettingsProperties()
.Single(property => property.Name == "AfterStartupMicroflowId")
.Value?
.ToString();
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Make sure to keep this Studio Pro installation up-to-date to benefit from new fe
Extensions can be built on any operating system as the underlying framework is cross-platform.
{{% /alert %}}

## Using Extensions API via a Hosted NuGet Package
## Using Extensibility API via a Hosted NuGet Package

You can start extension development by simply including the `Mendix.StudioPro.ExtensionsAPI` NuGet package to your project by searching for *Mendix.Studio.ExtensionsAPI* in NuGet.

Expand All @@ -32,7 +32,7 @@ You can start extension development by simply including the `Mendix.StudioPro.Ex

Depending on your local environment setup, you possibly need to manually add a NuGet package to your solution. You can add a package source to Visual Studio via the menu: **Tools** > **Options** > **NuGet Package Manager** > **Package Sources**

## Importing Extensions API via a NuGet Package Hosted on a Local Repository
## Importing Extensibility API via a NuGet Package Hosted on a Local Repository

Another option to start extension development is to import a locally hosted `Mendix.StudioPro.ExtensionsAPI` NuGet package into your project.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,46 @@ numberless_headings: true

These release notes cover changes to the Extensibility API.

## Version 10.15.0

* We introduced the Untyped Model Access API. For more details and practical examples, see [How to Use the Untyped Model Access API](/apidocs-mxsdk/apidocs/extensibility-api/extensibility-api-howtos/untyped-model-access-api/).
* We added `CurrentLanguage` to `IConfiguration` to provide which language is currently set for the UI of Studio Pro.

## Version 10.14.0

* We added the event `ActiveDocumentChanged`, which allows an extension to be notified when the active document changes in Studio Pro. If the document is not yet supported by the Extensibility API, only its name and type will be returned.
* We added support for several microflow activities for lists and objects.
* We introduced `IMicroflowActivitiesService`, which includes several functions to facilitate the creation of these new activities.

## Version 10.13.1

* No user facing changes. However, the extension package version must be the same as your Studio Pro version.

## Version 10.13.0

* We fixed a bug where error handling for an activity was lost after you deployed an app.
* We fixed a bug where extensions got reloaded during the creation of a deployment package.

## Version 10.12.0
## Version 10.12.5

* No user facing changes. However, the extension package version must be the same as your Studio Pro version.

* We added a new menu public API that is simpler to use than the previous API. The previous API has now been moved to the internal API to only be used by internal Mendix employees.
* We added a new method in the project to allow retrieval of all the documents in it by type and/or module.
* We added `StudioProImage` that has now removed the need to use `Eto` images from the Extensibility API.
* We added the capability to add modules to a project through the Extensibility API.
* We added the `IStudioProNotificationService` that enables showing the balloon notifications in Studio Pro from the Extensibility API.
## Version 10.12.4

## Version 10.10.0
* No user facing changes. However, the extension package version must be the same as your Studio Pro version.

* It is now possible to export an add-on module with an extension inside it, only with the `--enable-extension-development` feature flag enabled.
## Version 10.12.3

## Version 10.8.0
* No user facing changes. However, the extension package version must be the same as your Studio Pro version.

* We added the new Extensions Overview page where users can view the current app-level extensions loaded by Studio Pro. The new page can be accessed via the following menu: **View** > **Extensions**.
## Version 10.12.2

## Version 10.7.0
* No user facing changes. However, the extension package version must be the same as your Studio Pro version.

* We renamed the `MicroflowService UpdateActionAfterRename` method to `RenameVariable`.
* We enable error dialogs for extensions when using the `--enable-extension-development` feature flag.
## Version 10.12.1

## Version 10.6.0
* No user facing changes. However, the extension package version must be the same as your Studio Pro version.

## Version 10.12.0

* The Extensibility API is released for beta usage.
* We fixed a bug when dealing with model elements detached from a container.
* The first [beta](/releasenotes/beta-features/) release of the Extensibility API.
Loading

0 comments on commit a405006

Please sign in to comment.