Browse Source

Merge branch 'dev' of https://github.com/abpframework/abp into test/theme-shared

pull/2069/head
mehmet-erim 7 years ago
parent
commit
865d0b5fd7
  1. 7
      abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
  2. 7
      abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json
  3. 2
      docs/en/Getting-Started-AspNetCore-Application.md
  4. 15
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  5. 8
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs
  6. 8
      framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs
  7. 4
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserLookupAppService.cs
  8. 1
      samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerDataSeeder.cs
  9. 2
      samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs
  10. 1
      samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs
  11. 2
      samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj
  12. 6
      samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs
  13. 2
      samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj
  14. 6
      samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs
  15. 2
      samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj
  16. 6
      samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs

7
abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json

@ -29,15 +29,15 @@
"Authorization": "Authorization", "Authorization": "Authorization",
"AuthorizationExplanation": "Advanced authorization with user, role and fine-grained permission system. Built on the Microsoft Identity library.", "AuthorizationExplanation": "Advanced authorization with user, role and fine-grained permission system. Built on the Microsoft Identity library.",
"MultiTenancy": "Multi-Tenancy", "MultiTenancy": "Multi-Tenancy",
"MultiTenancyExplanation": "SaaS applications made easy! Integrated multi-tenancy from database to UI.", "MultiTenancyExplanationShort": "SaaS applications made easy! Integrated multi-tenancy from database to UI.",
"CrossCuttingConcerns": "Cross Cutting Concerns", "CrossCuttingConcerns": "Cross Cutting Concerns",
"CrossCuttingConcernsExplanation": "Complete infrastructure for authorization, validation, exception handling, caching, audit logging, transaction management and so on.", "CrossCuttingConcernsExplanationShort": "Complete infrastructure for authorization, validation, exception handling, caching, audit logging, transaction management and so on.",
"BuiltInBundlingMinification": "Built-In Bundling & Minification", "BuiltInBundlingMinification": "Built-In Bundling & Minification",
"BuiltInBundlingMinificationExplanation": "Stop to use external tools for bundling & minification. ABP offers a simpler, dynamic, powerful, modular and built-in way!", "BuiltInBundlingMinificationExplanation": "Stop to use external tools for bundling & minification. ABP offers a simpler, dynamic, powerful, modular and built-in way!",
"VirtualFileSystem": "Virtual File System", "VirtualFileSystem": "Virtual File System",
"VirtualFileSystemExplanation": "Embed views, scripts, styles, images... into packages/libraries and reuse in different applications.", "VirtualFileSystemExplanation": "Embed views, scripts, styles, images... into packages/libraries and reuse in different applications.",
"Theming": "Theming", "Theming": "Theming",
"ThemingExplanation": "Use and customize the bootstrap-based standard UI theme or create your own one.", "ThemingExplanationShort": "Use and customize the bootstrap-based standard UI theme or create your own one.",
"BootstrapTagHelpersDynamicForms": "Bootstrap Tag Helpers & Dynamic Forms", "BootstrapTagHelpersDynamicForms": "Bootstrap Tag Helpers & Dynamic Forms",
"BootstrapTagHelpersDynamicFormsExplanation": "Built-in background job system that can be integrated to Hangfire, RabbitMQ or any tool you like.", //TODO explanation doesn't match. "BootstrapTagHelpersDynamicFormsExplanation": "Built-in background job system that can be integrated to Hangfire, RabbitMQ or any tool you like.", //TODO explanation doesn't match.
"HTTPAPIsDynamicProxies": "HTTP APIs & Dynamic Proxies", "HTTPAPIsDynamicProxies": "HTTP APIs & Dynamic Proxies",
@ -100,7 +100,6 @@
"DistributedEventBus": "Distributed Event Bus", "DistributedEventBus": "Distributed Event Bus",
"DistributedEventBusWithRabbitMQIntegration": "Distributed Event Bus with RabbitMQ Integration", "DistributedEventBusWithRabbitMQIntegration": "Distributed Event Bus with RabbitMQ Integration",
"TestInfrastructure": "Test Infrastructure", "TestInfrastructure": "Test Infrastructure",
"AuditLogging": "Audit Logging",
"AuditLoggingEntityHistories": "Audit Logging & Entity Histories", "AuditLoggingEntityHistories": "Audit Logging & Entity Histories",
"ObjectToObjectMapping": "Object to Object Mapping", "ObjectToObjectMapping": "Object to Object Mapping",
"EmailSMSAbstractions": "Email & SMS Abstractions", "EmailSMSAbstractions": "Email & SMS Abstractions",

7
abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json

@ -29,15 +29,15 @@
"Authorization": "授权", "Authorization": "授权",
"AuthorizationExplanation": "具有用户,角色和细粒度权限系统的高级授权. 建立在Microsoft Identity库上.", "AuthorizationExplanation": "具有用户,角色和细粒度权限系统的高级授权. 建立在Microsoft Identity库上.",
"MultiTenancy": "多租户", "MultiTenancy": "多租户",
"MultiTenancyExplanation": "SaaS应用程序变得简单! 从数据库到UI的多租户集成.", "MultiTenancyExplanationShort": "SaaS应用程序变得简单! 从数据库到UI的多租户集成.",
"CrossCuttingConcerns": "横切关注点", "CrossCuttingConcerns": "横切关注点",
"CrossCuttingConcernsExplanation": "完整的基础架构,用于授权,验证,异常处理,缓存,审计日志记录,事务管理等.", "CrossCuttingConcernsExplanationShort": "完整的基础架构,用于授权,验证,异常处理,缓存,审计日志记录,事务管理等.",
"BuiltInBundlingMinification": "内置Bundling & Minification", "BuiltInBundlingMinification": "内置Bundling & Minification",
"BuiltInBundlingMinificationExplanation": "无需使用外部工具进行Bundling & Minification. ABP提供了一种更简单,动态,功能强大,模块化和内置的方式!", "BuiltInBundlingMinificationExplanation": "无需使用外部工具进行Bundling & Minification. ABP提供了一种更简单,动态,功能强大,模块化和内置的方式!",
"VirtualFileSystem": "虚拟文件系统", "VirtualFileSystem": "虚拟文件系统",
"VirtualFileSystemExplanation": "将视图,脚本,样式,图像...嵌入到包/库中,并在不同的应用程序中重复使用.", "VirtualFileSystemExplanation": "将视图,脚本,样式,图像...嵌入到包/库中,并在不同的应用程序中重复使用.",
"Theming": "主题", "Theming": "主题",
"ThemingExplanation": "使用和定制基于bootstrap的标准UI主题,或创建自己的主题.", "ThemingExplanationShort": "使用和定制基于bootstrap的标准UI主题,或创建自己的主题.",
"BootstrapTagHelpersDynamicForms": "Bootstrap Tag Helpers和动态表单", "BootstrapTagHelpersDynamicForms": "Bootstrap Tag Helpers和动态表单",
"BootstrapTagHelpersDynamicFormsExplanation": "内置的后台作业系统可以集成到Hangfire,RabbitMQ或您喜欢的任何工具中.", //TODO explanation doesn't match. "BootstrapTagHelpersDynamicFormsExplanation": "内置的后台作业系统可以集成到Hangfire,RabbitMQ或您喜欢的任何工具中.", //TODO explanation doesn't match.
"HTTPAPIsDynamicProxies": "HTTP APIs和动态代理", "HTTPAPIsDynamicProxies": "HTTP APIs和动态代理",
@ -100,7 +100,6 @@
"DistributedEventBus": "分布式事件总线", "DistributedEventBus": "分布式事件总线",
"DistributedEventBusWithRabbitMQIntegration": "具有RabbitMQ集成的分布式事件总线", "DistributedEventBusWithRabbitMQIntegration": "具有RabbitMQ集成的分布式事件总线",
"TestInfrastructure": "测试基础设施", "TestInfrastructure": "测试基础设施",
"AuditLogging": "审计日志",
"AuditLoggingEntityHistories": "审计日志和实体历史", "AuditLoggingEntityHistories": "审计日志和实体历史",
"ObjectToObjectMapping": "对象映射", "ObjectToObjectMapping": "对象映射",
"EmailSMSAbstractions": "电子邮件和短信抽象", "EmailSMSAbstractions": "电子邮件和短信抽象",

2
docs/en/Getting-Started-AspNetCore-Application.md

@ -14,7 +14,7 @@ This tutorial explains how to start ABP from scratch with minimal dependencies.
3. Press to the create button: 3. Press to the create button:
![create-aspnet-core-application](D:\Github\abp\docs\en\images\create-aspnet-core-application.png) ![create-aspnet-core-application](images/create-aspnet-core-application.png)
## Install Volo.Abp.AspNetCore.Mvc Package ## Install Volo.Abp.AspNetCore.Mvc Package

15
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -71,18 +71,13 @@ namespace Volo.Abp.Cli.Commands
} }
var outputFolder = commandLineArgs.Options.GetOrNull(Options.OutputFolder.Short, Options.OutputFolder.Long); var outputFolder = commandLineArgs.Options.GetOrNull(Options.OutputFolder.Short, Options.OutputFolder.Long);
if (outputFolder != null)
{
if (!Directory.Exists(outputFolder))
{
Directory.CreateDirectory(outputFolder);
}
outputFolder = Path.GetFullPath(outputFolder); outputFolder = Path.Combine(outputFolder != null ? Path.GetFullPath(outputFolder) : Directory.GetCurrentDirectory(),
} SolutionName.Parse(commandLineArgs.Target).FullName);
else
if (!Directory.Exists(outputFolder))
{ {
outputFolder = Directory.GetCurrentDirectory(); Directory.CreateDirectory(outputFolder);
} }
Logger.LogInformation("Output folder: " + outputFolder); Logger.LogInformation("Output folder: " + outputFolder);

8
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs

@ -224,15 +224,15 @@ namespace Volo.Abp.EntityFrameworkCore
return; return;
} }
var localEvents = generatesDomainEventsEntity.GetLocalEvents().ToArray(); var localEvents = generatesDomainEventsEntity.GetLocalEvents()?.ToArray();
if (localEvents.Any()) if (localEvents != null && localEvents.Any())
{ {
changeReport.DomainEvents.AddRange(localEvents.Select(eventData => new DomainEventEntry(entityAsObj, eventData))); changeReport.DomainEvents.AddRange(localEvents.Select(eventData => new DomainEventEntry(entityAsObj, eventData)));
generatesDomainEventsEntity.ClearLocalEvents(); generatesDomainEventsEntity.ClearLocalEvents();
} }
var distributedEvents = generatesDomainEventsEntity.GetDistributedEvents().ToArray(); var distributedEvents = generatesDomainEventsEntity.GetDistributedEvents()?.ToArray();
if (distributedEvents.Any()) if (distributedEvents != null && distributedEvents.Any())
{ {
changeReport.DistributedEvents.AddRange(distributedEvents.Select(eventData => new DomainEventEntry(entityAsObj, eventData))); changeReport.DistributedEvents.AddRange(distributedEvents.Select(eventData => new DomainEventEntry(entityAsObj, eventData)));
generatesDomainEventsEntity.ClearDistributedEvents(); generatesDomainEventsEntity.ClearDistributedEvents();

8
framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs

@ -359,8 +359,8 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
return; return;
} }
var localEvents = generatesDomainEventsEntity.GetLocalEvents().ToArray(); var localEvents = generatesDomainEventsEntity.GetLocalEvents()?.ToArray();
if (localEvents.Any()) if (localEvents != null && localEvents.Any())
{ {
foreach (var localEvent in localEvents) foreach (var localEvent in localEvents)
{ {
@ -370,8 +370,8 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
generatesDomainEventsEntity.ClearLocalEvents(); generatesDomainEventsEntity.ClearLocalEvents();
} }
var distributedEvents = generatesDomainEventsEntity.GetDistributedEvents().ToArray(); var distributedEvents = generatesDomainEventsEntity.GetDistributedEvents()?.ToArray();
if (distributedEvents.Any()) if (distributedEvents != null && distributedEvents.Any())
{ {
foreach (var distributedEvent in distributedEvents) foreach (var distributedEvent in distributedEvents)
{ {

4
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserLookupAppService.cs

@ -16,7 +16,7 @@ namespace Volo.Abp.Identity
UserLookupServiceProvider = userLookupServiceProvider; UserLookupServiceProvider = userLookupServiceProvider;
} }
public virtual virtual async Task<UserData> FindByIdAsync(Guid id) public virtual async Task<UserData> FindByIdAsync(Guid id)
{ {
var userData = await UserLookupServiceProvider.FindByIdAsync(id); var userData = await UserLookupServiceProvider.FindByIdAsync(id);
if (userData == null) if (userData == null)
@ -27,7 +27,7 @@ namespace Volo.Abp.Identity
return new UserData(userData); return new UserData(userData);
} }
public virtual virtual async Task<UserData> FindByUserNameAsync(string userName) public virtual async Task<UserData> FindByUserNameAsync(string userName)
{ {
var userData = await UserLookupServiceProvider.FindByUserNameAsync(userName); var userData = await UserLookupServiceProvider.FindByUserNameAsync(userName);
if (userData == null) if (userData == null)

1
samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerDataSeeder.cs

@ -117,6 +117,7 @@ namespace AuthServer.Host
commonScopes.Union(new[] { "BackendAdminAppGateway", "IdentityService", "ProductService" }), commonScopes.Union(new[] { "BackendAdminAppGateway", "IdentityService", "ProductService" }),
new[] { "hybrid" }, new[] { "hybrid" },
commonSecret, commonSecret,
permissions: new[] { IdentityPermissions.Users.Default, "ProductManagement.Product" },
redirectUri: "http://localhost:51954/signin-oidc", redirectUri: "http://localhost:51954/signin-oidc",
postLogoutRedirectUri: "http://localhost:51954/signout-callback-oidc" postLogoutRedirectUri: "http://localhost:51954/signout-callback-oidc"
); );

2
samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs

@ -54,7 +54,6 @@ namespace BackendAdminApp.Host
}) })
.AddCookie("Cookies", options => .AddCookie("Cookies", options =>
{ {
options.Cookie.Expiration = TimeSpan.FromDays(365);
options.ExpireTimeSpan = TimeSpan.FromDays(365); options.ExpireTimeSpan = TimeSpan.FromDays(365);
}) })
.AddOpenIdConnect("oidc", options => .AddOpenIdConnect("oidc", options =>
@ -100,6 +99,7 @@ namespace BackendAdminApp.Host
app.UseVirtualFiles(); app.UseVirtualFiles();
app.UseRouting(); app.UseRouting();
app.UseAuthentication(); app.UseAuthentication();
app.UseAuthorization();
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(options => app.UseSwaggerUI(options =>

1
samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs

@ -52,7 +52,6 @@ namespace PublicWebSite.Host
}) })
.AddCookie("Cookies", options => .AddCookie("Cookies", options =>
{ {
options.Cookie.Expiration = TimeSpan.FromDays(365);
options.ExpireTimeSpan = TimeSpan.FromDays(365); options.ExpireTimeSpan = TimeSpan.FromDays(365);
}) })
.AddOpenIdConnect("oidc", options => .AddOpenIdConnect("oidc", options =>

2
samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj

@ -16,7 +16,7 @@
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="6.5.0" /> <PackageReference Include="Serilog.Sinks.Elasticsearch" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="Ocelot" Version="13.5.2" /> <PackageReference Include="Ocelot" Version="13.8.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" /> <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" />

6
samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs

@ -103,7 +103,11 @@ namespace BackendAdminAppGateway.Host
app.MapWhen( app.MapWhen(
ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") || ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") ||
ctx.Request.Path.ToString().StartsWith("/Abp/"), ctx.Request.Path.ToString().StartsWith("/Abp/"),
app2 => { app2.UseMvcWithDefaultRouteAndArea(); } app2 =>
{
app2.UseRouting();
app2.UseMvcWithDefaultRouteAndArea();
}
); );
app.UseOcelot().Wait(); app.UseOcelot().Wait();

2
samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGateway.Host.csproj

@ -16,7 +16,7 @@
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="6.5.0" /> <PackageReference Include="Serilog.Sinks.Elasticsearch" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="Ocelot" Version="13.5.2" /> <PackageReference Include="Ocelot" Version="13.8.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" /> <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" />

6
samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs

@ -94,7 +94,11 @@ namespace InternalGateway.Host
ctx.Request.Path.ToString().StartsWith("/api/abp/") || ctx.Request.Path.ToString().StartsWith("/api/abp/") ||
ctx.Request.Path.ToString().StartsWith("/Abp/") || ctx.Request.Path.ToString().StartsWith("/Abp/") ||
ctx.Request.Path.ToString().StartsWith("/Test/"), ctx.Request.Path.ToString().StartsWith("/Test/"),
app2 => { app2.UseMvcWithDefaultRouteAndArea(); } app2 =>
{
app2.UseRouting();
app2.UseMvcWithDefaultRouteAndArea();
}
); );
app.UseOcelot().Wait(); app.UseOcelot().Wait();

2
samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGateway.Host.csproj

@ -16,7 +16,7 @@
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="6.5.0" /> <PackageReference Include="Serilog.Sinks.Elasticsearch" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="Ocelot" Version="13.5.2" /> <PackageReference Include="Ocelot" Version="13.8.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" /> <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" />

6
samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs

@ -90,7 +90,11 @@ namespace PublicWebSiteGateway.Host
app.MapWhen( app.MapWhen(
ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") || ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") ||
ctx.Request.Path.ToString().StartsWith("/Abp/"), ctx.Request.Path.ToString().StartsWith("/Abp/"),
app2 => { app2.UseMvcWithDefaultRouteAndArea(); } app2 =>
{
app2.UseRouting();
app2.UseMvcWithDefaultRouteAndArea();
}
); );
app.UseOcelot().Wait(); app.UseOcelot().Wait();

Loading…
Cancel
Save