mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-19 17:14:45 +00:00
Update extending.md (#683)
This commit is contained in:
parent
caaa66ff23
commit
5e3d9fd769
@ -16,7 +16,7 @@ and any number of external plugins that are references of the main entry point.
|
|||||||
The application also comes with the `/src/assets/plugins/` folder
|
The application also comes with the `/src/assets/plugins/` folder
|
||||||
already preconfigured to store external files.
|
already preconfigured to store external files.
|
||||||
|
|
||||||
You can create plugins that change, toggle or extend the following areas:
|
You can create plugins that change, toggle, or extend the following areas:
|
||||||
|
|
||||||
- Navigation sidebar links and groups
|
- Navigation sidebar links and groups
|
||||||
- Context Menu
|
- Context Menu
|
||||||
@ -37,11 +37,11 @@ Extensions can also:
|
|||||||
- Overwrite or disable extension points of the main application or other plugins
|
- Overwrite or disable extension points of the main application or other plugins
|
||||||
- Change rules, actions or any visual element
|
- Change rules, actions or any visual element
|
||||||
- Register new application routes based on empty pages or layouts
|
- Register new application routes based on empty pages or layouts
|
||||||
- Register new rule evaluators, components, guards, etc.
|
- Register new rule evaluators, components, guards
|
||||||
|
|
||||||
## Format
|
## Format
|
||||||
|
|
||||||
The format is represented by a JSON file with the structure similar to the following one:
|
The format is represented by a JSON file with the structure similar to the following:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@ -74,8 +74,8 @@ Schema allows validating extension files, provides code completion and documenta
|
|||||||
### Multiple files
|
### Multiple files
|
||||||
|
|
||||||
You can have multiple extension files distributed separately.
|
You can have multiple extension files distributed separately.
|
||||||
All additional files are linked via the `$references` property,
|
All additional files are linked via the `$references` property.
|
||||||
the order of declaration defines also the order of loading.
|
The order of declaration defines the order of loading.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@ -87,27 +87,25 @@ the order of declaration defines also the order of loading.
|
|||||||
```
|
```
|
||||||
|
|
||||||
<p class="warning">
|
<p class="warning">
|
||||||
Always keep in mind that all extension files are merged together at runtime.
|
Keep in mind all extension files are merged together at runtime.
|
||||||
That allows plugins overwriting the code from the main application or altering other plugins.
|
That allows plugins overwriting the code from the main application or altering other plugins.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
### Startup behaviour
|
### Startup behavior
|
||||||
|
|
||||||
First, the root `app.extensions.json` is loaded by means of the special `Loader` service.
|
First, the root `app.extensions.json` is loaded by means of the special `Loader` service.
|
||||||
The file can contain all the necessary declarations for an application to function,
|
The file can contain all the necessary declarations for an application to function,
|
||||||
and having extra plugin files is fully optional.
|
and having extra plugin files is fully optional.
|
||||||
|
|
||||||
Next, the `Loader` traverses the `$references` metadata and loads additional files if provided.
|
Next, the `Loader` traverses the `$references` metadata and loads additional files if provided.
|
||||||
For the sake of speed the files are loaded in parallel,
|
For the sake of speed the files are loaded in parallel, however once everything is loaded, they are applied in the order of declaration.
|
||||||
however, once everything is loaded, they are applied in the order of declaration.
|
|
||||||
|
|
||||||
After all the external files are fetched, the `Loader` sorts them, removes the metadata properties
|
After all the external files are fetched, the `Loader` sorts them, removes the metadata properties
|
||||||
and stacks the resulting JSON objects on top of each other.
|
and stacks the resulting JSON objects on top of each other.
|
||||||
|
|
||||||
<p class="tip">
|
<p class="tip">
|
||||||
Any top-level property name that starts with the `$` symbol is considered a metadata and does not participate in merge process.
|
Any top-level property name that starts with the `$` symbol is considered a metadata and does not participate in the merge process.
|
||||||
That allows a plugin to carry extra information for maintenance and visualisation purposes,
|
That allows a plugin to carry extra information for maintenance and visualisation purposes, for example: `$name`, `$version`, `$description`, `$license`, etc.
|
||||||
for example: `$name`, `$version`, `$description`, `$license`, etc.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
#### Merging properties
|
#### Merging properties
|
||||||
|
Loading…
x
Reference in New Issue
Block a user