Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/abpframework/abp into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ebicoglu committed Jan 7, 2022
2 parents b8eafdd + 9bef5a1 commit 11b5aec
Show file tree
Hide file tree
Showing 81 changed files with 2,578 additions and 290 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
dotnet-version: 6.0.100

- name: Build All
run: .\build-all.ps1
run: .\build-all.ps1 -f
working-directory: .\build
shell: powershell

- name: Test All
run: .\test-all.ps1
run: .\test-all.ps1 -f
working-directory: .\build
shell: powershell

Expand Down

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions docs/en/Background-Workers-Hangfire.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,33 @@ public class MyLogWorker : HangfireBackgroundWorkerBase

> You can directly implement the `IHangfireBackgroundWorker`, but `HangfireBackgroundWorkerBase` provides some useful properties like Logger.
### UnitOfWork

For use with `UnitOfWorkAttribute`, you need to define an interface for worker:

```csharp
public interface IMyLogWorker : IHangfireBackgroundWorker
{
}

[ExposeServices(typeof(IMyLogWorker))]
public class MyLogWorker : HangfireBackgroundWorkerBase, IMyLogWorker
{
public MyLogWorker()
{
RecurringJobId = nameof(MyLogWorker);
CronExpression = Cron.Daily();
}

[UnitOfWork]
public override Task DoWorkAsync()
{
Logger.LogInformation("Executed MyLogWorker..!");
return Task.CompletedTask;
}
}
```

## Register BackgroundWorkerManager

After creating a background worker class, you should add it to the `IBackgroundWorkerManager`. The most common place is the `OnApplicationInitialization` method of your module class:
Expand All @@ -78,6 +105,9 @@ public class MyModule : AbpModule
ApplicationInitializationContext context)
{
context.AddBackgroundWorker<MyLogWorker>();

//If the interface is defined
//context.AddBackgroundWorker<IMyLogWorker>();
}
}
````
Expand Down
9 changes: 4 additions & 5 deletions docs/en/Modules/Cms-Kit/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ Click to a feature to understand and learn how to use it.
All features are individually usable. If you disable a feature, it completely disappears from your application, even from the database tables, by the help of the [Global Features](../../Global-Features.md) system.

## Pre Requirements
- This module depends on [BlobStoring](../../Blob-Storing.md) module for keeping media content.
> Make sure `BlobStoring` module is installed and at leats one provider is configured properly. For more information, check the [documentation](../../Blob-Storing.md).
CMS Kit uses [distributed cache](../../Caching.md) for responding faster.

- CMS Kit uses [distributed cache](../../Caching.md) for responding faster.
> Using a distributed cache, such as [Redis](../../Redis-Cache.md), is highly recommended for data consistency in distributed/clustered deployments.
## How to Install

> This module is depends on [BlobStoring](../../Blob-Storing.md) module, please install `BlobStoring` module first and add a provider. For more information, check the [documentation](../../Blob-Storing.md).
[ABP CLI](../../CLI.md) allows installing a module to a solution using the `add-module` command. You can install the CMS Kit module in a command-line terminal with the following command:

```bash
Expand Down Expand Up @@ -77,4 +76,4 @@ All tables/collections use the `Cms` prefix by default. Set static properties on

This module uses `CmsKit` for the connection string name. If you don't define a connection string with this name, it fallbacks to the `Default` connection string.

See the [connection strings](https://docs.abp.io/en/abp/latest/Connection-Strings) documentation for details.
See the [connection strings](https://docs.abp.io/en/abp/latest/Connection-Strings) documentation for details.
86 changes: 43 additions & 43 deletions docs/en/Tutorials/Part-3.md

Large diffs are not rendered by default.

25 changes: 11 additions & 14 deletions docs/zh-Hans/Autofac-Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,23 @@ namespace MyCompany.MyProject

### ASP.NET Core 应用程序

如下所示, 在 **Startup.cs** 文件中调用 `UseAutofac()`:
如下所示, 在 **Program.cs** 文件中调用 `UseAutofac()`:

````csharp
public class Startup
public class Program
{
public IServiceProvider ConfigureServices(IServiceCollection services)
public static int Main(string[] args)
{
services.AddApplication<MyWebModule>(options =>
{
//Integrate Autofac!
options.UseAutofac();
});

return services.BuildServiceProviderFromFactory();
CreateHostBuilder(args).Build().Run();
}

public void Configure(IApplicationBuilder app)
{
app.InitializeApplication();
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac(); //Integrate Autofac!
}
````

Expand Down
30 changes: 30 additions & 0 deletions docs/zh-Hans/Background-Workers-Hangfire.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,33 @@ public class MyLogWorker : HangfireBackgroundWorkerBase

> 你可以直接实现 `IHangfireBackgroundWorker`, 但是 `HangfireBackgroundWorkerBase` 提供了一些有用的属性,例如 `Logger`.
### UnitOfWork

使用 `UnitOfWorkAttribute` 你需要为工作者定义一个接口:

```csharp
public interface IMyLogWorker : IHangfireBackgroundWorker
{
}

[ExposeServices(typeof(IMyLogWorker))]
public class MyLogWorker : HangfireBackgroundWorkerBase, IMyLogWorker
{
public MyLogWorker()
{
RecurringJobId = nameof(MyLogWorker);
CronExpression = Cron.Daily();
}

[UnitOfWork]
public override Task DoWorkAsync()
{
Logger.LogInformation("Executed MyLogWorker..!");
return Task.CompletedTask;
}
}
```

## 注册到后台工作者管理器

创建一个后台工作者后, 你应该添加到 `IBackgroundWorkerManager`, 最常用的地方是在你模块类的 `OnApplicationInitialization` 方法中:
Expand All @@ -79,6 +106,9 @@ public class MyModule : AbpModule
ApplicationInitializationContext context)
{
context.AddBackgroundWorker<MyLogWorker>();

//如果定义了接口
//context.AddBackgroundWorker<IMyLogWorker>();
}
}
````
Expand Down
3 changes: 0 additions & 3 deletions docs/zh-Hans/Modules/Cms-Kit.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/zh-Hans/Modules/Cms-Kit/Blogging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CMS Kit: Blogging

TODO...
3 changes: 3 additions & 0 deletions docs/zh-Hans/Modules/Cms-Kit/Comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CMS Kit: Comments

TODO...
79 changes: 79 additions & 0 deletions docs/zh-Hans/Modules/Cms-Kit/Index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 内容管理系统套件模块

此模块为您的应用程序提供内容管理系统 (Content Management System, CMS) 功能. 它提供 **核心构建块** 和完整工作的 **子系统**, 以创建启用 CMS 功能的您自己的网站, 或出于任何目的使用网站中的构建块.

> **此模块目前仅适用于 MVC / Razor 页面 UI**. 虽然没有官方的 Blazor 软件包, 但它也可以在 Blazor 服务器 UI 中工作, 因为实际上 Blazor 服务器 UI 实际上是一个运行在 ASP.NET Core MVC / Razor 页面应用程序的混合型应用程序.
目前提供以下功能:

* 提供 [**页面**](Pages.md) 管理系统来管理具有动态 URL 的动态页面.
* 提供 [**博客**](Blogging.md) 系统来创建发表具有多种博客支持的博客文章.
* 提供 [**标签**](Tags.md) 系统来标记任何资源, 如博客文章.
* 提供 [**评论**](Comments.md) 系统来添加对任何资源的评论功能, 如博客文章或产品评价页面.
* 提供 [**反应**](Reactions.md) 系统来添加对任何资源的反应 (表情符号) 功能, 如博客文章或评论.
* 提供 [**评级**](Ratings.md) 系统来添加对任何资源的评级功能.
* 提供 [**菜单**](Menus.md) 系统来动态管理公共菜单.

点击功能以了解和学习如何去使用它.

所有功能均可单独使用. 如果你禁用了一个功能, 则在 [全局功能](../../Global-Features.md) 系统的帮助下, 该功能会从你的应用程序甚至数据库表中完全消失.

## 预备要求
- 此模块依赖于 [Blob 存储](../../Blob-Storing.md) 模块来保存媒体内容.
> 确保 `BlobStoring` 模块已安装并至少正确地配置了一个提供程序. 请查阅 [文档](../../Blob-Storing.md) 了解更多信息.
- CMS Kit 使用 [分布式缓存](../../Caching.md) 来提高响应速度.
> 强烈建议在分布式/集群部署中为实现数据一致性使用分布式缓存, 如 [Redis](../../Redis-Cache.md).
## 如何安装

可以使用 [ABP CLI](../../CLI.md)`add-module` 命令为解决方案安装模块. 您可以使用以下命令在命令行中安装 CMS Kit 模块:

```bash
abp add-module Volo.CmsKit
```

> 默认情况下, Cms-Kit `GlobalFeature` 被禁用. 因此初始迁移将为空. 所以, 当你使用 EF Core 安装时,你可以添加 `--skip-db-migrations` 命令来跳过迁移. 启用 Cms-Kit 全局功能后, 请添加新的迁移.
安装过程完成后, 在您的解决方案 `Domain.Shared` 项目中打开 `GlobalFeatureConfigurator` 类, 并将以下代码写入 `Configure` 方法中, 以启用 CMS Kit 模块的全部功能.

```csharp
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit =>
{
cmsKit.EnableAll();
});
```

你可能更愿意逐个启用这些功能, 而不是启用全部功能. 以下示例仅启用了 [标签](Tags.md)[评论](Comments.md) 功能:

````csharp
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit =>
{
cmsKit.Tags.Enable();
cmsKit.Comments.Enable();
});
````

> 如果你使用 EF Core, 不要忘记添加一个新的迁移并更新你的数据库.
## 软件包

此模块遵循 [模块开发最佳实践指南](https://docs.abp.io/zh-Hans/abp/latest/Best-Practices/Index), 由多个 NuGet 和 NPM 软件包组成. 如果你想了解软件包及其之间的关系, 请参阅指南.

CMS Kit 软件包专为各种使用场景而设计. 如果您查阅了 [CMS Kit 软件包](https://www.nuget.org/packages?q=Volo.CmsKit) 您将看到一些有 `Admin``Public` 后缀的软件包. 该模块有两个应用程序层, 原因是他们可能被用于不同类型的应用程序. 这些应用程序层仅使用一个领域层.

- `Volo.CmsKit.Admin.*` 软件包包括管理员 (后台) 应用程序所必须的功能.
- `Volo.CmsKit.Public.*` 软件包包括被用于用户阅读博客文章和发表评论的公共网站上的功能.
- `Volo.CmsKit.*` (不带 Admin/Public 后缀) 软件包称为统一包. 统一包分别是添加 Admin 和 Public (相关层的) 软件包的快照. 如果您有一个用于管理和公共网站的单应用程序, 您可以使用这些软件包.

## 内部结构

### 表/集合 前缀&架构

所有表/集合使用 `Cms` 作为默认前缀. 如果需要更改表的前缀或者设置一个架构名称 (如果你的数据库提供程序支持), 请在 `CmsKitDbProperties` 类中设置静态属性.

### 连接字符串

此模块使用 `CmsKit` 作为连接字符串的名称. 如果您未使用此名称定义连接字符串, 它将回退为 `Default` 连接字符串.

有关详细信息, 请参阅 [连接字符串](https://docs.abp.io/en/abp/latest/Connection-Strings) 文档.
3 changes: 3 additions & 0 deletions docs/zh-Hans/Modules/Cms-Kit/Menus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CMS Kit: Pages

TODO...
3 changes: 3 additions & 0 deletions docs/zh-Hans/Modules/Cms-Kit/Pages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CMS Kit: Pages

TODO...
3 changes: 3 additions & 0 deletions docs/zh-Hans/Modules/Cms-Kit/Ratings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Rating System

TODO...
3 changes: 3 additions & 0 deletions docs/zh-Hans/Modules/Cms-Kit/Reactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Reaction System

TODO...
3 changes: 3 additions & 0 deletions docs/zh-Hans/Modules/Cms-Kit/Tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Tag Management

TODO...
2 changes: 1 addition & 1 deletion docs/zh-Hans/Modules/Identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## 如何安装

当你使用 ABP 框架 [创建一个新的解决方案](https://abp.io/get-started)此模块将被预安装作为 NuGet/NPM 包)。你可以继续用其作为包并轻松地获取更新也可以将其源代码包含在解决方案中(请参阅 `get-source` [CLI](../CLI.md))以开发自定义模块
当你使用 ABP 框架 [创建一个新的解决方案](https://abp.io/get-started), 此模块将被预安装 (作为 NuGet/NPM 包). 你可以继续用其作为包并轻松地获取更新, 也可以将其源代码包含在解决方案中(请参阅 `get-source` [CLI](../CLI.md))以开发自定义模块.

### 源代码

Expand Down
2 changes: 1 addition & 1 deletion docs/zh-Hans/Modules/Tenant-Management.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## 如何安装

当你使用 ABP 框架 [创建一个新的解决方案](https://abp.io/get-started)此模块将被预安装作为 NuGet/NPM 包)。你可以继续用其作为包并轻松地获取更新也可以将其源代码包含在解决方案中(请参阅 `get-source` [CLI](../CLI.md))以开发自定义模块
当你使用 ABP 框架 [创建一个新的解决方案](https://abp.io/get-started), 此模块将被预安装(作为 NuGet/NPM 包). 你可以继续用其作为包并轻松地获取更新, 也可以将其源代码包含在解决方案中(请参阅 `get-source` [CLI](../CLI.md))以开发自定义模块.

### 源代码

Expand Down
Loading

0 comments on commit 11b5aec

Please sign in to comment.