• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Switching of module
2
3
4When switching an application from the FA model to the stage model, you must migrate the configurations under the **module** tag in the **config.json** file to the **module** tag in the **module.json5** file.
5
6###   Table 1 module Comparison
7
8| Field Name in the FA Model| Field Description| Field Name in the Stage Model| Difference|
9| -------- | -------- | -------- | -------- |
10| mainAbility | Ability displayed on the Service Center icon. When the resident process is started, the **mainAbility** is started.| mainElement | The field name is changed, and the stage mode does not use the period (.) in ability names.|
11| package | Package name of the HAP file, which must be unique in the application.| / | The stage model uses **name** to ensure application uniqueness. |
12| name | Class name of the HAP file.| / | This configuration is not enabled in the FA model, and the stage model does not have such a field.|
13| supportedModes | Modes supported by the application. Currently, only the **drive** mode is defined.| / | This configuration is deprecated in the stage model.|
14| moduleName in the distro object| Name of the current HAP file.<br>moduleName in the distro object.| name | The field name is changed.|
15| moduleType in the distro object| Type of the HAP file. The value can be **entry** or **feature**. For the HAR type, set this field to **har**.| type | The field name is changed.|
16| installationFree in the distro object| Whether the HAP file supports the installation-free feature.| installationFree | The field name is changed.|
17| deliveryWithInstall in the distro object| Whether the HAP file is installed with the application.| deliveryWithInstall | The field name is changed.|
18| metaData | Metadata of the HAP file.| metadata | See [Table 2](#table-2-metadata-comparison).|
19| abilities | All abilities in the current module.| abilities | See [Table 5](#table-5-abilities-comparison).|
20| js | A set of JS modules developed using ArkUI. Each element in the set represents the information about a JS module.| pages | The stage model retains **pages** under the **module** tag. The window configuration is the lower level of **pages**.|
21| shortcuts | Shortcuts of the application.| shortcut_config.json| In the stage model, the **shortcut_config.json** file is defined in **resources/base/profile** in the development view.|
22| reqPermissions | Permissions that the application requests from the system when it is running.| requestPermissions | The field name is changed.|
23| colorMode | Color mode of the application.| / | This configuration is not supported in the stage model.|
24| distributionFilter | Distribution rules of the application.| distroFilter_config.json| In the stage model, the **distroFilter_config.json** file is defined in **resources/base/profile** in the development view.|
25| reqCapabilities | Device capabilities required for running the application.| / | This configuration is not supported in the stage model.|
26| commonEvents | Common events.| common_event_config.json| In the stage model, the **common_event_config.json** file is defined in **resources/base/profile** in the development view.|
27| entryTheme | Keyword of an OpenHarmony internal theme.| / | This configuration is not supported in the stage model.|
28
29
30### Table 2 metaData Comparison
31
32| Field Name Under metaData in the FA Model| Field Description| Field Name Under metaData in the Stage Model| Difference|
33| -------- | -------- | -------- | -------- |
34| parameters | Metadata of the parameters to be passed for calling the ability.| / | This configuration is not supported in the stage model.|
35| results | Metadata of the ability return value.| / | This configuration is not supported in the stage model.|
36| customizeData | Custom metadata of the parent component. **parameters** and **results** cannot be configured in **application**.| metadata | See [Table 3](#table-3-comparison-between-customizedata-under-metadata-in-the-fa-model-and-metadata-in-the-stage-model).|
37
38### Table 3 Comparison Between customizeData Under metaData in the FA Model and metadata in the Stage Model
39
40| Field Name Under customizeData in metaData in the FA Model| Field Description| Field Name Under metaData in the Stage Model| Difference|
41| -------- | -------- | -------- | -------- |
42| name | Key name that identifies a data item. The value is a string with a maximum of 255 bytes.| name | None.|
43| value | Value of the data item. The value is a string with a maximum of 255 bytes.| value | None.|
44| extra | Format of the current custom data. The value is the resource value of **extra**.| resource | The field name is changed. For details, see [Table 4](#table 4-metadata-examples).|
45
46
47### Table 4 metaData Examples
48
49| Example in the FA Model| Example in the Stage Model|
50| -------- | -------- |
51| "meteData": {<br>    "customizeDate": [{<br>        "name": "label",<br>        "value": "string",<br>        "extra": "$string:label",<br>    }]<br>} | "meteData": [{<br>    "name": "label",<br>    "value": "string",<br>    "resource": "$string:label",<br>}] |
52
53
54### Table 5 abilities Comparison
55
56| Field Name Under abilities in the FA Model| Field Description| Field Name Under abilities in the Stage Model| Difference|
57| -------- | -------- | -------- | -------- |
58| process | Name of the process running the application or ability.| / | The stage model does not support configuration of **process** under **abilities**. The configuration of **process** is available under the **module** tag.|
59| uri | URI of the ability.| / | This configuration is not supported in the stage model.|
60| deviceCapability | Device capabilities required to run the ability.| / | This configuration is not supported in the stage model.|
61| metaData | Metadata of the ability.| metadata | See [Table 2](#table-2-metadata-comparison).|
62| type | Ability type.| / | This configuration is not supported in the stage model.|
63| grantPermission | Whether permissions can be granted for any data in the ability.| / | The stage model does not support such a configuration under **abilities**.|
64| readPermission | Permission required for reading data in the ability. This field applies only to the ability using the Data template.| / | In the stage model, this configuration is available under **extensionAbilities**, but not **abilities**.|
65| writePermission | Permission required for writing data to the ability.| / | In the stage model, this configuration is available under **extensionAbilities**, but not **abilities**.|
66| configChanges | System configurations that the ability concerns.| / | This configuration is not supported in the stage model.|
67| mission | Mission stack of the ability.| / | This configuration is not supported in the stage model.|
68| targetAbility | Target ability that this ability alias points to.| / | This configuration is not supported in the stage model.|
69| multiUserShared | Whether the ability supports data sharing among multiple users. This field applies only to the ability using the Data template.| / | This configuration is not supported in the stage model.|
70| supportPipMode | Whether the ability allows the user to enter the Picture in Picture (PiP) mode. The PiP mode enables the user to watch a video in a small window that hovers on top of a full screen window (main window).| / | This configuration is not supported in the stage model.|
71| formsEnabled | Whether the ability can provide widgets.| / | This configuration is not supported in the stage model.|
72| forms | Information about the widgets used by the ability. This field is valid only when **formsEnabled** is set to **true**.| form_config.json| In the stage model, the **form_config.json** file is defined in **resources/base/profile** in the development view.|
73| srcLanguage | Programming language used to develop the ability.| / | This configuration is not supported in the stage model.|
74| srcPath | Path of the JS component code corresponding to the ability.| srcEnty | Path of the JS code corresponding to the ability.|
75| uriPermission | Application data that the ability can access.| / | This configuration is not supported in the stage model.|
76