Browse Source

Merge pull request #2 from abpframework/master

Master
pull/1351/head
Joe 7 years ago
committed by GitHub
parent
commit
4c704abc5b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      abp_io/src/Volo.AbpWebSite.Web/gulpfile.js
  2. 8
      abp_io/src/Volo.AbpWebSite.Web/package.json
  3. 56
      abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/abp/core/abp.css
  4. 108
      abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/abp/core/abp.js
  5. 2
      abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/tui-editor/tui-editor-extChart.js
  6. 2
      abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/tui-editor/tui-editor-extChart.min.js
  7. 2
      abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/tui-editor/tui-editor-extUML.js
  8. 2
      abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/tui-editor/tui-editor-extUML.min.js
  9. 2056
      abp_io/src/Volo.AbpWebSite.Web/yarn.lock
  10. 52
      docs/cs/Contribution/Index.md
  11. 40
      docs/cs/Contribution/Localization-Text-Files.md
  12. 2
      docs/cs/docs-nav.json
  13. BIN
      docs/cs/images/bookstore-apis.png
  14. BIN
      docs/cs/images/bookstore-create-template.png
  15. BIN
      docs/cs/images/bookstore-homepage.png
  16. BIN
      docs/cs/images/bookstore-user-management-v2.png
  17. BIN
      docs/cs/images/bookstore-visual-studio-solution-tiered.png
  18. BIN
      docs/cs/images/bookstore-visual-studio-solution-v3.png
  19. BIN
      docs/cs/images/build-action-embedded-resource-sample.png
  20. BIN
      docs/cs/images/create-new-aspnet-core-application.png
  21. BIN
      docs/cs/images/create-new-net-core-console-application.png
  22. BIN
      docs/cs/images/db-migrator-app.png
  23. BIN
      docs/cs/images/docs-create-project.jpg
  24. BIN
      docs/cs/images/docs-module_download-new-abp-project.png
  25. BIN
      docs/cs/images/docs-module_download-sample-navigation-menu.png
  26. BIN
      docs/cs/images/docs-module_solution-explorer.png
  27. BIN
      docs/cs/images/github-access-token-private-repo.jpg
  28. BIN
      docs/cs/images/github-access-token-public-repo.jpg
  29. BIN
      docs/cs/images/github-myusername.jpg
  30. BIN
      docs/cs/images/issuemanagement-module-solution.png
  31. BIN
      docs/cs/images/layered-project-dependencies-module.png
  32. BIN
      docs/cs/images/layered-project-dependencies.png
  33. BIN
      docs/cs/images/localization-resource-json-files.png
  34. BIN
      docs/cs/images/microservice-sample-authserver-home.png
  35. BIN
      docs/cs/images/microservice-sample-authserver-login.png
  36. BIN
      docs/cs/images/microservice-sample-backend-ui-permissions.png
  37. BIN
      docs/cs/images/microservice-sample-backend-ui.png
  38. BIN
      docs/cs/images/microservice-sample-blogservice-permission-in-database.png
  39. BIN
      docs/cs/images/microservice-sample-diagram-2.png
  40. BIN
      docs/cs/images/microservice-sample-diagram.png
  41. BIN
      docs/cs/images/microservice-sample-kibana-1.png
  42. BIN
      docs/cs/images/microservice-sample-kibana-2.png
  43. BIN
      docs/cs/images/microservice-sample-product-module-in-solution.png
  44. BIN
      docs/cs/images/microservice-sample-public-product-list.png
  45. BIN
      docs/cs/images/microservice-sample-solution.png
  46. BIN
      docs/cs/images/microservice-sample-update-database-authserver.png
  47. BIN
      docs/cs/images/microservice-sample-update-database-products.png
  48. BIN
      docs/cs/images/module-layers-and-packages.jpg
  49. BIN
      docs/cs/images/night-build-add-nuget-package.png
  50. BIN
      docs/cs/images/night-build-add-nuget-source.png
  51. BIN
      docs/cs/images/pcm-update-database-v2.png
  52. BIN
      docs/cs/images/pcm-update-database.png
  53. BIN
      docs/cs/images/select-empty-web-application.png
  54. BIN
      docs/cs/images/set-as-startup-project.png
  55. BIN
      docs/cs/images/tiered-solution-applications.png
  56. BIN
      docs/cs/images/tiered-solution-servers.png
  57. BIN
      docs/cs/images/volodocs-iis-add-website.png
  58. BIN
      docs/cs/images/volodocs-iis-application-pool.png
  59. 5
      docs/docs-langs.json
  60. 89
      docs/en/Blog-Posts/2019-06-19 v0_18_Release/Post.md
  61. BIN
      docs/en/Blog-Posts/2019-06-19 v0_18_Release/mvc-template-solution.png
  62. 2
      docs/en/CLI.md
  63. 2
      docs/en/Contribution/Index.md
  64. 8
      docs/en/Getting-Started-AspNetCore-Application.md
  65. 2
      docs/en/Getting-Started-AspNetCore-MVC-Template.md
  66. 8
      docs/en/Startup-Templates/Mvc-Module.md
  67. 4
      docs/en/Startup-Templates/Mvc.md
  68. 89
      docs/zh-Hans/Blog-Posts/2019-06-19 v0_18_Release/Post.md
  69. BIN
      docs/zh-Hans/Blog-Posts/2019-06-19 v0_18_Release/mvc-template-solution.png
  70. 2
      docs/zh-Hans/Contribution/Index.md
  71. 8
      docs/zh-Hans/Getting-Started-AspNetCore-Application.md
  72. 156
      docs/zh-Hans/Startup-Templates/Mvc-Module.md
  73. 39
      docs/zh-Hans/Startup-Templates/Mvc.md
  74. BIN
      docs/zh-Hans/images/issuemanagement-module-solution.png
  75. BIN
      docs/zh-Hans/images/layered-project-dependencies-module.png
  76. 18
      framework/Volo.Abp.sln
  77. 37
      framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs
  78. 11
      framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs
  79. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Core/CoreStyleContributor.cs
  80. 16
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/FreezeUi/FreezeUiScriptContributor.cs
  81. 16
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/FreezeUi/FreezeUiStyleContributor.cs
  82. 18
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml
  83. 16
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml
  84. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Bundling/SharedThemeGlobalScriptContributor.cs
  85. 8
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Bundling/SharedThemeGlobalStyleContributor.cs
  86. 46
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/freeze-ui/abp-freeze-ui.js
  87. 63
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs
  88. 14
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs
  89. 17
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs
  90. 24
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs
  91. 13
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs
  92. 3
      framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobInfo.cs
  93. 1
      framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
  94. 196
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs
  95. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs
  96. 33
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs
  97. 24
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs
  98. 9
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Mvc/MvcTemplate.cs
  99. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Mvc/MvcTemplateSwitchEntityFrameworkCoreToMongoDbStep.cs
  100. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/MvcModule/MvcModuleTemplate.cs

8
abp_io/src/Volo.AbpWebSite.Web/gulpfile.js

@ -4,8 +4,6 @@ var gulp = require("gulp"),
path = require('path'),
copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js');
copyResources.init(path.resolve('./'));
gulp.task('default', [copyResources.taskName], function () {
});
exports.default = function(){
return copyResources(path.resolve('./'));
};

8
abp_io/src/Volo.AbpWebSite.Web/package.json

@ -3,8 +3,8 @@
"name": "volo.aspnetzero.support",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^0.4.9",
"@abp/blogging": "^0.4.9",
"@abp/docs": "^0.5.1"
"@abp/aspnetcore.mvc.ui.theme.basic": "^0.6.6",
"@abp/blogging": "^0.6.6",
"@abp/docs": "^0.6.5"
}
}
}

56
abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/abp/core/abp.css

@ -0,0 +1,56 @@
@keyframes spin {
0% {
transform: translateZ(0) rotate(0deg);
}
100% {
transform: translateZ(0) rotate(360deg);
}
}
.abp-block-area {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999999999;
background-color: #fff;
opacity: .8;
transition: opacity .25s;
}
.abp-block-area.abp-block-area-disappearing {
opacity: 0;
}
.abp-block-area.abp-block-area-busy:after {
content: attr(data-text);
display: block;
max-width: 125px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
font-family: sans-serif;
color: #343a40;
text-align: center;
text-transform: uppercase;
}
.abp-block-area.abp-block-area-busy:before {
content: "";
display: block;
width: 150px;
height: 150px;
border-radius: 50%;
border-width: 2px;
border-style: solid;
border-color: transparent #228ae6 #228ae6 #228ae6;
position: absolute;
top: calc(50% - 75px);
left: calc(50% - 75px);
will-change: transform;
animation: spin .75s infinite ease-in-out;
}

108
abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/abp/core/abp.js

@ -161,6 +161,25 @@ var abp = abp || {};
abp.auth.setToken();
}
/* SETTINGS *************************************************/
abp.setting = abp.setting || {};
abp.setting.values = abp.setting.values || {};
abp.setting.get = function (name) {
return abp.setting.values[name];
};
abp.setting.getBoolean = function (name) {
var value = abp.setting.get(name);
return value == 'true' || value == 'True';
};
abp.setting.getInt = function (name) {
return parseInt(abp.setting.values[name]);
};
/* NOTIFICATION *********************************************/
//Defines Notification API, not implements it
@ -227,25 +246,96 @@ var abp = abp || {};
abp.ui = abp.ui || {};
/* UI BLOCK */
//Defines UI Block API, not implements it
//Defines UI Block API and implements basically
var $abpBlockArea = document.createElement('div');
$abpBlockArea.classList.add('abp-block-area');
/* opts: { //Can be an object with options or a string for query a selector
* elm: a query selector (optional - default: document.body)
* busy: boolean (optional - default: false)
* promise: A promise with always or finally handler (optional - auto unblocks the ui if provided)
* }
*/
abp.ui.block = function (opts) {
if (!opts) {
opts = {};
} else if (typeof opts == 'string') {
opts = {
elm: opts
};
}
abp.ui.block = function (elm) {
abp.log.warn('abp.ui.block is not implemented!');
var $elm = document.querySelector(opts.elm) || document.body;
if (opts.busy) {
$abpBlockArea.classList.add('abp-block-area-busy');
} else {
$abpBlockArea.classList.remove('abp-block-area-busy');
}
if (document.querySelector(opts.elm)) {
$abpBlockArea.style.position = 'absolute';
} else {
$abpBlockArea.style.position = 'fixed';
}
$elm.appendChild($abpBlockArea);
if (opts.promise) {
if (opts.promise.always) { //jQuery.Deferred style
opts.promise.always(function () {
abp.ui.unblock({
$elm: opts.elm
});
});
} else if (opts.promise['finally']) { //Q style
opts.promise['finally'](function () {
abp.ui.unblock({
$elm: opts.elm
});
});
}
}
};
abp.ui.unblock = function (elm) {
abp.log.warn('abp.ui.unblock is not implemented!');
/* opts: {
*
* }
*/
abp.ui.unblock = function (opts) {
var element = document.querySelector('.abp-block-area');
if (element) {
element.classList.add('abp-block-area-disappearing');
setTimeout(function () {
if (element) {
element.classList.remove('abp-block-area-disappearing');
element.parentElement.removeChild(element);
}
}, 250);
}
};
/* UI BUSY */
//Defines UI Busy API, not implements it
abp.ui.setBusy = function (elm, optionsOrPromise) {
abp.log.warn('abp.ui.setBusy is not implemented!');
abp.ui.setBusy = function (opts) {
if (!opts) {
opts = {
busy: true
};
} else if (typeof opts == 'string') {
opts = {
elm: opts,
busy: true
};
}
abp.ui.block(opts);
};
abp.ui.clearBusy = function (elm) {
abp.log.warn('abp.ui.clearBusy is not implemented!');
abp.ui.clearBusy = function (opts) {
abp.ui.unblock(opts);
};
/* SIMPLE EVENT BUS *****************************************/

2
abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/tui-editor/tui-editor-extChart.js

@ -1,6 +1,6 @@
/*!
* tui-editor
* @version 1.2.2
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/

2
abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/tui-editor/tui-editor-extChart.min.js

@ -1,6 +1,6 @@
/*!
* tui-editor
* @version 1.2.2
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/

2
abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/tui-editor/tui-editor-extUML.js

@ -1,6 +1,6 @@
/*!
* tui-editor
* @version 1.2.2
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/

2
abp_io/src/Volo.AbpWebSite.Web/wwwroot/libs/tui-editor/tui-editor-extUML.min.js

@ -1,6 +1,6 @@
/*!
* tui-editor
* @version 1.2.2
* @version 1.2.6
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/

2056
abp_io/src/Volo.AbpWebSite.Web/yarn.lock

File diff suppressed because it is too large

52
docs/cs/Contribution/Index.md

@ -0,0 +1,52 @@
## Průvodce pro přispěvatele
ABP je [open source](https://github.com/abpframework) a komunitně řízený projekt. Tento průvodce má za cíl pomoci každému kdo chce do projektu nějak přispět.
### Příspěvek kódu
Vždy můžete zaslat pull request do Github repositáře.
- Naklonujte [ABP repozitář](https://github.com/abpframework/abp/) z Githubu.
- Učiňte potřebné změny.
- Zašlete pull request.
Než budete dělat nějaké změny, diskutujte o nich prosím na [Github problémy](https://github.com/abpframework/abp/issues). Díky tomu nebude žádný jiný vývojář pracovat na stejném problému a Váš PR má lepší šanci na to být přijat.
#### Opravy chyb a vylepšení
Pokud chcete opravit známou chybu nebo pracovat na plánovaném vylepšení podívejte se na [seznam problémů](https://github.com/abpframework/abp/issues) na Githubu.
#### Požadavky na funkce
Pokud máte nápad na funkci pro framework nebo modul [vytvořte problém](https://github.com/abpframework/abp/issues/new) na Githubu nebo se připojte ke stávající diskuzi. V případě přijetí komunitou ho pak můžete implementovat.
### Překlad dokumentů
Pokud chcete přeložit celou [dokumentaci](https://abp.io/documents/) (včetně této stránky) do Vašeho rodného jazyka, následujte tyto kroky:
* Naklonujte [ABP repozitář](https://github.com/abpframework/abp/) z Githubu.
* K přidání nového jazyka vytvořte novou složku v [docs](https://github.com/abpframework/abp/tree/master/docs). Název složky musí být "en", "es", "fr", "tr" atd. v závislosti na jazyku (navštivte [všechny jazykové kódy](https://msdn.microsoft.com/en-us/library/hh441729.aspx)).
* Pro referenci použijte ["en" složku](https://github.com/abpframework/abp/tree/master/docs/en) a její názvy souborů a strom složek. Při překladu této dokumentace zachovejte prosím tyto názvy stejné.
* Zašlete pull request (PR) po překladu jakéhokoliv dokumentu klidně i po jednom. Nečekejte až budete mít překlad všech dokumentů.
### Lokalizace zdrojů
ABP framework má flexibilní [lokalizační systém](../Localization.md). Můžete tak vytvořit lokalizované uživatelské prostředí pro svou vlastní aplikaci.
K tomu mají framework a vestavěné moduly již lokalizované texty. Například [lokalizační texty pro Volo.Abp.UI balík](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json). Můžete vytvořit nový soubor ve [stejné složce](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi) k přidání překladu.
* Naklonujte [ABP repozitář](https://github.com/abpframework/abp/) z Githubu.
* Vytvořte nový soubor pro cílový jazyk pro lokalizační text v (json) souboru (u souboru en.json).
* Zkopírujte veškerý text ze souboru en.json.
* Přeložte texty.
* Zašlete pull request na Githubu.
ABP je modulářní framework, proto je zde mnoho zdrojů lokalizačních textů, jeden pro každý modul. K najití všech .json souborů, vyhledejte po naklonování repozitáře soubory "en.json". Můžete se taky podívat na [tento seznam](Localization-Text-Files.md) souborů lokalizačních textů.
### Příspevky do blogu a návody
Pokud se rozhodnete pro ABP vytvořit nějaké návody nebo příspěvky do blogu, dejte nám vědět (prostřednictvím [Github problémy](https://github.com/abpframework/abp/issues)), ať můžeme přidat odkaz na Váš návod/příspěvek v oficiální dokumentaci a oznámit na našem [Twitter účtu](https://twitter.com/abpframework).
### Zpráva o chybě
Pokud najdete chybu, [vytvořte prosím problém v Github repozitáři](https://github.com/abpframework/abp/issues/new).

40
docs/cs/Contribution/Localization-Text-Files.md

@ -0,0 +1,40 @@
## Textové soubory pro lokalizaci
Toto je seznam lokalizačních textových souborů pro každého kdo chce přispět k překladu textů ve frameworku. Tento seznam budeme udržovat aktuální:
* https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/en.json
* https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json
* https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/en.json
* https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/en.json
* https://github.com/abpframework/abp/tree/master/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json
* https://github.com/abpframework/abp/tree/master/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/en.json
* https://github.com/abpframework/abp/tree/master/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/en.json
* https://github.com/abpframework/abp/tree/master/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/en.json
* https://github.com/abpframework/abp/tree/master/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/en.json
* https://github.com/abpframework/abp/tree/master/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/Localization/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/Localization/Domain/en.json
* https://github.com/abpframework/abp/tree/master/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/en.json
* https://github.com/abpframework/abp/tree/master/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/en.json
* https://github.com/abpframework/abp/tree/master/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/en.json
* https://github.com/abpframework/abp/tree/master/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/en.json
* https://github.com/abpframework/abp/tree/master/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/en.json
* https://github.com/abpframework/abp/tree/master/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/en.json
* https://github.com/abpframework/abp/tree/master/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/en.json
* https://github.com/abpframework/abp/tree/master/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/en.json
* https://github.com/abpframework/abp/tree/master/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement/Localization/Domain/en.json
* https://github.com/abpframework/abp/tree/master/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/en.json
* https://github.com/abpframework/abp/tree/master/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/en.json
* https://github.com/abpframework/abp/tree/master/templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/en.json
* https://github.com/abpframework/abp/tree/master/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/en.json

2
docs/cs/docs-nav.json

@ -218,7 +218,7 @@
},
{
"text": "Tag pomocníci",
"path": "Tag-Helpers.md"
"path": "AspNetCore/Tag-Helpers/Index.md"
},
{
"text": "Motivy",

BIN
docs/cs/images/bookstore-apis.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
docs/cs/images/bookstore-create-template.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
docs/cs/images/bookstore-homepage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
docs/cs/images/bookstore-user-management-v2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
docs/cs/images/bookstore-visual-studio-solution-tiered.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
docs/cs/images/bookstore-visual-studio-solution-v3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
docs/cs/images/build-action-embedded-resource-sample.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
docs/cs/images/create-new-aspnet-core-application.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
docs/cs/images/create-new-net-core-console-application.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
docs/cs/images/db-migrator-app.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
docs/cs/images/docs-create-project.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
docs/cs/images/docs-module_download-new-abp-project.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
docs/cs/images/docs-module_download-sample-navigation-menu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
docs/cs/images/docs-module_solution-explorer.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
docs/cs/images/github-access-token-private-repo.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

BIN
docs/cs/images/github-access-token-public-repo.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

BIN
docs/cs/images/github-myusername.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
docs/cs/images/issuemanagement-module-solution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
docs/cs/images/layered-project-dependencies-module.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
docs/cs/images/layered-project-dependencies.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/cs/images/localization-resource-json-files.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
docs/cs/images/microservice-sample-authserver-home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
docs/cs/images/microservice-sample-authserver-login.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
docs/cs/images/microservice-sample-backend-ui-permissions.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
docs/cs/images/microservice-sample-backend-ui.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
docs/cs/images/microservice-sample-blogservice-permission-in-database.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
docs/cs/images/microservice-sample-diagram-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

BIN
docs/cs/images/microservice-sample-diagram.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
docs/cs/images/microservice-sample-kibana-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
docs/cs/images/microservice-sample-kibana-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
docs/cs/images/microservice-sample-product-module-in-solution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
docs/cs/images/microservice-sample-public-product-list.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
docs/cs/images/microservice-sample-solution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
docs/cs/images/microservice-sample-update-database-authserver.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
docs/cs/images/microservice-sample-update-database-products.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
docs/cs/images/module-layers-and-packages.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
docs/cs/images/night-build-add-nuget-package.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
docs/cs/images/night-build-add-nuget-source.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/cs/images/pcm-update-database-v2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
docs/cs/images/pcm-update-database.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
docs/cs/images/select-empty-web-application.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
docs/cs/images/set-as-startup-project.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
docs/cs/images/tiered-solution-applications.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
docs/cs/images/tiered-solution-servers.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
docs/cs/images/volodocs-iis-add-website.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
docs/cs/images/volodocs-iis-application-pool.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

5
docs/docs-langs.json

@ -1,10 +1,5 @@
{
"Languages":[
{
"DisplayName" : "Čeština",
"Code" : "cs",
"IsDefault": false
},
{
"DisplayName" : "English",
"Code" : "en",

89
docs/en/Blog-Posts/2019-06-19 v0_18_Release/Post.md

@ -0,0 +1,89 @@
# ABP CLI, New Templates & Other Features with the v0.18 Release
ABP v0.18 has been released with [80+ issues](https://github.com/abpframework/abp/milestone/16?closed=1) resolved and [550+ commits](https://github.com/abpframework/abp/compare/0.17.0.0...0.18.0) pushed.
## Web Site Changes
[abp.io](https://abp.io) web site is **completely renewed** to highlight the goals and important features of the ABP framework. Document & blog URLs are also changed:
- `abp.io/documents` moved to [docs.abp.io](https://docs.abp.io).
- `abp.io/blog` moved to [blog.abp.io](https://blog.abp.io).
## ABP CLI
ABP CLI (Command Line Interface) is a new global command line tool to perform some common operations for ABP based solutions. Main functions are;
* **Creating a new application** or module project.
* **Adding a new module** to an application.
* **Updating** all ABP related packages in a solution.
ABP CLI is now the preferred way to create a new project, while you can still download a new project from the [get started](https://abp.io/get-started) page.
### Usage
Install the ABP CLI using a command line window:
````bash
dotnet tool install -g Volo.Abp.Cli
````
Create a new application:
````bash
abp new Acme.BookStore
````
Add a module to an application:
````bash
abp add-module Volo.Blogging
````
Update all ABP related packages in a solution:
````bash
abp update
````
See [ABP CLI documentation](https://docs.abp.io/en/abp/latest/CLI) for details.
## New Templates
In this release, we've renewed all startup templates. The main goal is to provide better startup templates based on Domain Driven Design layers those also allow to create tiered solutions (where Web and API layers can be physically separated). It also includes unit & integration test projects separated for different layers.
The image below shows the new startup project for an MVC application.
![mvc-template-solution](mvc-template-solution.png)
See the [startup templates document](https://docs.abp.io/en/abp/latest/Startup-Templates/Index) for details.
## Change Logs
Here are some other features and enhancements coming with this release:
* New [Volo.Abp.Dapper](https://www.nuget.org/packages/Volo.Abp.Dapper) package.
* New [Volo.Abp.Specifications](https://www.nuget.org/packages/Volo.Abp.Specifications) package.
* New data seed system with `IDataSeeder` service & `IDataSeedContributor` interface to allow a modular initial data seed system.
* Improved MemoryDB implementation to serialize/deserialize objects stored in memory, so it provides more realistic infrastructure for mocking database in unit/integration tests.
* Added multi-language support for the docs module. Used it for the [ABP documentation](https://docs.abp.io).
See the [GitHub Release Notes](https://github.com/abpframework/abp/releases/tag/0.18.0) for all features, enhancements & bugfixes in this release.
## Road Map
One thing related to the ABP v1.0 release is .NET Core / ASP.NET Core 3.0 release. According to the [.NET Core road map](https://github.com/dotnet/core/blob/master/roadmap.md), 3.0 release has been scheduled for September 2019.
ASP.NET Core comes with big changes and features. As a big breaking change, it will [only run on .NET Core](https://github.com/aspnet/Announcements/issues/324) (dropping .net standard support), so it will not work with full .net framework anymore.
We had declared to release v1.0 in 2019 Q2. The main works we should do for v1.0 are;
* Fill the gaps in current features.
* Refactor & improve the current APIs.
* Fix known bugs.
* Complete the documentation & tutorials.
In addition to the work we should do, we are also considering to wait ASP.NET Core 3.0 release. Because, if we release ABP v1.0 before ASP.NET Core 3.0, we will have to release ABP v2.0 again in a short time and drop v1.0 support. So, we are considering to publish ABP v1.0 RC with ASP.NET Core 3.0 RC and align the final release date with Microsoft.
## Want to Contribute?
Thanks to the community for their support for ABP development. It is very appreciated. If you also want to contribute, see [this guide](https://github.com/abpframework/abp/blob/master/docs/en/Contribution/Index.md) as the beginning.

BIN
docs/en/Blog-Posts/2019-06-19 v0_18_Release/mvc-template-solution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

2
docs/en/CLI.md

@ -103,7 +103,7 @@ abp add-module Volo.Blogging
### update
Updating all ABP related packages can be tedious since there are many packages of the framework and modules. This command automatically updates all ABP related packages in a solution or project to the latest versions.
Updating all ABP related packages can be tedious since there are many packages of the framework and modules. This command automatically updates all ABP NuGet related packages and NPM packages in a solution or project to the latest versions.
Usage:

2
docs/en/Contribution/Index.md

@ -31,7 +31,7 @@ You may want to translate the complete [documentation](https://abp.io/documents/
### Resource Localization
ABP framework has a flexible [localization system](https://abp.io/documents/abp/latest/Localization). You can create localized user interfaces for your own application.
ABP framework has a flexible [localization system](../Localization.md). You can create localized user interfaces for your own application.
In addition to that, the framework and pre-build modules have already localized texts. As an example, see [the localization texts for the Volo.Abp.UI package](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json). You can create a new file in the [same folder](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi) to translate it.

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

@ -159,6 +159,13 @@ public class Program
{
public static void Main(string[] args)
{
/*
https://github.com/aspnet/AspNetCore/issues/4206#issuecomment-445612167
CurrentDirectoryHelpers exists in: \framework\src\Volo.Abp.AspNetCore.Mvc\Microsoft\AspNetCore\InProcess\CurrentDirectoryHelpers.cs
Will remove CurrentDirectoryHelpers.cs when upgrade to ASP.NET Core 3.0.
*/
CurrentDirectoryHelpers.SetCurrentDirectory();
BuildWebHostInternal(args).Run();
}
@ -166,6 +173,7 @@ public class Program
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

2
docs/en/Getting-Started-AspNetCore-MVC-Template.md

@ -14,7 +14,7 @@ dotnet tool install -g Volo.Abp.Cli
Use `abp new` command in an empty folder to create your project:
````
````bash
abp new Acme.BookStore
````

8
docs/en/Startup-Templates/Mvc-Module.md

@ -50,7 +50,7 @@ Each section below will explain the related project & its dependencies.
This project contains constants, enums and other objects these are actually a part of the domain layer, but needed to be used by all layers/projects in the solution.
An `IssueType` enum and an `IssueConts` class (which may have some constant fields for the `Issue` entity, like `MaxTitleLength`) are good candidates for this project.
An `IssueType` enum and an `IssueConsts` class (which may have some constant fields for the `Issue` entity, like `MaxTitleLength`) are good candidates for this project.
- This project has no dependency to other projects in the solution. All other projects depend on this directly or indirectly.
@ -102,7 +102,7 @@ The solution has multiple test projects, one for each layer:
- `.Domain.Tests` is used to test the domain layer.
- `.Application.Tests` is used to test the application layer.
- `.EntityFrameworkCore.Tests` is used to test EF Core configuration and custom repositories.
- `.MongoDB.Tests` is used to test EF Core configuration and custom repositories.
- `.MongoDB.Tests` is used to test MongoDB configuration and custom repositories.
- `.TestBase` is a base (shared) project for all tests.
In addition, `.HttpApi.Client.ConsoleTestApp` is a console application (not an automated test project) which demonstrate the usage of HTTP APIs from a Dotnet application.
@ -121,8 +121,6 @@ You can still create unit tests for your classes which will be harder to write (
The solution has a few host applications to run your module on development. Host applications are used to run your module in a fully configured application. It is useful on development. Host applications includes some other modules in addition to the module being developed:
*
Host applications support two types of scenarios.
#### Single (Unified) Application Scenario
@ -157,4 +155,4 @@ You should run the application with the given order:
- First, run the `.IdentityServer` since other applications depends on it.
- Then run the `.HttpApi.Host` since it is used by the `.Web.Host` application.
- Finally, you can run the `.Web.Host` project and login to the application using `admin` as the username and `1q2w3E*` as the password.
- Finally, you can run the `.Web.Host` project and login to the application using `admin` as the username and `1q2w3E*` as the password.

4
docs/en/Startup-Templates/Mvc.md

@ -73,7 +73,7 @@ Each section below will explain the related project & its dependencies.
This project contains constants, enums and other objects these are actually a part of the domain layer, but needed to be used by all layers/projects in the solution.
A `BookType` enum and a `BookConts` class (which may have some constant fields for the `Book` entity, like `MaxNameLength`) are good candidates for this project.
A `BookType` enum and a `BookConsts` class (which may have some constant fields for the `Book` entity, like `MaxNameLength`) are good candidates for this project.
* This project has no dependency to other projects in the solution. All other projects depend on this directly or indirectly.
@ -257,4 +257,4 @@ You should run the application with the given order:
## What's Next?
- See [Getting Started With the ASP.NET Core MVC Template](../Getting-Started-AspNetCore-MVC-Template.md) to create a new solution and run it for this template.
- See the [ASP.NET Core MVC Tutorial](../Tutorials/AspNetCore-Mvc/Part-I.md) to learn how to develop applications using this template.
- See the [ASP.NET Core MVC Tutorial](../Tutorials/AspNetCore-Mvc/Part-I.md) to learn how to develop applications using this template.

89
docs/zh-Hans/Blog-Posts/2019-06-19 v0_18_Release/Post.md

@ -0,0 +1,89 @@
# ABP CLI,v0.18版本的新模板和其他功能
ABP v0.18已发布, 包含解决的[80+个issue](https://github.com/abpframework/abp/milestone/16?closed=1),[550+次提交](https://github.com/abpframework/abp/compare/0.17.0.0...0.18.0)
## 网站更改
[abp.io](https://abp.io)网站**完全更新**以突出ABP框架的目标和重要功能.文档和博客网址也会更改:
- `abp.io/documents`移至[docs.abp.io](https://docs.abp.io).
- `abp.io/blog`转移到[blog.abp.io](https://blog.abp.io).
## ABP CLI
ABP CLI(命令行界面)是一种新的全局命令行工具,用于执行基于ABP的解决方案的一些常见操作.主要功能是;
* **创建新的应用程序**或模块项目.
* **向应用程序添加新模块**.
* **更新**解决方案中所有与ABP相关的包.
ABP CLI现在是创建新项目的首选方式,你仍然可以从[开始](https://abp.io/get-started)页面下载新项目.
### 用法
使用命令行窗口安装ABP CLI:
```` bash
dotnet tool install -g Volo.Abp.Cli
````
创建一个新应用程序:
```` bash
abp new Acme.BookStore
````
将模块添加到应用程序:
```` bash
abp add-module Volo.Blogging
````
更新解决方案中所有与ABP相关的包:
```` bash
abp update
````
有关详细信息,请参阅[ABP CLI文档](https://docs.abp.io/en/abp/latest/CLI).
## 新模板
在此版本中,我们更新了所有启动模板.主要目标是提供基于领域驱动设计层的更好的启动模板,这些模板还允许创建分层解决方案(Web和API层可以在物理上分开).它还包括针对不同层分开的单元和集成测试项目.
下图显示了MVC应用程序的新启动项目.
![mvc-template-solution](mvc-template-solution.png)
有关详细信息,请参阅[启动模板文档](https://docs.abp.io/en/abp/latest/Startup-Templates/Index).
## 更改日志
以下是此版本附带的一些其他功能和增强功能:
* 新[Volo.Abp.Dapper](https://www.nuget.org/packages/Volo.Abp.Dapper)包.
* 新[Volo.Abp.Specifications](https://www.nuget.org/packages/Volo.Abp.Specifications)包.
* 具有`IDataSeeder`服务和`IDataSeedContributor`接口的新数据种子系统,允许模块化初始数据种子系统.
* 改进了MemoryDB实现,以序列化/反序列化存储在内存中的对象,因此它为单元/集成测试中的数据库模拟提供了更真实的基础结构.
* 为docs模块添加了多语言支持.用于[ABP文档](https://docs.abp.io).
有关此版本中的所有功能,增强功能和错误修正,请参阅[GitHub发行说明](https://github.com/abpframework/abp/releases/tag/0.18.0).
## 路线图
与ABP v1.0版本相关的一件事是.NET Core / ASP.NET Core 3.0版本.根据[.NET核心路线图](https://github.com/dotnet/core/blob/master/roadmap.md),计划于2019年9月发布3.0版本.
ASP.NET Core具有很大的变化和功能.作为一个重大的突破性变化,它将[仅在.NET Core上运行](https://github.com/aspnet/Announcements/issues/324)(删除.net标准支持),因此它不能用于完整.net框架了.
我们已宣布在2019年第二季度发布v1.0.我们应该为v1.0做的主要工作是:
* 填补当前功能的空白.
* 重构和改进当前的API.
* 修复已知的错误.
* 完成文档和教程.
除了我们应该做的工作之外,我们还在考虑等待ASP.NET Core 3.0发布.因为,如果我们在ASP.NET Core 3.0之前发布ABP v1.0,我们将不得不在短时间内再次发布ABP v2.0并放弃v1.0支持.因此,我们正在考虑使用ASP.NET Core 3.0 RC发布ABP v1.0 RC,并将最终发布日期与Microsoft保持一致.
## 想要贡献?
感谢社区对ABP开发的支持.非常感谢.如果你还想参与,请参阅[本指南](https://github.com/abpframework/abp/blob/master/docs/en/Contribution/Index.md)作为开始.

BIN
docs/zh-Hans/Blog-Posts/2019-06-19 v0_18_Release/mvc-template-solution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

2
docs/zh-Hans/Contribution/Index.md

@ -31,7 +31,7 @@ ABP是[开源](https://github.com/abpframework)和社区驱动项目. 本指南
### 资源本地化
ABP框架具有灵活的[本地化系统](https://abp.io/documents/abp/latest/Localization). 你可以为自己的应用程序创建本地化用户界面.
ABP框架具有灵活的[本地化系统](../Localization.md). 你可以为自己的应用程序创建本地化用户界面.
除此之外,框架和预构建模块已经本地化了文本.请参阅[Volo.Abp.UI包的本地化文本](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json).你可以在[相同文件夹](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi)中创建一个新文件进行翻译.

8
docs/zh-Hans/Getting-Started-AspNetCore-Application.md

@ -163,12 +163,20 @@ public class Program
{
public static void Main(string[] args)
{
/*
https://github.com/aspnet/AspNetCore/issues/4206#issuecomment-445612167
CurrentDirectoryHelpers 文件位于: \framework\src\Volo.Abp.AspNetCore.Mvc\Microsoft\AspNetCore\InProcess\CurrentDirectoryHelpers.cs
当升级到ASP.NET Core 3.0的时候将会删除这个类.
*/
CurrentDirectoryHelpers.SetCurrentDirectory();
BuildWebHostInternal(args).Run();
}
public static IWebHost BuildWebHostInternal(string[] args) =>
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

156
docs/zh-Hans/Startup-Templates/Mvc-Module.md

@ -1,6 +1,158 @@
# MVC Module 启动模板
# MVC模块启动模板
TODO
可用此模板开发基于[模块开发最佳实践和约定](../Best-Practices/Index.md)的可**复用 [应用程序模块](../Modules/Index.md)** . 它同样适用于开发**微服务**.
## 如何开始?
你可以使用[ABP CLI](../CLI.md)创建基于此启动模板的新项目,或者你也可以在[入门](https://abp.io/get-started)页面创建并下载项目. 在这里我们使用CLI创建新项目.
如果未安装ABP CLI,第一步是安装ABP CLI
````bash
dotnet tool install -g Volo.Abp.Cli
````
然后使用 `abp new` 命令在空文件夹中创建新解决方案:
````bash
abp new Acme.IssueManagement -t mvc-module
````
* `Acme.IssueManagement` 是解决方案的名称, 如*YourCompany.YourProduct*. 你可以使用单级或多级名称.
### 无用户界面
默认情况模板附带一个UI,你可以使用`--no-ui`选项指定不包含UI层.
````bash
abp new Acme.IssueManagement -t mvc-module --no-ui
````
## 解决方案结构
根据命令的选项,会创建略有不同的解决方案结构. 如果未指定选项,你会得到如下所示的解决方案:
![issuemanagement-module-solution](../images/issuemanagement-module-solution.png)
项目组织在`src`和`test`和`host`文件夹中:
* `src` 文件夹包含基于[DDD](../Domain-Driven-Design.md)原则分层的实际模块.
* `test` 文件夹包含单元和集成测试.
* `host` 文件夹包含具有不同配置的应用程序,用于演示在应用程序中如何托管模块. 这些不是模块的一部分,但开发时会很有用.
下图展示了模块的层和项目的依赖关系:
![layered-project-dependencies-module](../images/layered-project-dependencies-module.png)
下面介绍解决方案中的项目及依赖关系:
### .Domain.Shared 项目
项目包含常量,枚举和其他对象,这些对象实际上是领域层的一部分,但是解决方案中所有的层/项目中都会使用到.
例如 `IssueType` 枚举和 `IssueConsts` 类 (可能是 `Issue` 实体用到的常数字段,像`MaxTitleLength`)都适合放在这个项目中.
* 该项目不依赖解决方案中的其他项目. 其他项目直接或间接依赖该项目.
### .Domain 项目
解决方案的领域层. 它主要包含 [实体, 集合根](../Entities.md), [领域服务](../Domain-Services.md), [值类型](../Value-Types.md), [仓储接口](../Repositories.md) 和解决方案的其他领域对象.
例如 `Issue` 实体, `IssueManager` 领域服务和 `IIssueRepository` 接口都适合放在这个项目中.
* 它依赖 `.Domain.Shared` 项目,因为项目中会用到它的一些常量,枚举和定义其他对象.
### .Application.Contracts 项目
项目主要包含 [应用服务](../Application-Services.md) **interfaces** 和应用层的 [数据传输对象](../Data-Transfer-Objects.md) (DTO). 它用于分离应用层的接口和实现. 这种方式可以将接口项目做为约定包共享给客户端.
例如 `IIssueAppService` 接口和 `IssueCreationDto` 类都适合放在这个项目中.
* 它依赖 `.Domain.Shared` 因为它可能会在应用接口和DTO中使用常量,枚举和其他的共享对象.
### .Application 项目
项目包含 `.Application.Contracts` 项目的 [应用服务](../Application-Services.md) 接口**实现**.
例如 `IssueAppService` 类适合放在这个项目中.
* 它依赖 `.Application.Contracts` 项目, 因为它需要实现接口与使用DTO.
* 它依赖 `.Domain` 项目,因为它需要使用领域对象(实体,仓储接口等)执行应用程序逻辑.
### .EntityFrameworkCore 项目
这是集成EF Core的项目. 它定义了 `DbContext` 并实现 `.Domain` 项目中定义的仓储接口.
* 它依赖 `.Domain` 项目,因为它需要引用实体和仓储接口.
> 如果不需要使用EF Core,可以删除此项目.
### .MongoDB 项目
这是集成MongoDB的项目.
* 它依赖 `.Domain` 项目,因为它需要引用实体和仓储接口.
> 如果不需要使用MongoDB,可以删除此项目.
#### Test 项目
解决方案有多个测试项目,每一层都会有一个:
* `.Domain.Tests` 用于测试领域层.
* `.Application.Tests` 用于测试应用层.
* `.EntityFrameworkCore.Tests` 用于测试EF Core配置与自定义仓储.
* `.MongoDB.Tests` 用于测试MongoDB配置与自定义仓储.
* `.TestBase` 所有测试项目的基础(共享)项目.
此外, `.HttpApi.Client.ConsoleTestApp` 是一个控制台应用程序(不是自动化测试项目),它用于演示DotNet应用程序中HTTP API的用法.
测试项目是用于做集成测试的:
* 它完全集成到ABP框架和应用程序的所有服务.
* 如果数据库提供程序是EF Core,测试项目会使用SQLite内存数据库,如果是MongoDB,它使用[Mongo2Go](https://github.com/Mongo2Go/Mongo2Go)库.
* 授权被禁用,任何的应用服务都可以在测试中轻松调用.
你依然可以编写单元测试,只不过它很难写(因为你需要准备mock/fake对象),但它的运行速度更快(因为只测试单个类并跳过所有初始化过程).
> 领域层和应用层测试使用EF Core. 如果你删除了EF Core集成项目或者要使用MongoDB测试这些层,需要手动的修改项目引用和依赖.
### Host 项目
解决方案中有一些宿主应用程序可以在开发时运行模块. 在开发时会很有用. 除了正在开发的模块外,宿主应用程序包括其他模块:
宿主应用程序支持两种类型的场景.
#### 单体 (统一) 应用场景
如果模块含有UI, 那么 `.Web.Unified` 应用程序于在一个站点上托管UI和API. 它有自己的 `appsettings.json` 配置文件(包括数据库连接字符串)和EF Core数据库迁移.
`.Web.Unified` 应用程序有一个名为`YourProjectName_Unified`的数据库(本例中名为 *IssueManagement_Unified*).
> 如果你选择了 `--no-ui` 选项, 这个项目不会出现在你的解决方案中.
##### 如何运行?
将其设置成启动项, 使用包管理控制台运行 `Update-Database` 命令迁移数据库,然后运行应用程序. 默认用户名: `admin` 密码: `1q2w3E*`.
#### 分离部署&数据库 场景
在这个场景中,有三个应用程序;
* `.IdentityServer` 应用程序是其他应用程序使用的身份验证服务器,它有自己的 `appsettings.json` 包含数据库连接字符串和其他配置.
* `.HttpApi.Host` 托管模块的HTTP API. 它有自己的 `appsettings.json` 包含数据库连接字符串和其他配置.
* `.Web.Host` 托管模块的UI. 它包含 `appsettings.json` 文件, 但是其中没有数据库连接字符串, 因为它不需要连接到数据库, 它主要调用远程API服务器和身份认证服务器.
下图展示了应用程序的关系:
![tiered-solution-applications](../images/tiered-solution-applications.png)
`.Web.Host` 项目使用OpenId Connect身份认证从`.IdentityServer`获取当前用户的身份和访问令牌. 然后使用访问令牌调用 `.HttpApi.Host`. HTTP API 服务器使用bearer token验证访问令牌获取当前用户声明并授权用户.
##### 如何运行?
你需要按照以下顺序运行应用程序:
- 首先, 运行 `.IdentityServer`,因为其他应用程序依赖它做身份认证.
- 然后运行 `.HttpApi.Host`,因为`.Web.Host`应用程序使用API接口.
- 最后运行 `.Web.Host` 使用用户名: `admin` 密码: `1q2w3E*` 登录到应用程序.

39
docs/zh-Hans/Startup-Templates/Mvc.md

@ -11,7 +11,7 @@ MVC应用程序启动模板是基于[领域驱动设计](../Domain-Driven-Design
## 如何开始
你要以使用[ABP CLI](../CLI.md)创建基于此启动模板的新项目,或者你也可以在[入门](https://abp.io/get-started)页面创建并下载项目. 在这里我们使用CLI创建新项目.
你可以使用[ABP CLI](../CLI.md)创建基于此启动模板的新项目,或者你也可以在[入门](https://abp.io/get-started)页面创建并下载项目. 在这里我们使用CLI创建新项目.
如果未安装ABP CLI,第一步是安装ABP CLI
@ -71,7 +71,7 @@ abp new Acme.BookStore --tiered
项目包含常量,枚举和其他对象,这些对象实际上是领域层的一部分,但是解决方案中所有的层/项目中都会使用到.
例如 `BookType` 枚举和 `BookConts` 类 (可能是 `Book` 实体用到的常数字段,像`MaxNameLength`)都适合放在这个项目中.
例如 `BookType` 枚举和 `BookConsts` 类 (可能是 `Book` 实体用到的常数字段,像`MaxNameLength`)都适合放在这个项目中.
* 该项目不依赖解决方案中的其他项目. 其他项目直接或间接依赖该项目
@ -87,12 +87,16 @@ abp new Acme.BookStore --tiered
项目主要包含 [应用服务](../Application-Services.md) **interfaces** 和应用层的 [数据传输对象](../Data-Transfer-Objects.md) (DTO). 它用于分离应用层的接口和实现. 这种方式可以将接口项目做为约定包共享给客户端.
例如 `IBookAppService` 接口和 `BookCreationDto` 类都适合放在这个项目中.
* 它依赖 `.Domain.Shared` 因为它可能会在应用接口和DTO中使用常量,枚举和其他的共享对象.
#### .Application 项目
项目包含 `.Application.Contracts` 项目的 [应用服务](../Application-Services.md) 接口**实现**.
例如 `BookAppService` 类适合放在这个项目中.
* 它依赖 `.Application.Contracts` 项目, 因为它需要实现接口与使用DTO.
* 它依赖 `.Domain` 项目,因为它需要使用领域对象(实体,仓储接口等)执行应用程序逻辑.
@ -118,7 +122,7 @@ ABP是一个模块化的框架,理想的设计是让每个模块都有自己的
#### .DbMigrator 项目
这是一个控制台应用唾弃,它简化了在开发和生产环境执行数据库迁移的操作.当你使用它时;
这是一个控制台应用程序,它简化了在开发和生产环境执行数据库迁移的操作.当你使用它时;
* 必要时创建数据库(没有数据库时).
* 应用未迁移的数据库迁移.
@ -169,7 +173,7 @@ ABP有[动态 C# API 客户端](../AspNetCore/Dynamic-CSharp-API-Clients.md)功
>
> 你可以在表示层中使用领域实体和仓储,但是根据DDD的理论,这被认为是一种不好的做法.
#### 测试项目
#### Test 项目
解决方案有多个测试项目,每一层都会有一个:
@ -181,9 +185,9 @@ ABP有[动态 C# API 客户端](../AspNetCore/Dynamic-CSharp-API-Clients.md)功
此外, `.HttpApi.Client.ConsoleTestApp` 是一个控制台应用程序(不是自动化测试项目),它用于演示DotNet应用程序中HTTP API的用法.
测试项目已为集成测试做好准备:
测试项目是用于做集成测试的:
* 它完成集成到ABP框架和应用程序的所有服务.
* 它完全集成到ABP框架和应用程序的所有服务.
* 如果数据库提供程序是EF Core,测试项目会使用SQLite内存数据库,如果是MongoDB,它使用[Mongo2Go](https://github.com/Mongo2Go/Mongo2Go)库.
* 授权被禁用,任何的应用服务都可以在测试中轻松调用.
@ -199,7 +203,7 @@ ABP有[动态 C# API 客户端](../AspNetCore/Dynamic-CSharp-API-Clients.md)功
如果你按上面的描述指定了 `--tiered` 选项,会创建分层解决方案. 分层结构的目的是**将Web应用程序和HTTP API部署到不同的服务器**:
![bookstore-visual-studio-solution-v3](../images/tiered-solution-servers.png)
![tiered-solution-servers](../images/tiered-solution-servers.png)
* 浏览器渲染HTML,执行CSS和JavaScript来运行UI.
* Web服务器托管静态文件(CSS,JavaScript,图片...等)和动态组件(如Razor页面),它通过HTTP请求到API服务器执行应用程序的业务逻辑.
@ -212,15 +216,15 @@ ABP有[动态 C# API 客户端](../AspNetCore/Dynamic-CSharp-API-Clients.md)功
解决方案结构如下所示:
![bookstore-visual-studio-solution-v3](../images/bookstore-visual-studio-solution-tiered.png)
![bookstore-visual-studio-solution-tiered](../images/bookstore-visual-studio-solution-tiered.png)
与默认结构不同,我们得到了两个新项目: `.IdentityServer` 和 `.HttpApi.Host`.
#### .IdentityServer 项目
用于其他项目的身份验证服务器. `.Web`项目使用OpenId Connect身份验证获取当前用户的身份和访问令牌. 然后使用访问令牌调用HTTP API服务器. HTTP API服务器使用bearer token从访问令牌获取声明授权当前用户.
用于其他项目的身份验证服务器. `.Web`项目使用OpenId Connect身份验证从IdentityServer获取当前用户的身份和访问令牌. 然后使用访问令牌调用HTTP API服务器. HTTP API服务器使用bearer token从访问令牌获取声明授权当前用户.
![bookstore-visual-studio-solution-v3](../images/tiered-solution-applications.png)
![tiered-solution-applications](../images/tiered-solution-applications.png)
ABP使用开源的[IdentityServer4](https://identityserver.io/)框架做应用程序间的身份验证. 有关IdentityServer4和OpenId Connect协议的详细信息请参阅[IdentityServer4文档](http://docs.identityserver.io).
@ -228,9 +232,7 @@ ABP使用开源的[IdentityServer4](https://identityserver.io/)框架做应用
#### .HttpApi.Host 项目
该项目是一个承载解决方案API的应用程序.
它有自己的`appsettings.json`文件(数据库连接字符串等其他配置).
该项目是一个承载解决方案API的应用程序. 它有自己的`appsettings.json`文件(数据库连接字符串等其他配置).
#### .Web 项目
@ -247,13 +249,10 @@ ABP使用开源的[IdentityServer4](https://identityserver.io/)框架做应用
你应该按照以下顺序运行应用:
* 首先运行`.IdentityServer`,因为其他应用程序依赖它做身份验证.
* 然后运行`.HttpApi.Server`,因为`.Web`应用程序需要访问HTTI API.
* 然后运行`.HttpApi.Host`,因为`.Web`应用程序需要访问HTTI API.
* 最后运行`.Web`并登录到应用程序(用户名: `admin` 密码: `1q2w3E*`).
### 其他数据库提供程序
## 下一步是什么?
TODO
#### MongoDB
TODO
* 参阅[ASP.NET Core MVC 模板入门](../Getting-Started-AspNetCore-MVC-Template.md)创建此模板的新解决方案并运行它.
* 参阅[ASP.NET Core MVC 教程](../Tutorials/AspNetCore-Mvc/Part-I.md)学习使用此模板开发应用程序.

BIN
docs/zh-Hans/images/issuemanagement-module-solution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
docs/zh-Hans/images/layered-project-dependencies-module.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

18
framework/Volo.Abp.sln

@ -238,9 +238,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.Dashboards", "src\Volo.Abp.AspNetCore.Mvc.UI.Dashboards\Volo.Abp.AspNetCore.Mvc.UI.Dashboards.csproj", "{054D766D-5992-460E-A4D8-936D80BE2C1A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Ldap", "src\Volo.Abp.Ldap\Volo.Abp.Ldap.csproj", "{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ldap", "src\Volo.Abp.Ldap\Volo.Abp.Ldap.csproj", "{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Ldap.Tests", "test\Volo.Abp.Ldap.Tests\Volo.Abp.Ldap.Tests.csproj", "{38FB8F75-426E-4265-8D0E-E121837B6FCC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ldap.Tests", "test\Volo.Abp.Ldap.Tests\Volo.Abp.Ldap.Tests.csproj", "{38FB8F75-426E-4265-8D0E-E121837B6FCC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Dapper", "src\Volo.Abp.Dapper\Volo.Abp.Dapper.csproj", "{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Dapper.Tests", "test\Volo.Abp.Dapper.Tests\Volo.Abp.Dapper.Tests.csproj", "{E026A085-D881-4AE0-9F08-422AC3903BD7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -720,6 +724,14 @@ Global
{38FB8F75-426E-4265-8D0E-E121837B6FCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38FB8F75-426E-4265-8D0E-E121837B6FCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38FB8F75-426E-4265-8D0E-E121837B6FCC}.Release|Any CPU.Build.0 = Release|Any CPU
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}.Release|Any CPU.Build.0 = Release|Any CPU
{E026A085-D881-4AE0-9F08-422AC3903BD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E026A085-D881-4AE0-9F08-422AC3903BD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E026A085-D881-4AE0-9F08-422AC3903BD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E026A085-D881-4AE0-9F08-422AC3903BD7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -843,6 +855,8 @@ Global
{054D766D-5992-460E-A4D8-936D80BE2C1A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{38FB8F75-426E-4265-8D0E-E121837B6FCC} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{E026A085-D881-4AE0-9F08-422AC3903BD7} = {447C8A77-E5F0-4538-8687-7383196D04EA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

37
framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs

@ -7,16 +7,37 @@ namespace Microsoft.AspNetCore.Authentication.OAuth.Claims
{
public static void MapAbpClaimTypes(this ClaimActionCollection claimActions)
{
claimActions.MapJsonKey(AbpClaimTypes.Email, "email");
claimActions.MapJsonKey(AbpClaimTypes.UserName, "name");
claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified");
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number");
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified");
if (AbpClaimTypes.UserName != "name")
{
claimActions.MapJsonKey(AbpClaimTypes.UserName, "name");
claimActions.DeleteClaim("name");
}
claimActions.MapJsonKeyMultiple(AbpClaimTypes.Role, "role");
if (AbpClaimTypes.Email != "email")
{
claimActions.MapJsonKey(AbpClaimTypes.Email, "email");
claimActions.DeleteClaim("email");
}
claimActions.DeleteClaim("name");
claimActions.DeleteClaim("email");
if (AbpClaimTypes.EmailVerified != "email_verified")
{
claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified");
}
if (AbpClaimTypes.PhoneNumber != "phone_number")
{
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number");
}
if (AbpClaimTypes.PhoneNumberVerified != "phone_number_verified")
{
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified");
}
if (AbpClaimTypes.Role != "role")
{
claimActions.MapJsonKeyMultiple(AbpClaimTypes.Role, "role");
}
}
public static void MapJsonKeyMultiple(this ClaimActionCollection claimActions, string claimType, string jsonKey)

11
framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs

@ -1,34 +1,31 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.AspNetCore.MultiTenancy
{
public class MultiTenancyMiddleware
public class MultiTenancyMiddleware : IMiddleware, ITransientDependency
{
private readonly RequestDelegate _next;
private readonly ITenantResolver _tenantResolver;
private readonly ITenantStore _tenantStore;
private readonly ICurrentTenant _currentTenant;
private readonly ITenantResolveResultAccessor _tenantResolveResultAccessor;
public MultiTenancyMiddleware(
RequestDelegate next,
ITenantResolver tenantResolver,
ITenantStore tenantStore,
ICurrentTenant currentTenant,
ITenantResolveResultAccessor tenantResolveResultAccessor)
{
_next = next;
_tenantResolver = tenantResolver;
_tenantStore = tenantStore;
_currentTenant = currentTenant;
_tenantResolveResultAccessor = tenantResolveResultAccessor;
}
public async Task Invoke(HttpContext httpContext)
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
var resolveResult = _tenantResolver.ResolveTenantIdOrName();
_tenantResolveResultAccessor.Result = resolveResult;
@ -48,7 +45,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy
using (_currentTenant.Change(tenant?.Id, tenant?.Name))
{
await _next(httpContext);
await next(context);
}
}

13
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Core/CoreStyleContributor.cs

@ -0,0 +1,13 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Core
{
public class CoreStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/abp/core/abp.css");
}
}
}

16
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/FreezeUi/FreezeUiScriptContributor.cs

@ -1,16 +0,0 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Core;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.FreezeUi
{
[DependsOn(typeof(CoreScriptContributor))]
public class FreezeUiScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/freeze-ui/freeze-ui.min.css");
}
}
}

16
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/FreezeUi/FreezeUiStyleContributor.cs

@ -1,16 +0,0 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.FreezeUi
{
[DependsOn(typeof(BootstrapStyleContributor))]
public class FreezeUiStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/freeze-ui/freeze-ui.min.css");
}
}
}

18
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml

@ -1,14 +1,28 @@
@using Volo.Abp.AspNetCore.Mvc.AntiForgery
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.MainNavbar
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.PageAlerts
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
@inject IBrandingProvider BrandingProvider
@inject IPageLayout PageLayout
@{
Layout = null;
AbpAntiForgeryManager.SetCookie();
var containerClass = ViewBag.FluidLayout == true ? "container-fluid" : "container"; //TODO: Better and type-safe options
var pageTitle = ViewBag.Title == null ? BrandingProvider.AppName : ViewBag.Title; //TODO: Discard to get from Title
if (PageLayout.Content.Title != null)
{
if (!string.IsNullOrWhiteSpace(pageTitle))
{
pageTitle = " | " + pageTitle;
}
pageTitle = PageLayout.Content.Title + pageTitle;
}
}
<!DOCTYPE html>
@ -19,7 +33,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>@(ViewBag.Title == null ? BrandingProvider.AppName : ViewBag.Title)</title>
<title>@pageTitle</title>
<abp-style-bundle name="@BasicThemeBundles.Styles.Global" />
@ -28,7 +42,7 @@
<body class="abp-application-layout">
@(await Component.InvokeAsync<MainNavbarViewComponent>())
<div class="@containerClass">
@(await Component.InvokeAsync<PageAlertsViewComponent>())
<div id="AbpContentToolbar" class="text-right mb-3">

16
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml

@ -1,13 +1,27 @@
@using Volo.Abp.AspNetCore.Mvc.AntiForgery
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.PageAlerts
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
@inject IBrandingProvider BrandingProvider
@inject IPageLayout PageLayout
@{
Layout = null;
AbpAntiForgeryManager.SetCookie();
var containerClass = ViewBag.FluidLayout == true ? "container-fluid" : "container"; //TODO: Better and type-safe options
var pageTitle = ViewBag.Title == null ? BrandingProvider.AppName : ViewBag.Title; //TODO: Discard to get from Title
if (PageLayout.Content.Title != null)
{
if (!string.IsNullOrWhiteSpace(pageTitle))
{
pageTitle = " | " + pageTitle;
}
pageTitle = PageLayout.Content.Title + pageTitle;
}
}
<!DOCTYPE html>
@ -18,7 +32,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>@(ViewBag.Title == null ? BrandingProvider.AppName : ViewBag.Title)</title>
<title>@pageTitle</title>
<abp-style-bundle name="@BasicThemeBundles.Styles.Global" />

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Bundling/SharedThemeGlobalScriptContributor.cs

@ -1,15 +1,11 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Anchor;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Clipboard;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.DatatablesNetBs4;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.FreezeUi;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQueryForm;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQueryValidationUnobtrusive;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Lodash;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.MalihuCustomScrollbar;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Popper;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Select2;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.SweetAlert;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Timeago;
@ -28,8 +24,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling
typeof(DatatablesNetBs4ScriptContributor),
typeof(SweetalertScriptContributor),
typeof(ToastrScriptBundleContributor),
typeof(TimeagoScriptContributor),
typeof(FreezeUiScriptContributor))]
typeof(MalihuCustomScrollbarPluginScriptBundleContributor),
typeof(TimeagoScriptContributor)
)]
public class SharedThemeGlobalScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
@ -42,8 +39,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling
"/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js",
"/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js",
"/libs/abp/aspnetcore-mvc-ui-theme-shared/sweetalert/abp-sweetalert.js",
"/libs/abp/aspnetcore-mvc-ui-theme-shared/toastr/abp-toastr.js",
"/libs/abp/aspnetcore-mvc-ui-theme-shared/freeze-ui/abp-freeze-ui.js"
"/libs/abp/aspnetcore-mvc-ui-theme-shared/toastr/abp-toastr.js"
});
}
}

8
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Bundling/SharedThemeGlobalStyleContributor.cs

@ -1,8 +1,9 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Core;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.DatatablesNetBs4;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.FontAwesome;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.FreezeUi;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.MalihuCustomScrollbar;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Select2;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Toastr;
using Volo.Abp.Modularity;
@ -10,12 +11,13 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling
{
[DependsOn(
typeof(CoreStyleContributor),
typeof(BootstrapStyleContributor),
typeof(FontAwesomeStyleContributor),
typeof(ToastrStyleBundleContributor),
typeof(Select2StyleContributor),
typeof(DatatablesNetBs4StyleContributor),
typeof(FreezeUiStyleContributor)
typeof(MalihuCustomScrollbarPluginStyleBundleContributor),
typeof(DatatablesNetBs4StyleContributor)
)]
public class SharedThemeGlobalStyleContributor : BundleContributor
{

46
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/freeze-ui/abp-freeze-ui.js

@ -1,46 +0,0 @@
var abp = abp || {};
(function ($) {
if (!window.FreezeUI || !$) {
return;
}
/* MESSAGE **************************************************/
/*Package from https://alexradulescu.github.io/freeze-ui/*/
abp.ui = abp.ui || {};
/* UI BLOCK */
abp.ui.block = function (elm) {
if (elm) {
window.FreezeUI({ selector: elm });
} else {
window.FreezeUI();
}
};
abp.ui.unblock = function () {
window.UnFreezeUI();
};
/* UI BUSY */
abp.ui.setBusy = function (element, text, freezeDelay) {
var opt = { text : text ? text : ' ' };
if (element) {
opt.element = element;
}
if (freezeDelay) {
opt.freezeDelay = freezeDelay;
}
window.FreezeUI(opt);
};
abp.ui.clearBusy = function () {
window.UnFreezeUI();
};
})(jQuery);

63
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/InProcess/CurrentDirectoryHelpers.cs

@ -0,0 +1,63 @@
using System;
namespace Microsoft.AspNetCore.InProcess
{
/// <summary>
/// https://github.com/aspnet/AspNetCore.Docs/blob/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs
/// TODO: Remove CurrentDirectoryHelpers.cs when upgrade to ASP.NET Core 3.0.
/// </summary>
public class CurrentDirectoryHelpers
{
internal const string AspNetCoreModuleDll = "aspnetcorev2_inprocess.dll";
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern IntPtr GetModuleHandle(string lpModuleName);
[System.Runtime.InteropServices.DllImport(AspNetCoreModuleDll)]
private static extern int http_get_application_properties(ref IISConfigurationData iiConfigData);
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
private struct IISConfigurationData
{
public IntPtr pNativeApplication;
[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)]
public string pwzFullApplicationPath;
[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)]
public string pwzVirtualApplicationPath;
public bool fWindowsAuthEnabled;
public bool fBasicAuthEnabled;
public bool fAnonymousAuthEnable;
}
public static void SetCurrentDirectory()
{
try
{
// Check if physical path was provided by ANCM
var sitePhysicalPath = Environment.GetEnvironmentVariable("ASPNETCORE_IIS_PHYSICAL_PATH");
if (string.IsNullOrEmpty(sitePhysicalPath))
{
// Skip if not running ANCM InProcess
if (GetModuleHandle(AspNetCoreModuleDll) == IntPtr.Zero)
{
return;
}
IISConfigurationData configurationData = default(IISConfigurationData);
if (http_get_application_properties(ref configurationData) != 0)
{
return;
}
sitePhysicalPath = configurationData.pwzFullApplicationPath;
}
Environment.CurrentDirectory = sitePhysicalPath;
}
catch
{
// ignore
}
}
}
}

14
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs

@ -3,36 +3,34 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Volo.Abp.Auditing;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Users;
namespace Volo.Abp.AspNetCore.Auditing
{
public class AbpAuditingMiddleware
public class AbpAuditingMiddleware : IMiddleware, ITransientDependency
{
private readonly RequestDelegate _next;
private readonly IAuditingManager _auditingManager;
protected AbpAuditingOptions Options { get; }
protected ICurrentUser CurrentUser { get; }
public AbpAuditingMiddleware(
RequestDelegate next,
IAuditingManager auditingManager,
ICurrentUser currentUser,
IOptions<AbpAuditingOptions> options)
{
_next = next;
_auditingManager = auditingManager;
CurrentUser = currentUser;
Options = options.Value;
}
public async Task Invoke(HttpContext httpContext)
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
if (!ShouldWriteAuditLog(httpContext))
if (!ShouldWriteAuditLog(context))
{
await _next(httpContext);
await next(context);
return;
}
@ -40,7 +38,7 @@ namespace Volo.Abp.AspNetCore.Auditing
{
try
{
await _next(httpContext);
await next(context);
}
finally
{

17
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs

@ -5,46 +5,45 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
using Volo.Abp.AspNetCore.Uow;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http;
using Volo.Abp.Json;
namespace Volo.Abp.AspNetCore.Mvc.ExceptionHandling
{
public class AbpExceptionHandlingMiddleware
public class AbpExceptionHandlingMiddleware : IMiddleware, ITransientDependency
{
private readonly RequestDelegate _next;
private readonly ILogger<AbpUnitOfWorkMiddleware> _logger;
private readonly Func<object, Task> _clearCacheHeadersDelegate;
public AbpExceptionHandlingMiddleware(RequestDelegate next, ILogger<AbpUnitOfWorkMiddleware> logger)
public AbpExceptionHandlingMiddleware(ILogger<AbpUnitOfWorkMiddleware> logger)
{
_next = next;
_logger = logger;
_clearCacheHeadersDelegate = ClearCacheHeaders;
}
public async Task Invoke(HttpContext httpContext)
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
try
{
await _next(httpContext);
await next(context);
}
catch (Exception ex)
{
// We can't do anything if the response has already started, just abort.
if (httpContext.Response.HasStarted)
if (context.Response.HasStarted)
{
_logger.LogWarning("An exception occurred, but response has already started!");
throw;
}
if (httpContext.Items["_AbpActionInfo"] is AbpActionInfoInHttpContext actionInfo)
if (context.Items["_AbpActionInfo"] is AbpActionInfoInHttpContext actionInfo)
{
if (actionInfo.IsObjectResult) //TODO: Align with AbpExceptionFilter.ShouldHandleException!
{
await HandleAndWrapException(httpContext, ex);
await HandleAndWrapException(context, ex);
return;
}
}

24
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs

@ -1,34 +1,34 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Tracing;
namespace Volo.Abp.AspNetCore.Tracing
{
public class AbpCorrelationIdMiddleware
public class AbpCorrelationIdMiddleware : IMiddleware, ITransientDependency
{
private readonly RequestDelegate _next;
private readonly CorrelationIdOptions _options;
private readonly ICorrelationIdProvider _correlationIdProvider;
public AbpCorrelationIdMiddleware(RequestDelegate next)
public AbpCorrelationIdMiddleware(IOptions<CorrelationIdOptions> options,
ICorrelationIdProvider correlationIdProvider)
{
_next = next;
_options = options.Value;
_correlationIdProvider = correlationIdProvider;
}
public async Task Invoke(
HttpContext httpContext,
IOptions<CorrelationIdOptions> options,
ICorrelationIdProvider correlationIdProvider)
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
var correlationId = correlationIdProvider.Get();
var optionsValue = options.Value;
var correlationId = _correlationIdProvider.Get();
try
{
await _next(httpContext);
await next(context);
}
finally
{
CheckAndSetCorrelationIdOnResponse(httpContext, optionsValue, correlationId);
CheckAndSetCorrelationIdOnResponse(context, _options, correlationId);
}
}

13
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs

@ -1,28 +1,27 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Uow;
namespace Volo.Abp.AspNetCore.Uow
{
public class AbpUnitOfWorkMiddleware
public class AbpUnitOfWorkMiddleware : IMiddleware, ITransientDependency
{
public const string UnitOfWorkReservationName = "_AbpActionUnitOfWork";
private readonly RequestDelegate _next;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public AbpUnitOfWorkMiddleware(RequestDelegate next, IUnitOfWorkManager unitOfWorkManager)
public AbpUnitOfWorkMiddleware(IUnitOfWorkManager unitOfWorkManager)
{
_next = next;
_unitOfWorkManager = unitOfWorkManager;
}
public async Task Invoke(HttpContext httpContext)
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
using (var uow = _unitOfWorkManager.Reserve(UnitOfWorkReservationName))
{
await _next(httpContext);
await uow.CompleteAsync(httpContext.RequestAborted);
await next(context);
await uow.CompleteAsync(context.RequestAborted);
}
}
}

3
framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobInfo.cs

@ -10,8 +10,7 @@ namespace Volo.Abp.BackgroundJobs
public Guid Id { get; set; }
/// <summary>
/// Type of the job.
/// It's AssemblyQualifiedName of job type.
/// Name of the job.
/// </summary>
public virtual string JobName { get; set; }

1
framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj

@ -15,6 +15,7 @@
<PackageReference Include="Ionic.Zip" Version="1.9.1.8" />
<PackageReference Include="HtmlAgilityPack.NetCore" Version="1.5.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="NuGet.Versioning" Version="5.1.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.1.0" />

196
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

@ -1,12 +1,12 @@
using System;
using System.Diagnostics;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Versioning;
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.Commands;
using Volo.Abp.Cli.NuGet;
@ -18,7 +18,6 @@ namespace Volo.Abp.Cli
public class CliService : ITransientDependency
{
public ILogger<CliService> Logger { get; set; }
protected ICommandLineArgumentParser CommandLineArgumentParser { get; }
protected ICommandSelector CommandSelector { get; }
protected IHybridServiceScopeFactory ServiceScopeFactory { get; }
@ -40,11 +39,9 @@ namespace Volo.Abp.Cli
public async Task RunAsync(string[] args)
{
Logger.LogInformation($"ABP CLI, version {GetCliVersion()}.");
Logger.LogInformation("https://abp.io");
await CheckForNewVersion();
Logger.LogInformation("ABP CLI (https://abp.io)");
await CheckCliVersionAsync();
CheckDependencies();
var commandLineArgs = CommandLineArgumentParser.Parse(args);
@ -71,8 +68,8 @@ namespace Volo.Abp.Cli
private void CheckDependencies()
{
var installedNpmPackages = GetInstalledNpmPackages();
var installedNpmPackages = CmdHelper.RunCmdAndGetOutput("npm list -g --depth 0");
if (!installedNpmPackages.Contains(" yarn@"))
{
InstallYarn();
@ -83,35 +80,6 @@ namespace Volo.Abp.Cli
}
}
private string GetInstalledNpmPackages()
{
var output = "";
using (var process = new Process())
{
process.StartInfo = new ProcessStartInfo(CmdHelper.GetFileName())
{
Arguments = CmdHelper.GetArguments("npm list -g --depth 0"),
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true
};
process.Start();
using (var stdOut = process.StandardOutput)
{
using (var stdErr = process.StandardError)
{
output = stdOut.ReadToEnd();
output += stdErr.ReadToEnd();
}
}
}
return output;
}
private void InstallYarn()
{
Logger.LogInformation("Installing yarn...");
@ -124,47 +92,145 @@ namespace Volo.Abp.Cli
CmdHelper.RunCmd("npm install gulp -g");
}
private async Task CheckForNewVersion()
private async Task CheckCliVersionAsync()
{
var assembly = typeof(CliService).Assembly;
var toolPath = GetToolPath(assembly);
var currentCliVersion = await GetCurrentCliVersion(toolPath, assembly);
var updateChannel = GetUpdateChannel(currentCliVersion);
Logger.LogInformation($"Version {currentCliVersion} ({updateChannel} channel)");
try
{
var currentVersion = GetCliVersion();
var latestVersion = await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli");
var latestVersion = await GetLatestVersion(updateChannel);
if (!latestVersion.IsNullOrEmpty() && currentVersion != latestVersion)
if (latestVersion != null && latestVersion > currentCliVersion)
{
Logger.LogInformation("");
Logger.LogWarning("ABP CLI has a newer version (" + latestVersion + "). Please update to get the latest features and fixes.");
Logger.LogWarning("");
Logger.LogWarning("Update Command: ");
Logger.LogWarning(" dotnet tool update -g Volo.Abp.Cli");
Logger.LogWarning("");
LogNewVersionInfo(updateChannel, latestVersion, toolPath);
}
}
catch (Exception e)
{
Logger.LogWarning("Could not get the latest version infom from NuGet.org:");
Logger.LogWarning("Unable to retrieve the latest version");
Logger.LogWarning(e.Message);
}
}
private static string GetCliVersion()
private static string GetToolPath(Assembly assembly)
{
if (!assembly.Location.Contains(".store"))
{
return null;
}
return assembly.Location.Substring(0, assembly.Location.IndexOf(".store", StringComparison.Ordinal));
}
private async Task<SemanticVersion> GetCurrentCliVersion(string toolPath, Assembly assembly)
{
SemanticVersion currentCliVersion = default;
if (!string.IsNullOrEmpty(toolPath))
{
var consoleOutput = new StringReader(CmdHelper.RunCmdAndGetOutput($"dotnet tool list --tool-path {toolPath}"));
string line;
while ((line = await consoleOutput.ReadLineAsync()) != null)
{
if (line.StartsWith("Volo.Abp.Cli", StringComparison.InvariantCultureIgnoreCase))
{
var version = line.Split(new char[0], StringSplitOptions.RemoveEmptyEntries)[1];
SemanticVersion.TryParse(version, out currentCliVersion);
break;
}
}
}
if (currentCliVersion == null)
{
// If not a tool executable, fallback to assembly version and treat as dev without updates
// Assembly revisions are not supported by SemVer scheme required for NuGet, trim to {major}.{minor}.{patch}
var assemblyVersion = string.Join(".", assembly.GetFileVersion().Split('.').Take(3));
return SemanticVersion.Parse(assemblyVersion + "-dev");
}
return currentCliVersion;
}
private static UpdateChannel GetUpdateChannel(SemanticVersion currentCliVersion)
{
if (!currentCliVersion.IsPrerelease)
{
return UpdateChannel.Stable;
}
if (currentCliVersion.Release.Contains("preview"))
{
return UpdateChannel.Nightly;
}
if (currentCliVersion.Release.Contains("dev"))
{
return UpdateChannel.Development;
}
return UpdateChannel.Prerelease;
}
private async Task<SemanticVersion> GetLatestVersion(UpdateChannel updateChannel)
{
var version = typeof(CliService)
.Assembly
.GetFileVersion();
switch (updateChannel)
{
case UpdateChannel.Stable:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli");
case UpdateChannel.Prerelease:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli", includePreviews: true);
/* Assembly versions are like "2.4.0.0", but NuGet removes the last "0" here,
* like "2.4.0".
* So, we need to remove it from the assembly version to match to the NuGet version.
*/
case UpdateChannel.Nightly:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli", includeNightly: true);
if (version.Split('.').Length == 4)
default:
return default;
}
}
private void LogNewVersionInfo(UpdateChannel updateChannel, SemanticVersion latestVersion, string toolPath)
{
Logger.LogWarning(
$"ABP CLI has a newer {updateChannel.ToString().ToLowerInvariant()} version {latestVersion}, please update to get the latest features and fixes.");
Logger.LogWarning("");
Logger.LogWarning("Update Command: ");
// Update command doesn't support prerelease versions https://github.com/dotnet/sdk/issues/2551 workaround is to uninstall & install
switch (updateChannel)
{
version = version.RemovePostFix(".0");
case UpdateChannel.Stable:
Logger.LogWarning($" dotnet tool update --tool-path {toolPath} Volo.Abp.Cli");
break;
case UpdateChannel.Prerelease:
Logger.LogWarning($" dotnet tool uninstall --tool-path {toolPath} Volo.Abp.Cli");
Logger.LogWarning($" dotnet tool install --tool-path {toolPath} --version {latestVersion} Volo.Abp.Cli");
break;
case UpdateChannel.Nightly:
Logger.LogWarning($" dotnet tool uninstall --tool-path {toolPath} Volo.Abp.Cli");
Logger.LogWarning(
$" dotnet tool install --tool-path {toolPath} --add-source https://www.myget.org/F/abp-nightly/api/v3/index.json --version {latestVersion} Volo.Abp.Cli");
break;
}
return version;
Logger.LogWarning("");
}
protected enum UpdateChannel
{
Development,
Stable,
Prerelease,
Nightly
}
}
}
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs

@ -56,9 +56,9 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(" --skip-db-migrations <boolean> Specify if a new migration will be added or not.");
sb.AppendLine("");
sb.AppendLine("Examples:");
sb.AppendLine(" abp add-module Volo.Blogging Adds the module to the current soluton.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore Adds the module to the given soluton.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore --skip-db-migrations false Adds the module to the given soluton but doesn't create a database migration.");
sb.AppendLine(" abp add-module Volo.Blogging Adds the module to the current solution.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore Adds the module to the given solution.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore --skip-db-migrations false Adds the module to the given solution but doesn't create a database migration.");
sb.AppendLine("");
return Task.FromResult(sb.ToString());
@ -93,7 +93,7 @@ namespace Volo.Abp.Cli.Commands
if (foundSolutionFiles.Length == 0)
{
throw new CliUsageException("'abp add-module' command should be used inside a folder contaning a .sln file!");
throw new CliUsageException("'abp add-module' command should be used inside a folder containing a .sln file!");
}
//foundSolutionFiles.Length > 1

33
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs

@ -15,18 +15,32 @@ namespace Volo.Abp.Cli.Commands
{
public ILogger<UpdateCommand> Logger { get; set; }
private readonly VoloPackagesVersionUpdater _packagesVersionUpdater;
private readonly VoloNugetPackagesVersionUpdater _nugetPackagesVersionUpdater;
private readonly NpmPackagesUpdater _npmPackagesUpdater;
public UpdateCommand(VoloPackagesVersionUpdater packagesVersionUpdater)
public UpdateCommand(VoloNugetPackagesVersionUpdater nugetPackagesVersionUpdater, NpmPackagesUpdater npmPackagesUpdater)
{
_packagesVersionUpdater = packagesVersionUpdater;
_nugetPackagesVersionUpdater = nugetPackagesVersionUpdater;
_npmPackagesUpdater = npmPackagesUpdater;
Logger = NullLogger<UpdateCommand>.Instance;
}
public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
{
var includePreviews = commandLineArgs.Options.GetOrNull(Options.IncludePreviews.Short, Options.IncludePreviews.Long) != null;
UpdateNugetPackages(commandLineArgs);
UpdateNpmPackages();
}
private void UpdateNpmPackages()
{
_npmPackagesUpdater.Update(Directory.GetCurrentDirectory());
}
private void UpdateNugetPackages(CommandLineArgs commandLineArgs)
{
var includePreviews =
commandLineArgs.Options.GetOrNull(Options.IncludePreviews.Short, Options.IncludePreviews.Long) != null;
var solution = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sln").FirstOrDefault();
@ -34,7 +48,7 @@ namespace Volo.Abp.Cli.Commands
{
var solutionName = Path.GetFileName(solution).RemovePostFix(".sln");
_packagesVersionUpdater.UpdateSolution(solution, includePreviews);
_nugetPackagesVersionUpdater.UpdateSolution(solution, includePreviews);
Logger.LogInformation($"Volo packages are updated in {solutionName} solution.");
return;
@ -46,13 +60,14 @@ namespace Volo.Abp.Cli.Commands
{
var projectName = Path.GetFileName(project).RemovePostFix(".csproj");
_packagesVersionUpdater.UpdateProject(project, includePreviews);
_nugetPackagesVersionUpdater.UpdateProject(project, includePreviews);
Logger.LogInformation($"Volo packages are updated in {projectName} project.");
return;
}
throw new CliUsageException("No solution or project found in this directory." + Environment.NewLine + Environment.NewLine + GetUsageInfo());
throw new CliUsageException("No solution or project found in this directory." + Environment.NewLine +
Environment.NewLine + GetUsageInfo());
}
public Task<string> GetUsageInfo()
@ -77,8 +92,8 @@ namespace Volo.Abp.Cli.Commands
public Task<string> GetShortDescriptionAsync()
{
return Task.FromResult("Automatically updates all ABP related packages in a" +
" solution or project to the latest versions.");
return Task.FromResult("Automatically updates all ABP related NuGet packages and NPM packages in a" +
" solution or project to the latest versions");
}
public static class Options

24
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs

@ -1,4 +1,5 @@
using Newtonsoft.Json;
using NuGet.Versioning;
using System;
using System.Collections.Generic;
using System.Linq;
@ -23,16 +24,17 @@ namespace Volo.Abp.Cli.NuGet
CancellationTokenProvider = cancellationTokenProvider;
}
public async Task<string> GetLatestVersionOrNullAsync(string packageId, bool includePreviews = false)
public async Task<SemanticVersion> GetLatestVersionOrNullAsync(string packageId, bool includePreviews = false, bool includeNightly = false)
{
using (var client = new HttpClient())
{
client.Timeout = TimeSpan.FromSeconds(30);
var responseMessage = await client.GetAsync(
$"https://api.nuget.org/v3-flatcontainer/{packageId.ToLowerInvariant()}/index.json",
CancellationTokenProvider.Token
);
var url = includeNightly ?
$"https://www.myget.org/F/abp-nightly/api/v3/flatcontainer/{packageId.ToLowerInvariant()}/index.json" :
$"https://api.nuget.org/v3-flatcontainer/{packageId.ToLowerInvariant()}/index.json";
var responseMessage = await client.GetAsync(url, CancellationTokenProvider.Token);
if (!responseMessage.IsSuccessStatusCode)
{
@ -41,16 +43,14 @@ namespace Volo.Abp.Cli.NuGet
var result = await responseMessage.Content.ReadAsStringAsync();
var versions = JsonSerializer.Deserialize<NuGetVersionResultDto>(result).Versions;
var versions = JsonSerializer.Deserialize<NuGetVersionResultDto>(result).Versions.Select(x => SemanticVersion.Parse(x));
if (!includePreviews)
if (!includePreviews && !includeNightly)
{
versions = versions
.Where(x => !x.Contains("beta") && !x.Contains("preview") && !x.Contains("alpha") && !x.Contains("rc"))
.ToList();
versions = versions.Where(x => !x.IsPrerelease);
}
return versions.Count > 0 ? versions.Last() : null;
return versions.Any() ? versions.Max() : null;
}
}
@ -60,4 +60,4 @@ namespace Volo.Abp.Cli.NuGet
public List<string> Versions { get; set; }
}
}
}
}

9
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Mvc/MvcTemplate.cs

@ -1,6 +1,7 @@
using System.Collections.Generic;
using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.ProjectBuilding.Building.Steps;
using Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.Mvc
{
@ -24,6 +25,14 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.Mvc
SwitchDatabaseProvider(context, steps);
DeleteUnrelatedProjects(context, steps);
steps.Add(new TemplateRandomSslPortStep(new List<string>
{
"https://localhost:44300",
"https://localhost:44301",
"https://localhost:44302",
"https://localhost:44303"
}));
return steps;
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Mvc/MvcTemplateSwitchEntityFrameworkCoreToMongoDbStep.cs

@ -113,7 +113,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.Mvc
"/test/MyCompanyName.MyProjectName.Domain.Tests/MyProjectNameDomainTestModule.cs",
"MyCompanyName.MyProjectName.EntityFrameworkCore",
"MyCompanyName.MyProjectName.MongoDb",
"MyProjectNameEntityFrameworkCoreDbMigrationsModule",
"MyProjectNameEntityFrameworkCoreTestModule",
"MyProjectNameMongoDbTestModule"
);
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/MvcModule/MvcModuleTemplate.cs

@ -23,6 +23,14 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule
DeleteUnrelatedProjects(context, steps);
steps.Add(new TemplateRandomSslPortStep(new List<string>
{
"https://localhost:44300",
"https://localhost:44301",
"https://localhost:44302",
"https://localhost:44303"
}));
return steps;
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save