Skip to content

Commit

Permalink
Merge pull request #458 from abpio/gterdem/modules_distributed_events…
Browse files Browse the repository at this point in the history
…_updates

[Docs] Update Distributed Events section of the modules
  • Loading branch information
ebicoglu authored Aug 2, 2023
2 parents 215db88 + fa1a933 commit 1c9acba
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 12 deletions.
46 changes: 35 additions & 11 deletions en/modules/language-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ See [the module description page](https://commercial.abp.io/modules/Volo.Languag

## How to Install

Language management module is pre-installed in [the startup templates](../Startup-Templates/Index). So, no need to manually install it.
The language management module is pre-installed in [the startup templates](../Startup-Templates/Index). So, no need to manually install it.

## Packages

This module follows the [module development best practices guide](https://docs.abp.io/en/abp/latest/Best-Practices/Index) and consists of several NuGet and NPM packages. See the guide if you want to understand the packages and relations between them.
This module follows the [module development best practices guide](https://docs.abp.io/en/abp/latest/Best-Practices/Index) and consists of several NuGet and NPM packages. Please look at the guide if you want to understand the packages and the relations between them.

You can visit [Language Management module package list page](https://abp.io/packages?moduleName=Volo.LanguageManagement) to see list of packages related with this module.
You can visit [Language Management module package list page](https://abp.io/packages?moduleName=Volo.LanguageManagement) to see the list of packages related to this module.

## User Interface

### Menu Items

Language management module adds the following items to the "Main" menu, under the "Administration" menu item:
The language management module adds the following items to the "Main" menu, under the "Administration" menu item:

* **Languages**: Language management page.
* **Language Texts**: Language text management page.
Expand All @@ -34,7 +34,7 @@ Language management module adds the following items to the "Main" menu, under th

#### Languages

Languages page is used to manage languages in the system.
The languages page is used to manage languages in the system.

![language-management-languages-page](../images/language-management-languages-page.png)

Expand All @@ -46,7 +46,7 @@ You can create a new language or edit an existing language in this page:

#### Language Texts

Language texts page is used to manage texts in different languages.
The language texts page is used to manage texts in different languages.

![language-management-language-texts-page](../images/language-management-language-texts-page.png)

Expand Down Expand Up @@ -136,7 +136,7 @@ See the `LanguageManagementPermissions` class members for all permissions define

#### Installation

In order to configure the application to use the `LanguageManagementModule`, you first need to import `LanguageManagementConfigModule` from `@volo/abp.ng.language-management/config` to root module. `LanguageManagementConfigModule` has a static `forRoot` method which you should call for a proper configuration.
To configure the application to use the `LanguageManagementModule`, you first need to import `LanguageManagementConfigModule` from `@volo/abp.ng.language-management/config` to root module. `LanguageManagementConfigModule` has a static `forRoot` method which you should call for a proper configuration.

```js
// app.module.ts
Expand Down Expand Up @@ -170,7 +170,7 @@ const routes: Routes = [
export class AppRoutingModule {}
```

> If you have generated your project via the startup template, you do not have to do anything, because it already has both `LanguageManagementConfigModule` and `LanguageManagementModule`.
> If you have generated your project via the startup template, you do not have to do anything because it already has both `LanguageManagementConfigModule` and `LanguageManagementModule`.
<h4 id="h-language-management-module-options">Options</h4>

Expand Down Expand Up @@ -217,9 +217,33 @@ export const environment = {
};
```

The Language Management module remote URL configuration shown above is optional. If you don't set a URL, the `default.url` will be used as fallback.

The Language Management module remote URL configuration shown above is optional. If you don't set a URL, the `default.url` will be used as a fallback.

## Distributed Events

This module doesn't define any additional distributed event. See the [standard distributed events](https://docs.abp.io/en/abp/latest/Distributed-Event-Bus).

This module defines the following ETOs (Event Transfer Objects) to allow you to subscribe to changes on the entities of the module;

- `LanguageEto` is published on changes done on a `Language` entity.
- `LanguageTextEto` is published on changes done on a `LanguageText` entity.

**Example: Get notified when a new tenant has been created**

```
public class MyHandler :
IDistributedEventHandler<EntityCreatedEto<LanguageEto>>,
ITransientDependency
{
public async Task HandleEventAsync(EntityCreatedEto<LanguageEto> eventData)
{
LanguageEto language = eventData.Entity;
// TODO: ...
}
}
```



`LanguageEto` and `LanguageTextEto` are configured to publish the events automatically. You should be able to configure yourself for the others. See the [Distributed Event Bus document](https://github.com/abpframework/abp/blob/rel-7.3/docs/en/Distributed-Event-Bus.md) to learn details of the pre-defined events.

> Subscribing to distributed events is especially useful for distributed scenarios (like microservice architecture). If you are building a monolithic application or listening events in the same process that runs the Tenant Management Module, then subscribing to the [local events](https://github.com/abpframework/abp/blob/rel-7.3/docs/en/Local-Event-Bus.md) can be more efficient and easier.
28 changes: 27 additions & 1 deletion en/modules/saas.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,30 @@ The Saas module remote URL configurations shown above are optional. If you don't
## Distributed Events
This module doesn't define any additional distributed events. See the [standard distributed events](https://docs.abp.io/en/abp/latest/Distributed-Event-Bus).
This module defines the following ETOs (Event Transfer Objects) to allow you to subscribe to changes on the entities of the module;
- `TenantEto` is published on changes done on a `Tenant` entity.
- `EditionEto` is published on changes done on an `Edition` entity.
**Example: Get notified when a new tenant has been created**
```
public class MyHandler :
IDistributedEventHandler<EntityCreatedEto<TenantEto>>,
ITransientDependency
{
public async Task HandleEventAsync(EntityCreatedEto<TenantEto> eventData)
{
TenantEto tenant = eventData.Entity;
// TODO: ...
}
}
```
`TenantEto` and `EditionEto` are configured to automatically publish the events. You should configure yourself for the others. See the [Distributed Event Bus document](https://github.com/abpframework/abp/blob/rel-7.3/docs/en/Distributed-Event-Bus.md) to learn details of the pre-defined events.
> Subscribing to the distributed events is especially useful for distributed scenarios (like microservice architecture). If you are building a monolithic application, or listening events in the same process that runs the Tenant Management Module, then subscribing to the [local events](https://github.com/abpframework/abp/blob/rel-7.3/docs/en/Local-Event-Bus.md) can be more efficient and easier.

0 comments on commit 1c9acba

Please sign in to comment.