Skip to content

Commit d126a35

Browse files
Merge branch 'development' into Maria_Studio_RN
2 parents 77a7084 + fb3a7c8 commit d126a35

File tree

85 files changed

+495
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+495
-314
lines changed

content/en/docs/apidocs-mxsdk/apidocs/data-hub-apis.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ The API includes the following:
4444
## 4 Transform API {#transform}
4545

4646
Mendix users who deploy to *non-Mendix clouds* can make use of the [Transform API](https://datahub-spec.s3.eu-central-1.amazonaws.com/transform.html) to generate the request body for the Registration API. The Transform API reconfigures information from the *dependencies.json* file into the correct fields. For an example API, see the [Preparing Your Service Details Using the Transform API](/data-hub/data-hub-catalog/register-data/#transform-api) section of *How to Register OData Resources in the Data Hub Catalog*.
47+
48+
V4 compatibility for the **Transform API** is accessible via the [Data Hub Registration API](https://datahub-spec.s3.eu-central-1.amazonaws.com/registration_v4.html) under the **Endpoints** section.

content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-client-apis/_index.md

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ If a widget uses a TabIndex prop [system property](/apidocs-mxsdk/apidocs/plugga
4848

4949
### 4.1 ActionValue {#actionvalue}
5050

51-
ActionValue is used to represent actions, like the [On click](/refguide/on-click-event/#on-click) property of an action button. For any action except **Do nothing**, your component will receive a value adhering to the following interface. For **Do nothing** it will receive `undefined`. The `ActionValue` prop appears like this:
51+
`ActionValue` is used to represent actions, like the [On click](/refguide/on-click-event/#on-click) property of an action button. For any action except **Do nothing**, your component will receive a value adhering to the following interface. For **Do nothing** it will receive `undefined`. The `ActionValue` prop appears like this:
5252

5353
```ts
5454
export interface ActionValue {
@@ -68,7 +68,7 @@ The method `execute` triggers the action. It returns nothing and does not guaran
6868

6969
### 4.2 DynamicValue {#dynamic-value}
7070

71-
DynamicValue is used to represent values that can change over time and is used by many property types. It is defined as follows:
71+
`DynamicValue` is used to represent values that can change over time and is used by many property types. It is defined as follows:
7272

7373
```ts
7474
export type DynamicValue<X> =
@@ -97,7 +97,7 @@ Though the type definition above looks complex, it is fairly simply to use becau
9797

9898
### 4.3 EditableValue {#editable-value}
9999

100-
EditableValue is used to represent values that can be changed by a pluggable widget client component and is passed only to [attribute properties](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#attribute). It is defined as follows:
100+
`EditableValue` is used to represent values that can be changed by a pluggable widget client component and is passed only to [attribute properties](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#attribute). It is defined as follows:
101101

102102
```ts
103103
export interface EditableValue<T extends AttributeValue> {
@@ -137,7 +137,51 @@ There is a way to use more the convenient `displayValue` and `setTextValue` whi
137137

138138
The optional field `universe` is used to indicate the set of all possible values that can be passed to a `setValue` if a set is limited. Currently, `universe` is provided only when the edited attribute is of the Boolean or enumeration [types](/refguide/attributes/#type).
139139

140-
### 4.4 IconValue {#icon-value}
140+
### 4.4 ModifiableValue {#modifiable-value}
141+
142+
`ModifiableValue` is used to represent values that can be changed by a pluggable widget client component. It is passed only to [association properties](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#association), and is defined as follows:
143+
144+
```ts
145+
export interface ModifiableValue<T> {
146+
readonly status: ValueStatus;
147+
readonly readOnly: boolean;
148+
149+
readonly value: Option<T>;
150+
readonly setValue: (value: Option<T>) => void;
151+
readonly validation: Option<string>;
152+
readonly setValidator: (validator?: (value: Option<T>) => Option<string>) => void;
153+
}
154+
```
155+
156+
The type received by the component for the association property depends on the allowed association types:
157+
* If only references are allowed, the component receives a `ReferenceValue` defined as `ModifiableValue<ObjectItem> & { type: "Reference" };`
158+
* If only reference sets are allowed, the client gets a `ReferenceSetValue` defined as `ModifiableValue<ObjectItem[]> & { type: "ReferenceSet" };`
159+
160+
Finally, when both association types are allowed the type is a union of `ReferenceValue` and `ReferenceSetValue` and the widget should check the `type` to determine if a reference or reference set is configured and act accordingly in the code. Checking the type will also [narrow](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#handbook-content) to the correct type in TypeScript.
161+
162+
```ts
163+
if (association.value === undefined) {
164+
return "None";
165+
}
166+
167+
if (association.type === "Reference") {
168+
return textTemplate.get(association.value);
169+
} else {
170+
return association.value.map((objectItem) => textTemplate.get(objectItem)).join(",");
171+
}
172+
```
173+
174+
`status` is similar to the one exposed for `DynamicValue`. It indicates if the value's loading has finished and if loading was successful. Similarly to `DynamicValue`, `ModifiableValue` keeps returning the previous `value` when `status` changes from `Available` to `Loading` to help a widget avoid flickering.
175+
176+
The flag `readOnly` indicates whether a value can actually be edited. It will be true, for example, when a widget is placed inside a data view that is not [editable](/refguide/data-view/#editable), or when a selected attribute is not editable due to [access rules](/refguide/access-rules/). The `readOnly` flag is always true when a `status` is not `ValueStatus.Available`. Any attempt to edit a value set to read-only will have no affect and incur a debug-level warning message.
177+
178+
The value can be read from the `value` field and modified using the `setValue` function. The `value` contains an `ObjectItem` or an `ObjectItem[]` based on the configured association. The `ObjectItem` can be passed to the `get` function of any [linked property value](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#linked-values) which is linked to the selectable object's datasource.
179+
180+
When setting a value, the `ObjectItem`(s) must be items from the selectable object's data source. Note that `setValue` returns nothing and does not guarantee that the value is changed synchronously. But when a change is propagated, a component receives a new prop reflecting the change.
181+
182+
It is possible for a component to extend the defined set of validation rules. A new validator — a function that checks a passed value and returns a validation message string if any — can be provided through the `setValidator` function. A component can have only a single custom validator. The Mendix Platform ensures that custom validators are executed whenever necessary, for example when a page is being saved by an end-user. It is best practice to call `setValidator` early in a component's lifecycle — specifically in the [componentDidMount](https://en.reactjs.org/docs/react-component.html#componentdidmount) function.
183+
184+
### 4.5 IconValue {#icon-value}
141185

142186
`DynamicValue<IconValue>` is used to represent icons: small pictograms in the Mendix platform. Those can be static or dynamic file- or font-based images. An icon can only be configured through an [icon](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#attribute) property. `IconValue` is defined as follows:
143187

@@ -164,7 +208,7 @@ export type IconValue = WebIcon | NativeIcon;
164208

165209
In practice, `WebIcon` and `NativeIcon` are usually passed to a `Icon` component provided by Mendix, since this provides a convenient way of handling all types of icons at once. For more information on `Icon`, see the [Icon](#icon) section below.
166210

167-
### 4.5 ImageValue{#imagevalue}
211+
### 4.6 ImageValue{#imagevalue}
168212

169213
`DynamicValue<ImageValue>` is used to represent static or dynamic images. An image can be configured only through an [image](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#image) property. `ImageValue` is defined as follows:
170214

@@ -180,7 +224,7 @@ export type ImageValue = WebImage | NativeImage;
180224

181225
`NativeImage` can be passed to a `mendix/components/native/Image` component provided by Mendix for native widgets. `WebImage` can be passed to react-dom’s `img` component.
182226

183-
### 4.6 FileValue {#filevalue}
227+
### 4.7 FileValue {#filevalue}
184228

185229
`DynamicValue<FileValue>` is used to represent files. A file can be configured only through a [file](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#file) property. `FileValue` is defined as follows:
186230

@@ -191,7 +235,7 @@ export interface FileValue {
191235
}
192236
```
193237

194-
### 4.7 List values{#list-values}
238+
### 4.8 List values{#list-values}
195239

196240
`ListValue` is used to represent a list of objects for the [datasource](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#datasource) property. See [List Values](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/) for more information about usage of `ListValue` and associated property values.
197241

content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-client-apis/pluggable-widgets-client-apis-list-values.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ More specifically, the `status` property functions as follows:
334334
* In other cases, the `items` is `undefined`. This happens if a page is still being loaded or if the previous state was `ValueStatus.Unavailable`.
335335

336336

337-
## 3 Linked Property Values
337+
## 3 Linked Property Values {#linked-values}
338338

339339
### 3.1 ListActionValue {#listactionvalue}
340340

content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-property-types.md

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ This defines a property's type. A `type` must be one of the following:
4848
* [textTemplate](#texttemplate)
4949
* [action](#action)
5050
* [attribute](#attribute)
51+
* [association](#association)
5152
* [object](#object)
5253
* [file](#file)
5354
* [datasource](#datasource)
@@ -463,7 +464,7 @@ If a `dataSource` attribute is not specified, the client will receive an `Editab
463464

464465
When a `dataSource` attribute is specified and configured by the user, it is passed as a [`ListAttributeValue`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#listattributevalue). For more information, see the [Datasource](#datasource) section below.
465466

466-
#### 4.4.1 XML
467+
#### 4.4.1 XML Attributes
467468

468469
| Attribute | Required | Attribute Type | Description |
469470
| ------------ | -------- | -------------- | ------------------------------------------------------------ |
@@ -516,24 +517,74 @@ Then the Studio Pro UI for the property appears like this:
516517

517518
{{< figure src="/attachments/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-property-types/attribute.png" >}}
518519

519-
### 4.5 Object{#object}
520+
### 4.5 Association{#association}
520521

521-
The object property type allows to create an arbitrary list of properties.
522+
The association property type allows a widget to work directly with both reading and writing associations between entities. Depending on the widget's purposes, a widget should define association types it supports.
523+
524+
The client will receive an `ModifiableValue<T>` where `T` depends on the configured `<associationType>`. For more information, see the [ModifiableValue](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/#modifiable-value) section of *Client APIs Available to Pluggable Widgets*.
522525

523526
#### 4.5.1 XML Attributes
524527

528+
| Attribute | Required | Attribute Type | Description |
529+
|---------------------| -------- | -------------- |--------------------------------------------------------------------------------------------------------------------|
530+
| `type` | Yes | String | Must be `association` |
531+
| `key` | Yes | String | See [key](#key) |
532+
| `required` | No | Boolean | Decides if the property must be specified by the user, `true` by default |
533+
| `selectableObjects` | Yes | Property Path | The path to a Datasource property that will provide selectable objects for the association |
534+
535+
#### 4.5.2 XML Elements
536+
537+
`<associationTypes>` (required) — This element encapsulates `<associationType>` elements which declare supported association types available while configuring the association property in the Studios.
538+
539+
`<associationType>` (required one or more) — this element defines the allowed attribute type in the `name` attribute.
540+
541+
| Supported Attribute Types | Corresponding Types Client Components Receive |
542+
|---------------------------|-----------------------------------------------|
543+
| `Reference` | `ReferenceValue` |
544+
| `ReferenceSet` | `ReferenceSetValue` |
545+
546+
#### 4.5.3 Studio Pro UI
547+
548+
When the property is defined as follows:
549+
550+
```xml
551+
<property key="ref" type="association" selectableObjects="objectsDatasource">
552+
<caption>Reference</caption>
553+
<description>Reference</description>
554+
<associationTypes>
555+
<associationType name="Reference"/>
556+
<associationType name="ReferenceSet"/>
557+
</associationTypes>
558+
</property>
559+
560+
<property key="objectsDatasource" type="datasource" isList="true">
561+
<caption>Selectable objects</caption>
562+
<description/>
563+
</property>
564+
```
565+
566+
Then the Studio Pro UI for the property appears like this:
567+
568+
{{< figure src="/attachments/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-property-types/association.png" >}}
569+
570+
### 4.6 Object{#object}
571+
572+
The object property type allows to create an arbitrary list of properties.
573+
574+
#### 4.6.1 XML Attributes
575+
525576
| Attribute | Required | Attribute Type | Description |
526577
| ---------- | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
527578
| `type` | Yes | String | Must be `object` |
528579
| `key` | Yes | String | See [key](#key) |
529580
| `isList` | Yes | Boolean | Must be `true` |
530581
| `required` | No | Boolean | This decides if the user is required to specify items in the list, `true` by default |
531582

532-
#### 4.5.2 XML Elements
583+
#### 4.6.2 XML Elements
533584

534585
`<properties>` (required) — This encapsulates the list or properties to be configured. For more information on property groups, see the [Property Groups](/apidocs-mxsdk/apidocs/pluggable-widgets/#property-groups) section of *Pluggable Widgets API*. Properties must be grouped by `<propertyGroup>` elements. Nested object properties are not supported.
535586

536-
#### 4.5.3 Studio Pro UI
587+
#### 4.6.3 Studio Pro UI
537588

538589
When the property is defined as follows:
539590

@@ -560,18 +611,18 @@ Then the Studio Pro UI for the property appears like this:
560611

561612
{{< figure src="/attachments/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-property-types/object.png" >}}
562613

563-
### 4.6 File {#file}
614+
### 4.7 File {#file}
564615

565616
The file property type allows a user to configure a file from an object that is a specialization of **System.File**. It is passed as a [`DynamicValue<FileValue>`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/#filevalue) prop to a client component.
566617

567-
#### 4.6.1 XML Attributes
618+
#### 4.7.1 XML Attributes
568619

569620
| Attribute | Required | Attribute Type | Description |
570621
| ---------- | -------- | -------------- | ----------- |
571622
| `type` | Yes | String | Must be `file` |
572623
| `key` | Yes | String | See [key](#key) |
573624

574-
#### 4.6.2 Studio Pro UI
625+
#### 4.7.2 Studio Pro UI
575626

576627
When the property is defined as follows:
577628

@@ -587,7 +638,7 @@ Then the Studio Pro UI for the property appears like this:
587638

588639
{{< figure src="/attachments/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-property-types/file.png" >}}
589640

590-
### 4.7 Datasource {#datasource}
641+
### 4.8 Datasource {#datasource}
591642

592643
The datasource property allows widgets to work with object lists. The client component will receive value prop of type [`ListValue`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#listvalue) and may be used with [`action`](#action), [`attribute`](#attribute), [`expression`](#expression), [`text template`](#texttemplate) and [`widgets`](#widgets) properties. See [Data Sources](/refguide/data-sources/#list-widgets) for available data source types.
593644

@@ -597,7 +648,7 @@ If no data source has been configured by the user, any properties that are linke
597648
Only list datasources are supported, therefore specifying `isList="true"` is required.
598649
{{% /alert %}}
599650

600-
#### 4.7.1 XML Attributes
651+
#### 4.8.1 XML Attributes
601652

602653
| Attribute | Required | Attribute Type | Description |
603654
| ---------- | -------- | -------------- | ----------- |
@@ -606,7 +657,7 @@ Only list datasources are supported, therefore specifying `isList="true"` is req
606657
| `isList` | Yes | Boolean | Must be `true` |
607658
| `required` | No | Boolean | This decides if the user is required to specify a datasource, `true` by default |
608659

609-
#### 4.7.2 Studio Pro UI
660+
#### 4.8.2 Studio Pro UI
610661

611662
When the property is defined as follows:
612663

content/en/docs/appstore/app-services/text-analytics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ The **TokenEndpoint** constant provides a valid endpoint of security token servi
200200

201201
#### 3.3.1 CreateDominantLanguageDetector
202202

203-
The **CreateDominantLanguageDetector** microflow takes **text** (String) and **languageCode** (String) as input parameters to create DominantLanguageDetector as a return object from the back-end service.
203+
The **CreateDominantLanguageDetector** microflow takes **text** (String) as input parameters to create DominantLanguageDetector as a return object from the back-end service.
204204

205205
{{< figure src="/attachments/appstore/app-services/text-analytics/createdominantlanguagedetector.png" alt="createdominantlanguagedetector" >}}
206206

@@ -404,7 +404,7 @@ If you deploy your app in your own environment, you need to configure the licens
404404

405405
## 4 Usage
406406

407-
### 4.1 Performing Language Detection in Your Browser
407+
### 4.1 Performing Dominant Language Detection in Your Browser
408408

409409
Use the **CreateDominantLanguageDetector** microflow and the **DetectDominantLanguage** nanoflow to perform language detection. Follow these steps to configure the language detection:
410410

@@ -415,7 +415,7 @@ Use the **CreateDominantLanguageDetector** microflow and the **DetectDominantLan
415415

416416
{{< figure src="/attachments/appstore/app-services/text-analytics/call-createdominantlanguagedetector-microflow.png" alt="call-createdominantlanguagedetector-microflow" >}}
417417

418-
4. Right-click the create object activity and select **Set $detector as return value** in the pop-up menu.
418+
4. Right-click the microflow activity you just added and select **Set $detector as return value** in the pop-up menu.
419419

420420
{{< figure src="/attachments/appstore/app-services/text-analytics/createdominantlanguagedetector-nanoflow.png" alt="createdominantlanguagedetector-nanoflow" >}}
421421

0 commit comments

Comments
 (0)