[ACA-2157] Fixed structure, markup and links (#904)

* [ACA-2157] Added brief description and updated links

* [ACA-2157] Fixed broken image URL
This commit is contained in:
Andy Stark
2019-01-23 07:45:31 +00:00
committed by Denys Vuika
parent a12c60337d
commit a46e16c28a
26 changed files with 106 additions and 219 deletions

View File

@@ -4,6 +4,8 @@ Title: Actions
# Actions
Below are the details of the JSON properties that are used to define actions.
| Name | Description |
| -- | -- |
| **id** | Unique identifier. |

View File

@@ -4,8 +4,10 @@ Title: Application Actions
# Application Actions
Application is using NgRx (Reactive libraries for Angular, inspired by Redux).
To get more information on NxRx please refer to the following resources:
The app uses **NgRx** (Reactive libraries for Angular, inspired by Redux)
to implement application actions.
For more information on NgRx, please refer to the following resources:
- [Comprehensive Introduction to @ngrx/store](https://gist.github.com/btroncone/a6e4347326749f938510)
@@ -41,10 +43,8 @@ export class MyService {
You can invoke every application action from the extensions, i.e. buttons, menus, etc.
<p class="tip">
Many of the actions take currently selected nodes if no payload provided.
**Tip:** Many of the actions take currently selected nodes if no payload provided.
That simplifies declaring and invoking actions from the extension files.
</p>
In the example below, we create a new entry to the "NEW" menu dropdown
and provide a new `Create Folder (plugin1)` command that invokes the `CREATE_FOLDER` application action.

View File

@@ -117,9 +117,7 @@ You can populate the menu with an extra entries like in the example below:
Please refer to the [Content Actions](/extending/application-features#content-actions) section for more details on supported properties.
<p class="tip">
It is also possible to update or disable existing entries from within the external extension files. You will need to know the `id` of the target element to customize.
</p>
**Tip:** It is also possible to update or disable existing entries from within the external extension files. You will need to know the `id` of the target element to customize.
## Navigation Bar
@@ -235,10 +233,8 @@ The example above renders two tabs:
All corresponding components must be registered for runtime use.
<p class="tip">
See the [Registration](/extending/registration) section for more details
**Tip:** See the [Registration](/extending/registration) section for more details
on how to register your own entries to be re-used at runtime.
</p>
### Tab properties
@@ -537,7 +533,7 @@ As with other content actions, custom plugins can disable, update or extend `Ope
## Content metadata presets
The content metadata presets are needed by the [Content Metadata Component](https://alfresco.github.io/adf-component-catalog/components/ContentMetadataComponent.html#readme) to render the properties of metadata aspects for a given node.
The content metadata presets are needed by the [Content Metadata Component](https://www.alfresco.com/abn/adf/docs/content-services/content-metadata-card.component/) to render the properties of metadata aspects for a given node.
The different aspects and their properties are configured in the `app.config.json` file, but they can also be set on runtime through extension files.
Configuring these presets from `app.extensions.json` will overwrite the default application setting.
@@ -547,9 +543,7 @@ Check out more info about merging extensions [here](/extending/extension-format#
The `content-metadata-presets` elements can be switched off by setting the `disabled` property.
This can be applied also for nested items, allowing disabling down to aspect level.
<p class="tip">
In order to modify or disable existing entries, you need to know the id of the target element, along with its parents ids.
</p>
**Tip:** In order to modify or disable existing entries, you need to know the id of the target element, along with its parents ids.
Your extensions can perform the following actions at runtime:
@@ -642,7 +636,5 @@ Here is the initial setting from `app.extension.json`:
```
<p class="tip">
In order to allow the content-metadata presets to be extended, the settings from `app.config.json` must be copied to the `app.extensions.json` file and its ids must be added to all the items.
**Tip:** In order to allow the content-metadata presets to be extended, the settings from `app.config.json` must be copied to the `app.extensions.json` file and its ids must be added to all the items.
Having ids allows external plugins to extend the current setting.
</p>

View File

@@ -6,7 +6,9 @@ Title: Creating custom evaluators
Rule evaluators are plain JavaScript (or TypeScript) functions that take `RuleContext` references and an optional list of `RuleParameter` instances.
Application provides a special [RuleEvaluator](https://github.com/Alfresco/alfresco-content-app/blob/master/src/app/extensions/rule.extensions.ts#L30) type alias for evaluator functions:
Application provides a special
[RuleEvaluator](https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/extensions/src/lib/config/rule.extensions.ts)
type alias for evaluator functions:
```ts
export type RuleEvaluator = (context: RuleContext, ...args: any[]) => boolean;
@@ -23,7 +25,7 @@ export function hasSelection(
}
```
The `context` is a reference to a special instance of the [RuleContext](https://github.com/Alfresco/alfresco-content-app/blob/master/src/app/extensions/rule.extensions.ts#L32) type,
The `context` is a reference to a special instance of the [RuleContext](https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/extensions/src/lib/config/rule.extensions.ts) type,
that provides each evaluator access to runtime entities.
```ts
@@ -63,7 +65,5 @@ extensions.setEvaluators({
Now, the `plugin1.rules.hasSelection` evaluator can be used as an inline rule reference,
or part of the composite rule like `core.every`.
<p class="tip">
See the [Registration](/extending/registration) section for more details
**Tip:** See the [Registration](/extending/registration) section for more details
on how to register your own entries to be re-used at runtime.
</p>

View File

@@ -25,11 +25,9 @@ The format is represented by a JSON file with the structure similar to the follo
## Schema
You can find the JSON schema at the project root folder: [extension.schema.json](https://github.com/Alfresco/alfresco-content-app/blob/master/extension.schema.json).
You can find the JSON schema at the project root folder: [extension.schema.json](../../extension.schema.json).
<p class="tip">
The Schema allows you to validate extension files, provides code completion and documentation hints.
</p>
**Tip:** The Schema allows you to validate extension files, provides code completion and documentation hints.
```json
{
@@ -54,10 +52,8 @@ The order of declaration defines the order of loading.
}
```
<p class="warning">
All extension files are merged together at runtime.
**Note:** All extension files are merged together at runtime.
This allows plugins to overwrite the code from the main application or to alter other plugins.
</p>
## Startup behavior
@@ -69,10 +65,8 @@ For the sake of speed the files are loaded in parallel, however once everything
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.
<p class="tip">
Any top-level property name that starts with the `$` symbol is considered metadata and does not participate in the merge process.
**Tip:** Any top-level property name that starts with the `$` symbol is considered metadata and does not participate in the merge process.
That allows a plugin to carry extra information for maintenance and visualisation purposes, for example: `$name`, `$version`, `$description`, `$license`, etc.
</p>
### Merging properties
@@ -112,10 +106,8 @@ Final result:
Note that as a result we have two unique properties `plugin1.key` and `plugin2.key`,
and also a `plugin1.text` that was first defined in the `Plugin 1`, but then overwritten by the `Plugin 2`.
<p class="tip">
JSON merging is a very powerful concept as it gives you the ability to alter any base application settings,
**Tip:** JSON merging is a very powerful concept as it gives you the ability to alter any base application settings,
or toggle features in other plugins without rebuilding the application or corresponding plugin libraries.
</p>
### Merging objects
@@ -216,9 +208,7 @@ You can find more details in the [Disabling Content](/extending/extension-format
The extension `Loader` provides a special support for merging Arrays.
By default, two collections will be merged into a single array unless objects have `id` properties.
<p class="tip">
If array contains two objects with the same `id` property, the objects will be merged rather than appended.
</p>
**Tip:** If the array contains two objects with the same `id` property, the objects will be merged rather than appended.
Before: Plugin 1

View File

@@ -122,10 +122,8 @@ Update the root `package.json` file and append the following entry to the `scrip
You can now use that script to build the library and copy assets to the output folder.
<p class="tip">
It is good practice to provide installation instructions for your library in the `README.md` file.
**Tip:** It is good practice to provide installation instructions for your library in the `README.md` file.
Be sure to mention that developers should have a build rule to copy your plugin definition file to the `assets/plugins` folder of the main application.
</p>
## Publishing library to NPM
@@ -156,9 +154,7 @@ npm install my-extension
This installs the library and all its dependencies.
<p class="warning">
You do not need to install the library in the original workspace as the application is already configured to use the local version from the `dist` folder.
</p>
**Note:** You do not need to install the library in the original workspace as the application is already configured to use the local version from the `dist` folder.
### Copy assets
@@ -223,6 +219,4 @@ npm start
Click the `My Extension` link and in the main content area you will see the extension component coming from your library.
<p class="warning">
Depending on the application setup, you may need enabling external plugins via the `Settings` dialog available for `admin` users (clicking the application profile button).
</p>
**Note:** Depending on the application setup, you may need enabling external plugins via the `Settings` dialog available for `admin` users (clicking the application profile button).

View File

@@ -42,10 +42,8 @@ export class MyExtensionModule {
}
```
<p class="warning">
According to Angular rules, all components that are created dynamically at runtime
**Note:** According to Angular rules, all components that are created dynamically at runtime
need to be registered within the `entryComponents` section of the NgModule.
</p>
The Registration API is not limited to the custom content only.
You can replace any existing entries by replacing the values from your module.

View File

@@ -38,10 +38,8 @@ Use the `app.layout.main` value for the `layout` property to get the default app
with header, navigation sidebar and main content area.
You can register any component to back the `app.layout.main` value.
<p class="tip">
By default, the `app.layout.main` is used if you do not specify any custom values.
**Tip:** By default, the `app.layout.main` is used if you do not specify any custom values.
Use `blank` if you want your route component take the whole page.
</p>
You can define the full route schema like in the next example:

View File

@@ -4,8 +4,7 @@ Title: Rules
# Rules
Rules allow evaluating conditions for extension components.
For example, you can disable or hide elements based on certain rules.
Rules allow you to evaluate conditions for extension components, so you can disable or hide elements based on certain rules, for example.
Every rule is backed by a condition evaluator.
@@ -47,10 +46,8 @@ Rules can accept other rules as parameters:
}
```
<p class="tip">
You can also negate any rule by utilizing a `!` prefix:
**Tip:** You can also negate any rule by utilizing a `!` prefix:
`!app.navigation.isTrashcan` is the opposite of the `app.navigation.isTrashcan`.
</p>
It is also possible to use inline references to registered evaluators without declaring rules,
in case you do not need providing extra parameters, or chaining multiple rules together.
@@ -160,10 +157,8 @@ The application exposes a set of navigation-related evaluators to help developer
The negated evaluators are provided just to simplify development, and to avoid having complex rule trees just to negate the rules,
for example mixing `core.every` and `core.not`.
<p class="tip">
You can also negate any rule by utilizing a `!` prefix:
**Tip:** You can also negate any rule by utilizing a `!` prefix:
`!app.navigation.isTrashcan` is the opposite of the `app.navigation.isTrashcan`.
</p>
| Key | Description |
| --------------------------------- | ------------------------------------------------------- |
@@ -182,10 +177,8 @@ You can also negate any rule by utilizing a `!` prefix:
| app.navigation.isSearchResults | User is using the **Search Results** page. |
| app.navigation.isNotSearchResults | Current page is not the **Search Results**. |
<p class="tip">
See [Registration](/extending/registration) section for more details
**Tip:** See the [Registration](/extending/registration) section for more details
on how to register your own entries to be re-used at runtime.
</p>
### Example

View File

@@ -4,6 +4,8 @@ Title: Tutorials
# Tutorials
Below are some short tutorials that cover common tasks.
## Custom route with parameters
In this tutorial, we are going to implement the following features: