@ -0,0 +1,20 @@ |
|||
@ECHO off |
|||
cls |
|||
|
|||
ECHO Deleting all BIN and OBJ folders... |
|||
ECHO. |
|||
|
|||
FOR /d /r . %%d in (bin,obj) DO ( |
|||
IF EXIST "%%d" ( |
|||
ECHO %%d | FIND /I "\node_modules\" > Nul && ( |
|||
ECHO.Skipping: %%d |
|||
) || ( |
|||
ECHO.Deleting: %%d |
|||
rd /s/q "%%d" |
|||
) |
|||
) |
|||
) |
|||
|
|||
ECHO. |
|||
ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit. |
|||
pause > nul |
|||
@ -0,0 +1,139 @@ |
|||
# ABP Commercial 4.3 RC Has Been Published |
|||
|
|||
ABP Commercial version 4.3 RC (Release Candidate) has been published alongside [ABP Framework 4.3. RC](https://blog.abp.io/abp/ABP-Framework-4.3-RC-Has-Been-Published). I will introduce the new features in this blog post. Here, a list of highlights for this release; |
|||
|
|||
* The **microservice starter template** is getting more mature. We've also added a **service template** to add new microservices to the solution. |
|||
* New option for the application starter template to have a **separate database schema for tenant databases**. |
|||
* New **Forms** module to create surveys |
|||
* **Enable/disable modules** per edition/tenant. |
|||
* **Lepton theme** and **Account module**'s source codes are available with the Team License. |
|||
|
|||
Here, some other features already covered in the ABP Framework announcement, but worth mentioning here since they are also implemented for the ABP Commercial; |
|||
|
|||
* **Blazor UI server-side** support |
|||
|
|||
* **Email setting** management UI |
|||
* **Module extensibility** system is now available for the **Blazor UI** too. |
|||
|
|||
> This post doesn't cover the features and changes done on the ABP Framework side. Please also see the **[ABP Framework 4.3. RC blog post](https://blog.abp.io/abp/ABP-Framework-4.3-RC-Has-Been-Published)**. |
|||
|
|||
## The Migration Guide |
|||
|
|||
**This upgrade requires some manual work documented in [the migration guide](https://docs.abp.io/en/commercial/4.3/migration-guides/v4_3).** Please read the guide carefully. Even if your application doesn't break on upgrade, you should apply the changes to avoid future release problems. |
|||
|
|||
## What's New With The ABP Commercial 4.3 |
|||
|
|||
### The Microservice Starter Template |
|||
|
|||
We'd introduced an initial version of the [microservice starter template](https://docs.abp.io/en/commercial/4.3/startup-templates/microservice/index) in the [previous version](https://blog.abp.io/abp/ABP-IO-Platform-v4-2-RC-Has-Been-Released). It is getting more mature with this release. We've made a lot of improvements and changes, including; |
|||
|
|||
* New **"service" template** to add new microservices for the solution. It still requires some manual work to integrate to other services and gateways; however, it makes progress very easy and straightforward. |
|||
* Added [Tye](https://github.com/dotnet/tye) configuration to develop and test the solution easier. |
|||
* Added [Prometheus](https://prometheus.io/), [Grafana](https://grafana.com/) integrations for monitoring the solution. |
|||
* **Automatic database migrations**. Every microservice automatically checks and migrates/seeds its database on startup (concurrency issues are resolved for multiple instances). For multi-tenant systems, tenant databases are also upgraded by the queue. |
|||
* For multi-tenant systems, **databases are being created on the fly** for new tenants with separate connection strings. |
|||
* Created **separate solution (`.sln`) file** for each microservice, gateway, and application. In this way, you can focus on what you are working on. The main (roof) solution file only includes the executable projects in these solutions. |
|||
* All microservices are converted to the standard **layered module structure**, making it easier to align with ABP application development practices. |
|||
|
|||
After this release, **we will be preparing microservice development guides** based on this startup solution. |
|||
|
|||
### Separate Tenant Schema |
|||
|
|||
ABP's multi-tenancy system allows to the creation of dedicated databases for tenants. However, the application startup solution comes with a single database migration path; hence it has a single database schema. As a result, tenant databases have some host-related tables. These tables are not used for tenants, and they are always empty. However, their existence may disturb us as a clean developer. |
|||
|
|||
With this release, the application startup template provides an option to address this problem. So, if you want, you can have a separate migration path for tenant databases. Of course, this has a cost; You will have two DbContexts for migration purposes, bringing additional complexity to your solution. We've done our best to reduce this complexity and added a README file into the migration assembly. If you prefer this approach, please check that README file. |
|||
|
|||
You can specify the new `--separate-tenant-schema` parameter while you are creating a new solution using the [ABP CLI](https://docs.abp.io/en/abp/4.3/CLI): |
|||
|
|||
````bash |
|||
abp new Acme.BookStore --separate-tenant-schema |
|||
```` |
|||
|
|||
If you prefer the [ABP Suite](https://docs.abp.io/en/commercial/latest/abp-suite/create-solution) to create solutions, you can check the *Separated tenant schema* option. |
|||
|
|||
 |
|||
|
|||
### Creating Tenant Databases On The Fly |
|||
|
|||
With this release, the separate tenant database feature becomes more mature. When you create a new tenant with specifying a connection string, the **new database is automatically created** with all the tables and the initial seed data if available. So, tenants can immediately start to use the new database. With this change, tenant connection string textboxes come in the tenant creation modal: |
|||
|
|||
 |
|||
|
|||
Besides, we've added an "**Apply database migrations**" action to the tenant management UI to manually trigger the database creation & migration in case you have a problem with automatic migration: |
|||
|
|||
 |
|||
|
|||
Automatic migration only tries one time. If it fails, it writes the exception log and discards this request. For example, this can happen if the connection string is wrong or the database server is not available. In this case, you can manually retry with this action. |
|||
|
|||
> Note that this feature requires to **make changes in your solution**, if you upgrade from an older version. Because the tenant database creation and migration code are located in the application startup template. See the [version 4.3 migration guide](https://docs.abp.io/en/commercial/4.3/migration-guides/v4_3) for details. |
|||
|
|||
### New Module: CMS Kit |
|||
|
|||
CMS Kit module initial version has been released with this version. As stated in the [ABP Framework 4.3 announcement post](https://blog.abp.io/abp/ABP-Framework-4.3-RC-Has-Been-Published), it should be considered premature for now. |
|||
|
|||
For ABP Commercial application startup template, we are providing an option to include the CMS Kit into the solution while creating new solutions: |
|||
|
|||
 |
|||
|
|||
It is available only if you select the *Public web site* option. Once you include CMS Kit, a *Cms* item is shown on the menu: |
|||
|
|||
 |
|||
|
|||
Each CMS Kit feature can be individually enabled/disabled, using the global feature system. Once you disable a feature, it becomes completely invisible; even the related tables are not included in your database. |
|||
|
|||
CMS Kit features are separated into two categories: Open source (free) features and pro (commercial) features. For now, only newsletter and contact form features are commercial. By the time, we will add more free and commercial features. |
|||
|
|||
> We will create a separate blog post for the CMS Kit module, so I keep it short. |
|||
|
|||
### New Module: Forms |
|||
|
|||
*Forms* is a new module that is being introduced with this version. It looks like the Google Forms application; You dynamically create forms on the UI and send them to people to answer. Then you can get statistics/report and export answers to a CSV file. |
|||
|
|||
Forms module currently supports the following question types; |
|||
|
|||
* **Free text** |
|||
* Selecting a **single option** from a **dropdown** list or a **radio button** list |
|||
* **Multiple choice**: Selecting multiple options from a checkbox list |
|||
|
|||
**Screenshot: editing form and questions - view responses** |
|||
|
|||
 |
|||
|
|||
**Screenshot: answering to the form** |
|||
|
|||
 |
|||
|
|||
|
|||
|
|||
### Team License Source Code for Modules |
|||
|
|||
Team License users can't access the source code of modules and themes as a license restriction. You have to buy a Business or Enterprise license to download any module/theme's full source code. However, we got a lot of feedback from the Team License owners on the source code of the account module and the lepton theme. We see that customization of these two modules is highly necessary for most of our customers. |
|||
|
|||
With this version, we decided to allow Team License holders to download the source code of the **Account Module** and the **Lepton Theme** to freely customize them based on their requirements. |
|||
|
|||
You can **Replace these modules with their source code** using the ABP Suite: |
|||
|
|||
 |
|||
|
|||
Remember that; when you include the source code in your solution, it is your responsibility to upgrade them when we release new versions (while you don't have to upgrade them). |
|||
|
|||
### Lepton Theme Public Website Layout |
|||
|
|||
We'd added a public website application in the application starter template in the previous versions. It was using the public website layout of the Lepton Theme. We realized that the layout of this application is customized or completely changed in most of the solutions. So, with this version, the layout is included inside the application in the downloaded solution. You can freely change it. Before, you had to download it separately and include it in your solution manually. |
|||
|
|||
### Enable/Disable Modules |
|||
|
|||
With this release, all modules can be enabled/disabled per edition/tenant. You can allow/disallow modules when you click *Features* action for an edition or tenant: |
|||
|
|||
 |
|||
|
|||
### Other Features/Changes |
|||
|
|||
* ABP Suite now supports defining *required* navigation properties on code generation. |
|||
* **Blazor server-side** (with tiered option) is added for the application and microservice starter templates. |
|||
* An **"Email"** tab has been added to the Settings page to configure the email settings. |
|||
|
|||
## Feedback |
|||
|
|||
Please check out the ABP Commercial 4.3 RC to help us to release a more stable version. **The planned release date for the 4.3.0 final version is April 15, 2021**. |
|||
|
|||
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 123 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,189 @@ |
|||
# ABP Framework 4.3 RC Has Been Published |
|||
|
|||
We are super excited to announce the ABP Framework 4.3 RC (Release Candidate). Here, a list of highlights of this release; |
|||
|
|||
* **CMS Kit** module initial release. |
|||
* **Blazor UI server-side** support. |
|||
* **Module extensibility** system for the Blazor UI. |
|||
* Angular UI **resource owner password** flow comes back. |
|||
* **Volo.Abp.EntityFrameworkCore.Oracle** package is now compatible with .NET 5. |
|||
* CLI support to easily add the **Basic Theme** into the solution. |
|||
* New **IInitLogger** service to write logs before dependency injection phase completed. |
|||
|
|||
Besides the new features above, we've done many performance improvements, enhancements and bug fixes on the current features. See the [4.3 milestone](https://github.com/abpframework/abp/milestone/49?closed=1) on GitHub for all changes made on this version. |
|||
|
|||
This version was a big development journey for us; [~160 issues](https://github.com/abpframework/abp/issues?q=is%3Aissue+milestone%3A4.3-preview+is%3Aclosed) resolved, [~300 PRs](https://github.com/abpframework/abp/issues?q=is%3Apr+milestone%3A4.3-preview+is%3Aclosed) merged and **~1,700 commits** done only in the [main framework repository](https://github.com/abpframework/abp). **Thanks to the ABP Framework team and all the contributors.** |
|||
|
|||
> ABP Commercial 4.3 RC has also been published. Check out [the commercial blog post](https://blog.abp.io/abp/ABP-Commercial-4.3-RC-Has-Been-Published). |
|||
|
|||
## The Migration Guide |
|||
|
|||
We normally don't make breaking changes in feature versions. However, this version has some small **breaking changes** mostly related to Blazor UI WebAssembly & Server separation. **Please check the [migration guide](https://docs.abp.io/en/abp/4.3/Migration-Guides/Abp-4_3) while upgrading to version 4.3**. |
|||
|
|||
## Known Issues |
|||
|
|||
Some minor issues will be fixed in the stable release. You can see the known issues [here](https://github.com/abpframework/abp/issues?q=is%3Aopen+is%3Aissue+milestone%3A4.3-final). |
|||
|
|||
## Get Started With The 4.3 RC |
|||
|
|||
If you want to try version 4.3 today, follow the steps below; |
|||
|
|||
1) **Upgrade** the ABP CLI to the version `4.3.0-rc.1` using a command-line terminal: |
|||
|
|||
````bash |
|||
dotnet tool update Volo.Abp.Cli -g --version 4.3.0-rc.1 |
|||
```` |
|||
|
|||
**or install** if you haven't installed before: |
|||
|
|||
````bash |
|||
dotnet tool install Volo.Abp.Cli -g --version 4.3.0-rc.1 |
|||
```` |
|||
|
|||
2) Create a **new application** with the `--preview` option: |
|||
|
|||
````bash |
|||
abp new BookStore --preview |
|||
```` |
|||
|
|||
See the [ABP CLI documentation](https://docs.abp.io/en/abp/4.3/CLI) for all the available options. |
|||
|
|||
> You can also use the *Direct Download* tab on the [Get Started](https://abp.io/get-started) page by selecting the **Preview checkbox**. |
|||
|
|||
## What's New With The ABP Framework 4.3 |
|||
|
|||
### CMS Kit |
|||
|
|||
CMS (Content Management System) Kit was a module we worked on for the last couple of months. It is usable now, and we are releasing the initial version with this release. We are considering this module as pre-mature. It will be improved in the next versions. The goal to provide a flexible and extensible CMS infrastructure to .NET community. It currently has the following features; |
|||
|
|||
* **Pages**: Used to create UI pages with a Markdown + WYSIWYG editor. Once you create a page, it becomes available via URL like `/pages/my-page-url`. |
|||
* **Blog**: A built-in blog system that supports multiple blogs with blog posts. |
|||
* **Comments**: Allows users to write comments under contents. It is used for blog posts. |
|||
* **Tags**: To add tag feature to any content/entity. It is used for blog posts. |
|||
* **Reactions**: Allows users to react to content via emojis, like a smile, upvote, downvote, etc. |
|||
* **Rating**: This component is used to rate content by users. |
|||
|
|||
All features are separately usable. For example, you can create an image gallery and reuse the Comments and Tags features for the images. You can enable/disable features individually using the [Global Features System](https://docs.abp.io/en/abp/4.3/Global-Features). |
|||
|
|||
> We will create a separate blog post for the CMS Kit module, so I keep it short. |
|||
|
|||
### Blazor Server Side |
|||
|
|||
We'd implemented Blazor WebAssembly before. With version 4.3, we have the Blazor Server-Side option too. All the current functionalities are available to the Blazor Server. |
|||
|
|||
You can select Blazor Server as the UI type while creating a new solution. |
|||
|
|||
**Example:** |
|||
|
|||
````bash |
|||
abp new Acme.BookStore -u blazor-server |
|||
```` |
|||
|
|||
If you write `blazor` as the UI type, it will create Blazor WebAssembly just as before. |
|||
|
|||
> You can also select the Blazor Server on the [get started](https://abp.io/get-started) page. |
|||
|
|||
Blazor Server applications are mixed applications; You can mix the server-side MVC / Razor Pages with the Blazor SPA. This brings an interesting opportunity: MVC / Razor Pages modules can work seamlessly in the Blazor Server applications. For example, the CMS Kit module has no Blazor UI yet, but you can use its MVC UI inside your Blazor Server application. |
|||
|
|||
> Blazor Server UI has a `--tiered` option just [like](https://docs.abp.io/en/abp/latest/Startup-Templates/Application#tiered-structure) the MVC / Razor Pages UI. This can be used to separate the HTTP API server from the UI server (UI application doesn't directly connect to the database). |
|||
|
|||
### Blazor UI Module Extensibility |
|||
|
|||
Module Entity Extensions and some other extensibility features was not supported by the Blazor UI. With this version, we've implemented that system for Blazor UI. |
|||
|
|||
For anyone wondering what the module entity extensions is, please check [the document](https://docs.abp.io/en/abp/4.3/Module-Entity-Extensions) or [this community video](https://community.abp.io/articles/overview-of-abp-framework-4.1-module-extensions-part-1-n04f7bhf). |
|||
|
|||
### Email Setting Management UI |
|||
|
|||
With this release, a new item is added to the main menu to navigate to the setting management page. This page contains the email setting management UI, as shown below: |
|||
|
|||
 |
|||
|
|||
The setting page is provided by the [setting management module](https://docs.abp.io/en/abp/4.3/Modules/Setting-Management), and it is extensible; You can add your tabs to this page for your application settings. |
|||
|
|||
### Angular UI Resource Owner Password Flow |
|||
|
|||
The login page was removed from the Angular UI in previous versions because Authorization Code flow is the recommended approach for SPAs. However, it requires redirecting the user to the authentication server, logging there, and returning to the application. We got a lot of feedback because this brings overhead for simple applications. |
|||
|
|||
With version 4.3, Angular UI can use its login page with resource owner password flow. Please refer to [the documentation](https://github.com/abpframework/abp/blob/dev/docs/en/UI/Angular/Account-Module.md) to learn how to make it work. |
|||
|
|||
### Volo.Abp.EntityFrameworkCore.Oracle Package |
|||
|
|||
We couldn't update the [Oracle.EntityFrameworkCore](https://www.nuget.org/packages/Oracle.EntityFrameworkCore/) package on .NET 5.0 upgrade since it was not supporting .NET 5.0 at that time. Now, it supports .NET 5.0 and we've upgraded the package. |
|||
|
|||
See [the documentation](https://docs.abp.io/en/abp/4.3/Entity-Framework-Core-Oracle-Official) to learn how to switch to this package for the Oracle database. |
|||
|
|||
### Add Basic Theme Into Your Solution |
|||
|
|||
ABP Framework provides a strong theming system. However, the default theme, named the Basic Theme, has a non-styled, base Bootstrap UI. It is expected that you override the styles and UI components of that theme in a serious application. |
|||
|
|||
There are some articles (see for [mvc](https://community.abp.io/articles/creating-a-new-ui-theme-by-copying-the-basic-theme-for-mvc-ui-yt9b18io) & [blazor](https://community.abp.io/articles/creating-a-new-ui-theme-by-copying-the-basic-theme-for-blazor-ui-qaf5ho1b)) to explain how to include the Basic Theme's source code into your solution to modify it fully. However, it still requires some manual work. |
|||
|
|||
With this version, ABP CLI providing a command to add the Basic Theme's source code into your solution. Run the following command in a command-line terminal inside the root directory of your solution: |
|||
|
|||
**MVC UI** |
|||
|
|||
````bash |
|||
abp add-package Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic --with-source-code --add-to-solution |
|||
```` |
|||
|
|||
**Blazor Web Assembly UI** |
|||
|
|||
````bash |
|||
abp add-package Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme --with-source-code --add-to-solution |
|||
abp add-package Volo.Abp.AspNetCore.Components.Web.BasicTheme --with-source-code --add-to-solution |
|||
```` |
|||
|
|||
**Blazor Server UI** |
|||
|
|||
````bash |
|||
abp add-package Volo.Abp.AspNetCore.Components.Server.BasicTheme --with-source-code --add-to-solution |
|||
abp add-package Volo.Abp.AspNetCore.Components.Web.BasicTheme --with-source-code --add-to-solution |
|||
```` |
|||
|
|||
As you see, Blazor UI developers should add two packages. The Basic Theme consists of two packages for the Blazor UI: one for wasm/server and one shared. |
|||
|
|||
**Angular UI** |
|||
|
|||
Execute the following command in a terminal inside the `angular` folder of your solution: |
|||
|
|||
````bash |
|||
abp add-package @abp/ng.theme.basic --with-source-code |
|||
```` |
|||
|
|||
### IInitLogger |
|||
|
|||
In ASP.NET Core, logging is not possible before the dependency injection phase is completed. For example, you can't write log in `ConfigureServices` method. However, we sometimes need to write logs in this stage. |
|||
|
|||
We are introducing the `IInitLogger` service, which allows writing logs inside the `ConfigureServices` method. |
|||
|
|||
**Example:** |
|||
|
|||
````csharp |
|||
public class MyModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
var logger = context.Services.GetInitLogger<MyModule>(); |
|||
logger.LogInformation("Some log..."); |
|||
} |
|||
} |
|||
```` |
|||
|
|||
Logs are written once the service registration phase is completed. It stores the written logs in memory and then writes logs to the actual `ILogger` when ready. |
|||
|
|||
> Notice: Startup templates come with [Serilog](https://serilog.net/) pre-installed. So, you can write logs everywhere by directly using its static API (ex: `Log.Information("...");`). The `InitLogger` is a way to write pre-initialization logs without depending on a particular logging library. So, it makes it very handy to write logs inside reusable modules. |
|||
|
|||
### Other Features/Changes |
|||
|
|||
* [#7423](https://github.com/abpframework/abp/issues/7423) MongoDB repository base aggregation API. |
|||
* [#8163](https://github.com/abpframework/abp/issues/8163) Ignoring given files on minification for MVC UI. |
|||
* [#7799](https://github.com/abpframework/abp/pull/7799) Added `RequiredPermissionName` to `ApplicationMenuItem` for MVC & Blazor UI to easily show/hide menu items based on user permissions. Also added `RequiredPermissionName` to `ToolbarItem` for the MVC UI for the same purpose. |
|||
* [#7523](https://github.com/abpframework/abp/pull/7523) Add more bundle methods to the distributed cache. |
|||
* [#8013](https://github.com/abpframework/abp/pull/8013) Handle `JsonProperty` attribute on Angular proxy generation. |
|||
|
|||
See the [4.3 milestone](https://github.com/abpframework/abp/milestone/49) on GitHub for all changes made on this version. |
|||
|
|||
## Feedback |
|||
|
|||
Please check out the ABP Framework 4.3 RC and [provide feedback](https://github.com/abpframework/abp/issues/new) to help us release a more stable version. **The planned release date for the [4.3.0 final](https://github.com/abpframework/abp/milestone/50) version is April 15, 2021**. |
|||
|
After Width: | Height: | Size: 24 KiB |
@ -0,0 +1,3 @@ |
|||
# Introducing the CMS Kit Module for the ABP Framework |
|||
|
|||
TODO... |
|||
@ -0,0 +1,216 @@ |
|||
# ABP CLI Create Solution Sample Commands |
|||
|
|||
The `abp new` command creates an ABP solution or other artifacts based on an ABP template. ABP CLI has several parameters to create a new ABP solution. In this document we will show you some sample commands to create a new solution. All the project names are `Acme.BookStore`. Currently, the only available mobile project is a `React Native` mobile app. Available database providers are `Entity Framework Core` and `MongoDB`. All the commands starts with `abp new`. |
|||
|
|||
## Angular |
|||
|
|||
The following commands are for creating Angular UI projects: |
|||
|
|||
* **Entity Framework Core**, no mobile app, creates the project in a new folder: |
|||
|
|||
````bash |
|||
abp new Acme.BookStore -u angular --mobile none --database-provider ef -csf |
|||
```` |
|||
|
|||
* **Entity Framework Core**, default app template, **separate Identity Server**, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u angular -m none --separate-identity-server --database-provider ef -csf |
|||
``` |
|||
|
|||
* **Entity Framework Core**, **custom connection string**, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u angular -csf --connection-string Server=localhost;Database=MyDatabase;Trusted_Connection=True |
|||
``` |
|||
|
|||
* **MongoDB**, default app template, mobile project included, creates solution in `C:\MyProjects\Acme.BookStore` |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u angular --database-provider mongodb --output-folder C:\MyProjects\Acme.BookStore |
|||
``` |
|||
|
|||
* **MongoDB**, default app template, no mobile app, **separate Identity Server**, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u angular -m none --separate-identity-server --database-provider mongodb -csf |
|||
``` |
|||
|
|||
## MVC |
|||
|
|||
The following commands are for creating MVC UI projects: |
|||
|
|||
* **Entity Framework Core**, no mobile app, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u mvc --mobile none --database-provider ef -csf |
|||
``` |
|||
|
|||
* **Entity Framework Core**, **tier architecture** (*Web and HTTP API are separated*), no mobile app, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u mvc --mobile none --tiered --database-provider ef -csf |
|||
``` |
|||
|
|||
* **MongoDB**, no mobile app, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u mvc --mobile none --database-provider mongodb -csf |
|||
``` |
|||
|
|||
* **MongoDB**, **tier architecture**, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u mvc --tiered --database-provider mongodb -csf |
|||
``` |
|||
|
|||
|
|||
## Blazor |
|||
|
|||
The following commands are for creating Blazor projects: |
|||
|
|||
* **Entity Framework Core**, no mobile app: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u blazor --mobile none |
|||
``` |
|||
|
|||
* **Entity Framework Core**, **separate Identity Server**, mobile app included: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u blazor --separate-identity-server |
|||
``` |
|||
|
|||
* **MongoDB**, no mobile app, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u blazor --database-provider mongodb --mobile none -csf |
|||
``` |
|||
|
|||
## No UI |
|||
|
|||
In the default app template, there is always a frontend project. In this option there is no frontend project. It has a `HttpApi.Host` project to serve your HTTP WebAPIs. It's appropriate if you want to create a WebAPI service. |
|||
|
|||
* **Entity Framework Core**, separate Identity Server, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u none --separate-identity-server -csf |
|||
``` |
|||
* **MongoDB**, no mobile app: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u none --mobile none --database-provider mongodb |
|||
``` |
|||
|
|||
## Console application |
|||
|
|||
It's a template of a basic .NET console application with ABP module architecture integrated. To create a console application use the following command: |
|||
|
|||
* This project consists of the following files: `Acme.BookStore.csproj`, `appsettings.json`, `BookStoreHostedService.cs`, `BookStoreModule.cs`, `HelloWorldService.cs` and `Program.cs`. |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t console -csf |
|||
``` |
|||
|
|||
## Module |
|||
|
|||
Module are reusable sub applications used by your main project. Using ABP Module is a best practice if you are building a microservice solution. As modules are not final applications, each module has all the frontend UI projects and database providers. The module template comes with an MVC UI to be able to develop without the final solution. But if you will develop your module under a final solution, you add `--no-ui` parameter to exclude MVC UI project. |
|||
|
|||
* Included frontends: `MVC`, `Angular`, `Blazor`. Included database providers: `Entity Framework Core`, `MongoDB`. Includes MVC startup project. |
|||
|
|||
```bash |
|||
abp new Acme.IssueManagement -t module |
|||
``` |
|||
* The same with the upper but doesn't include MVC startup project. |
|||
|
|||
```bash |
|||
abp new Acme.IssueManagement -t module --no-ui |
|||
``` |
|||
|
|||
## Create a solution from a specific version |
|||
|
|||
When you create a solution, it always creates with the latest version. To create a project from an older version, you can pass the `--version` parameter. |
|||
|
|||
* Create a solution from v3.3.0, with Angular UI and Entity Framework Core. |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u angular -m none --database-provider ef -csf --version 3.3.0 |
|||
``` |
|||
|
|||
To get the ABP version list, checkout following link: https://www.nuget.org/packages/Volo.Abp.Core/ |
|||
|
|||
## Create from a custom template |
|||
|
|||
ABP CLI uses the default [app template](https://github.com/abpframework/abp/tree/dev/templates/app) to create your project. If you want to create a new solution from your customized template, you can use the parameter `--template-source`. |
|||
|
|||
* MVC UI, Entity Framework Core, no mobile app, using the template in `c:\MyProjects\templates\app` directory. |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u mvc --mobile none --database-provider ef --template-source "c:\MyProjects\templates\app" |
|||
``` |
|||
|
|||
* Same with the previous one except this command retrieves the template from the URL `https://myabp.com/app-template.zip`. |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u mvc --mobile none --database-provider ef --template-source https://myabp.com/app-template.zip |
|||
``` |
|||
|
|||
## Create a preview version |
|||
|
|||
ABP CLI always uses the latest version. In order to create a solution from a preview (RC) version add the `--preview` parameter. |
|||
|
|||
* Blazor UI, Entity Framework Core, no mobile, **preview version**, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -t app -u blazor --mobile none -csf --preview |
|||
``` |
|||
|
|||
## Choose database management system |
|||
|
|||
The default database management system (DBMS) is `Entity Framework Core` / ` SQL Server`. You can choose a DBMS by passing `--database-management-system` parameter. Accepted values are `SqlServer`, `MySQL`, `SQLite`, `Oracle-Devart`, `PostgreSQL`. The default value is `SqlServer`. |
|||
|
|||
* Angular UI, **PostgreSQL** database, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore -u angular --database-management-system PostgreSQL -csf |
|||
``` |
|||
|
|||
|
|||
|
|||
## Use static HTTP ports |
|||
|
|||
ABP CLI always assigns random ports to the hostable projects. If you need to keep the default ports and create a solution always with the same HTTP ports, add the parameter `--no-random-port`. |
|||
|
|||
* MVC UI, Entity Framework Core, **static ports**, creates the project in a new folder: |
|||
|
|||
```bash |
|||
abp new Acme.BookStore --no-random-port -csf |
|||
``` |
|||
|
|||
## Use local ABP framework references |
|||
|
|||
ABP libraries are referenced from NuGet by default in the ABP solutions. Sometimes you need to reference ABP libraries locally to your solution. This is useful to debug the framework itself. Your local ABP Framework 's root directory must have the `Volo.Abp.sln` file. You can copy the content of the following directory to your file system https://github.com/abpframework/abp/tree/dev/framework |
|||
|
|||
* MVC UI, Entity Framework Core, **ABP libraries are local project references**: |
|||
|
|||
The local path must be the root directory of ABP repository. |
|||
If `C:\source\abp\framework\Volo.Abp.sln` is your framework solution path, then you must write `C:\source\abp` to the `--abp-path` paramter. |
|||
|
|||
```bash |
|||
abp new Acme.BookStore --local-framework-ref --abp-path C:\source\abp |
|||
``` |
|||
|
|||
**Output**: |
|||
|
|||
As seen below, ABP Framework libraries are local project references. |
|||
|
|||
```xml |
|||
<ItemGroup> |
|||
<ProjectReference Include="C:\source\abp\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> |
|||
<ProjectReference Include="C:\source\abp\framework\src\Volo.Abp.AspNetCore.Serilog\Volo.Abp.AspNetCore.Serilog.csproj" /> |
|||
<ProjectReference Include="C:\source\abp\framework\src\Volo.Abp.AspNetCore.Authentication.JwtBearer\Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj" /> |
|||
<ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" /> |
|||
<ProjectReference Include="..\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.csproj" /> |
|||
<ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" /> |
|||
</ItemGroup> |
|||
``` |
|||
@ -0,0 +1,99 @@ |
|||
# Send Real-time Notifications via SignalR in ABP Project |
|||
|
|||
SignalR is an open source library that adds real-time operation functionality to applications. Real-time web functionality enables server-side code to instantly send content to clients without refreshing the page. I'll show you how to add SignalR and use it to send notifications from backend. I'll implement this functionality in MVC template of ABP Framework. |
|||
|
|||
 |
|||
|
|||
## Implement Backend |
|||
|
|||
### Create Notification Hub |
|||
|
|||
Create a new folder named `SignalR` in your root directory of your Web project. |
|||
|
|||
 |
|||
|
|||
Then add the following classes to the folder: |
|||
|
|||
1. [INotificationClient.cs](https://gist.github.com/ebicoglu/f7dc22cca2d353f8bf7f68a03e3395b8#file-inotificationclient-cs) |
|||
2. [UiNotificationClient.cs](https://gist.github.com/ebicoglu/f7dc22cca2d353f8bf7f68a03e3395b8#file-uinotificationclient-cs) |
|||
3. [UiNotificationHub.cs](https://gist.github.com/ebicoglu/f7dc22cca2d353f8bf7f68a03e3395b8#file-uinotificationhub-cs) |
|||
|
|||
### Configure Module |
|||
|
|||
These 3 steps will be done in your web module class. |
|||
|
|||
#### 1- Add SignalR |
|||
|
|||
Open `YourProjectWebModule.cs` class and add the following line to the `PreConfigureServices` method: |
|||
|
|||
```csharp |
|||
context.Services.AddSignalR(); |
|||
``` |
|||
|
|||
|
|||
|
|||
 |
|||
|
|||
|
|||
|
|||
#### 2- Add Client Scripts |
|||
|
|||
2- In the `ConfigureServices` method of your web module add the following code to add the `signalr.js` and `notification-hub.js`. We'll add these packages in the next steps. |
|||
|
|||
 |
|||
|
|||
#### 3- Add Hub Endpoint |
|||
|
|||
Add the following code to add the notification hub endpoint in `OnApplicationInitialization` method: |
|||
|
|||
```csharp |
|||
app.UseEndpoints(endpoints => |
|||
{ |
|||
endpoints.MapHub<UiNotificationHub>("/notification-hub"); |
|||
}); |
|||
``` |
|||
|
|||
 |
|||
|
|||
### Implement Frontend |
|||
|
|||
We'll write the client-side code to be able to handle the SignalR response. |
|||
|
|||
#### 1- Add Notification Hub |
|||
|
|||
Add the following JavaScript class into your `Pages` folder in your Web project. We already added this script to our global scripts. |
|||
|
|||
[notification-hub.js](https://gist.github.com/ebicoglu/f7dc22cca2d353f8bf7f68a03e3395b8#file-notification-hub-js) |
|||
|
|||
 |
|||
|
|||
#### 2- Add SignalR NPM package |
|||
|
|||
Add [Microsoft.SignalR](https://www.npmjs.com/package/@microsoft/signalr) JavaScript package to the `package.json` which is located in your root folder of the Web project. After you add it, run `yarn` command in your Web directory to be able to install this package. |
|||
|
|||
 |
|||
|
|||
#### 3- Add resource Mapping |
|||
|
|||
We added SignalR to the `package.json` but it comes into your `node_modules` folder. We need to copy the related files to `wwwroot/libs` folder. To do this copy the content of the following file to your `abp.resourcemappings.js` file. It's in your root directory of Web folder. After you do this, go to your web directory and run `gulp` command. By doing this, it'll copy the related files into your `wwwroot/libs` folder. |
|||
|
|||
[abp.resourcemappings.js](https://gist.github.com/ebicoglu/f7dc22cca2d353f8bf7f68a03e3395b8#file-abp-resourcemapping-js) |
|||
|
|||
 |
|||
|
|||
#### 4- Usage |
|||
|
|||
We have completed the implementation part. Let's check if it's running... |
|||
We will show the current time which comes from server. |
|||
To do this replace the `Index.cshtml` and `Index.cshtml.cs` with the followings: |
|||
|
|||
- [Index.cshtml](https://gist.github.com/ebicoglu/f7dc22cca2d353f8bf7f68a03e3395b8#file-index-cshtml) |
|||
|
|||
- [Index.cshtml.cs](https://gist.github.com/ebicoglu/f7dc22cca2d353f8bf7f68a03e3395b8#file-index-cshtml-cs) |
|||
|
|||
|
|||
#### 5- See it in action |
|||
|
|||
Run your web project and in the Index page you'll see a button named as "Get Notification". Click the button and see the notification that comes from SignalR. This is a basic usage of SignalR notification system. You can implement it according to your own requirements. |
|||
|
|||
 |
|||
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 75 KiB |
@ -0,0 +1,37 @@ |
|||
# ABP Framework 4.x to 4.3 Migration Guide |
|||
|
|||
This version comes with some changes in the startup template, mostly related to Blazor UI. This document explains the breaking changes. However, **it is suggested to [compare the startup templates manually](Upgrading-Startup-Template.md) to see all the changes** and apply to your solution. |
|||
|
|||
## Common |
|||
|
|||
* `app.UseVirtualFiles()` has been marked as **obsolete**. Use `app.UseStaticFiles()` instead. ABP will handle the virtual file system integrated to the static files middleware. |
|||
|
|||
## Blazor UI |
|||
|
|||
Implemented the Blazor Server Side support with this release. It required some packages and namespaces arrangements. **Existing Blazor (WebAssembly) applications should done the changes explained in this section**. |
|||
|
|||
### Namespace Changes |
|||
|
|||
- `AbpBlazorMessageLocalizerHelper` -> moved to Volo.Abp.AspNetCore.Components.Web |
|||
- `AbpRouterOptions` -> moved to Volo.Abp.AspNetCore.Components.Web.Theming.Routing |
|||
- `AbpToolbarOptions` and `IToolbarContributor` -> moved to Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars |
|||
- `IAbpUtilsService` -> moved to Volo.Abp.AspNetCore.Components.Web |
|||
- `PageHeader` -> moved to `Volo.Abp.AspNetCore.Components.Web.Theming.Layout`. |
|||
|
|||
In practice, if your application is broken because of the `Volo.Abp.AspNetCore.Components.WebAssembly.*` namespace, please try to switch to `Volo.Abp.AspNetCore.Components.Web.*` namespace. |
|||
|
|||
Remember to change namespaces in the `_Imports.razor` files. |
|||
|
|||
### Package Changes |
|||
|
|||
No change on the framework packages, but **module packages are separated as Web Assembly & Server**; |
|||
|
|||
* Use `Volo.Abp.Identity.Blazor.WebAssembly` NuGet package instead of `Volo.Abp.Identity.Blazor` package. Also, change `AbpIdentityBlazorModule` usage to `AbpIdentityBlazorWebAssemblyModule` in the `[DependsOn]` attribute on your module class. |
|||
* Use `Volo.Abp.TenantManagement.Blazor.WebAssembly` NuGet package instead of `Volo.Abp.TenantManagement.Blazor` package. Also, change `AbpTenantManagementBlazorModule` usage to `AbpTenantManagementBlazorWebAssemblyModule` in the `[DependsOn]` attribute on your module class. |
|||
* Use `Volo.Abp.PermissionManagement.Blazor.WebAssembly` NuGet package instead of `Volo.Abp.PermissionManagement.Blazor` package. Also, change `AbpPermissionManagementBlazorModule` usage to `AbpPermissionManagementBlazorWebAssemblyModule` in the `[DependsOn]` attribute on your module class. |
|||
* Use `Volo.Abp.SettingManagement.Blazor.WebAssembly` NuGet package instead of `Volo.Abp.SettingManagement.Blazor` package. Also, change `AbpSettingManagementBlazorModule` usage to `AbpSettingManagementBlazorWebAssemblyModule` in the `[DependsOn]` attribute on your module class. |
|||
* Use `Volo.Abp.FeatureManagement.Blazor.WebAssembly` NuGet package instead of `Volo.Abp.FeatureManagement.Blazor` package. Also, change `AbpFeatureManagementBlazorModule` usage to `AbpFeatureManagementBlazorWebAssemblyModule` in the `[DependsOn]` attribute on your module class. |
|||
|
|||
### Other Changes |
|||
|
|||
* `EntityAction.RequiredPermission` has been marked as **obsolete**, because of performance reasons. It is suggested to use the `Visible` property by checking the permission/policy yourself and assigning to a variable. |
|||
@ -0,0 +1,88 @@ |
|||
# Upgrading the Startup Template |
|||
|
|||
Sometimes we introduce new features/changes that requires to **make changes in the startup template**. We already implement the changes in the startup template for new applications. However, in some cases you need to manually make some minor changes in your existing solution. |
|||
|
|||
This guide explains a suggested way of upgrading your solution templates, using the WinMerge tool. |
|||
|
|||
> See also the [Upgrading document](../Upgrading.md) for an overall progress of upgrading. This document focuses on upgrading the startup template. |
|||
|
|||
## 1) Create Dummy Solutions |
|||
|
|||
We will create two solutions to compare the changes; |
|||
|
|||
* The first solution is with your existing version |
|||
* The second solution is the version you want to upgrade |
|||
|
|||
Assume that we are upgrading from the version **4.2.2** to version **4.3.0-rc.1**. First, create two empty folders: |
|||
|
|||
 |
|||
|
|||
**A)** Open a command-line terminal inside the `4_2_2` folder and create a new solution with the version `4.2.2` using the ABP [CLI](../CLI.md) (install it if you haven't installed before). |
|||
|
|||
**Example:** |
|||
|
|||
````bash |
|||
abp new MyCompareApp -u blazor -v 4.2.2 |
|||
```` |
|||
|
|||
> Important: You need to create the solution with the exact configuration of your solution. If your application has Angular UI and MongoDB, you should use the same options here. |
|||
|
|||
**B)** Then open a command-line terminal inside the `4_3_0-rc1` folder and create a new solution with the version `4.3.0-rc.1` using the ABP [CLI](../CLI.md). |
|||
|
|||
**Example:** |
|||
|
|||
````bash |
|||
abp new MyCompareApp -u blazor -v 4.3.0-rc.1 |
|||
```` |
|||
|
|||
Now, we have the same application with different versions. |
|||
|
|||
## 2) Upgrade the Old Application |
|||
|
|||
If we compare two folders now, we will see unnecessary differences because of NuGet & NPM package differences. It is better to upgrade the old application to the new version before comparing them. |
|||
|
|||
Open a command-line terminal inside the `4_2_2` folder and type the following command: |
|||
|
|||
````bash |
|||
abp update -v 4.3.0-rc.1 |
|||
```` |
|||
|
|||
This will update all NuGet & NPM packages in your solution. We are ready to compare the folders to see the differences. |
|||
|
|||
## 3) Compare the Folders |
|||
|
|||
We will use the [WinMerge](https://winmerge.org/) utility for the comparison. So, please install it if it wasn't installed before. After installation, open the WinMerge application, select the the *File > Open* menu item, select the folders you want to compare: |
|||
|
|||
 |
|||
|
|||
Now, we can click to the *Compare* button to see all the differences. Here, a screenshot from the comparison: |
|||
|
|||
 |
|||
|
|||
See the *Comparison result* column or the yellow coloring to understand if two files or folder are different. It shows almost all folders are different. However, don't worry. Generally a few files will be different in a folder and a few lines will be different in a file comparison. |
|||
|
|||
For example, I select the `MyCompareApp.Blazor.csproj` to understand what's changed in this file: |
|||
|
|||
 |
|||
|
|||
We see that; |
|||
|
|||
* `Blazorise.Bootstrap` package is upgraded from version `0.9.3-preview6` to version `0.9.3.3`. |
|||
* `Blazorise.Icons.FontAwesome` package is upgraded from version `0.9.3-preview6` to version `0.9.3.3`. |
|||
* `Volo.Abp.Identity.Blazor` package is replaced by `Volo.Abp.Identity.Blazor.WebAssembly`. |
|||
* `Volo.Abp.TenantManagement.Blazor` package is replaced by `Volo.Abp.TenantManagement.Blazor.WebAssembly`. |
|||
* `Volo.Abp.SettingManagement.Blazor.WebAssembly` package is newly added. |
|||
|
|||
In this way, we can understand all the changes. |
|||
|
|||
## 4) Apply Changes on Your Solution |
|||
|
|||
Comparison result clearly shows the necessary changes should be done on upgrade. All you need to do is to apply the same changes in your own solution. |
|||
|
|||
> **It is important you first upgrade your own solution to the new version, using the `abp update` command. Then you can apply the manual changes** |
|||
|
|||
## Notes |
|||
|
|||
* Sometimes, you may find some changes are unnecessary for your own solution. You may deleted these or already customized. In these cases, you can just ignore it. |
|||
* If you do not upgrade your solution as described in this document, your application will continue to work as long as you implement the breaking changes documented in the [migration guide](Index.md). However, you may not get benefit of some new features those require changes in your solution files. |
|||
* Most of the times, there will be a few or no differences on the startup templates. When there are important changes, we write a note to the related migration guide, so you apply them manually. |
|||
@ -1,3 +0,0 @@ |
|||
# Blogging Module |
|||
|
|||
TODO |
|||
@ -1,3 +0,0 @@ |
|||
# Client Simulation Module |
|||
|
|||
TODO |
|||
@ -1,3 +0,0 @@ |
|||
# Users Module |
|||
|
|||
TODO |
|||
@ -0,0 +1,100 @@ |
|||
# Multi Lingual Entities |
|||
|
|||
ABP Framework defines two basic interfaces for Multi-Lingual entity definitions to provide a standard model for translating entities. |
|||
|
|||
## IHasMultiLingual |
|||
|
|||
`IHasMultiLingual<TTranslation>` interface is used to mark multi lingual entities. The entities marked with `IHasMultiLingual<TTranslation>` interface must define language-neutral information. The entities marked with `IHasMultiLingual<TTranslation>` contains a collection of Translations which contains language-dependent information. |
|||
|
|||
Example: |
|||
|
|||
```csharp |
|||
public class Product : Entity, IMultiLingualEntity<ProductTranslation> |
|||
{ |
|||
public decimal Price { get; set; } |
|||
|
|||
public ICollection<ProductTranslation> Translations { get; set; } |
|||
} |
|||
``` |
|||
|
|||
## IMultiLingualTranslation |
|||
|
|||
`IMultiLingualTranslation` interface is used to mark translation of a Multi-Lingual entity. The entities marked with `IMultiLingualTranslation` interface must define language dependent information. The entities marked with `IMultiLingualTranslation` contains Language field which contains a language code for the translation. |
|||
|
|||
Example: |
|||
|
|||
```csharp |
|||
public class ProductTranslation : Entity, IMultiLingualTranslation |
|||
{ |
|||
public string Name { get; set; } |
|||
|
|||
public string Language { get; set; } |
|||
} |
|||
``` |
|||
|
|||
## Map to DTO object |
|||
|
|||
ABP provdies the [Object To Object Mapping](Object-To-Object-Mapping.md) system, you can implement the `IObjectMapper<TSource, TDestination>` interface to map multi lingual entities to DTOs. |
|||
|
|||
Example: |
|||
|
|||
```csharp |
|||
public class MultiLingualProductObjectMapper : IObjectMapper<Product, ProductDto>, ITransientDependency |
|||
{ |
|||
private readonly IMultiLingualObjectManager _multiLingualObjectManager; |
|||
|
|||
public MultiLingualProductObjectMapper(IMultiLingualObjectManager multiLingualObjectManager) |
|||
{ |
|||
_multiLingualObjectManager = multiLingualObjectManager; |
|||
} |
|||
|
|||
public ProductDto Map(Product source) |
|||
{ |
|||
var translation = _multiLingualObjectManager.GetTranslation<Product, ProductDto>(source); |
|||
|
|||
return new ProductDto |
|||
{ |
|||
Price = source.Price, |
|||
Id = source.Id, |
|||
Name = translation?.Name |
|||
}; |
|||
} |
|||
|
|||
public ProductDto Map(Product source, ProductDto destination) |
|||
{ |
|||
return default; |
|||
} |
|||
} |
|||
|
|||
``` |
|||
|
|||
### AutoMapper integration |
|||
|
|||
ABP provides the `CreateMultiLingualMap` extension method for mapping multilingual entities to DTOs. |
|||
|
|||
Example: |
|||
|
|||
```csharp |
|||
public class ProductProfile : Profile |
|||
{ |
|||
public ProductProfile() |
|||
{ |
|||
var mapResult = this.CreateMultiLingualMap<Product, ProductTranslation, ProductDto>(); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
`CreateMultiLingualMap` extension method returns an object of type `CreateMultiLingualMapResult` which contains `EntityMap` and `TranslationMap` fields. These fields can be used to customize multi lingual mapping. |
|||
|
|||
Example: |
|||
|
|||
```csharp |
|||
this.CreateMultiLingualMap<Order, OrderTranslation, OrderListDto>(context) |
|||
.EntityMap.ForMember(dest => dest.ProductCount, opt => opt.MapFrom(src => src.Products.Count)); |
|||
``` |
|||
|
|||
## IMultiLingualObjectManager |
|||
|
|||
`IMultiLingualObjectManager` interface defines `GetTranslation` and `GetTranslationAsync` method to get the translation object of the entity. |
|||
|
|||
The default implementation of the `IMultiLingualObjectManager` interface finds the translation with selected UI language first. If there is no translation with selected UI language, then extension method searches for the default language setting (see [Setting](Settings.md)) and uses the translation in default language. If extension method couldn't find any translation in current UI language or default language, it uses one of the existing translations. |
|||
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 96 KiB |
@ -0,0 +1,125 @@ |
|||
# Angular UI Account Module |
|||
|
|||
Angular UI account module is available as of v4.3. It contains some pages (login, register, manage your profile, etc.). |
|||
|
|||
If you add the account module to your project; |
|||
|
|||
- "Manage your profile" link in the current user dropdown on the top bar will redirect the user to a page in the account module. |
|||
- You can switch the authentication flow to the resource owner password flow. |
|||
|
|||
|
|||
### Account Module Implementation |
|||
|
|||
Install the `@abp/ng.account` NPM package by running the below command: |
|||
|
|||
```bash |
|||
npm install @abp/ng.account@next |
|||
``` |
|||
|
|||
> Make sure v4.3-rc or higher version is installed. |
|||
|
|||
Open the `app.module.ts` and add `AccountConfigModule.forRoot()` to the imports array as shown below: |
|||
|
|||
```js |
|||
// app.module.ts |
|||
|
|||
import { AccountConfigModule } from '@abp/ng.account/config'; |
|||
//... |
|||
|
|||
@NgModule({ |
|||
imports: [ |
|||
//... |
|||
AccountConfigModule.forRoot() |
|||
], |
|||
//... |
|||
}) |
|||
export class AppModule {} |
|||
``` |
|||
|
|||
Open the `app-routing.module.ts` and add the `account` route to `routes` array as follows: |
|||
|
|||
```js |
|||
// app-routing.module.ts |
|||
const routes: Routes = [ |
|||
//... |
|||
{ |
|||
path: 'account', |
|||
loadChildren: () => import('@abp/ng.account').then(m => m.AccountModule.forLazy()), |
|||
}, |
|||
//... |
|||
export class AppRoutingModule {} |
|||
``` |
|||
|
|||
### Account Public Module Implementation for Commercial Templates |
|||
|
|||
The pro startup template comes with `@volo/abp.ng.account` package. You should update the package version to v4.3-rc or higher version. The package can be updated by running the following command: |
|||
|
|||
```bash |
|||
npm install @volo/abp.ng.account@next |
|||
``` |
|||
> Make sure v4.3-rc or higher version is installed. |
|||
|
|||
Open the `app.module.ts` and add `AccountPublicConfigModule.forRoot()` to the imports array as shown below: |
|||
|
|||
```js |
|||
// app.module.ts |
|||
|
|||
import { AccountPublicConfigModule } from '@volo/abp.ng.account/public/config'; |
|||
//... |
|||
|
|||
@NgModule({ |
|||
imports: [ |
|||
//... |
|||
AccountPublicConfigModule.forRoot() |
|||
], |
|||
//... |
|||
}) |
|||
export class AppModule {} |
|||
``` |
|||
|
|||
Open the `app-routing.module.ts` and add the `account` route to `routes` array as follows: |
|||
|
|||
```js |
|||
// app-routing.module.ts |
|||
const routes: Routes = [ |
|||
//... |
|||
{ |
|||
path: 'account', |
|||
loadChildren: () => import('@volo/abp.ng.account/public').then(m => m.AccountPublicModule.forLazy()), |
|||
}, |
|||
//... |
|||
export class AppRoutingModule {} |
|||
``` |
|||
|
|||
### Manage Profile Page |
|||
|
|||
Before v4.3, the "Manage Your Profile" link in the current user dropdown on the top bar redirected the user to MVC's profile management page. As of v4.3, if you added the account module to your project, the same link will land on a page in the Angular UI account module instead. |
|||
|
|||
### My Security Logs Page [COMMERCIAL] |
|||
|
|||
Before v4.3, the "My Security Logs" link in the current user dropdown on the top bar redirected the user to MVC's my security logs page. As of v4.3, if you added the account module to your project, the same link will land on a page in the Angular UI account public module instead. |
|||
|
|||
### Resource Owner Password Flow |
|||
|
|||
OAuth is preconfigured as authorization code flow in Angular application templates by default. If you added the account module to your project, you can switch the flow to resource owner password flow by changing the OAuth configuration in the _environment.ts_ files as shown below: |
|||
|
|||
```js |
|||
import { Config } from '@abp/ng.core'; |
|||
|
|||
export const environment = { |
|||
// other options removed for sake of brevity |
|||
|
|||
oAuthConfig: { |
|||
issuer: 'https://localhost:44305', // IdentityServer url |
|||
clientId: 'MyProjectName_App', |
|||
dummyClientSecret: '1q2w3e*', |
|||
scope: 'offline_access MyProjectName', |
|||
}, |
|||
|
|||
// other options removed for sake of brevity |
|||
} as Config.Environment; |
|||
``` |
|||
|
|||
> Note: The resource owner password flow does not support the two-factor authentication for some technical reasons. |
|||
|
|||
See the [Authorization in Angular UI](./Authorization.md) document for more details. |
|||
@ -0,0 +1,218 @@ |
|||
# Page Component |
|||
|
|||
ABP provides a component that wraps your content with some built-in components to reduce the amount of code you need to write. |
|||
|
|||
If the template of a component looks as follows, you can utilize the `abp-page` component. |
|||
|
|||
Let's look at the following example without `abp-page` component. |
|||
|
|||
`dashboard.component.ts` |
|||
|
|||
```html |
|||
<div class="row entry-row"> |
|||
<div class="col-auto"> |
|||
<h1 class="content-header-title">{{ '::Dashboard' | abpLocalization }}</h1> |
|||
</div> |
|||
<div id="breadcrumb" class="col-lg-auto pl-lg-0"> |
|||
<abp-breadcrumb></abp-breadcrumb> |
|||
</div> |
|||
<div class="col"> |
|||
<abp-page-toolbar [record]="data"></abp-page-toolbar> |
|||
</div> |
|||
</div> |
|||
|
|||
<div id="dashboard-id"> |
|||
<!-- dashboard content here --> |
|||
</div> |
|||
``` |
|||
|
|||
## Page Parts |
|||
|
|||
PageComponent divides the template shown above into three parts, `title`, `breadcrumb`, `toolbar`. Each can be configured separately. There, also, is an enum exported from the package that describes each part. |
|||
|
|||
```javascript |
|||
export enum PageParts { |
|||
title = 'PageTitleContainerComponent', |
|||
breadcrumb = 'PageBreadcrumbContainerComponent', |
|||
toolbar = 'PageToolbarContainerComponent', |
|||
} |
|||
|
|||
// You can import this enum from -> import { PageParts } from '@abp/ng.components/page'; |
|||
``` |
|||
|
|||
## Usage |
|||
|
|||
Firstly, you need to import `PageModule` from `@abp/ng.components/page` as follows: |
|||
|
|||
`dashboard.module.ts` |
|||
|
|||
```javascript |
|||
import { PageModule } from '@abp/ng.components/page'; |
|||
import { DashboardComponent } from './dashboard.component'; |
|||
|
|||
@NgModule({ |
|||
declarations: [DashboardComponent], |
|||
imports: [PageModule] |
|||
}) |
|||
export class DashboardModule {} |
|||
``` |
|||
|
|||
And change the template of `dashboard.component.ts` to the following: |
|||
|
|||
```html |
|||
<abp-page [title]="'::Dashboard' | abpLocalization" [toolbar]="data"> |
|||
<div id="dashboard-id"> |
|||
<!-- .... --> |
|||
</div> |
|||
</abp-page> |
|||
``` |
|||
|
|||
## Inputs |
|||
|
|||
* title: `string`: Will be be rendered within `h1.content-header-title`. If not provided, the parent `div` will not be rendered |
|||
* breadcrumb: `boolean`: Determines whether to render `abp-breadcrumb`. Default is `true`. |
|||
* toolbar: `any`: Will be passed into `abp-page-toolbar` component through `record` input. If your page does not contain `abp-page-toolbar`, you can simply omit this field. |
|||
|
|||
## Overriding template |
|||
|
|||
If you need to replace the template of any part, you can use the following sub-components. |
|||
|
|||
```html |
|||
<abp-page> |
|||
<abp-page-title-container> |
|||
<div class="col"> |
|||
<h2>Custom Title</h2> |
|||
</div> |
|||
</abp-page-title-container> |
|||
|
|||
<abp-page-breacrumb-container> |
|||
<div class="col"> |
|||
<my-breadcrumb></my-breadcrumb> |
|||
</div> |
|||
</abp-page-breacrumb-container> |
|||
|
|||
<abp-page-toolbar-container> |
|||
<div class="col"> |
|||
<!-- ... --> |
|||
</div> |
|||
</abp-page-toolbar-container> |
|||
</abp-page> |
|||
``` |
|||
|
|||
You do not have to provide them all. You can just use which one you need to replace. These components have priority over the inputs declared above. If you use these components, you can omit the inputs. |
|||
|
|||
## PagePartDirective |
|||
|
|||
`PageModule` provides a structural directive that is used internally within `PageComponent` and can also be used externally. |
|||
|
|||
`PageComponent` employs this directive internally as follows: |
|||
|
|||
```html |
|||
<div class="col-lg-auto pl-lg-0" *abpPagePart="pageParts.breadcrumb"> |
|||
<abp-breadcrumb></abp-breadcrumb> |
|||
</div> |
|||
``` |
|||
|
|||
It also can take a context input as follows: |
|||
|
|||
```html |
|||
<div class="col" *abpPagePart="pageParts.toolbar; context: toolbarData"> |
|||
<abp-page-toolbar [record]="toolbarData"></abp-page-toolbar> |
|||
</div> |
|||
``` |
|||
|
|||
Its render strategy can be provided through Angular's Dependency Injection system. |
|||
|
|||
It expects a service through the `PAGE_RENDER_STRATEGY` injection token that implements the following interface. |
|||
|
|||
```javascript |
|||
interface PageRenderStrategy { |
|||
shouldRender(type?: string): boolean | Observable<boolean>; |
|||
onInit?(type?: string, injector?: Injector, context?: any): void; |
|||
onDestroy?(type?: string, injector?: Injector, context?: any): void; |
|||
onContextUpdate?(change?: SimpleChange): void; |
|||
} |
|||
``` |
|||
|
|||
* `shouldRender` (required): It takes a string input named `type` and expects a `boolean` or `Observable<boolean>` in return. |
|||
* `onInit` (optional): Will be called when the directive is initiated. Three inputs will be passed into this method. |
|||
* `type`: type of the page part |
|||
* `injector`: injector of the directive which could be used to retrieve anything from directive's DI tree. |
|||
* `context`: whatever context is available at the initialization phase. |
|||
* `onDestroy` (optional): Will be called when the directive is destroyed. The parameters are the same with `onInit` |
|||
* `onContextUpdate` (optional): Will be called when the context is updated. |
|||
* `change`: changes of the `context` will be passed through this method. |
|||
|
|||
Let's see everything in action. |
|||
|
|||
```javascript |
|||
import { |
|||
PageModule, |
|||
PageRenderStrategy, |
|||
PageParts, |
|||
PAGE_RENDER_STRATEGY |
|||
} from '@abp/ng.components/page'; |
|||
|
|||
@Injectable() |
|||
export class MyPageRenderStrategy implements PageRenderStrategy { |
|||
shouldRender(type: string) { |
|||
// meaning everything but breadcrumb and custom-part will be rendered |
|||
return type !== PageParts.breadcrumb && type !== 'custom-part'; |
|||
} |
|||
|
|||
/** |
|||
* shouldRender can also return an Observable<boolean> which means |
|||
* an async service can be used within. |
|||
|
|||
constructor(private service: SomeAsyncService) {} |
|||
|
|||
shouldRender(type: string) { |
|||
return this.service.checkTypeAsync(type).pipe(map(val => val.isTrue())); |
|||
} |
|||
*/ |
|||
|
|||
onInit(type: string, injector: Injector, context: any) { |
|||
// this method will be called in ngOnInit of the directive |
|||
} |
|||
|
|||
onDestroy(type: string, injector: Injector, context: any) { |
|||
// this method will be called in ngOnDestroy of the directive |
|||
} |
|||
|
|||
onContextUpdate?(change?: SimpleChange) { |
|||
// this method will be called everytime context is updated within the directive |
|||
} |
|||
} |
|||
|
|||
@Component({ |
|||
selector: 'app-dashboard', |
|||
template: ` |
|||
<abp-page [title]="'::Dashboard' | abpLocalization"> |
|||
<abp-page-toolbar-container> |
|||
<button>New Dashboard</button> |
|||
</abp-page-toolbar-container> |
|||
|
|||
<div class="dashboard-content"> |
|||
<h3 *abpPagePart="'custom-part'"> Inner Title </h3> |
|||
</div> |
|||
</abp-page> |
|||
` |
|||
}) |
|||
export class DashboardComponent {} |
|||
|
|||
@NgModule({ |
|||
imports: [PageModule], |
|||
declarations: [DashboardComponent], |
|||
providers: [ |
|||
{ |
|||
provide: PAGE_RENDER_STRATEGY, |
|||
useClass: MyPageRenderStrategy, |
|||
} |
|||
] |
|||
}) |
|||
export class DashboardModule {} |
|||
``` |
|||
|
|||
## See Also |
|||
|
|||
- [Page Toolbar Extensions for Angular UI](./Page-Page-Toolbar-Extensions.md) |
|||
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 984 B |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 60 KiB |