From 729ec1ee03d7c418c21dcf1810b880ff019987b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Thu, 15 May 2025 18:04:32 +0300 Subject: [PATCH 01/21] Improve pdf download --- modules/docs/Volo.Docs.abpmdl | 16 + .../Documents/IDocumentPdfAdminAppService.cs | 15 + .../Admin/Projects/IProjectAdminAppService.cs | 4 - .../BackgroundJobs/DocumentPdfGenerateJob.cs | 36 ++ .../DocumentPdfGenerateJobArgs.cs | 12 + .../Volo.Docs.Admin.Application.csproj | 1 + .../Docs/Admin/DocsAdminApplicationModule.cs | 4 +- .../Documents/DocumentPdfAdminAppService.cs | 67 +++ .../Admin/Projects/ProjectAdminAppService.cs | 20 - .../DocumentPdfAdminClientProxy.Generated.cs | 61 +++ .../Docs/Admin/DocumentPdfAdminClientProxy.cs | 7 + .../ProjectsAdminClientProxy.Generated.cs | 16 - .../Docs/Admin/docs-admin-generate-proxy.json | 460 ++++++++++++++++++ .../Docs/Admin/DocumentPdfAdminController.cs | 60 +++ .../Docs/Admin/ProjectsAdminController.cs | 14 - .../Docs/Admin/Projects/GeneratePdf.cshtml | 68 ++- .../Docs/Admin/Projects/GeneratePdf.cshtml.cs | 33 +- .../Pages/Docs/Admin/Projects/generatePdf.js | 54 -- .../Docs/Admin/Projects/managePdfFiles.js | 23 +- .../Volo.Docs.Admin.Web.abppkg | 2 +- .../client-proxies/docs-admin-proxy.js | 60 ++- ...o.Docs.Common.Application.Contracts.abppkg | 3 + .../Documents/IDocumentPdfAppService.cs | 12 + .../IDocumentPdfGeneratorAppService.cs | 10 - .../Volo.Docs.Common.Application.abppkg | 3 + .../Common/Documents/DocumentPdfAppService.cs | 54 ++ .../DocumentPdfGeneratorAppService.cs | 52 -- .../DocsDocumentPdfClientProxy.Generated.cs | 36 ++ .../DocsDocumentPdfClientProxy.cs | 7 + .../DocsProjectClientProxy.Generated.cs | 59 +++ .../ClientProxies/DocsProjectClientProxy.cs | 7 + ...> DocsDocumentPdfClientProxy.Generated.cs} | 4 +- ...Proxy.cs => DocsDocumentPdfClientProxy.cs} | 2 +- .../docs-common-generate-proxy.json | 102 +++- .../Volo.Docs.Common.HttpApi.Client.abppkg | 15 + .../Volo.Docs.Common.HttpApi.abppkg | 3 + .../Documents/DocsDocumentPdfController.cs | 37 ++ .../DocsDocumentPdfGeneratorController.cs | 32 -- .../Projects/Pdf/BlobProjectPdfFileStore.cs | 6 - .../Pdf/DocsProjectPdfGeneratorOptions.cs | 13 +- .../Docs/Projects/Pdf/IProjectPdfGenerator.cs | 3 +- .../Docs/Projects/Pdf/ProjectPdfGenerator.cs | 12 +- .../Volo/Docs/Projects/Project.cs | 31 ++ .../DocsDocumentClientProxy.Generated.cs | 80 +++ .../ClientProxies/DocsDocumentClientProxy.cs | 7 + .../Volo.Docs.HttpApi.Client.abppkg | 14 +- .../Pages/Documents/Project/Index.cshtml | 6 +- .../Pages/Documents/Project/Index.cshtml.cs | 16 +- .../Pages/Documents/Project/index.js | 7 + .../src/Volo.Docs.Web/Volo.Docs.Web.abppkg | 13 +- nupkg/common.ps1 | 4 + 51 files changed, 1367 insertions(+), 316 deletions(-) create mode 100644 modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentPdfAdminAppService.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/DocumentPdfAdminClientProxy.Generated.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/DocumentPdfAdminClientProxy.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentPdfAdminController.cs create mode 100644 modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo.Docs.Common.Application.Contracts.abppkg create mode 100644 modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Documents/IDocumentPdfAppService.cs delete mode 100644 modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Documents/IDocumentPdfGeneratorAppService.cs create mode 100644 modules/docs/src/Volo.Docs.Common.Application/Volo.Docs.Common.Application.abppkg create mode 100644 modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs delete mode 100644 modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfGeneratorAppService.cs create mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.Generated.cs create mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.cs create mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.Generated.cs create mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.cs rename modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/{DocsDocumentPdfGeneratorClientProxy.Generated.cs => DocsDocumentPdfClientProxy.Generated.cs} (77%) rename modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/{DocsDocumentPdfGeneratorClientProxy.cs => DocsDocumentPdfClientProxy.cs} (74%) create mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/Volo.Docs.Common.HttpApi.Client.abppkg create mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi/Volo.Docs.Common.HttpApi.abppkg create mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs delete mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfGeneratorController.cs create mode 100644 modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.Generated.cs create mode 100644 modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.cs diff --git a/modules/docs/Volo.Docs.abpmdl b/modules/docs/Volo.Docs.abpmdl index 77c70bddf8..bb861a309d 100644 --- a/modules/docs/Volo.Docs.abpmdl +++ b/modules/docs/Volo.Docs.abpmdl @@ -86,6 +86,22 @@ "Volo.Docs.MongoDB.Tests": { "path": "test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.abppkg", "folder": "test" + }, + "Volo.Docs.Common.Application": { + "path": "src/Volo.Docs.Common.Application/Volo.Docs.Common.Application.abppkg", + "folder": "src" + }, + "Volo.Docs.Common.Application.Contracts": { + "path": "src/Volo.Docs.Common.Application.Contracts/Volo.Docs.Common.Application.Contracts.abppkg", + "folder": "src" + }, + "Volo.Docs.Common.HttpApi": { + "path": "src/Volo.Docs.Common.HttpApi/Volo.Docs.Common.HttpApi.abppkg", + "folder": "src" + }, + "Volo.Docs.Common.HttpApi.Client": { + "path": "src/Volo.Docs.Common.HttpApi.Client/Volo.Docs.Common.HttpApi.Client.abppkg", + "folder": "src" } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentPdfAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentPdfAdminAppService.cs new file mode 100644 index 0000000000..ad253cecef --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentPdfAdminAppService.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Docs.Admin.Projects; +using Volo.Docs.Common.Documents; + +namespace Volo.Docs.Admin.Documents; + +public interface IDocumentPdfAdminAppService : IDocumentPdfAppService +{ + Task GeneratePdfAsync(DocumentPdfGeneratorInput input); + + Task> GetPdfFilesAsync(GetPdfFilesInput input); + + Task DeletePdfFileAsync(DeletePdfFileInput input); +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs index 41b309f308..6f3d503f44 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs @@ -22,9 +22,5 @@ namespace Volo.Docs.Admin.Projects Task ReindexAllAsync(); Task> GetListWithoutDetailsAsync(); - - Task> GetPdfFilesAsync(GetPdfFilesInput input); - - Task DeletePdfFileAsync(DeletePdfFileInput input); } } diff --git a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs new file mode 100644 index 0000000000..7bfaa641c8 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs @@ -0,0 +1,36 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Uow; +using Volo.Docs.Projects; +using Volo.Docs.Projects.Pdf; + +namespace Volo.Docs.Admin.BackgroundJobs; + +public class DocumentPdfGenerateJob : AsyncBackgroundJob, ITransientDependency +{ + protected IProjectPdfGenerator ProjectPdfGenerator { get; } + protected IProjectRepository ProjectRepository { get; } + + public DocumentPdfGenerateJob(IProjectPdfGenerator projectPdfGenerator, IProjectRepository projectRepository) + { + ProjectPdfGenerator = projectPdfGenerator; + ProjectRepository = projectRepository; + } + + [UnitOfWork] + public async override Task ExecuteAsync(DocumentPdfGenerateJobArgs args) + { + try + { + var project = await ProjectRepository.GetAsync(args.ProjectId, includeDetails: true); + await ProjectPdfGenerator.GenerateAsync(project, args.Version, args.LanguageCode); + } + catch (Exception e) + { + Logger.LogError(e, "Error while generating PDF for project {ProjectId}, version {Version}, language {LanguageCode}", args.ProjectId, args.Version, args.LanguageCode); + } + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs new file mode 100644 index 0000000000..be18746f17 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs @@ -0,0 +1,12 @@ +using System; + +namespace Volo.Docs.Admin.BackgroundJobs; + +public class DocumentPdfGenerateJobArgs +{ + public Guid ProjectId { get; set; } + + public string Version { get; set; } + + public string LanguageCode { get; set; } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj index 7279eeee67..2ecefbfd1a 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj @@ -17,6 +17,7 @@ + diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs index 7e6983d65e..9358705f94 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs @@ -4,6 +4,7 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Caching; using Volo.Abp.Modularity; using Volo.Docs.Common; +using Volo.Abp.BackgroundJobs; namespace Volo.Docs.Admin { @@ -13,7 +14,8 @@ namespace Volo.Docs.Admin typeof(DocsCommonApplicationModule), typeof(AbpCachingModule), typeof(AbpAutoMapperModule), - typeof(AbpDddApplicationModule) + typeof(AbpDddApplicationModule), + typeof(AbpBackgroundJobsModule) )] public class DocsAdminApplicationModule : AbpModule { diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs new file mode 100644 index 0000000000..234f3ae2e3 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs @@ -0,0 +1,67 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Options; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.DistributedLocking; +using Volo.Docs.Admin.BackgroundJobs; +using Volo.Docs.Admin.Projects; +using Volo.Docs.Common; +using Volo.Docs.Common.Documents; +using Volo.Docs.Projects; +using Volo.Docs.Projects.Pdf; + +namespace Volo.Docs.Admin.Documents; + +[Authorize(DocsCommonPermissions.Projects.PdfGeneration)] +public class DocumentPdfAdminAppService : DocumentPdfAppService, IDocumentPdfAdminAppService +{ + protected IBackgroundJobManager BackgroundJobManager { get; } + protected IAbpDistributedLock DistributedLock { get; } + + public DocumentPdfAdminAppService( + IProjectPdfGenerator projectPdfGenerator, + IProjectRepository projectRepository, + IProjectPdfFileStore projectPdfFileStore, + IOptions options, + IBackgroundJobManager backgroundJobManager, + IAbpDistributedLock distributedLock) : + base(projectPdfGenerator, projectRepository, projectPdfFileStore, options) + { + BackgroundJobManager = backgroundJobManager; + DistributedLock = distributedLock; + } + + public virtual async Task GeneratePdfAsync(DocumentPdfGeneratorInput input) + { + var project = await ProjectRepository.GetAsync(input.ProjectId, includeDetails: true); + await BackgroundJobManager.EnqueueAsync(new DocumentPdfGenerateJobArgs + { + Version = project.GetFullVersion(input.Version), + LanguageCode = input.LanguageCode, + ProjectId = input.ProjectId, + }); + } + + public virtual async Task> GetPdfFilesAsync(GetPdfFilesInput input) + { + var project = await ProjectRepository.GetAsync(input.ProjectId, includeDetails: true); + + var pdfFiles = project.PdfFiles.Skip(input.SkipCount).Take(input.MaxResultCount).ToList(); + + return new PagedResultDto( + project.PdfFiles.Count, + ObjectMapper.Map, List>(pdfFiles) + ); + } + + [Authorize(DocsAdminPermissions.Projects.ManagePdfFiles)] + public virtual async Task DeletePdfFileAsync(DeletePdfFileInput input) + { + var project = await ProjectRepository.GetAsync(input.ProjectId, includeDetails: true); + await ProjectPdfFileStore.DeleteAsync(project, input.Version, input.LanguageCode); + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs index abbb26abe5..af4ca2230b 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs @@ -181,25 +181,5 @@ namespace Volo.Docs.Admin.Projects var projects = await _projectRepository.GetListWithoutDetailsAsync(); return ObjectMapper.Map, List>(projects); } - - [Authorize(DocsAdminPermissions.Projects.ManagePdfFiles)] - public virtual async Task> GetPdfFilesAsync(GetPdfFilesInput input) - { - var project = await _projectRepository.GetAsync(input.ProjectId, includeDetails: true); - - var pdfFiles = project.PdfFiles.Skip(input.SkipCount).Take(input.MaxResultCount).ToList(); - - return new PagedResultDto( - project.PdfFiles.Count, - ObjectMapper.Map, List>(pdfFiles) - ); - } - - [Authorize(DocsAdminPermissions.Projects.ManagePdfFiles)] - public virtual async Task DeletePdfFileAsync(DeletePdfFileInput input) - { - var project = await _projectRepository.GetAsync(input.ProjectId, includeDetails: true); - await _projectPdfFileStore.DeleteAsync(project, input.Version, input.LanguageCode); - } } } diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/DocumentPdfAdminClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/DocumentPdfAdminClientProxy.Generated.cs new file mode 100644 index 0000000000..8c14d65460 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/DocumentPdfAdminClientProxy.Generated.cs @@ -0,0 +1,61 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Content; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; +using Volo.Docs.Admin.Projects; +using Volo.Docs.Common.Documents; + +// ReSharper disable once CheckNamespace +namespace Volo.Docs.Admin; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IDocumentPdfAppService), typeof(DocumentPdfAdminClientProxy))] +public partial class DocumentPdfAdminClientProxy : ClientProxyBase, IDocumentPdfAppService +{ + public virtual async Task GeneratePdfAsync(DocumentPdfGeneratorInput input) + { + await RequestAsync(nameof(GeneratePdfAsync), new ClientProxyRequestTypeValue + { + { typeof(DocumentPdfGeneratorInput), input } + }); + } + + public virtual async Task> GetPdfFilesAsync(GetPdfFilesInput input) + { + return await RequestAsync>(nameof(GetPdfFilesAsync), new ClientProxyRequestTypeValue + { + { typeof(GetPdfFilesInput), input } + }); + } + + public virtual async Task DeletePdfFileAsync(DeletePdfFileInput input) + { + await RequestAsync(nameof(DeletePdfFileAsync), new ClientProxyRequestTypeValue + { + { typeof(DeletePdfFileInput), input } + }); + } + + public virtual async Task DownloadPdfAsync(DocumentPdfGeneratorInput input) + { + return await RequestAsync(nameof(DownloadPdfAsync), new ClientProxyRequestTypeValue + { + { typeof(DocumentPdfGeneratorInput), input } + }); + } + + public virtual async Task ExistsAsync(DocumentPdfGeneratorInput input) + { + return await RequestAsync(nameof(ExistsAsync), new ClientProxyRequestTypeValue + { + { typeof(DocumentPdfGeneratorInput), input } + }); + } +} diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/DocumentPdfAdminClientProxy.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/DocumentPdfAdminClientProxy.cs new file mode 100644 index 0000000000..a8d5f82116 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/DocumentPdfAdminClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of DocumentPdfAdminClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Docs.Admin; + +public partial class DocumentPdfAdminClientProxy +{ +} diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/ProjectsAdminClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/ProjectsAdminClientProxy.Generated.cs index 9437ee487d..54f1ec22d5 100644 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/ProjectsAdminClientProxy.Generated.cs +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/ProjectsAdminClientProxy.Generated.cs @@ -68,22 +68,6 @@ public partial class ProjectsAdminClientProxy : ClientProxyBase>(nameof(GetListWithoutDetailsAsync)); } - public virtual async Task> GetPdfFilesAsync(GetPdfFilesInput input) - { - return await RequestAsync>(nameof(GetPdfFilesAsync), new ClientProxyRequestTypeValue - { - { typeof(GetPdfFilesInput), input } - }); - } - - public virtual async Task DeletePdfFileAsync(DeletePdfFileInput input) - { - await RequestAsync(nameof(DeletePdfFileAsync), new ClientProxyRequestTypeValue - { - { typeof(DeletePdfFileInput), input } - }); - } - public virtual async Task ReindexAsync(ReindexInput input) { await RequestAsync(nameof(ReindexAsync), new ClientProxyRequestTypeValue diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/docs-admin-generate-proxy.json b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/docs-admin-generate-proxy.json index e433e06ef9..0b3e9f9445 100644 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/docs-admin-generate-proxy.json +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/Volo/Docs/Admin/docs-admin-generate-proxy.json @@ -4,6 +4,466 @@ "rootPath": "docs-admin", "remoteServiceName": "AbpDocsAdmin", "controllers": { + "Volo.Docs.Admin.DocumentPdfAdminController": { + "controllerName": "DocumentPdfAdmin", + "controllerGroupName": "DocumentsPdfAdmin", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, + "type": "Volo.Docs.Admin.DocumentPdfAdminController", + "interfaces": [ + { + "type": "Volo.Docs.Admin.Documents.IDocumentPdfAdminAppService", + "name": "IDocumentPdfAdminAppService", + "methods": [ + { + "name": "GeneratePdfAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + { + "name": "GetPdfFilesAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Admin.Projects.GetPdfFilesInput, Volo.Docs.Admin.Application.Contracts", + "type": "Volo.Docs.Admin.Projects.GetPdfFilesInput", + "typeSimple": "Volo.Docs.Admin.Projects.GetPdfFilesInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + { + "name": "DeletePdfFileAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Admin.Projects.DeletePdfFileInput, Volo.Docs.Admin.Application.Contracts", + "type": "Volo.Docs.Admin.Projects.DeletePdfFileInput", + "typeSimple": "Volo.Docs.Admin.Projects.DeletePdfFileInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + { + "name": "DownloadPdfAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Content.IRemoteStreamContent", + "typeSimple": "Volo.Abp.Content.IRemoteStreamContent" + } + }, + { + "name": "ExistsAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Boolean", + "typeSimple": "boolean" + } + } + ] + }, + { + "type": "Volo.Docs.Common.Documents.IDocumentPdfAppService", + "name": "IDocumentPdfAppService", + "methods": [ + { + "name": "DownloadPdfAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Content.IRemoteStreamContent", + "typeSimple": "Volo.Abp.Content.IRemoteStreamContent" + } + }, + { + "name": "ExistsAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Boolean", + "typeSimple": "boolean" + } + } + ] + } + ], + "actions": { + "GeneratePdfAsyncByInput": { + "uniqueName": "GeneratePdfAsyncByInput", + "name": "GeneratePdfAsync", + "httpMethod": "GET", + "url": "api/docs/admin/documents/pdf/generate", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "ProjectId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Version", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "LanguageCode", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Docs.Admin.Documents.IDocumentPdfAdminAppService" + }, + "GetPdfFilesAsyncByInput": { + "uniqueName": "GetPdfFilesAsyncByInput", + "name": "GetPdfFilesAsync", + "httpMethod": "GET", + "url": "api/docs/admin/documents/pdf/files", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Admin.Projects.GetPdfFilesInput, Volo.Docs.Admin.Application.Contracts", + "type": "Volo.Docs.Admin.Projects.GetPdfFilesInput", + "typeSimple": "Volo.Docs.Admin.Projects.GetPdfFilesInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "ProjectId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Docs.Admin.Documents.IDocumentPdfAdminAppService" + }, + "DeletePdfFileAsyncByInput": { + "uniqueName": "DeletePdfFileAsyncByInput", + "name": "DeletePdfFileAsync", + "httpMethod": "DELETE", + "url": "api/docs/admin/documents/pdf/delete-file", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Admin.Projects.DeletePdfFileInput, Volo.Docs.Admin.Application.Contracts", + "type": "Volo.Docs.Admin.Projects.DeletePdfFileInput", + "typeSimple": "Volo.Docs.Admin.Projects.DeletePdfFileInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "ProjectId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Version", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "LanguageCode", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Docs.Admin.Documents.IDocumentPdfAdminAppService" + }, + "DownloadPdfAsyncByInput": { + "uniqueName": "DownloadPdfAsyncByInput", + "name": "DownloadPdfAsync", + "httpMethod": "GET", + "url": "api/docs/admin/documents/pdf/download", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "ProjectId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Version", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "LanguageCode", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Content.IRemoteStreamContent", + "typeSimple": "Volo.Abp.Content.IRemoteStreamContent" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Docs.Common.Documents.IDocumentPdfAppService" + }, + "ExistsAsyncByInput": { + "uniqueName": "ExistsAsyncByInput", + "name": "ExistsAsync", + "httpMethod": "GET", + "url": "api/docs/admin/documents/pdf/exists", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "ProjectId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Version", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "LanguageCode", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Boolean", + "typeSimple": "boolean" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Docs.Common.Documents.IDocumentPdfAppService" + } + } + }, "Volo.Docs.Admin.DocumentsAdminController": { "controllerName": "DocumentsAdmin", "controllerGroupName": "DocumentsAdmin", diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentPdfAdminController.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentPdfAdminController.cs new file mode 100644 index 0000000000..4cc49efc79 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentPdfAdminController.cs @@ -0,0 +1,60 @@ +using System.Threading.Tasks; +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Content; +using Volo.Docs.Admin.Documents; +using Volo.Docs.Admin.Projects; +using Volo.Docs.Common.Documents; + +namespace Volo.Docs.Admin; +[RemoteService(Name = DocsAdminRemoteServiceConsts.RemoteServiceName)] +[Area(DocsAdminRemoteServiceConsts.ModuleName)] +[ControllerName("DocumentsPdfAdmin")] +[Route("api/docs/admin/documents/pdf")] +public class DocumentPdfAdminController : AbpControllerBase, IDocumentPdfAdminAppService +{ + private readonly IDocumentPdfAdminAppService _documentPdfAdminAppService; + + public DocumentPdfAdminController(IDocumentPdfAdminAppService documentPdfAdminAppService) + { + _documentPdfAdminAppService = documentPdfAdminAppService; + } + + [HttpGet] + [Route("generate")] + public Task GeneratePdfAsync(DocumentPdfGeneratorInput input) + { + return _documentPdfAdminAppService.GeneratePdfAsync(input); + } + + [HttpGet] + [Route("files")] + public Task> GetPdfFilesAsync(GetPdfFilesInput input) + { + return _documentPdfAdminAppService.GetPdfFilesAsync(input); + } + + [HttpDelete] + [Route("delete-file")] + public Task DeletePdfFileAsync(DeletePdfFileInput input) + { + return _documentPdfAdminAppService.DeletePdfFileAsync(input); + } + + [HttpGet] + [Route("download")] + public Task DownloadPdfAsync(DocumentPdfGeneratorInput input) + { + return _documentPdfAdminAppService.DownloadPdfAsync(input); + } + + [HttpGet] + [Route("exists")] + public Task ExistsAsync(DocumentPdfGeneratorInput input) + { + return _documentPdfAdminAppService.ExistsAsync(input); + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs index e020486887..5b1cffeae1 100644 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs @@ -70,20 +70,6 @@ namespace Volo.Docs.Admin return _projectAppService.GetListWithoutDetailsAsync(); } - [HttpGet] - [Route("PdfFiles")] - public Task> GetPdfFilesAsync(GetPdfFilesInput input) - { - return _projectAppService.GetPdfFilesAsync(input); - } - - [HttpDelete] - [Route("DeletePdfFile")] - public Task DeletePdfFileAsync(DeletePdfFileInput input) - { - return _projectAppService.DeletePdfFileAsync(input); - } - [HttpPost] [Route("Reindex")] public Task ReindexAsync(ReindexInput input) diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/GeneratePdf.cshtml b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/GeneratePdf.cshtml index b8ad9742d8..64cb3d3b01 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/GeneratePdf.cshtml +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/GeneratePdf.cshtml @@ -8,40 +8,34 @@ @{ Layout = null; } - - - - - - -
- - -
-
- - -
-
- -
-
- - - - - -
\ No newline at end of file +
+ + + + + +
+ + +
+
+ + +
+
+ + + + +
+
\ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/GeneratePdf.cshtml.cs b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/GeneratePdf.cshtml.cs index 231f7c56eb..3396f3335c 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/GeneratePdf.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/GeneratePdf.cshtml.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; +using Volo.Docs.Admin.Documents; using Volo.Docs.Admin.Projects; using Volo.Docs.Common.Documents; using Volo.Docs.Common.Projects; @@ -15,20 +16,32 @@ public class GeneratePdfModal : DocsAdminPageModel { protected IProjectAppService ProjectAppService { get; } protected IProjectAdminAppService ProjectAdminAppService { get; } + protected IDocumentPdfAdminAppService DocumentPdfAdminAppService { get; } public GeneratePdfViewModel ViewModel { get; set; } + + [BindProperty(SupportsGet = true)] + public Guid ProjectId { get; set; } + + [BindProperty(SupportsGet = true)] + public string Version { get; set; } + + [BindProperty(SupportsGet = true)] + public string Language { get; set; } public GeneratePdfModal( IProjectAppService projectAppService, - IProjectAdminAppService projectAdminAppService) + IProjectAdminAppService projectAdminAppService, + IDocumentPdfAdminAppService documentPdfAdminAppService) { ProjectAppService = projectAppService; ProjectAdminAppService = projectAdminAppService; + DocumentPdfAdminAppService = documentPdfAdminAppService; } - public virtual async Task OnGetAsync(Guid id) + public virtual async Task OnGetAsync() { - var project = await ProjectAdminAppService.GetAsync(id); + var project = await ProjectAdminAppService.GetAsync(ProjectId); var versions = await ProjectAppService.GetVersionsAsync(project.ShortName); if(versions.Items.Count == 0) { @@ -40,7 +53,6 @@ public class GeneratePdfModal : DocsAdminPageModel var languages = await ProjectAppService.GetLanguageListAsync(project.ShortName, versions.Items.FirstOrDefault()?.Name); ViewModel = new GeneratePdfViewModel { - ProjectId = id, ShortName = project.ShortName, Versions = versions.Items.Select(x => new SelectListItem(x.DisplayName, x.Name)).ToList(), Languages = languages.Languages.Select(x => new SelectListItem(x.DisplayName, x.Code)).ToList() @@ -49,9 +61,20 @@ public class GeneratePdfModal : DocsAdminPageModel return Page(); } + public virtual async Task OnPostAsync() + { + await DocumentPdfAdminAppService.GeneratePdfAsync(new DocumentPdfGeneratorInput + { + ProjectId = ProjectId, + Version = Version, + LanguageCode = Language + }); + + return NoContent(); + } + public class GeneratePdfViewModel { - public Guid ProjectId { get; set; } public string ShortName { get; set; } public List Versions { get; set; } public List Languages { get; set; } diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/generatePdf.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/generatePdf.js index 91015b1584..42883088b8 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/generatePdf.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/generatePdf.js @@ -4,8 +4,6 @@ $(function () { var l = abp.localization.getResource('Docs'); var projectAppService = volo.docs.projects.docsProject; - var pdfGeneratorAppService = volo.docs.documents.docsDocumentPdfGenerator; - var projectAdminAppService = volo.docs.admin.projectsAdmin; var initModal = function (publicApi, args) { @@ -22,58 +20,6 @@ $(function () { }); }) - $("#GenerateBtn").click(function () { - var $btn = $(this); - $btn.buttonBusy(true); - $("#GenerateAndDownloadPdfBtn").buttonBusy(true); - var input = { - projectId: $("#ProjectId").val(), - version: $("#Version").val(), - languageCode: $("#Language").val(), - } - - function generatePdf(input) { - pdfGeneratorAppService.generatePdf(input, { - abpHandleError : false, - error: function (jqXHR) { - if (jqXHR.status === 200) { - abp.message.success(l('PdfFileGeneratedSuccessfully')); - $btn.buttonBusy(false); - $("#GenerateAndDownloadPdfBtn").buttonBusy(false); - } else { - abp.ajax.handleErrorStatusCode(jqXHR.status); - } - } - }); - } - if(shouldForceToGenerate(input)){ - projectAdminAppService.deletePdfFile(input).done(() =>{ - generatePdf(input); - }); - }else{ - generatePdf(input); - } - }) - - $("#GenerateAndDownloadPdfBtn").click(function () { - var input = { - projectId: $("#ProjectId").val(), - version: $("#Version").val(), - languageCode: $("#Language").val(), - } - if(shouldForceToGenerate(input)){ - projectAdminAppService.deletePdfFile(input).done(() =>{ - window.open(abp.appPath + 'api/docs/documents/pdf' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'version', value: input.version }, { name: 'languageCode', value: input.languageCode }]), '_blank'); - }); - }else{ - window.open(abp.appPath + 'api/docs/documents/pdf' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'version', value: input.version }, { name: 'languageCode', value: input.languageCode }]), '_blank'); - } - }) - - function shouldForceToGenerate(input) { - return $("#ForceToGenerate").is(":checked"); - } - return { initModal: initModal, }; diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js index 8481867f46..50af57959d 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js @@ -3,7 +3,7 @@ $(function () { abp.modals.projectManagePdfFiles = function () { var l = abp.localization.getResource('Docs'); - var projectAdminAppService = volo.docs.admin.projectsAdmin; + var documentPdfAdminAppService = volo.docs.admin.documentPdfAdmin; var _generatePdfModal = new abp.ModalManager({ viewUrl: abp.appPath + 'Docs/Admin/Projects/GeneratePdf', @@ -22,7 +22,7 @@ $(function () { scrollCollapse: true, order: [[2, 'desc']], ajax: abp.libs.datatables.createAjax( - volo.docs.admin.projectsAdmin.getPdfFiles, + documentPdfAdminAppService.getPdfFiles, { projectId : args.projectId } @@ -37,16 +37,23 @@ $(function () { return l('PdfFileDeletionWarningMessage', data.record.fileName); }, action: function (data) { - projectAdminAppService.deletePdfFile({ + documentPdfAdminAppService.deletePdfFile({ projectId: data.record.projectId, version: data.record.version, languageCode: data.record.languageCode }).then(() => { _dataTable.ajax.reloadEx(); - abp.notify.success(l('PdfGeneratedSuccessfully')); + abp.notify.success(l('PdfDeletedSuccessfully')); }) }, - } + }, + { + text: l('Download'), + action: function (data) { + var url = abp.appPath + 'api/docs/admin/documents/pdf?projectId=' + data.record.projectId + '&version=' + data.record.version + '&languageCode=' + data.record.languageCode; + window.open(url, '_blank'); + }, + }, ], }, }, @@ -78,13 +85,17 @@ $(function () { $('#GeneratePdfBtn').click(function () { _generatePdfModal.open({ - Id: args.projectId, + ProjectId: args.projectId, }); }); _generatePdfModal.onClose(function () { _dataTable.ajax.reloadEx(); }); + + _generatePdfModal.onResult(function (){ + abp.message.info(l('PdfGenerationStarted'), l('PdfGenerationStartedInfoMessage')); + }); }; return { diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.abppkg b/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.abppkg index 4e12d28da1..1c2d273971 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.abppkg +++ b/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.abppkg @@ -6,7 +6,7 @@ "applicationName": "VoloDocs.Web", "module": "docs-admin", "url": "https://localhost:5001", - "output": "wwwroot/client-proxies", + "output": "wwwroot/client-proxies/", "serviceType": "application" } } diff --git a/modules/docs/src/Volo.Docs.Admin.Web/wwwroot/client-proxies/docs-admin-proxy.js b/modules/docs/src/Volo.Docs.Admin.Web/wwwroot/client-proxies/docs-admin-proxy.js index a1e2aafaca..2551021a80 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/wwwroot/client-proxies/docs-admin-proxy.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/wwwroot/client-proxies/docs-admin-proxy.js @@ -5,6 +5,51 @@ (function(){ + // controller volo.docs.admin.documentPdfAdmin + + (function(){ + + abp.utils.createNamespace(window, 'volo.docs.admin.documentPdfAdmin'); + + volo.docs.admin.documentPdfAdmin.generatePdf = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/docs/admin/documents/pdf/generate' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'version', value: input.version }, { name: 'languageCode', value: input.languageCode }]) + '', + type: 'GET', + dataType: null + }, ajaxParams)); + }; + + volo.docs.admin.documentPdfAdmin.getPdfFiles = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/docs/admin/documents/pdf/files' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }]) + '', + type: 'GET' + }, ajaxParams)); + }; + + volo.docs.admin.documentPdfAdmin.deletePdfFile = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/docs/admin/documents/pdf/delete-file' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'version', value: input.version }, { name: 'languageCode', value: input.languageCode }]) + '', + type: 'DELETE', + dataType: null + }, ajaxParams)); + }; + + volo.docs.admin.documentPdfAdmin.downloadPdf = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/docs/admin/documents/pdf/download' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'version', value: input.version }, { name: 'languageCode', value: input.languageCode }]) + '', + type: 'GET' + }, ajaxParams)); + }; + + volo.docs.admin.documentPdfAdmin.exists = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/docs/admin/documents/pdf/exists' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'version', value: input.version }, { name: 'languageCode', value: input.languageCode }]) + '', + type: 'GET' + }, ajaxParams)); + }; + + })(); + // controller volo.docs.admin.documentsAdmin (function(){ @@ -136,21 +181,6 @@ }, ajaxParams)); }; - volo.docs.admin.projectsAdmin.getPdfFiles = function(input, ajaxParams) { - return abp.ajax($.extend(true, { - url: abp.appPath + 'api/docs/admin/projects/PdfFiles' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }]) + '', - type: 'GET' - }, ajaxParams)); - }; - - volo.docs.admin.projectsAdmin.deletePdfFile = function(input, ajaxParams) { - return abp.ajax($.extend(true, { - url: abp.appPath + 'api/docs/admin/projects/DeletePdfFile' + abp.utils.buildQueryString([{ name: 'projectId', value: input.projectId }, { name: 'version', value: input.version }, { name: 'languageCode', value: input.languageCode }]) + '', - type: 'DELETE', - dataType: null - }, ajaxParams)); - }; - volo.docs.admin.projectsAdmin.reindex = function(input, ajaxParams) { return abp.ajax($.extend(true, { url: abp.appPath + 'api/docs/admin/projects/Reindex', diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo.Docs.Common.Application.Contracts.abppkg b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo.Docs.Common.Application.Contracts.abppkg new file mode 100644 index 0000000000..5ae23d89fc --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo.Docs.Common.Application.Contracts.abppkg @@ -0,0 +1,3 @@ +{ + "role": "Volo.Docs.Application.Contracts" +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Documents/IDocumentPdfAppService.cs b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Documents/IDocumentPdfAppService.cs new file mode 100644 index 0000000000..f5ab523b1f --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Documents/IDocumentPdfAppService.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Services; +using Volo.Abp.Content; + +namespace Volo.Docs.Common.Documents; + +public interface IDocumentPdfAppService : IApplicationService +{ + Task DownloadPdfAsync(DocumentPdfGeneratorInput input); + + Task ExistsAsync(DocumentPdfGeneratorInput input); +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Documents/IDocumentPdfGeneratorAppService.cs b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Documents/IDocumentPdfGeneratorAppService.cs deleted file mode 100644 index dc8d87e820..0000000000 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Documents/IDocumentPdfGeneratorAppService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Application.Services; -using Volo.Abp.Content; - -namespace Volo.Docs.Common.Documents; - -public interface IDocumentPdfGeneratorAppService : IApplicationService -{ - Task GeneratePdfAsync(DocumentPdfGeneratorInput input); -} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application/Volo.Docs.Common.Application.abppkg b/modules/docs/src/Volo.Docs.Common.Application/Volo.Docs.Common.Application.abppkg new file mode 100644 index 0000000000..d8358a94f1 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.Application/Volo.Docs.Common.Application.abppkg @@ -0,0 +1,3 @@ +{ + "role": "Volo.Docs.Application" +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs new file mode 100644 index 0000000000..30a381a999 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs @@ -0,0 +1,54 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Options; +using Volo.Abp.Content; +using Volo.Docs.Projects; +using Volo.Docs.Projects.Pdf; + +namespace Volo.Docs.Common.Documents; + +[Authorize(DocsCommonPermissions.Projects.PdfGeneration)] +public class DocumentPdfAppService : DocsCommonAppServiceBase, IDocumentPdfAppService +{ + protected IProjectPdfGenerator ProjectPdfGenerator { get; } + protected IProjectRepository ProjectRepository { get; } + protected IProjectPdfFileStore ProjectPdfFileStore { get; } + protected IOptions Options { get; } + + public DocumentPdfAppService( + IProjectPdfGenerator projectPdfGenerator, + IProjectRepository projectRepository, + IProjectPdfFileStore projectPdfFileStore, + IOptions options) + { + ProjectPdfGenerator = projectPdfGenerator; + ProjectRepository = projectRepository; + ProjectPdfFileStore = projectPdfFileStore; + Options = options; + } + + public virtual async Task DownloadPdfAsync(DocumentPdfGeneratorInput input) + { + var project = await ProjectRepository.GetAsync(input.ProjectId); + var version = project.GetFullVersion(input.Version); + var languageCode = input.LanguageCode; + var fileName = Options.Value.CalculatePdfFileName(project, version, languageCode); + var fileStream = await ProjectPdfFileStore.GetOrNullAsync(project, version, languageCode); + + if (fileStream != null) + { + return new RemoteStreamContent(fileStream, fileName, "application/pdf"); + } + + return null; + } + + public virtual async Task ExistsAsync(DocumentPdfGeneratorInput input) + { + var project = await ProjectRepository.GetAsync(input.ProjectId); + var version = project.GetFullVersion(input.Version); + var languageCode = input.LanguageCode; + var fileName = Options.Value.CalculatePdfFileName(project, version, languageCode); + return project.FindPdfFile(fileName) != null; + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfGeneratorAppService.cs b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfGeneratorAppService.cs deleted file mode 100644 index 3960a16179..0000000000 --- a/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfGeneratorAppService.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Volo.Abp.Application.Services; -using Volo.Abp.Content; -using Volo.Abp.Data; -using Volo.Docs.Projects; -using Volo.Docs.Projects.Pdf; - -namespace Volo.Docs.Common.Documents; - -[Authorize(DocsCommonPermissions.Projects.PdfGeneration)] -public class DocumentPdfGeneratorAppService : ApplicationService, IDocumentPdfGeneratorAppService -{ - protected IProjectPdfGenerator ProjectPdfGenerator { get; } - protected IProjectRepository ProjectRepository { get; } - - public DocumentPdfGeneratorAppService( - IProjectPdfGenerator projectPdfGenerator, - IProjectRepository projectRepository) - { - ProjectPdfGenerator = projectPdfGenerator; - ProjectRepository = projectRepository; - } - - public virtual async Task GeneratePdfAsync(DocumentPdfGeneratorInput input) - { - var project = await ProjectRepository.GetAsync(input.ProjectId, includeDetails: true); - - // https://github.com/abpframework/abp/blob/e96f601641ab8a4bb7d704d3b9df2c00517d96f6/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs#L73 - var inputVersionStringBuilder = new StringBuilder(); - input.Version = inputVersionStringBuilder.Append(GetProjectVersionPrefixIfExist(project)).Append(input.Version).ToString(); - return await ProjectPdfGenerator.GenerateAsync(project, input.Version, input.LanguageCode); - } - - private string GetProjectVersionPrefixIfExist(Project project) - { - if (GetGithubVersionProviderSource(project) != GithubVersionProviderSource.Branches) - { - return string.Empty; - } - - return project.GetProperty("VersionBranchPrefix"); - } - - private GithubVersionProviderSource GetGithubVersionProviderSource(Project project) - { - return project.HasProperty("GithubVersionProviderSource") - ? project.GetProperty("GithubVersionProviderSource") - : GithubVersionProviderSource.Releases; - } -} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.Generated.cs new file mode 100644 index 0000000000..e40ce0d1ec --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.Generated.cs @@ -0,0 +1,36 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Content; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; +using Volo.Docs.Common.Documents; + +// ReSharper disable once CheckNamespace +namespace Volo.Docs.Documents; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IDocumentPdfAppService), typeof(DocsDocumentPdfClientProxy))] +public partial class DocsDocumentPdfClientProxy : ClientProxyBase, IDocumentPdfAppService +{ + public virtual async Task DownloadPdfAsync(DocumentPdfGeneratorInput input) + { + return await RequestAsync(nameof(DownloadPdfAsync), new ClientProxyRequestTypeValue + { + { typeof(DocumentPdfGeneratorInput), input } + }); + } + + public virtual async Task ExistsAsync(DocumentPdfGeneratorInput input) + { + return await RequestAsync(nameof(ExistsAsync), new ClientProxyRequestTypeValue + { + { typeof(DocumentPdfGeneratorInput), input } + }); + } +} diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.cs new file mode 100644 index 0000000000..e692a1a0ee --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of DocsDocumentPdfClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Docs.Documents; + +public partial class DocsDocumentPdfClientProxy +{ +} diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.Generated.cs new file mode 100644 index 0000000000..19170e497e --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.Generated.cs @@ -0,0 +1,59 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; +using Volo.Docs.Common.Projects; +using Volo.Docs.Documents; + +// ReSharper disable once CheckNamespace +namespace Volo.Docs.Projects; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IProjectAppService), typeof(DocsProjectClientProxy))] +public partial class DocsProjectClientProxy : ClientProxyBase, IProjectAppService +{ + public virtual async Task> GetListAsync() + { + return await RequestAsync>(nameof(GetListAsync)); + } + + public virtual async Task GetAsync(string shortName) + { + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(string), shortName } + }); + } + + public virtual async Task GetDefaultLanguageCodeAsync(string shortName, string version) + { + return await RequestAsync(nameof(GetDefaultLanguageCodeAsync), new ClientProxyRequestTypeValue + { + { typeof(string), shortName }, + { typeof(string), version } + }); + } + + public virtual async Task> GetVersionsAsync(string shortName) + { + return await RequestAsync>(nameof(GetVersionsAsync), new ClientProxyRequestTypeValue + { + { typeof(string), shortName } + }); + } + + public virtual async Task GetLanguageListAsync(string shortName, string version) + { + return await RequestAsync(nameof(GetLanguageListAsync), new ClientProxyRequestTypeValue + { + { typeof(string), shortName }, + { typeof(string), version } + }); + } +} diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.cs new file mode 100644 index 0000000000..c908205174 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of DocsProjectClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Docs.Projects; + +public partial class DocsProjectClientProxy +{ +} diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfGeneratorClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.Generated.cs similarity index 77% rename from modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfGeneratorClientProxy.Generated.cs rename to modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.Generated.cs index 39608380c5..3419472890 100644 --- a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfGeneratorClientProxy.Generated.cs +++ b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.Generated.cs @@ -15,8 +15,8 @@ using Volo.Docs.Common.Documents; namespace Volo.Docs.Documents; [Dependency(ReplaceServices = true)] -[ExposeServices(typeof(IDocumentPdfGeneratorAppService), typeof(DocsDocumentPdfGeneratorClientProxy))] -public partial class DocsDocumentPdfGeneratorClientProxy : ClientProxyBase, IDocumentPdfGeneratorAppService +[ExposeServices(typeof(IDocumentPdfAppService), typeof(DocsDocumentPdfClientProxy))] +public partial class DocsDocumentPdfClientProxy : ClientProxyBase, IDocumentPdfAppService { public virtual async Task GeneratePdfAsync(DocumentPdfGeneratorInput input) { diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfGeneratorClientProxy.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.cs similarity index 74% rename from modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfGeneratorClientProxy.cs rename to modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.cs index e14c1c25be..0ef8e84435 100644 --- a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfGeneratorClientProxy.cs +++ b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.cs @@ -2,6 +2,6 @@ // ReSharper disable once CheckNamespace namespace Volo.Docs.Documents; -public partial class DocsDocumentPdfGeneratorClientProxy +public partial class DocsDocumentPdfClientProxy { } diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/docs-common-generate-proxy.json b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/docs-common-generate-proxy.json index db7303a427..16b7c6d4b0 100644 --- a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/docs-common-generate-proxy.json +++ b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/docs-common-generate-proxy.json @@ -4,20 +4,20 @@ "rootPath": "docs-common", "remoteServiceName": "AbpDocsCommon", "controllers": { - "Volo.Docs.Documents.DocsDocumentPdfGeneratorController": { - "controllerName": "DocsDocumentPdfGenerator", - "controllerGroupName": "Document", + "Volo.Docs.Documents.DocsDocumentPdfController": { + "controllerName": "DocsDocumentPdf", + "controllerGroupName": "DocumentPdf", "isRemoteService": true, "isIntegrationService": false, "apiVersion": null, - "type": "Volo.Docs.Documents.DocsDocumentPdfGeneratorController", + "type": "Volo.Docs.Documents.DocsDocumentPdfController", "interfaces": [ { - "type": "Volo.Docs.Common.Documents.IDocumentPdfGeneratorAppService", - "name": "IDocumentPdfGeneratorAppService", + "type": "Volo.Docs.Common.Documents.IDocumentPdfAppService", + "name": "IDocumentPdfAppService", "methods": [ { - "name": "GeneratePdfAsync", + "name": "DownloadPdfAsync", "parametersOnMethod": [ { "name": "input", @@ -32,16 +32,33 @@ "type": "Volo.Abp.Content.IRemoteStreamContent", "typeSimple": "Volo.Abp.Content.IRemoteStreamContent" } + }, + { + "name": "ExistsAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Boolean", + "typeSimple": "boolean" + } } ] } ], "actions": { - "GeneratePdfAsyncByInput": { - "uniqueName": "GeneratePdfAsyncByInput", - "name": "GeneratePdfAsync", + "DownloadPdfAsyncByInput": { + "uniqueName": "DownloadPdfAsyncByInput", + "name": "DownloadPdfAsync", "httpMethod": "GET", - "url": "api/docs/documents/pdf", + "url": "api/docs/documents/pdf/download", "supportedVersions": [], "parametersOnMethod": [ { @@ -96,7 +113,68 @@ "typeSimple": "Volo.Abp.Content.IRemoteStreamContent" }, "allowAnonymous": null, - "implementFrom": "Volo.Docs.Common.Documents.IDocumentPdfGeneratorAppService" + "implementFrom": "Volo.Docs.Common.Documents.IDocumentPdfAppService" + }, + "ExistsAsyncByInput": { + "uniqueName": "ExistsAsyncByInput", + "name": "ExistsAsync", + "httpMethod": "GET", + "url": "api/docs/documents/pdf/exists", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput, Volo.Docs.Common.Application.Contracts", + "type": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "typeSimple": "Volo.Docs.Common.Documents.DocumentPdfGeneratorInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "ProjectId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Version", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "LanguageCode", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Boolean", + "typeSimple": "boolean" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Docs.Common.Documents.IDocumentPdfAppService" } } }, diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/Volo.Docs.Common.HttpApi.Client.abppkg b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/Volo.Docs.Common.HttpApi.Client.abppkg new file mode 100644 index 0000000000..a4939ea991 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/Volo.Docs.Common.HttpApi.Client.abppkg @@ -0,0 +1,15 @@ +{ + "role": "Volo.Docs.HttpApi.Client", + "proxies": { + "csharp": { + "VoloDocs.Web-docs-common": { + "applicationName": "VoloDocs.Web", + "module": "docs-common", + "url": "https://localhost:5001", + "folder": "ClientProxies", + "serviceType": "all", + "withoutContracts": true + } + } + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi/Volo.Docs.Common.HttpApi.abppkg b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo.Docs.Common.HttpApi.abppkg new file mode 100644 index 0000000000..bbc082c681 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo.Docs.Common.HttpApi.abppkg @@ -0,0 +1,3 @@ +{ + "role": "Volo.Docs.HttpApi" +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs new file mode 100644 index 0000000000..06c20093aa --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs @@ -0,0 +1,37 @@ +using System.Threading.Tasks; +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Content; +using Volo.Docs.Common; +using Volo.Docs.Common.Documents; + +namespace Volo.Docs.Documents; + +[RemoteService(Name = DocsCommonRemoteServiceConsts.RemoteServiceName)] +[Area(DocsCommonRemoteServiceConsts.ModuleName)] +[ControllerName("DocumentPdf")] +[Route("api/docs/documents/pdf")] +public class DocsDocumentPdfController : DocsControllerBase, IDocumentPdfAppService +{ + protected IDocumentPdfAppService DocumentPdfAppService { get; } + + public DocsDocumentPdfController(IDocumentPdfAppService documentPdfAppService) + { + DocumentPdfAppService = documentPdfAppService; + } + + [HttpGet] + [Route("download")] + public Task DownloadPdfAsync(DocumentPdfGeneratorInput input) + { + return DocumentPdfAppService.DownloadPdfAsync(input); + } + + [HttpGet] + [Route("exists")] + public Task ExistsAsync(DocumentPdfGeneratorInput input) + { + return DocumentPdfAppService.ExistsAsync(input); + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfGeneratorController.cs b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfGeneratorController.cs deleted file mode 100644 index 31ae2a2f44..0000000000 --- a/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfGeneratorController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Threading.Tasks; -using Asp.Versioning; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; -using Volo.Abp.Content; -using Volo.Docs.Common; -using Volo.Docs.Common.Documents; - -namespace Volo.Docs.Documents; - -[RemoteService(Name = DocsCommonRemoteServiceConsts.RemoteServiceName)] -[Area(DocsCommonRemoteServiceConsts.ModuleName)] -[ControllerName("Document")] -[Route("api/docs/documents")] -public class DocsDocumentPdfGeneratorController : DocsControllerBase, IDocumentPdfGeneratorAppService -{ - protected IDocumentPdfGeneratorAppService DocumentPdfGeneratorAppService { get; } - - public DocsDocumentPdfGeneratorController(IDocumentPdfGeneratorAppService documentPdfGeneratorAppService) - { - DocumentPdfGeneratorAppService = documentPdfGeneratorAppService; - } - - [HttpGet] - [Route("pdf")] - public async Task GeneratePdfAsync(DocumentPdfGeneratorInput input) - { - var streamContent = await DocumentPdfGeneratorAppService.GeneratePdfAsync(input); - Response.Headers.ContentDisposition = $"inline; filename=\"{streamContent.FileName}\""; - return streamContent; - } -} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/BlobProjectPdfFileStore.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/BlobProjectPdfFileStore.cs index 315d89c49c..9d12923325 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/BlobProjectPdfFileStore.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/BlobProjectPdfFileStore.cs @@ -53,12 +53,6 @@ public class BlobProjectPdfFileStore : IProjectPdfFileStore, ITransientDependenc return null; } - var lastModificationTime = pdfFile.LastModificationTime ?? pdfFile.CreationTime; - if(lastModificationTime.Add(Options.Value.PdfFileCacheExpiration) <= Clock.Now) - { - return null; - } - return await BlobContainer.GetOrNullAsync(Options.Value.CalculatePdfFileName(project, version, languageCode)); } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs index ef24e6ffd7..92c07ed1af 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs @@ -1,5 +1,4 @@ using System; -using Scriban.Syntax; namespace Volo.Docs.Projects.Pdf; @@ -29,12 +28,6 @@ public class DocsProjectPdfGeneratorOptions /// public string IndexPagePath { get; set; } - /// - /// PDF file cache expiration time. - /// Default value is 24 hours. - /// - public TimeSpan PdfFileCacheExpiration { get; set; } = TimeSpan.FromHours(24); - /// /// The function to calculate the PDF file name. /// Default is "{project.ShortName}-{version}-{languageCode}.pdf". @@ -50,6 +43,12 @@ public class DocsProjectPdfGeneratorOptions public Func DocumentContentNormalizer { get; set; } + /// + /// The maximum number of last versions to cache. + /// If null, all versions will be cached. + /// + public int? CacheLastVersionsCount { get; set; } + public DocsProjectPdfGeneratorOptions() { HtmlLayout = $@" diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IProjectPdfGenerator.cs index af685659fa..dad173bc19 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IProjectPdfGenerator.cs @@ -1,9 +1,8 @@ using System.Threading.Tasks; -using Volo.Abp.Content; namespace Volo.Docs.Projects.Pdf; public interface IProjectPdfGenerator { - Task GenerateAsync(Project project, string version, string languageCode); + Task GenerateAsync(Project project, string version, string languageCode); } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs index c00973b3e8..5abb380199 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs @@ -52,16 +52,8 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency Logger = NullLogger.Instance; } - public virtual async Task GenerateAsync(Project project, string version, string languageCode) + public virtual async Task GenerateAsync(Project project, string version, string languageCode) { - var fileName = Options.Value.CalculatePdfFileName(project, version, languageCode); - var fileStream = await ProjectPdfFileStore.GetOrNullAsync(project, version, languageCode); - - if (fileStream != null) - { - return new RemoteStreamContent(fileStream, fileName, "application/pdf"); - } - Project = project; DocumentSource = DocumentStoreFactory.Create(project.DocumentStoreType); DocumentParams = await GetDocumentParamsAsync(project, version, languageCode); @@ -74,8 +66,6 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency var pdfStream = await HtmlToPdfRenderer.RenderAsync(title, html, AllPdfDocuments); await ProjectPdfFileStore.SetAsync(project, version, languageCode, pdfStream); - - return new RemoteStreamContent(pdfStream, fileName, "application/pdf"); } protected virtual async Task BuildHtmlAsync() diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs index 69fa3a7056..03020494d8 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using System.Text; using JetBrains.Annotations; using Volo.Abp; +using Volo.Abp.Data; using Volo.Abp.Domain.Entities; namespace Volo.Docs.Projects @@ -126,5 +128,34 @@ namespace Volo.Docs.Projects PdfFiles.Remove(pdfFile); } } + + public virtual string GetFullVersion(string version) + { + var prefix = GetProjectVersionPrefixIfExist(this); + if (string.IsNullOrWhiteSpace(prefix) || version.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)) + { + return version; + } + + var inputVersionStringBuilder = new StringBuilder(); + return inputVersionStringBuilder.Append(prefix).Append(version).ToString(); + } + + protected virtual string GetProjectVersionPrefixIfExist(Project project) + { + if (GetGithubVersionProviderSource(project) != GithubVersionProviderSource.Branches) + { + return string.Empty; + } + + return project.GetProperty("VersionBranchPrefix"); + } + + protected virtual GithubVersionProviderSource GetGithubVersionProviderSource(Project project) + { + return project.HasProperty("GithubVersionProviderSource") + ? project.GetProperty("GithubVersionProviderSource") + : GithubVersionProviderSource.Releases; + } } } diff --git a/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.Generated.cs new file mode 100644 index 0000000000..418e46f6f8 --- /dev/null +++ b/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.Generated.cs @@ -0,0 +1,80 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; +using Volo.Docs.Documents; + +// ReSharper disable once CheckNamespace +namespace Volo.Docs.Documents; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IDocumentAppService), typeof(DocsDocumentClientProxy))] +public partial class DocsDocumentClientProxy : ClientProxyBase, IDocumentAppService +{ + public virtual async Task GetAsync(GetDocumentInput input) + { + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(GetDocumentInput), input } + }); + } + + public virtual async Task GetDefaultAsync(GetDefaultDocumentInput input) + { + return await RequestAsync(nameof(GetDefaultAsync), new ClientProxyRequestTypeValue + { + { typeof(GetDefaultDocumentInput), input } + }); + } + + public virtual async Task GetNavigationAsync(GetNavigationDocumentInput input) + { + return await RequestAsync(nameof(GetNavigationAsync), new ClientProxyRequestTypeValue + { + { typeof(GetNavigationDocumentInput), input } + }); + } + + public virtual async Task GetResourceAsync(GetDocumentResourceInput input) + { + return await RequestAsync(nameof(GetResourceAsync), new ClientProxyRequestTypeValue + { + { typeof(GetDocumentResourceInput), input } + }); + } + + public virtual async Task> SearchAsync(DocumentSearchInput input) + { + return await RequestAsync>(nameof(SearchAsync), new ClientProxyRequestTypeValue + { + { typeof(DocumentSearchInput), input } + }); + } + + public virtual async Task FullSearchEnabledAsync() + { + return await RequestAsync(nameof(FullSearchEnabledAsync)); + } + + public virtual async Task> GetUrlsAsync(string prefix) + { + return await RequestAsync>(nameof(GetUrlsAsync), new ClientProxyRequestTypeValue + { + { typeof(string), prefix } + }); + } + + public virtual async Task GetParametersAsync(GetParametersDocumentInput input) + { + return await RequestAsync(nameof(GetParametersAsync), new ClientProxyRequestTypeValue + { + { typeof(GetParametersDocumentInput), input } + }); + } +} diff --git a/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.cs b/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.cs new file mode 100644 index 0000000000..7671995758 --- /dev/null +++ b/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of DocsDocumentClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Docs.Documents; + +public partial class DocsDocumentClientProxy +{ +} diff --git a/modules/docs/src/Volo.Docs.HttpApi.Client/Volo.Docs.HttpApi.Client.abppkg b/modules/docs/src/Volo.Docs.HttpApi.Client/Volo.Docs.HttpApi.Client.abppkg index 7deef5e383..f32651686a 100644 --- a/modules/docs/src/Volo.Docs.HttpApi.Client/Volo.Docs.HttpApi.Client.abppkg +++ b/modules/docs/src/Volo.Docs.HttpApi.Client/Volo.Docs.HttpApi.Client.abppkg @@ -1,3 +1,15 @@ { - "role": "lib.http-api-client" + "role": "lib.http-api-client", + "proxies": { + "csharp": { + "VoloDocs.Web-docs": { + "applicationName": "VoloDocs.Web", + "module": "docs", + "url": "https://localhost:5001", + "folder": "ClientProxies", + "serviceType": "all", + "withoutContracts": true + } + } + } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml index e6a6f8470a..21d4aab5ac 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml @@ -291,12 +291,12 @@ id="sidebar-scroll" class="nav nav-list"> - @if (Model.HasDownloadPdfPermission) + @if (Model.HasDownloadPdf) { } } diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 471747fac1..ddac6c3f65 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -18,6 +18,7 @@ using Volo.Abp.Data; using Volo.Abp.Domain.Entities; using Volo.Abp.EventBus.Local; using Volo.Docs.Common; +using Volo.Docs.Common.Documents; using Volo.Docs.Common.Projects; using Volo.Docs.Documents; using Volo.Docs.Documents.Rendering; @@ -92,7 +93,7 @@ namespace Volo.Docs.Pages.Documents.Project public bool IsLatestVersion { get; private set; } - public bool HasDownloadPdfPermission { get; set; } + public bool HasDownloadPdf { get; set; } public DocumentNavigationsDto DocumentNavigationsDto { get; private set; } @@ -103,6 +104,7 @@ namespace Volo.Docs.Pages.Documents.Project private readonly IWebDocumentSectionRenderer _webDocumentSectionRenderer; private readonly DocsUiOptions _uiOptions; private readonly IPermissionChecker _permissionChecker; + private readonly IDocumentPdfAppService _documentPdfAppService; protected IDocsLinkGenerator DocsLinkGenerator => LazyServiceProvider.LazyGetRequiredService(); @@ -114,7 +116,8 @@ namespace Volo.Docs.Pages.Documents.Project IProjectAppService projectAppService, IOptions options, IWebDocumentSectionRenderer webDocumentSectionRenderer, - IPermissionChecker permissionChecker) + IPermissionChecker permissionChecker, + IDocumentPdfAppService documentPdfAppService) { ObjectMapperContext = typeof(DocsWebModule); @@ -123,6 +126,7 @@ namespace Volo.Docs.Pages.Documents.Project _projectAppService = projectAppService; _webDocumentSectionRenderer = webDocumentSectionRenderer; _permissionChecker = permissionChecker; + _documentPdfAppService = documentPdfAppService; _uiOptions = options.Value; LocalizationResourceType = typeof(DocsResource); @@ -152,7 +156,7 @@ namespace Volo.Docs.Pages.Documents.Project ShowProjectsCombobox = _uiOptions.ShowProjectsCombobox && !_uiOptions.SingleProjectMode.Enable; ShowProjectsComboboxLabel = ShowProjectsCombobox && _uiOptions.ShowProjectsComboboxLabel; FullSearchEnabled = await _documentAppService.FullSearchEnabledAsync(); - HasDownloadPdfPermission = await _permissionChecker.IsGrantedAsync(DocsCommonPermissions.Projects.PdfGeneration); + try { await SetProjectAsync(); @@ -210,6 +214,12 @@ namespace Volo.Docs.Pages.Documents.Project await SetNavigationAsync(); SetLanguageSelectListItems(); + HasDownloadPdf = await _permissionChecker.IsGrantedAsync(DocsCommonPermissions.Projects.PdfGeneration) + && await _documentPdfAppService.ExistsAsync(new() + { + ProjectId = Project.Id, Version = LatestVersionInfo.IsSelected ? LatestVersionInfo.Version : Version, LanguageCode = DocumentLanguageCode + }); + return Page(); } diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 23eca169b5..d55d9f2ef9 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -421,5 +421,12 @@ var doc = doc || {}; return originalSet.call(this, key, value); }; + $('#DownloadPdfBtn').click(function () { + var url = $(this).data('url'); + if (url) { + window.open(url, '_blank'); + } + }); + }); })(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.abppkg b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.abppkg index 8f16736603..f25f6f3d3e 100644 --- a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.abppkg +++ b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.abppkg @@ -2,7 +2,18 @@ "role": "lib.mvc", "npmDependencies": { "@abp/docs": { - "version": "" + "version": "" + } + }, + "proxies": { + "Javascript": { + "VoloDocs.Web-docs": { + "applicationName": "VoloDocs.Web", + "module": "docs", + "url": "https://localhost:5001", + "output": "wwwroot/client-proxies/", + "serviceType": "application" + } } } } \ No newline at end of file diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index e2d65a631c..e916a379d2 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -323,6 +323,10 @@ $projects = ( "modules/docs/src/Volo.Docs.Admin.Web", "modules/docs/src/Volo.Docs.Application.Contracts", "modules/docs/src/Volo.Docs.Application", + "modules/docs/src/Volo.Docs.Common.Application.Contracts", + "modules/docs/src/Volo.Docs.Common.Application", + "modules/docs/src/Volo.Docs.Common.HttpApi", + "modules/docs/src/Volo.Docs.Common.HttpApi.Client", "modules/docs/src/Volo.Docs.Domain", "modules/docs/src/Volo.Docs.Domain.Shared", "modules/docs/src/Volo.Docs.EntityFrameworkCore", From d41625646eff20523eb78ae108c242a01a0b79ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 16 May 2025 10:08:38 +0300 Subject: [PATCH 02/21] Update localization files for PDF management permissions and messages across multiple languages. --- .../Resources/Docs/ApplicationContracts/ar.json | 7 +++++-- .../Resources/Docs/ApplicationContracts/cs.json | 5 ++++- .../Resources/Docs/ApplicationContracts/de-DE.json | 5 ++++- .../Resources/Docs/ApplicationContracts/de.json | 5 ++++- .../Resources/Docs/ApplicationContracts/el.json | 7 +++++-- .../Resources/Docs/ApplicationContracts/en-GB.json | 5 ++++- .../Resources/Docs/ApplicationContracts/en.json | 5 ++++- .../Resources/Docs/ApplicationContracts/es.json | 5 ++++- .../Resources/Docs/ApplicationContracts/fi.json | 7 +++++-- .../Resources/Docs/ApplicationContracts/fr.json | 7 +++++-- .../Resources/Docs/ApplicationContracts/hi.json | 5 ++++- .../Resources/Docs/ApplicationContracts/hr.json | 5 ++++- .../Resources/Docs/ApplicationContracts/is.json | 5 ++++- .../Resources/Docs/ApplicationContracts/it.json | 5 ++++- .../Resources/Docs/ApplicationContracts/nl.json | 5 ++++- .../Resources/Docs/ApplicationContracts/pl-PL.json | 7 +++++-- .../Resources/Docs/ApplicationContracts/pt-BR.json | 7 +++++-- .../Resources/Docs/ApplicationContracts/ro-RO.json | 7 +++++-- .../Resources/Docs/ApplicationContracts/ru.json | 9 ++++++--- .../Resources/Docs/ApplicationContracts/sk.json | 5 ++++- .../Resources/Docs/ApplicationContracts/sl.json | 5 ++++- .../Resources/Docs/ApplicationContracts/sv.json | 5 ++++- .../Resources/Docs/ApplicationContracts/tr.json | 7 +++++-- .../Resources/Docs/ApplicationContracts/vi.json | 5 ++++- .../Resources/Docs/ApplicationContracts/zh-Hans.json | 11 +++++++---- .../Resources/Docs/ApplicationContracts/zh-Hant.json | 11 +++++++---- 26 files changed, 120 insertions(+), 42 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ar.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ar.json index bd93067140..bd2b0c6526 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ar.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ar.json @@ -1,7 +1,7 @@ { "culture": "ar", "texts": { - "Permission:DocumentManagement": "إدارة الوثائق", + "Permission:DocumentManagement": "إدارة المستندات", "Permission:Projects": "المشروعات", "Permission:Edit": "تعديل", "Permission:Delete": "حذف", @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "توليد وتحميل PDF", "PdfFileDeletionWarningMessage": "هل أنت متأكد أنك تريد حذف ملف PDF \"{0}\"?", "ManagePdfFiles": "إدارة ملفات PDF", - "Permission:ManagePdfFiles": "إدارة ملفات PDF" + "Permission:ManagePdfFiles": "إدارة ملفات PDF", + "PdfDeletedSuccessfully": "تم حذف ملف PDF بنجاح", + "PdfGenerationStarted": "بدأ إنشاء ملف PDF", + "PdfGenerationStartedInfoMessage": "بدأ إنشاء ملف PDF. بمجرد اكتمال العملية، يمكنك التحقق مما إذا تمت إضافة الملف في قسم ملفات PDF." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json index 9543166ac4..da63abd836 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generovat a stáhnout PDF", "PdfFileDeletionWarningMessage": "Opravdu chcete odstranit soubor PDF \"{0}\"?", "ManagePdfFiles": "Správa PDF souborů", - "Permission:ManagePdfFiles": "Správa PDF souborů" + "Permission:ManagePdfFiles": "Správa PDF souborů", + "PdfDeletedSuccessfully": "PDF soubor byl úspěšně smazán", + "PdfGenerationStarted": "Generování PDF bylo zahájeno", + "PdfGenerationStartedInfoMessage": "Generování PDF bylo zahájeno. Po dokončení můžete zkontrolovat, zda byl soubor přidán do sekce PDF souborů." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de-DE.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de-DE.json index a69c9283ea..dcbc32e310 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de-DE.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de-DE.json @@ -65,6 +65,9 @@ "GenerateAndDownloadPdf": "PDF generieren und herunterladen", "PdfFileDeletionWarningMessage": "Sind Sie sicher, dass Sie das PDF-Datei \"{0}\" löschen wollen?", "ManagePdfFiles": "PDF-Dateien verwalten", - "Permission:ManagePdfFiles": "PDF-Dateien verwalten" + "Permission:ManagePdfFiles": "PDF-Dateien verwalten", + "PdfDeletedSuccessfully": "PDF-Datei wurde erfolgreich gelöscht", + "PdfGenerationStarted": "PDF-Generierung wurde gestartet", + "PdfGenerationStartedInfoMessage": "Die PDF-Generierung wurde gestartet. Nach Abschluss können Sie überprüfen, ob die Datei im PDF-Dateibereich hinzugefügt wurde." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de.json index 1278047f50..972553c8ab 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "PDF generieren und herunterladen", "PdfFileDeletionWarningMessage": "Sind Sie sicher, dass Sie das PDF-Datei \"{0}\" löschen wollen?", "ManagePdfFiles": "PDF-Dateien verwalten", - "Permission:ManagePdfFiles": "PDF-Dateien verwalten" + "Permission:ManagePdfFiles": "PDF-Dateien verwalten", + "PdfDeletedSuccessfully": "PDF-Datei wurde erfolgreich gelöscht", + "PdfGenerationStarted": "PDF-Generierung gestartet", + "PdfGenerationStartedInfoMessage": "Die PDF-Generierung wurde gestartet. Nach Abschluss können Sie überprüfen, ob die Datei im PDF-Dateibereich hinzugefügt wurde." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/el.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/el.json index ae8108dfb5..d4142c99ad 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/el.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/el.json @@ -1,7 +1,7 @@ { "culture": "el", "texts": { - "Permission:DocumentManagement": "Διαχείρηση αρχείων", + "Permission:DocumentManagement": "Διαχείριση εγγράφων", "Permission:Projects": "Εργα", "Permission:Edit": "Επεξεργασία", "Permission:Delete": "Διαγραφή", @@ -65,6 +65,9 @@ "GenerateAndDownloadPdf": "Δημιουργία και λήψη PDF", "PdfFileDeletionWarningMessage": "Είστε βέβαιοι ότι θέλετε να διαγράψετε το PDF αρχείο \"{0}\";", "ManagePdfFiles": "Διαχείρηση PDF αρχείων", - "Permission:ManagePdfFiles": "Διαχείρηση PDF αρχείων" + "Permission:ManagePdfFiles": "Διαχείρηση PDF αρχείων", + "PdfDeletedSuccessfully": "Το αρχείο PDF διαγράφηκε με επιτυχία", + "PdfGenerationStarted": "Η δημιουργία PDF ξεκίνησε", + "PdfGenerationStartedInfoMessage": "Η δημιουργία PDF ξεκίνησε. Μόλις ολοκληρωθεί, μπορείτε να ελέγξετε αν το αρχείο έχει προστεθεί στην ενότητα αρχείων PDF." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json index 6ed2bb94cd..4e38b2cd74 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json @@ -65,6 +65,9 @@ "GenerateAndDownloadPdf": "Generate and download PDF", "PdfFileDeletionWarningMessage": "Are you sure you want to delete the PDF file \"{0}\"?", "ManagePdfFiles": "Manage PDF files", - "Permission:ManagePdfFiles": "Manage PDF files" + "Permission:ManagePdfFiles": "Manage PDF files", + "PdfDeletedSuccessfully": "PDF file has been deleted successfully", + "PdfGenerationStarted": "PDF generation has started", + "PdfGenerationStartedInfoMessage": "PDF generation has started. Once completed, you can check if the file has been added in the PDF files section." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json index bc606f7df7..db67eb8752 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generate and download PDF", "PdfFileDeletionWarningMessage": "Are you sure you want to delete the PDF file \"{0}\"?", "ManagePdfFiles": "Manage PDF files", - "Permission:ManagePdfFiles": "Manage PDF files" + "Permission:ManagePdfFiles": "Manage PDF files", + "PdfDeletedSuccessfully": "PDF file has been deleted successfully", + "PdfGenerationStarted": "PDF generation started", + "PdfGenerationStartedInfoMessage": "PDF generation has started. Once completed, you can check if the file has been added in the PDF files section." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/es.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/es.json index 79937b772d..9be8d72207 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/es.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/es.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generar y descargar PDF", "PdfFileDeletionWarningMessage": "¿Está seguro de querer eliminar el archivo PDF \"{0}\"?", "ManagePdfFiles": "Administrar archivos PDF", - "Permission:ManagePdfFiles": "Administrar archivos PDF" + "Permission:ManagePdfFiles": "Administrar archivos PDF", + "PdfDeletedSuccessfully": "El archivo PDF se ha eliminado correctamente", + "PdfGenerationStarted": "Se inició la generación de PDF", + "PdfGenerationStartedInfoMessage": "La generación del PDF ha comenzado. Una vez completado, puede verificar si el archivo se ha agregado en la sección de archivos PDF." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fi.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fi.json index d227037f32..9393234a44 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fi.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fi.json @@ -1,7 +1,7 @@ { "culture": "fi", "texts": { - "Permission:DocumentManagement": "Asiakirjojen hallinta", + "Permission:DocumentManagement": "Asiakirjahallinta", "Permission:Projects": "Projektit", "Permission:Edit": "Muokkaus", "Permission:Delete": "Poisto", @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generoi ja lataa PDF", "PdfFileDeletionWarningMessage": "Oletko varma, että haluat poistaa PDF-tiedoston \"{0}\"?", "ManagePdfFiles": "Hallitse PDF-tiedostoja", - "Permission:ManagePdfFiles": "Hallitse PDF-tiedostoja" + "Permission:ManagePdfFiles": "Hallitse PDF-tiedostoja", + "PdfDeletedSuccessfully": "PDF-tiedosto poistettu onnistuneesti", + "PdfGenerationStarted": "PDF:n luonti on aloitettu", + "PdfGenerationStartedInfoMessage": "PDF:n luonti on aloitettu. Kun se on valmis, voit tarkistaa, onko tiedosto lisätty PDF-tiedostot-osioon." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fr.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fr.json index 6efe4fe888..3e7affcaf7 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fr.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fr.json @@ -1,7 +1,7 @@ { "culture": "fr", "texts": { - "Permission:DocumentManagement": "Gestion de documents", + "Permission:DocumentManagement": "Gestion des documents", "Permission:Projects": "Projets", "Permission:Edit": "Éditer", "Permission:Delete": "Effacer", @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Générer et télécharger PDF", "PdfFileDeletionWarningMessage": "Êtes-vous sûr de vouloir supprimer le fichier PDF \"{0}\"?", "ManagePdfFiles": "Gérer les fichiers PDF", - "Permission:ManagePdfFiles": "Gérer les fichiers PDF" + "Permission:ManagePdfFiles": "Gérer les fichiers PDF", + "PdfDeletedSuccessfully": "Le fichier PDF a été supprimé avec succès", + "PdfGenerationStarted": "La génération du PDF a commencé", + "PdfGenerationStartedInfoMessage": "La génération du PDF a commencé. Une fois terminé, vous pouvez vérifier si le fichier a été ajouté dans la section des fichiers PDF." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hi.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hi.json index cdca790f20..75e43a2bde 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hi.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hi.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "PDF उत्पन्न और डाउनलोड करें", "PdfFileDeletionWarningMessage": "क्या आप वाकई \"{0}\" के PDF फ़ाइल को हटाना चाहते हैं?", "ManagePdfFiles": "PDF फ़ाइलें प्रबंधित करें", - "Permission:ManagePdfFiles": "PDF फ़ाइलें प्रबंधित करें" + "Permission:ManagePdfFiles": "PDF फ़ाइलें प्रबंधित करें", + "PdfDeletedSuccessfully": "PDF फ़ाइल सफलतापूर्वक हटा दी गई", + "PdfGenerationStarted": "PDF जनरेशन शुरू हो गया है", + "PdfGenerationStartedInfoMessage": "PDF जनरेशन शुरू हो गया है। पूरा होने के बाद, आप जांच सकते हैं कि फ़ाइल PDF फ़ाइल सेक्शन में जोड़ी गई है या नहीं।" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hr.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hr.json index 547484a062..b58648d7c5 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hr.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hr.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generiraj i preuzmi PDF", "PdfFileDeletionWarningMessage": "Jeste li sigurni da želite izbrisati PDF datoteku \"{0}\"?", "ManagePdfFiles": "Upravljanje PDF datotekama", - "Permission:ManagePdfFiles": "Upravljanje PDF datotekama" + "Permission:ManagePdfFiles": "Upravljanje PDF datotekama", + "PdfDeletedSuccessfully": "PDF datoteka je uspješno izbrisana", + "PdfGenerationStarted": "Započelo je generiranje PDF-a", + "PdfGenerationStartedInfoMessage": "Započelo je generiranje PDF-a. Nakon završetka možete provjeriti je li datoteka dodana u odjeljak PDF datoteka." } } diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/is.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/is.json index 64b41ce3b7..e262069bf7 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/is.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/is.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generate and download PDF", "PdfFileDeletionWarningMessage": "Are you sure you want to delete the PDF file \"{0}\"?", "ManagePdfFiles": "Manage PDF files", - "Permission:ManagePdfFiles": "Manage PDF files" + "Permission:ManagePdfFiles": "Manage PDF files", + "PdfDeletedSuccessfully": "PDF skrá var eytt með góðum árangri", + "PdfGenerationStarted": "PDF gerð hefur hafist", + "PdfGenerationStartedInfoMessage": "PDF gerð hefur hafist. Þegar henni er lokið geturðu athugað hvort skráin hafi verið bætt við í PDF skráarhlutanum." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/it.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/it.json index 29e7d1ba80..f253db8eb0 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/it.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/it.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Genera e scarica PDF", "PdfFileDeletionWarningMessage": "Sei sicuro di voler eliminare il file PDF \"{0}\"?", "ManagePdfFiles": "Gestione file PDF", - "Permission:ManagePdfFiles": "Gestione file PDF" + "Permission:ManagePdfFiles": "Gestione file PDF", + "PdfDeletedSuccessfully": "Il file PDF è stato eliminato con successo", + "PdfGenerationStarted": "La generazione del PDF è iniziata", + "PdfGenerationStartedInfoMessage": "La generazione del PDF è iniziata. Al termine, puoi verificare se il file è stato aggiunto nella sezione dei file PDF." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/nl.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/nl.json index 6f43a26ac8..377d0e3b84 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/nl.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/nl.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "PDF genereren en downloaden", "PdfFileDeletionWarningMessage": "Weet u zeker dat u het PDF-bestand \"{0}\" wilt verwijderen?", "ManagePdfFiles": "PDF-bestanden beheren", - "Permission:ManagePdfFiles": "PDF-bestanden beheren" + "Permission:ManagePdfFiles": "PDF-bestanden beheren", + "PdfDeletedSuccessfully": "PDF-bestand is succesvol verwijderd", + "PdfGenerationStarted": "PDF-generatie is gestart", + "PdfGenerationStartedInfoMessage": "PDF-generatie is gestart. Na voltooiing kunt u controleren of het bestand is toegevoegd in de PDF-bestandssectie." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pl-PL.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pl-PL.json index a93ee2bd0f..d82a792077 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pl-PL.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pl-PL.json @@ -1,7 +1,7 @@ { "culture": "pl-PL", "texts": { - "Permission:DocumentManagement": "Zarządzanie dokumentacją", + "Permission:DocumentManagement": "Zarządzanie dokumentami", "Permission:Projects": "Projekty", "Permission:Edit": "Edytuj", "Permission:Delete": "Usuń", @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generuj i pobierz PDF", "PdfFileDeletionWarningMessage": "Czy na pewno chcesz usunąć plik PDF \"{0}\"?", "ManagePdfFiles": "Zarządzanie plikami PDF", - "Permission:ManagePdfFiles": "Zarządzanie plikami PDF" + "Permission:ManagePdfFiles": "Zarządzaj plikami PDF", + "PdfDeletedSuccessfully": "Plik PDF został pomyślnie usunięty", + "PdfGenerationStarted": "Rozpoczęto generowanie PDF", + "PdfGenerationStartedInfoMessage": "Rozpoczęto generowanie PDF. Po zakończeniu możesz sprawdzić, czy plik został dodany w sekcji plików PDF." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json index ff8be45830..b1e0810dee 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json @@ -1,7 +1,7 @@ { "culture": "pt-BR", "texts": { - "Permission:DocumentManagement": "Gerenciar Documentos", + "Permission:DocumentManagement": "Gerenciamento de documentos", "Permission:Projects": "Projetos", "Permission:Edit": "Editar", "Permission:Delete": "Excluir", @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Gerar e baixar PDF", "PdfFileDeletionWarningMessage": "Tem certeza de que deseja excluir o arquivo PDF \"{0}\"?", "ManagePdfFiles": "Gerenciar arquivos PDF", - "Permission:ManagePdfFiles": "Gerenciar arquivos PDF" + "Permission:ManagePdfFiles": "Gerenciar arquivos PDF", + "PdfDeletedSuccessfully": "Arquivo PDF foi excluído com sucesso", + "PdfGenerationStarted": "A geração do PDF foi iniciada", + "PdfGenerationStartedInfoMessage": "A geração do PDF foi iniciada. Após a conclusão, você pode verificar se o arquivo foi adicionado na seção de arquivos PDF." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ro-RO.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ro-RO.json index 68f40183d8..2da365c7c5 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ro-RO.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ro-RO.json @@ -1,7 +1,7 @@ { "culture": "ro-RO", "texts": { - "Permission:DocumentManagement": "Administrarea documentelor", + "Permission:DocumentManagement": "Gestionare documente", "Permission:Projects": "Proiecte", "Permission:Edit": "Editează", "Permission:Delete": "Şterge", @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generare și descărcare PDF", "PdfFileDeletionWarningMessage": "Sunteți sigur(ă) că doriți să ștergeți fișierul PDF \"{0}\"?", "ManagePdfFiles": "Gestionare fișiere PDF", - "Permission:ManagePdfFiles": "Gestionare fișiere PDF" + "Permission:ManagePdfFiles": "Gestionare fișiere PDF", + "PdfDeletedSuccessfully": "Fișierul PDF a fost șters cu succes", + "PdfGenerationStarted": "Generarea PDF-ului a început", + "PdfGenerationStartedInfoMessage": "Generarea PDF-ului a început. După finalizare, puteți verifica dacă fișierul a fost adăugat în secțiunea de fișiere PDF." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ru.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ru.json index bc2691121d..5f05e906bc 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ru.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ru.json @@ -1,7 +1,7 @@ { "culture": "ru", "texts": { - "Permission:DocumentManagement": "Управление документацией", + "Permission:DocumentManagement": "Управление документами", "Permission:Projects": "Проекты", "Permission:Edit": "Редактировать", "Permission:Delete": "Удалить", @@ -65,7 +65,10 @@ "PdfGeneratedSuccessfully": "PDF успешно сгенерирован", "GenerateAndDownloadPdf": "Сгенерировать и скачать PDF", "PdfFileDeletionWarningMessage": "Вы уверены, что хотите удалить файл PDF \"{0}\"?", - "ManagePdfFiles": "Управление файлами PDF", - "Permission:ManagePdfFiles": "Управление файлами PDF" + "ManagePdfFiles": "Управление PDF файлами", + "Permission:ManagePdfFiles": "Управление PDF файлами", + "PdfDeletedSuccessfully": "PDF файл успешно удален", + "PdfGenerationStarted": "Началась генерация PDF", + "PdfGenerationStartedInfoMessage": "Началась генерация PDF. После завершения вы можете проверить, добавлен ли файл в раздел PDF файлов." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sk.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sk.json index 8b06da0e82..8ba521bb71 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sk.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sk.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generovať a stiahnuť PDF", "PdfFileDeletionWarningMessage": "Ste si istý, že chcete odstrániť súbor PDF \"{0}\"?", "ManagePdfFiles": "Správa PDF súborov", - "Permission:ManagePdfFiles": "Správa PDF súborov" + "Permission:ManagePdfFiles": "Správa PDF súborov", + "PdfDeletedSuccessfully": "PDF súbor bol úspešne odstránený", + "PdfGenerationStarted": "Začala sa generácia PDF", + "PdfGenerationStartedInfoMessage": "Začala sa generácia PDF. Po dokončení môžete skontrolovať, či bol súbor pridaný v sekcii PDF súborov." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sl.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sl.json index 0fe64f8903..dbf648bed2 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sl.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sl.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generiraj in prenesi PDF", "PdfFileDeletionWarningMessage": "Ali ste prepričani, da želite izbrisati datoteko PDF »{0}«?", "ManagePdfFiles": "Upravljanje datotek PDF", - "Permission:ManagePdfFiles": "Upravljanje datotek PDF" + "Permission:ManagePdfFiles": "Upravljanje datotek PDF", + "PdfDeletedSuccessfully": "PDF datoteka je bila uspešno izbrisana", + "PdfGenerationStarted": "Začelo se je ustvarjanje PDF-ja", + "PdfGenerationStartedInfoMessage": "Začelo se je ustvarjanje PDF-ja. Ko bo končano, lahko preverite, ali je bila datoteka dodana v razdelek PDF datotek." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sv.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sv.json index db67ecb79b..08571922d8 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sv.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sv.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Generate and download PDF", "PdfFileDeletionWarningMessage": "Are you sure you want to delete the PDF file \"{0}\"?", "ManagePdfFiles": "Manage PDF files", - "Permission:ManagePdfFiles": "Manage PDF files" + "Permission:ManagePdfFiles": "Manage PDF files", + "PdfDeletedSuccessfully": "PDF-filen har tagits bort", + "PdfGenerationStarted": "PDF-generering har påbörjats", + "PdfGenerationStartedInfoMessage": "PDF-generering har påbörjats. När den är klar kan du kontrollera om filen har lagts till i PDF-filsektionen." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json index 42283a4b89..6f2989cf2c 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json @@ -1,7 +1,7 @@ { "culture": "tr", "texts": { - "Permission:DocumentManagement": "Döküman yönetimi", + "Permission:DocumentManagement": "Belge Yönetimi", "Permission:Projects": "Projeler", "Permission:Edit": "Düzenle", "Permission:Delete": "Sil", @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "PDF oluştur ve indir", "PdfFileDeletionWarningMessage": "{0} PDF dosyasını silmek istediğinizden emin misiniz?", "ManagePdfFiles": "PDF dosyalarını yönet", - "Permission:ManagePdfFiles": "PDF dosyalarını yönet" + "Permission:ManagePdfFiles": "PDF dosyalarını yönet", + "PdfDeletedSuccessfully": "PDF dosyası başarıyla silindi", + "PdfGenerationStarted": "PDF oluşturma başladı", + "PdfGenerationStartedInfoMessage": "PDF oluşturma işlemi başlatıldı. İşlem tamamlandığında, dosyanın PDF dosyaları bölümüne eklenip eklenmediğini kontrol edebilirsiniz." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/vi.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/vi.json index 176b427e59..1b716f20f2 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/vi.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/vi.json @@ -66,6 +66,9 @@ "GenerateAndDownloadPdf": "Tạo và tải xuống PDF", "PdfFileDeletionWarningMessage": "Bạn có chắc chắn muốn xóa tệp PDF \"{0}\" không?", "ManagePdfFiles": "Quản lý tệp PDF", - "Permission:ManagePdfFiles": "Quản lý tệp PDF" + "Permission:ManagePdfFiles": "Quản lý tệp PDF", + "PdfDeletedSuccessfully": "Tệp PDF đã được xóa thành công", + "PdfGenerationStarted": "Bắt đầu tạo PDF", + "PdfGenerationStartedInfoMessage": "Quá trình tạo PDF đã bắt đầu. Sau khi hoàn thành, bạn có thể kiểm tra xem tệp đã được thêm vào phần tệp PDF chưa." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json index 137e42e4ae..7fc0d1fda6 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json @@ -42,7 +42,7 @@ "ReindexCompleted": "重新索引完成", "RemovedFromCache": "从缓存中删除并重新索引", "RemoveFromCacheConfirmation": "你确定要从缓存中删除该项吗?", - "ReIndexDocumentConfirmation": "您确定要重新索引“{0}”吗?", + "ReIndexDocumentConfirmation": "您确定要重新索引"{0}"吗?", "DeleteFromDatabase": "从数据库中删除", "Deleted": "删除", "Search": "搜索", @@ -57,15 +57,18 @@ "LastCachedTime": "缓存项", "Project": "项目", "AdvancedFilters": "高级过滤器", - "RemoveCacheAndReIndexConfirmation": "文档“{0}”将从缓存中删除并重新编制索引。 你确认吗?", + "RemoveCacheAndReIndexConfirmation": "文档"{0}"将从缓存中删除并重新编制索引。 你确认吗?", "GeneratePdf": "生成PDF", "Generating": "生成中...", "Language": "语言", "ForceToGenerateNewPdf": "强制生成新PDF", "PdfGeneratedSuccessfully": "PDF生成成功", "GenerateAndDownloadPdf": "生成并下载PDF", - "PdfFileDeletionWarningMessage": "你确定要删除PDF文件“{0}”吗?", + "PdfFileDeletionWarningMessage": "你确定要删除PDF文件"{0}"吗?", "ManagePdfFiles": "管理PDF文件", - "Permission:ManagePdfFiles": "管理PDF文件" + "Permission:ManagePdfFiles": "管理PDF文件", + "PdfDeletedSuccessfully": "PDF文件已成功删除", + "PdfGenerationStarted": "PDF生成已开始", + "PdfGenerationStartedInfoMessage": "PDF生成已开始。完成后,您可以在PDF文件部分检查文件是否已添加。" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json index bfa6e4ea97..afc7ccb398 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json @@ -42,7 +42,7 @@ "ReindexCompleted": "重新索引完成", "RemovedFromCache": "從緩存中刪除並重新編入索引", "RemoveFromCacheConfirmation": "您確定要從緩存中刪除此項嗎?", - "ReIndexDocumentConfirmation": "您確定要重新索引“{0}”嗎?", + "ReIndexDocumentConfirmation": "您確定要重新索引"{0}"嗎?", "DeleteFromDatabase": "從數據庫中刪除", "Deleted": "已刪除", "Search": "搜索", @@ -57,15 +57,18 @@ "LastCachedTime": "緩存時間", "Project": "專案", "AdvancedFilters": "進階過濾器", - "RemoveCacheAndReIndexConfirmation": "文檔“{0}”將從緩存中刪除並重新編制索引。 你確認嗎?", + "RemoveCacheAndReIndexConfirmation": "文檔"{0}"將從緩存中刪除並重新編制索引。 你確認嗎?", "GeneratePdf": "生成PDF", "Generating": "生成中...", "Language": "語言", "ForceToGenerateNewPdf": "强制生成新PDF", "PdfGeneratedSuccessfully": "PDF生成成功", "GenerateAndDownloadPdf": "生成并下载PDF", - "PdfFileDeletionWarningMessage": "你確定要刪除PDF文件“{0}”嗎?", + "PdfFileDeletionWarningMessage": "你確定要刪除PDF文件"{0}"嗎?", "ManagePdfFiles": "管理PDF文件", - "Permission:ManagePdfFiles": "管理PDF文件" + "Permission:ManagePdfFiles": "管理PDF文件", + "PdfDeletedSuccessfully": "PDF文件已成功刪除", + "PdfGenerationStarted": "PDF生成已開始", + "PdfGenerationStartedInfoMessage": "PDF生成已開始。完成後,您可以在PDF文件部分檢查文件是否已添加。" } } \ No newline at end of file From fbb462aeca5aacec3d02e905cf1feffbf24ae2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 16 May 2025 10:16:38 +0300 Subject: [PATCH 03/21] Update DocumentPdfAdminAppService.cs --- .../Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs index 234f3ae2e3..9d10d0d99a 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs @@ -3,20 +3,18 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Options; -using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.BackgroundJobs; using Volo.Abp.DistributedLocking; using Volo.Docs.Admin.BackgroundJobs; using Volo.Docs.Admin.Projects; -using Volo.Docs.Common; using Volo.Docs.Common.Documents; using Volo.Docs.Projects; using Volo.Docs.Projects.Pdf; namespace Volo.Docs.Admin.Documents; -[Authorize(DocsCommonPermissions.Projects.PdfGeneration)] +[Authorize(DocsAdminPermissions.Projects.ManagePdfFiles)] public class DocumentPdfAdminAppService : DocumentPdfAppService, IDocumentPdfAdminAppService { protected IBackgroundJobManager BackgroundJobManager { get; } @@ -58,7 +56,6 @@ public class DocumentPdfAdminAppService : DocumentPdfAppService, IDocumentPdfAdm ); } - [Authorize(DocsAdminPermissions.Projects.ManagePdfFiles)] public virtual async Task DeletePdfFileAsync(DeletePdfFileInput input) { var project = await ProjectRepository.GetAsync(input.ProjectId, includeDetails: true); From e997d852cd2ee33df90b79e5ca49782e8432be6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 16 May 2025 10:22:01 +0300 Subject: [PATCH 04/21] Update zh-Hans.json --- .../Resources/Docs/ApplicationContracts/zh-Hans.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json index 7fc0d1fda6..a7af969a12 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json @@ -42,7 +42,7 @@ "ReindexCompleted": "重新索引完成", "RemovedFromCache": "从缓存中删除并重新索引", "RemoveFromCacheConfirmation": "你确定要从缓存中删除该项吗?", - "ReIndexDocumentConfirmation": "您确定要重新索引"{0}"吗?", + "ReIndexDocumentConfirmation": "您确定要重新索引“{0}”吗?", "DeleteFromDatabase": "从数据库中删除", "Deleted": "删除", "Search": "搜索", @@ -57,14 +57,14 @@ "LastCachedTime": "缓存项", "Project": "项目", "AdvancedFilters": "高级过滤器", - "RemoveCacheAndReIndexConfirmation": "文档"{0}"将从缓存中删除并重新编制索引。 你确认吗?", + "RemoveCacheAndReIndexConfirmation": "文档“{0}”将从缓存中删除并重新编制索引。 你确认吗?", "GeneratePdf": "生成PDF", "Generating": "生成中...", "Language": "语言", "ForceToGenerateNewPdf": "强制生成新PDF", "PdfGeneratedSuccessfully": "PDF生成成功", "GenerateAndDownloadPdf": "生成并下载PDF", - "PdfFileDeletionWarningMessage": "你确定要删除PDF文件"{0}"吗?", + "PdfFileDeletionWarningMessage": "你确定要删除PDF文件“{0}”吗?", "ManagePdfFiles": "管理PDF文件", "Permission:ManagePdfFiles": "管理PDF文件", "PdfDeletedSuccessfully": "PDF文件已成功删除", From aafda7966e6dcf6402dfd2bdd75a623ff8738e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 16 May 2025 10:22:05 +0300 Subject: [PATCH 05/21] Update zh-Hant.json --- .../Resources/Docs/ApplicationContracts/zh-Hant.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json index afc7ccb398..99cc9cec27 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json @@ -42,7 +42,7 @@ "ReindexCompleted": "重新索引完成", "RemovedFromCache": "從緩存中刪除並重新編入索引", "RemoveFromCacheConfirmation": "您確定要從緩存中刪除此項嗎?", - "ReIndexDocumentConfirmation": "您確定要重新索引"{0}"嗎?", + "ReIndexDocumentConfirmation": "您確定要重新索引“{0}”嗎?", "DeleteFromDatabase": "從數據庫中刪除", "Deleted": "已刪除", "Search": "搜索", @@ -57,14 +57,14 @@ "LastCachedTime": "緩存時間", "Project": "專案", "AdvancedFilters": "進階過濾器", - "RemoveCacheAndReIndexConfirmation": "文檔"{0}"將從緩存中刪除並重新編制索引。 你確認嗎?", + "RemoveCacheAndReIndexConfirmation": "文檔“{0}”將從緩存中刪除並重新編制索引。 你確認嗎?", "GeneratePdf": "生成PDF", "Generating": "生成中...", "Language": "語言", "ForceToGenerateNewPdf": "强制生成新PDF", "PdfGeneratedSuccessfully": "PDF生成成功", "GenerateAndDownloadPdf": "生成并下载PDF", - "PdfFileDeletionWarningMessage": "你確定要刪除PDF文件"{0}"嗎?", + "PdfFileDeletionWarningMessage": "你確定要刪除PDF文件“{0}”嗎?", "ManagePdfFiles": "管理PDF文件", "Permission:ManagePdfFiles": "管理PDF文件", "PdfDeletedSuccessfully": "PDF文件已成功刪除", From d110f9c041113e699e52bd4b9251268d2c874056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 16 May 2025 10:31:04 +0300 Subject: [PATCH 06/21] Update PDF permissions from generation to download and localize changes across multiple languages. --- .../Volo/Docs/Common/DocsCommonPermissionDefinitionProvider.cs | 2 +- .../Volo/Docs/Common/DocsCommonPermissions.cs | 2 +- .../Localization/Resources/Docs/ApplicationContracts/ar.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/cs.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/de-DE.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/de.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/el.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/en-GB.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/en.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/es.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/fi.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/fr.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/hi.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/hr.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/hu.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/is.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/it.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/nl.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/pl-PL.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/pt-BR.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/ro-RO.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/ru.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/sk.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/sl.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/sv.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/tr.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/vi.json | 2 +- .../Resources/Docs/ApplicationContracts/zh-Hans.json | 2 +- .../Resources/Docs/ApplicationContracts/zh-Hant.json | 2 +- .../Volo/Docs/Common/Documents/DocumentPdfAppService.cs | 2 +- .../src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/DocsCommonPermissionDefinitionProvider.cs b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/DocsCommonPermissionDefinitionProvider.cs index 0bdfc7fa1d..4007cb2598 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/DocsCommonPermissionDefinitionProvider.cs +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/DocsCommonPermissionDefinitionProvider.cs @@ -10,7 +10,7 @@ namespace Volo.Docs.Common { var group = context.AddGroup(DocsCommonPermissions.GroupName, L("Permission:DocumentManagement.Common")); - group.AddPermission(DocsCommonPermissions.Projects.PdfGeneration, L("Permission:PdfGeneration")); + group.AddPermission(DocsCommonPermissions.Projects.PdfDownload, L("Permission:PdfDownload")); } private static LocalizableString L(string name) diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/DocsCommonPermissions.cs b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/DocsCommonPermissions.cs index f668f00813..e07d950110 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/DocsCommonPermissions.cs +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/DocsCommonPermissions.cs @@ -8,7 +8,7 @@ namespace Volo.Docs.Common public static class Projects { - public const string PdfGeneration = GroupName + ".PdfGeneration"; + public const string PdfDownload = GroupName + ".PdfDownload"; } public static string[] GetAll() diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ar.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ar.json index ff14b26dc6..71e129fa64 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ar.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ar.json @@ -2,6 +2,6 @@ "culture": "ar", "texts": { "Permission:DocumentManagement.Common": "إدارة المستندات العامة", - "Permission:PdfGeneration": "إنشاء ملفات PDF" + "Permission:PdfDownload": "تحميل ملفات PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/cs.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/cs.json index 7999e95a27..213dddc37d 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/cs.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/cs.json @@ -2,6 +2,6 @@ "culture": "cs", "texts": { "Permission:DocumentManagement.Common": "Správa dokumentů", - "Permission:PdfGeneration": "Generování PDF" + "Permission:PdfDownload": "Stahování PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/de-DE.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/de-DE.json index 0b2c842bb3..3310b5e4a3 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/de-DE.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/de-DE.json @@ -2,6 +2,6 @@ "culture": "de-DE", "texts": { "Permission:DocumentManagement.Common": "Dokumentenverwaltung", - "Permission:PdfGeneration": "PDF-Generierung" + "Permission:PdfDownload": "PDF-Herunterladen" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/de.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/de.json index 95d2923d1e..0b8d5986b1 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/de.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/de.json @@ -2,6 +2,6 @@ "culture": "de", "texts": { "Permission:DocumentManagement.Common": "Dokumentenverwaltung", - "Permission:PdfGeneration": "PDF-Generierung" + "Permission:PdfDownload": "PDF-Herunterladen" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/el.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/el.json index 3200537f6d..176c9fed46 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/el.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/el.json @@ -2,6 +2,6 @@ "culture": "el", "texts": { "Permission:DocumentManagement.Common": "Διαχείριση Εγγράφων", - "Permission:PdfGeneration": "Δημιουργία PDF" + "Permission:PdfDownload": "Λήψη PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/en-GB.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/en-GB.json index 8f01efadbf..ffe3694967 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/en-GB.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/en-GB.json @@ -2,6 +2,6 @@ "culture": "en-GB", "texts": { "Permission:DocumentManagement.Common": "Document Management Common", - "Permission:PdfGeneration": "PDF Generation" + "Permission:PdfDownload": "PDF Download" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/en.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/en.json index 3901eb8d1c..1113f1909f 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/en.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/en.json @@ -2,6 +2,6 @@ "culture": "en", "texts": { "Permission:DocumentManagement.Common": "Document Management Common", - "Permission:PdfGeneration": "PDF Generation" + "Permission:PdfDownload": "PDF Download" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/es.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/es.json index 707bd71c72..4d96926a28 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/es.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/es.json @@ -2,6 +2,6 @@ "culture": "es", "texts": { "Permission:DocumentManagement.Common": "Gestión de documentos comunes", - "Permission:PdfGeneration": "Generación de PDF" + "Permission:PdfDownload": "Descarga de PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/fi.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/fi.json index 7e3a84ff00..f9791278f6 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/fi.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/fi.json @@ -2,6 +2,6 @@ "culture": "fi", "texts": { "Permission:DocumentManagement.Common": "Tiedostonhallinta", - "Permission:PdfGeneration": "PDF-generointi" + "Permission:PdfDownload": "PDF-lataaminen" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/fr.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/fr.json index 6eba3e78c1..6cf85a2294 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/fr.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/fr.json @@ -2,6 +2,6 @@ "culture": "fr", "texts": { "Permission:DocumentManagement.Common": "Gestion des documents communs", - "Permission:PdfGeneration": "Génération de PDF" + "Permission:PdfDownload": "Téléchargement de PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hi.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hi.json index 5208d04868..80485999b5 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hi.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hi.json @@ -2,6 +2,6 @@ "culture": "hi", "texts": { "Permission:DocumentManagement.Common": "सामान्य दस्तावेज़ प्रबंधन", - "Permission:PdfGeneration": "PDF उत्पन्न करना" + "Permission:PdfDownload": "PDF डाउनलोड करना" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hr.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hr.json index 8da0d89a98..ae3e2b219a 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hr.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hr.json @@ -2,6 +2,6 @@ "culture": "hr", "texts": { "Permission:DocumentManagement.Common": "Upravljanje zajedničkih dokumenata", - "Permission:PdfGeneration": "Generiranje PDF-a" + "Permission:PdfDownload": "Preuzimanje PDF-a" } } diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hu.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hu.json index 30a2bd39f8..32868a4c7c 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hu.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/hu.json @@ -2,6 +2,6 @@ "culture": "hu", "texts": { "Permission:DocumentManagement.Common": "Általános dokumentumkezelés", - "Permission:PdfGeneration": "PDF generálás" + "Permission:PdfDownload": "PDF letöltése" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/is.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/is.json index 9e0f6b19c9..7f39fb6170 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/is.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/is.json @@ -2,6 +2,6 @@ "culture": "is", "texts": { "Permission:DocumentManagement.Common": "Almennir skjöl", - "Permission:PdfGeneration": "Breyta í PDF" + "Permission:PdfDownload": "Breyta í PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/it.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/it.json index 1616e2cecb..fd586ae4a0 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/it.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/it.json @@ -2,6 +2,6 @@ "culture": "it", "texts": { "Permission:DocumentManagement.Common": "Gestione documenti comuni", - "Permission:PdfGeneration": "Generazione PDF" + "Permission:PdfDownload": "Download PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/nl.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/nl.json index 64e170aaf8..29e5bf8a9c 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/nl.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/nl.json @@ -2,6 +2,6 @@ "culture": "nl", "texts": { "Permission:DocumentManagement.Common": "Algemene documentbeheer", - "Permission:PdfGeneration": "PDF-generatie" + "Permission:PdfDownload": "PDF downloaden" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/pl-PL.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/pl-PL.json index 89c83f4063..8268413768 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/pl-PL.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/pl-PL.json @@ -2,6 +2,6 @@ "culture": "pl-PL", "texts": { "Permission:DocumentManagement.Common": "Zarządzanie dokumentami", - "Permission:PdfGeneration": "Generowanie PDF" + "Permission:PdfDownload": "Pobieranie PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/pt-BR.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/pt-BR.json index e9c83fc560..a84f075202 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/pt-BR.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/pt-BR.json @@ -2,6 +2,6 @@ "culture": "pt-BR", "texts": { "Permission:DocumentManagement.Common": "Gerenciamento de documentos comuns", - "Permission:PdfGeneration": "Geração de PDF" + "Permission:PdfDownload": "Download de PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ro-RO.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ro-RO.json index b5cc16b376..8c037ebff5 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ro-RO.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ro-RO.json @@ -2,6 +2,6 @@ "culture": "ro-RO", "texts": { "Permission:DocumentManagement.Common": "Gestionarea documentelor comune", - "Permission:PdfGeneration": "Generarea PDF" + "Permission:PdfDownload": "Descărcare PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ru.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ru.json index f110638da1..950217d67c 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ru.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/ru.json @@ -2,6 +2,6 @@ "culture": "ru", "texts": { "Permission:DocumentManagement.Common": "Общее управление документами", - "Permission:PdfGeneration": "Генерация PDF" + "Permission:PdfDownload": "Скачивание PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sk.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sk.json index aca12e8304..d6a97d88f8 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sk.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sk.json @@ -2,6 +2,6 @@ "culture": "sk", "texts": { "Permission:DocumentManagement.Common": "Správa dokumentov", - "Permission:PdfGeneration": "Generovanie PDF" + "Permission:PdfDownload": "Generovanie PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sl.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sl.json index 1adc834a47..0f8d8bd2ae 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sl.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sl.json @@ -2,6 +2,6 @@ "culture": "sl", "texts": { "Permission:DocumentManagement.Common": "Skupna dokumentna upravljanja", - "Permission:PdfGeneration": "Generiranje PDF" + "Permission:PdfDownload": "Prenos PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sv.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sv.json index c0df8c8fa9..4a8e23575b 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sv.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/sv.json @@ -2,6 +2,6 @@ "culture": "sv", "texts": { "Permission:DocumentManagement.Common": "Dokumenthantering", - "Permission:PdfGeneration": "PDF-generering" + "Permission:PdfDownload": "PDF-generering" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/tr.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/tr.json index 19c39d619b..1b40bdb92a 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/tr.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/tr.json @@ -2,6 +2,6 @@ "culture": "tr", "texts": { "Permission:DocumentManagement.Common": "Genel Belge Yönetimi", - "Permission:PdfGeneration": "PDF Oluşturma" + "Permission:PdfDownload": "PDF İndirme" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/vi.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/vi.json index e0f7a86c7d..53b86e5ce3 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/vi.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/vi.json @@ -2,6 +2,6 @@ "culture": "vi", "texts": { "Permission:DocumentManagement.Common": "Quản lý tài liệu chung", - "Permission:PdfGeneration": "Tạo PDF" + "Permission:PdfDownload": "Tải xuống PDF" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json index f92de5bc99..70f0eaab4d 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json @@ -2,6 +2,6 @@ "culture": "zh-Hans", "texts": { "Permission:DocumentManagement.Common": "通用文档管理", - "Permission:PdfGeneration": "PDF生成" + "Permission:PdfDownload": "PDF下载" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json index 82b5257eed..d37a0ff67a 100644 --- a/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json +++ b/modules/docs/src/Volo.Docs.Common.Application.Contracts/Volo/Docs/Common/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json @@ -2,6 +2,6 @@ "culture": "zh-Hant", "texts": { "Permission:DocumentManagement.Common": "通用文件管理", - "Permission:PdfGeneration": "PDF生成" + "Permission:PdfDownload": "PDF下載" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs index 30a381a999..e06c4715ac 100644 --- a/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs +++ b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs @@ -7,7 +7,7 @@ using Volo.Docs.Projects.Pdf; namespace Volo.Docs.Common.Documents; -[Authorize(DocsCommonPermissions.Projects.PdfGeneration)] +[Authorize(DocsCommonPermissions.Projects.PdfDownload)] public class DocumentPdfAppService : DocsCommonAppServiceBase, IDocumentPdfAppService { protected IProjectPdfGenerator ProjectPdfGenerator { get; } diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index ddac6c3f65..8ffe5c4c7a 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -214,7 +214,7 @@ namespace Volo.Docs.Pages.Documents.Project await SetNavigationAsync(); SetLanguageSelectListItems(); - HasDownloadPdf = await _permissionChecker.IsGrantedAsync(DocsCommonPermissions.Projects.PdfGeneration) + HasDownloadPdf = await _permissionChecker.IsGrantedAsync(DocsCommonPermissions.Projects.PdfDownload) && await _documentPdfAppService.ExistsAsync(new() { ProjectId = Project.Id, Version = LatestVersionInfo.IsSelected ? LatestVersionInfo.Version : Version, LanguageCode = DocumentLanguageCode From 319cf38c72301d82d54bcfce79c470e90193244c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 16 May 2025 10:34:51 +0300 Subject: [PATCH 07/21] Update managePdfFiles.js --- .../Pages/Docs/Admin/Projects/managePdfFiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js index 50af57959d..bbb529620f 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js @@ -50,7 +50,7 @@ $(function () { { text: l('Download'), action: function (data) { - var url = abp.appPath + 'api/docs/admin/documents/pdf?projectId=' + data.record.projectId + '&version=' + data.record.version + '&languageCode=' + data.record.languageCode; + var url = abp.appPath + 'api/docs/admin/documents/pdf/download?projectId=' + data.record.projectId + '&version=' + data.record.version + '&languageCode=' + data.record.languageCode; window.open(url, '_blank'); }, }, From 8c90cc9cefacbe7bcc800cf7e1b0278966b04ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 16 May 2025 10:37:44 +0300 Subject: [PATCH 08/21] Update ManagePdfFiles.cshtml --- .../Pages/Docs/Admin/Projects/ManagePdfFiles.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/ManagePdfFiles.cshtml b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/ManagePdfFiles.cshtml index e4d9ecda72..895f876fe5 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/ManagePdfFiles.cshtml +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/ManagePdfFiles.cshtml @@ -36,6 +36,6 @@ - + \ No newline at end of file From 3be41c9acd83fdeac1ac56595815f680f7b65756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Tue, 20 May 2025 08:20:59 +0300 Subject: [PATCH 09/21] Update DocsProjectPdfGeneratorOptions.cs --- .../Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs index 92c07ed1af..f20a0e6a51 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs @@ -43,12 +43,6 @@ public class DocsProjectPdfGeneratorOptions public Func DocumentContentNormalizer { get; set; } - /// - /// The maximum number of last versions to cache. - /// If null, all versions will be cached. - /// - public int? CacheLastVersionsCount { get; set; } - public DocsProjectPdfGeneratorOptions() { HtmlLayout = $@" From 31843cebb648ea84d8d3d756f1c5fd6cd8cc6991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Tue, 20 May 2025 14:33:05 +0300 Subject: [PATCH 10/21] update --- .../Localization/Resources/Docs/ApplicationContracts/en-GB.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/en.json | 2 +- .../Pages/Docs/Admin/Projects/managePdfFiles.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json index 4e38b2cd74..2ccbdcf18a 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json @@ -68,6 +68,6 @@ "Permission:ManagePdfFiles": "Manage PDF files", "PdfDeletedSuccessfully": "PDF file has been deleted successfully", "PdfGenerationStarted": "PDF generation has started", - "PdfGenerationStartedInfoMessage": "PDF generation has started. Once completed, you can check if the file has been added in the PDF files section." + "PdfGenerationStartedInfoMessage": "PDF generation has started. Once completed, you can check if the file has been added to the PDF files section." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json index db67eb8752..0710e96f2b 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json @@ -69,6 +69,6 @@ "Permission:ManagePdfFiles": "Manage PDF files", "PdfDeletedSuccessfully": "PDF file has been deleted successfully", "PdfGenerationStarted": "PDF generation started", - "PdfGenerationStartedInfoMessage": "PDF generation has started. Once completed, you can check if the file has been added in the PDF files section." + "PdfGenerationStartedInfoMessage": "PDF generation has started. Once completed, you can check if the file has been added to the PDF files section." } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js index bbb529620f..de71403878 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/managePdfFiles.js @@ -94,7 +94,7 @@ $(function () { }); _generatePdfModal.onResult(function (){ - abp.message.info(l('PdfGenerationStarted'), l('PdfGenerationStartedInfoMessage')); + abp.message.info(l('PdfGenerationStartedInfoMessage')); }); }; From 65a95f610eec5b86df019e758b07975a51c92b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Wed, 21 May 2025 09:59:16 +0300 Subject: [PATCH 11/21] remove old proxies --- .../docs-admin-generate-proxy.json | 1199 ----------------- .../DocsDocumentPdfClientProxy.Generated.cs | 28 - .../Documents/DocsDocumentPdfClientProxy.cs | 7 - .../DocsProjectClientProxy.Generated.cs | 59 - .../Docs/Projects/DocsProjectClientProxy.cs | 7 - .../DocsDocumentClientProxy.Generated.cs | 80 -- .../Docs/Documents/DocsDocumentClientProxy.cs | 7 - 7 files changed, 1387 deletions(-) delete mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json delete mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.Generated.cs delete mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.cs delete mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.Generated.cs delete mode 100644 modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.cs delete mode 100644 modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.Generated.cs delete mode 100644 modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.cs diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json deleted file mode 100644 index 636c7b6d25..0000000000 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json +++ /dev/null @@ -1,1199 +0,0 @@ -{ - "modules": { - "docs-admin": { - "rootPath": "docs-admin", - "remoteServiceName": "AbpDocsAdmin", - "controllers": { - "Volo.Docs.Admin.DocumentsAdminController": { - "controllerName": "DocumentsAdmin", - "controllerGroupName": "DocumentsAdmin", - "isRemoteService": true, - "isIntegrationService": false, - "apiVersion": null, - "type": "Volo.Docs.Admin.DocumentsAdminController", - "interfaces": [ - { - "type": "Volo.Docs.Admin.Documents.IDocumentAdminAppService", - "name": "IDocumentAdminAppService", - "methods": [ - { - "name": "ClearCacheAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Documents.ClearCacheInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Documents.ClearCacheInput", - "typeSimple": "Volo.Docs.Admin.Documents.ClearCacheInput", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - }, - { - "name": "PullAllAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Documents.PullAllDocumentInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Documents.PullAllDocumentInput", - "typeSimple": "Volo.Docs.Admin.Documents.PullAllDocumentInput", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - }, - { - "name": "PullAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Documents.PullDocumentInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Documents.PullDocumentInput", - "typeSimple": "Volo.Docs.Admin.Documents.PullDocumentInput", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - }, - { - "name": "GetAllAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Documents.GetAllInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Documents.GetAllInput", - "typeSimple": "Volo.Docs.Admin.Documents.GetAllInput", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "Volo.Abp.Application.Dtos.PagedResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" - } - }, - { - "name": "RemoveFromCacheAsync", - "parametersOnMethod": [ - { - "name": "documentId", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - }, - { - "name": "ReindexAsync", - "parametersOnMethod": [ - { - "name": "documentId", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - }, - { - "name": "GetFilterItemsAsync", - "parametersOnMethod": [], - "returnValue": { - "type": "System.Collections.Generic.List", - "typeSimple": "[Volo.Docs.Admin.Documents.DocumentInfoDto]" - } - }, - { - "name": "GetProjectsAsync", - "parametersOnMethod": [], - "returnValue": { - "type": "System.Collections.Generic.List", - "typeSimple": "[Volo.Docs.Admin.Projects.ProjectWithoutDetailsDto]" - } - } - ] - } - ], - "actions": { - "ClearCacheAsyncByInput": { - "uniqueName": "ClearCacheAsyncByInput", - "name": "ClearCacheAsync", - "httpMethod": "POST", - "url": "api/docs/admin/documents/ClearCache", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Documents.ClearCacheInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Documents.ClearCacheInput", - "typeSimple": "Volo.Docs.Admin.Documents.ClearCacheInput", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "input", - "jsonName": null, - "type": "Volo.Docs.Admin.Documents.ClearCacheInput", - "typeSimple": "Volo.Docs.Admin.Documents.ClearCacheInput", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "Body", - "descriptorName": "" - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" - }, - "PullAllAsyncByInput": { - "uniqueName": "PullAllAsyncByInput", - "name": "PullAllAsync", - "httpMethod": "POST", - "url": "api/docs/admin/documents/PullAll", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Documents.PullAllDocumentInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Documents.PullAllDocumentInput", - "typeSimple": "Volo.Docs.Admin.Documents.PullAllDocumentInput", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "input", - "jsonName": null, - "type": "Volo.Docs.Admin.Documents.PullAllDocumentInput", - "typeSimple": "Volo.Docs.Admin.Documents.PullAllDocumentInput", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "Body", - "descriptorName": "" - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" - }, - "PullAsyncByInput": { - "uniqueName": "PullAsyncByInput", - "name": "PullAsync", - "httpMethod": "POST", - "url": "api/docs/admin/documents/Pull", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Documents.PullDocumentInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Documents.PullDocumentInput", - "typeSimple": "Volo.Docs.Admin.Documents.PullDocumentInput", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "input", - "jsonName": null, - "type": "Volo.Docs.Admin.Documents.PullDocumentInput", - "typeSimple": "Volo.Docs.Admin.Documents.PullDocumentInput", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "Body", - "descriptorName": "" - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" - }, - "GetAllAsyncByInput": { - "uniqueName": "GetAllAsyncByInput", - "name": "GetAllAsync", - "httpMethod": "GET", - "url": "api/docs/admin/documents/GetAll", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Documents.GetAllInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Documents.GetAllInput", - "typeSimple": "Volo.Docs.Admin.Documents.GetAllInput", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "ProjectId", - "jsonName": null, - "type": "System.Guid?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "Name", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "Version", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "LanguageCode", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "FileName", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "Format", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "CreationTimeMin", - "jsonName": null, - "type": "System.DateTime?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "CreationTimeMax", - "jsonName": null, - "type": "System.DateTime?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "LastUpdatedTimeMin", - "jsonName": null, - "type": "System.DateTime?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "LastUpdatedTimeMax", - "jsonName": null, - "type": "System.DateTime?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "LastSignificantUpdateTimeMin", - "jsonName": null, - "type": "System.DateTime?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "LastSignificantUpdateTimeMax", - "jsonName": null, - "type": "System.DateTime?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "LastCachedTimeMin", - "jsonName": null, - "type": "System.DateTime?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "LastCachedTimeMax", - "jsonName": null, - "type": "System.DateTime?", - "typeSimple": "string?", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "Sorting", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "SkipCount", - "jsonName": null, - "type": "System.Int32", - "typeSimple": "number", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "MaxResultCount", - "jsonName": null, - "type": "System.Int32", - "typeSimple": "number", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - } - ], - "returnValue": { - "type": "Volo.Abp.Application.Dtos.PagedResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" - }, - "RemoveFromCacheAsyncByDocumentId": { - "uniqueName": "RemoveFromCacheAsyncByDocumentId", - "name": "RemoveFromCacheAsync", - "httpMethod": "PUT", - "url": "api/docs/admin/documents/RemoveDocumentFromCache", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "documentId", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "documentId", - "name": "documentId", - "jsonName": null, - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "" - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" - }, - "ReindexAsyncByDocumentId": { - "uniqueName": "ReindexAsyncByDocumentId", - "name": "ReindexAsync", - "httpMethod": "PUT", - "url": "api/docs/admin/documents/ReindexDocument", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "documentId", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "documentId", - "name": "documentId", - "jsonName": null, - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "" - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" - }, - "GetFilterItemsAsync": { - "uniqueName": "GetFilterItemsAsync", - "name": "GetFilterItemsAsync", - "httpMethod": "GET", - "url": "api/docs/admin/documents/GetFilterItems", - "supportedVersions": [], - "parametersOnMethod": [], - "parameters": [], - "returnValue": { - "type": "System.Collections.Generic.List", - "typeSimple": "[Volo.Docs.Admin.Documents.DocumentInfoDto]" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" - }, - "GetProjectsAsync": { - "uniqueName": "GetProjectsAsync", - "name": "GetProjectsAsync", - "httpMethod": "GET", - "url": "api/docs/admin/documents/GetProjects", - "supportedVersions": [], - "parametersOnMethod": [], - "parameters": [], - "returnValue": { - "type": "System.Collections.Generic.List", - "typeSimple": "[Volo.Docs.Admin.Projects.ProjectWithoutDetailsDto]" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" - } - } - }, - "Volo.Docs.Admin.ProjectsAdminController": { - "controllerName": "ProjectsAdmin", - "controllerGroupName": "ProjectsAdmin", - "isRemoteService": true, - "isIntegrationService": false, - "apiVersion": null, - "type": "Volo.Docs.Admin.ProjectsAdminController", - "interfaces": [ - { - "type": "Volo.Docs.Admin.Projects.IProjectAdminAppService", - "name": "IProjectAdminAppService", - "methods": [ - { - "name": "GetListAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto, Volo.Abp.Ddd.Application.Contracts", - "type": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "Volo.Abp.Application.Dtos.PagedResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" - } - }, - { - "name": "GetAsync", - "parametersOnMethod": [ - { - "name": "id", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "Volo.Docs.Admin.Projects.ProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.ProjectDto" - } - }, - { - "name": "CreateAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.CreateProjectDto, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.CreateProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.CreateProjectDto", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "Volo.Docs.Admin.Projects.ProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.ProjectDto" - } - }, - { - "name": "UpdateAsync", - "parametersOnMethod": [ - { - "name": "id", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - }, - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.UpdateProjectDto, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.UpdateProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.UpdateProjectDto", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "Volo.Docs.Admin.Projects.ProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.ProjectDto" - } - }, - { - "name": "DeleteAsync", - "parametersOnMethod": [ - { - "name": "id", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - }, - { - "name": "ReindexAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.ReindexInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.ReindexInput", - "typeSimple": "Volo.Docs.Admin.Projects.ReindexInput", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - }, - { - "name": "ReindexAllAsync", - "parametersOnMethod": [], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - }, - { - "name": "GetListWithoutDetailsAsync", - "parametersOnMethod": [], - "returnValue": { - "type": "System.Collections.Generic.List", - "typeSimple": "[Volo.Docs.Admin.Projects.ProjectWithoutDetailsDto]" - } - }, - { - "name": "GetPdfFilesAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.GetPdfFilesInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.GetPdfFilesInput", - "typeSimple": "Volo.Docs.Admin.Projects.GetPdfFilesInput", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "Volo.Abp.Application.Dtos.PagedResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" - } - }, - { - "name": "DeletePdfFileAsync", - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.DeletePdfFileInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.DeletePdfFileInput", - "typeSimple": "Volo.Docs.Admin.Projects.DeletePdfFileInput", - "isOptional": false, - "defaultValue": null - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - } - } - ] - } - ], - "actions": { - "GetListAsyncByInput": { - "uniqueName": "GetListAsyncByInput", - "name": "GetListAsync", - "httpMethod": "GET", - "url": "api/docs/admin/projects", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto, Volo.Abp.Ddd.Application.Contracts", - "type": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "Sorting", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "SkipCount", - "jsonName": null, - "type": "System.Int32", - "typeSimple": "number", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "MaxResultCount", - "jsonName": null, - "type": "System.Int32", - "typeSimple": "number", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - } - ], - "returnValue": { - "type": "Volo.Abp.Application.Dtos.PagedResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "GetAsyncById": { - "uniqueName": "GetAsyncById", - "name": "GetAsync", - "httpMethod": "GET", - "url": "api/docs/admin/projects/{id}", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "id", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "id", - "name": "id", - "jsonName": null, - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": [], - "bindingSourceId": "Path", - "descriptorName": "" - } - ], - "returnValue": { - "type": "Volo.Docs.Admin.Projects.ProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.ProjectDto" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "CreateAsyncByInput": { - "uniqueName": "CreateAsyncByInput", - "name": "CreateAsync", - "httpMethod": "POST", - "url": "api/docs/admin/projects", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.CreateProjectDto, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.CreateProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.CreateProjectDto", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "input", - "jsonName": null, - "type": "Volo.Docs.Admin.Projects.CreateProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.CreateProjectDto", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "Body", - "descriptorName": "" - } - ], - "returnValue": { - "type": "Volo.Docs.Admin.Projects.ProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.ProjectDto" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "UpdateAsyncByIdAndInput": { - "uniqueName": "UpdateAsyncByIdAndInput", - "name": "UpdateAsync", - "httpMethod": "PUT", - "url": "api/docs/admin/projects/{id}", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "id", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - }, - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.UpdateProjectDto, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.UpdateProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.UpdateProjectDto", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "id", - "name": "id", - "jsonName": null, - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": [], - "bindingSourceId": "Path", - "descriptorName": "" - }, - { - "nameOnMethod": "input", - "name": "input", - "jsonName": null, - "type": "Volo.Docs.Admin.Projects.UpdateProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.UpdateProjectDto", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "Body", - "descriptorName": "" - } - ], - "returnValue": { - "type": "Volo.Docs.Admin.Projects.ProjectDto", - "typeSimple": "Volo.Docs.Admin.Projects.ProjectDto" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "DeleteAsyncById": { - "uniqueName": "DeleteAsyncById", - "name": "DeleteAsync", - "httpMethod": "DELETE", - "url": "api/docs/admin/projects", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "id", - "typeAsString": "System.Guid, System.Private.CoreLib", - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "id", - "name": "id", - "jsonName": null, - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "" - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "ReindexAllAsync": { - "uniqueName": "ReindexAllAsync", - "name": "ReindexAllAsync", - "httpMethod": "POST", - "url": "api/docs/admin/projects/ReindexAll", - "supportedVersions": [], - "parametersOnMethod": [], - "parameters": [], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "GetListWithoutDetailsAsync": { - "uniqueName": "GetListWithoutDetailsAsync", - "name": "GetListWithoutDetailsAsync", - "httpMethod": "GET", - "url": "api/docs/admin/projects/GetListProjectWithoutDetailsAsync", - "supportedVersions": [], - "parametersOnMethod": [], - "parameters": [], - "returnValue": { - "type": "System.Collections.Generic.List", - "typeSimple": "[Volo.Docs.Admin.Projects.ProjectWithoutDetailsDto]" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "GetPdfFilesAsyncByInput": { - "uniqueName": "GetPdfFilesAsyncByInput", - "name": "GetPdfFilesAsync", - "httpMethod": "GET", - "url": "api/docs/admin/projects/PdfFiles", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.GetPdfFilesInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.GetPdfFilesInput", - "typeSimple": "Volo.Docs.Admin.Projects.GetPdfFilesInput", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "ProjectId", - "jsonName": null, - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "Sorting", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "SkipCount", - "jsonName": null, - "type": "System.Int32", - "typeSimple": "number", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "MaxResultCount", - "jsonName": null, - "type": "System.Int32", - "typeSimple": "number", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - } - ], - "returnValue": { - "type": "Volo.Abp.Application.Dtos.PagedResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "DeletePdfFileAsyncByInput": { - "uniqueName": "DeletePdfFileAsyncByInput", - "name": "DeletePdfFileAsync", - "httpMethod": "DELETE", - "url": "api/docs/admin/projects/DeletePdfFile", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.DeletePdfFileInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.DeletePdfFileInput", - "typeSimple": "Volo.Docs.Admin.Projects.DeletePdfFileInput", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "ProjectId", - "jsonName": null, - "type": "System.Guid", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "Version", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - }, - { - "nameOnMethod": "input", - "name": "LanguageCode", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "ModelBinding", - "descriptorName": "input" - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - }, - "ReindexAsyncByInput": { - "uniqueName": "ReindexAsyncByInput", - "name": "ReindexAsync", - "httpMethod": "POST", - "url": "api/docs/admin/projects/Reindex", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "input", - "typeAsString": "Volo.Docs.Admin.Projects.ReindexInput, Volo.Docs.Admin.Application.Contracts", - "type": "Volo.Docs.Admin.Projects.ReindexInput", - "typeSimple": "Volo.Docs.Admin.Projects.ReindexInput", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "input", - "name": "input", - "jsonName": null, - "type": "Volo.Docs.Admin.Projects.ReindexInput", - "typeSimple": "Volo.Docs.Admin.Projects.ReindexInput", - "isOptional": false, - "defaultValue": null, - "constraintTypes": null, - "bindingSourceId": "Body", - "descriptorName": "" - } - ], - "returnValue": { - "type": "System.Void", - "typeSimple": "System.Void" - }, - "allowAnonymous": null, - "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" - } - } - } - } - } - }, - "types": {} -} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.Generated.cs deleted file mode 100644 index 3419472890..0000000000 --- a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.Generated.cs +++ /dev/null @@ -1,28 +0,0 @@ -// This file is automatically generated by ABP framework to use MVC Controllers from CSharp -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Content; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Http.Client; -using Volo.Abp.Http.Client.ClientProxying; -using Volo.Abp.Http.Modeling; -using Volo.Docs.Common.Documents; - -// ReSharper disable once CheckNamespace -namespace Volo.Docs.Documents; - -[Dependency(ReplaceServices = true)] -[ExposeServices(typeof(IDocumentPdfAppService), typeof(DocsDocumentPdfClientProxy))] -public partial class DocsDocumentPdfClientProxy : ClientProxyBase, IDocumentPdfAppService -{ - public virtual async Task GeneratePdfAsync(DocumentPdfGeneratorInput input) - { - return await RequestAsync(nameof(GeneratePdfAsync), new ClientProxyRequestTypeValue - { - { typeof(DocumentPdfGeneratorInput), input } - }); - } -} diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.cs deleted file mode 100644 index 0ef8e84435..0000000000 --- a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfClientProxy.cs +++ /dev/null @@ -1,7 +0,0 @@ -// This file is part of DocsDocumentPdfGeneratorClientProxy, you can customize it here -// ReSharper disable once CheckNamespace -namespace Volo.Docs.Documents; - -public partial class DocsDocumentPdfClientProxy -{ -} diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.Generated.cs deleted file mode 100644 index 19170e497e..0000000000 --- a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.Generated.cs +++ /dev/null @@ -1,59 +0,0 @@ -// This file is automatically generated by ABP framework to use MVC Controllers from CSharp -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Http.Client; -using Volo.Abp.Http.Client.ClientProxying; -using Volo.Abp.Http.Modeling; -using Volo.Docs.Common.Projects; -using Volo.Docs.Documents; - -// ReSharper disable once CheckNamespace -namespace Volo.Docs.Projects; - -[Dependency(ReplaceServices = true)] -[ExposeServices(typeof(IProjectAppService), typeof(DocsProjectClientProxy))] -public partial class DocsProjectClientProxy : ClientProxyBase, IProjectAppService -{ - public virtual async Task> GetListAsync() - { - return await RequestAsync>(nameof(GetListAsync)); - } - - public virtual async Task GetAsync(string shortName) - { - return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue - { - { typeof(string), shortName } - }); - } - - public virtual async Task GetDefaultLanguageCodeAsync(string shortName, string version) - { - return await RequestAsync(nameof(GetDefaultLanguageCodeAsync), new ClientProxyRequestTypeValue - { - { typeof(string), shortName }, - { typeof(string), version } - }); - } - - public virtual async Task> GetVersionsAsync(string shortName) - { - return await RequestAsync>(nameof(GetVersionsAsync), new ClientProxyRequestTypeValue - { - { typeof(string), shortName } - }); - } - - public virtual async Task GetLanguageListAsync(string shortName, string version) - { - return await RequestAsync(nameof(GetLanguageListAsync), new ClientProxyRequestTypeValue - { - { typeof(string), shortName }, - { typeof(string), version } - }); - } -} diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.cs deleted file mode 100644 index c908205174..0000000000 --- a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.cs +++ /dev/null @@ -1,7 +0,0 @@ -// This file is part of DocsProjectClientProxy, you can customize it here -// ReSharper disable once CheckNamespace -namespace Volo.Docs.Projects; - -public partial class DocsProjectClientProxy -{ -} diff --git a/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.Generated.cs deleted file mode 100644 index 418e46f6f8..0000000000 --- a/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.Generated.cs +++ /dev/null @@ -1,80 +0,0 @@ -// This file is automatically generated by ABP framework to use MVC Controllers from CSharp -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Http.Client; -using Volo.Abp.Http.Client.ClientProxying; -using Volo.Abp.Http.Modeling; -using Volo.Docs.Documents; - -// ReSharper disable once CheckNamespace -namespace Volo.Docs.Documents; - -[Dependency(ReplaceServices = true)] -[ExposeServices(typeof(IDocumentAppService), typeof(DocsDocumentClientProxy))] -public partial class DocsDocumentClientProxy : ClientProxyBase, IDocumentAppService -{ - public virtual async Task GetAsync(GetDocumentInput input) - { - return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue - { - { typeof(GetDocumentInput), input } - }); - } - - public virtual async Task GetDefaultAsync(GetDefaultDocumentInput input) - { - return await RequestAsync(nameof(GetDefaultAsync), new ClientProxyRequestTypeValue - { - { typeof(GetDefaultDocumentInput), input } - }); - } - - public virtual async Task GetNavigationAsync(GetNavigationDocumentInput input) - { - return await RequestAsync(nameof(GetNavigationAsync), new ClientProxyRequestTypeValue - { - { typeof(GetNavigationDocumentInput), input } - }); - } - - public virtual async Task GetResourceAsync(GetDocumentResourceInput input) - { - return await RequestAsync(nameof(GetResourceAsync), new ClientProxyRequestTypeValue - { - { typeof(GetDocumentResourceInput), input } - }); - } - - public virtual async Task> SearchAsync(DocumentSearchInput input) - { - return await RequestAsync>(nameof(SearchAsync), new ClientProxyRequestTypeValue - { - { typeof(DocumentSearchInput), input } - }); - } - - public virtual async Task FullSearchEnabledAsync() - { - return await RequestAsync(nameof(FullSearchEnabledAsync)); - } - - public virtual async Task> GetUrlsAsync(string prefix) - { - return await RequestAsync>(nameof(GetUrlsAsync), new ClientProxyRequestTypeValue - { - { typeof(string), prefix } - }); - } - - public virtual async Task GetParametersAsync(GetParametersDocumentInput input) - { - return await RequestAsync(nameof(GetParametersAsync), new ClientProxyRequestTypeValue - { - { typeof(GetParametersDocumentInput), input } - }); - } -} diff --git a/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.cs b/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.cs deleted file mode 100644 index 7671995758..0000000000 --- a/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.cs +++ /dev/null @@ -1,7 +0,0 @@ -// This file is part of DocsDocumentClientProxy, you can customize it here -// ReSharper disable once CheckNamespace -namespace Volo.Docs.Documents; - -public partial class DocsDocumentClientProxy -{ -} From 994218b4f8c82a780005018f11738e20fdfdcd72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Wed, 21 May 2025 21:17:44 +0300 Subject: [PATCH 12/21] update --- Directory.Packages.props | 6 +++--- .../BackgroundJobs/DocumentPdfGenerateJob.cs | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7263869bdf..5673bf6bac 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -34,9 +34,9 @@ - - - + + + diff --git a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs index 7bfaa641c8..985f8bc7bf 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs @@ -13,20 +13,24 @@ public class DocumentPdfGenerateJob : AsyncBackgroundJob Date: Wed, 4 Jun 2025 14:38:15 +0300 Subject: [PATCH 13/21] refactoring --- .../Docs/Projects/Pdf/IHtmlToPdfRenderer.cs | 2 + .../Pdf/IText/ITextHtmlToPdfRenderer.cs | 45 ++++++++ .../Docs/Projects/Pdf/ProjectPdfGenerator.cs | 101 ++++++++++++++++-- 3 files changed, 137 insertions(+), 11 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs index c17908af51..ad1cc5105b 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs @@ -7,4 +7,6 @@ namespace Volo.Docs.Projects.Pdf; public interface IHtmlToPdfRenderer { Task RenderAsync(string title, string html, List documents); + + Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true); } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs index 1ee6b679e3..0a78ceb4fe 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs @@ -45,6 +45,51 @@ public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer ,ITransientDependency return Task.FromResult(pdfStream); } + public virtual async Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true) + { + var mergedStream = new MemoryStream(); + var mergedPdfWriter = new PdfWriter(mergedStream); + var mergedPdfDocument = new iText.Kernel.Pdf.PdfDocument(mergedPdfWriter); + mergedPdfDocument.GetDocumentInfo().SetTitle(title); + mergedPdfWriter.SetCloseStream(false); + + foreach (var pdfFile in pdfFiles) + { + try + { + using var reader = new PdfReader(pdfFile); + using var sourcePdf = new iText.Kernel.Pdf.PdfDocument(reader); + + var pageCount = sourcePdf.GetNumberOfPages(); + + for (var i = 1; i <= pageCount; i++) + { + var page = sourcePdf.GetPage(i); + mergedPdfDocument.AddPage(page.CopyTo(mergedPdfDocument)); + } + } + catch (Exception ex) + { + throw new Exception($"Error merging PDF file {pdfFile}: {ex.Message}", ex); + } + finally + { + try + { + await pdfFile.DisposeAsync(); + } + catch + { + // Ignore any exceptions during disposal + } + } + } + + mergedPdfDocument.Close(); + mergedStream.Position = 0; + return mergedStream; + } + private void BuildPdfOutlines(PdfOutline parentOutline, List pdfDocumentNodes) { foreach (var pdfDocumentNode in pdfDocumentNodes) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs index 5abb380199..a61a2b2b8d 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs @@ -5,10 +5,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using Volo.Abp; -using Volo.Abp.Content; using Volo.Abp.DependencyInjection; using Volo.Docs.Documents; using Volo.Docs.Documents.Rendering; @@ -33,6 +31,8 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency protected Project Project { get; set; } protected List AllPdfDocuments { get; } = []; + protected int ChunkSize { get; set; } = 10; + public ProjectPdfGenerator( IDocumentSourceFactory documentStoreFactory, IDocumentRepository documentRepository, @@ -40,7 +40,8 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency IDocumentSectionRenderer documentSectionRenderer, IProjectPdfFileStore projectPdfFileStore, IHtmlToPdfRenderer htmlToPdfRenderer, - IDocumentToHtmlConverterFactory documentToHtmlConverterFactory) + IDocumentToHtmlConverterFactory documentToHtmlConverterFactory, + ILogger logger) { DocumentStoreFactory = documentStoreFactory; DocumentRepository = documentRepository; @@ -49,7 +50,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency ProjectPdfFileStore = projectPdfFileStore; HtmlToPdfRenderer = htmlToPdfRenderer; DocumentToHtmlConverterFactory = documentToHtmlConverterFactory; - Logger = NullLogger.Instance; + Logger = logger; } public virtual async Task GenerateAsync(Project project, string version, string languageCode) @@ -60,17 +61,85 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency var navigation = await GetNavigationAsync(project, version, languageCode); await SetAllPdfDocumentsAsync(navigation.Items, project, version, languageCode); - - var html = await BuildHtmlAsync(); + var title = Options.Value.CalculatePdfFileTitle?.Invoke(project) ?? project.Name; - var pdfStream = await HtmlToPdfRenderer.RenderAsync(title, html, AllPdfDocuments); + var tempStreams = new List(); + + try + { + var documentChunks = ChunkDocuments(AllPdfDocuments); + Logger.LogInformation("Documents split into {ChunkCount} chunks for processing", documentChunks.Count); + + foreach (var (chunk, index) in documentChunks.Select((chunk, index) => (chunk, index))) + { + + Logger.LogInformation("Processing chunk {Index}/{Total}", index + 1, documentChunks.Count); + + var chunkHtml = await BuildHtmlAsync(chunk); + + var pdfStream = await HtmlToPdfRenderer.RenderAsync($"{title} - Part {index + 1}", chunkHtml, chunk); + + tempStreams.Add(pdfStream); + + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + + using var mergedPdfStream = await MergePdfFilesAsync(tempStreams, title, disposeStreams: true); + await ProjectPdfFileStore.SetAsync(project, version, languageCode, mergedPdfStream); + } + catch + { + foreach (var tempStream in tempStreams) + { + try + { + await tempStream.DisposeAsync(); + } + catch + { + // ignore any exceptions during disposal + } + } + } + finally + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + } + + protected virtual List> ChunkDocuments(List documents) + { + var flatDocuments = FlattenDocuments(documents); - await ProjectPdfFileStore.SetAsync(project, version, languageCode, pdfStream); + return flatDocuments + .Select((doc, index) => new { doc, index }) + .GroupBy(x => x.index / ChunkSize) + .Select(g => g.Select(x => x.doc).ToList()) + .ToList(); } - - protected virtual async Task BuildHtmlAsync() + + protected virtual List FlattenDocuments(List documents) { - var htmlContent = await ConvertDocumentsToHtmlAsync(AllPdfDocuments); + var result = new List(); + + foreach (var document in documents) + { + result.Add(document); + + if (document.HasChildren) + { + result.AddRange(FlattenDocuments(document.Children)); + } + } + + return result; + } + + protected virtual async Task BuildHtmlAsync(List pdfDocuments) + { + var htmlContent = await ConvertDocumentsToHtmlAsync(pdfDocuments); var htmlBuilder = new StringBuilder(); htmlBuilder.Append(Options.Value.HtmlLayout); @@ -103,6 +172,16 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency return contentBuilder.ToString(); } + protected virtual async Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true) + { + if (pdfFiles.Count == 0) + { + throw new ArgumentException("No PDF files to merge", nameof(pdfFiles)); + } + + return await HtmlToPdfRenderer.MergePdfFilesAsync(pdfFiles, title, disposeStreams); + } + protected virtual IDocumentToHtmlConverter GetDocumentToHtmlConverter(Project project, PdfDocument pdfDocument) { return DocumentToHtmlConverterFactory.Create(DocsDomainConsts.PdfDocumentToHtmlConverterPrefix +(pdfDocument.Document.Format ?? project.Format)); From ff66c090015cf4dd3606d6f5c8d1af047785714e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Tue, 10 Jun 2025 17:06:50 +0300 Subject: [PATCH 14/21] add log --- .../BackgroundJobs/DocumentPdfGenerateJob.cs | 1 + .../Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs index 985f8bc7bf..2921039a91 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs @@ -27,6 +27,7 @@ public class DocumentPdfGenerateJob : AsyncBackgroundJob Date: Thu, 12 Jun 2025 10:34:25 +0300 Subject: [PATCH 15/21] Update ProjectPdfGenerator.cs --- .../Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs index ab9d736131..485903d79a 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs @@ -83,13 +83,15 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency tempStreams.Add(pdfStream); } + + Logger.LogInformation("All chunks processed, merging PDF files"); using var mergedPdfStream = await MergePdfFilesAsync(tempStreams, title, disposeStreams: true); await ProjectPdfFileStore.SetAsync(project, version, languageCode, mergedPdfStream); } - catch + catch(Exception e) { - Logger.LogError("An error occurred while generating the PDF for project {ProjectName}", project.Name); + Logger.LogError(e, "An error occurred while generating the PDF for project {ProjectName}", project.Name); foreach (var tempStream in tempStreams) { try From 42edab3381adc55dc980d4e2bd059814a61503d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 13 Jun 2025 13:48:14 +0300 Subject: [PATCH 16/21] update --- Directory.Packages.props | 1 + .../app/VoloDocs.Web/VoloDocsWebModule.cs | 9 +++- .../BackgroundJobs/DocumentPdfGenerateJob.cs | 0 .../DocumentPdfGenerateJobArgs.cs | 1 + .../Common/Documents/DocumentPdfAppService.cs | 3 +- .../Volo.Docs.Domain/Volo.Docs.Domain.csproj | 1 + .../Pdf/DocsProjectPdfGeneratorOptions.cs | 4 +- .../Docs/Projects/Pdf/IHtmlToPdfRenderer.cs | 4 +- .../Pdf/IText/ITextHtmlToPdfRenderer.cs | 6 +-- .../Docs/Projects/Pdf/ProjectPdfGenerator.cs | 54 +++++++++++++++---- .../Puppeteer/PuppeteerHtmlToPdfRenderer.cs | 38 +++++++++++++ 11 files changed, 101 insertions(+), 20 deletions(-) rename modules/docs/src/Volo.Docs.Admin.Application/{ => Volo/Docs/Admin}/BackgroundJobs/DocumentPdfGenerateJob.cs (100%) rename modules/docs/src/Volo.Docs.Admin.Application/{ => Volo/Docs/Admin}/BackgroundJobs/DocumentPdfGenerateJobArgs.cs (87%) create mode 100644 modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 62110b2326..1ba30a63dc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -113,6 +113,7 @@ + diff --git a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs index 5af8b1c129..a28da09273 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs +++ b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs @@ -32,6 +32,7 @@ using Localization.Resources.AbpUi; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Hosting; using Volo.Abp.Account; +using Volo.Abp.BackgroundJobs; using Volo.Abp.BlobStoring; using Volo.Abp.BlobStoring.Database; using Volo.Abp.PermissionManagement.HttpApi; @@ -62,7 +63,8 @@ namespace VoloDocs.Web typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementHttpApiModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule) - ,typeof(AbpCachingStackExchangeRedisModule) + ,typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpBackgroundJobsModule) )] public class VoloDocsWebModule : AbpModule { @@ -72,6 +74,11 @@ namespace VoloDocs.Web { options.AddAssemblyResource(typeof(DocsResource), typeof(VoloDocsWebModule).Assembly); }); + + PreConfigure(options => + { + options.ApplicationName = context.Services.GetApplicationName()!; + }); } public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJob.cs similarity index 100% rename from modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs rename to modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJob.cs diff --git a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJobArgs.cs similarity index 87% rename from modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs rename to modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJobArgs.cs index be18746f17..ce8b734f2c 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJobArgs.cs @@ -1,4 +1,5 @@ using System; +using Volo.Abp.BackgroundJobs; namespace Volo.Docs.Admin.BackgroundJobs; diff --git a/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs index e06c4715ac..0cfdf48bd7 100644 --- a/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs +++ b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Options; using Volo.Abp.Content; +using Volo.Abp.Http; using Volo.Docs.Projects; using Volo.Docs.Projects.Pdf; @@ -37,7 +38,7 @@ public class DocumentPdfAppService : DocsCommonAppServiceBase, IDocumentPdfAppSe if (fileStream != null) { - return new RemoteStreamContent(fileStream, fileName, "application/pdf"); + return new RemoteStreamContent(fileStream, fileName, MimeTypes.Application.Zip); } return null; diff --git a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj index e57312e16b..266983eb24 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj +++ b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj @@ -25,6 +25,7 @@ + diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs index f20a0e6a51..8b8678930d 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs @@ -30,7 +30,7 @@ public class DocsProjectPdfGeneratorOptions /// /// The function to calculate the PDF file name. - /// Default is "{project.ShortName}-{version}-{languageCode}.pdf". + /// Default is "{project.ShortName}-{version}-{languageCode}.zip". /// public Func CalculatePdfFileName { get; set; } @@ -108,6 +108,6 @@ public class DocsProjectPdfGeneratorOptions width: 100%; }"; - CalculatePdfFileName = (project, version, languageCode) => $"{project.ShortName}-{version}-{languageCode}.pdf"; + CalculatePdfFileName = (project, version, languageCode) => $"{project.ShortName}-{version}-{languageCode}.zip"; } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs index ad1cc5105b..56fdc2f995 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs @@ -6,7 +6,5 @@ namespace Volo.Docs.Projects.Pdf; public interface IHtmlToPdfRenderer { - Task RenderAsync(string title, string html, List documents); - - Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true); + Task RenderAsync(string title, string html, List documents); } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs index 0a78ceb4fe..730ca898d4 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs @@ -12,7 +12,7 @@ using ITextDocument = iText.Layout.Document; namespace Volo.Docs.Projects.Pdf.IText; -public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer ,ITransientDependency +public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer { protected IOptions Options { get; } @@ -21,7 +21,7 @@ public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer ,ITransientDependency Options = options; } - public virtual Task RenderAsync(string title, string html, List documents) + public virtual Task RenderAsync(string title, string html, List documents) { var pdfStream = new MemoryStream(); var pdfWrite = new PdfWriter(pdfStream); @@ -42,7 +42,7 @@ public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer ,ITransientDependency textDocument.Close(); pdfStream.Position = 0; - return Task.FromResult(pdfStream); + return Task.FromResult(pdfStream); } public virtual async Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs index 485903d79a..c93d5fe06e 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.IO.Compression; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -31,7 +32,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency protected Project Project { get; set; } protected List AllPdfDocuments { get; } = []; - protected int ChunkSize { get; set; } = 10; + protected int ChunkSize { get; set; } = 60; public ProjectPdfGenerator( IDocumentSourceFactory documentStoreFactory, @@ -63,7 +64,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency await SetAllPdfDocumentsAsync(navigation.Items, project, version, languageCode); var title = Options.Value.CalculatePdfFileTitle?.Invoke(project) ?? project.Name; - var tempStreams = new List(); + var tempStreams = new List(); try { @@ -72,21 +73,28 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency foreach (var (chunk, index) in documentChunks.Select((chunk, index) => (chunk, index))) { + try + { - Logger.LogInformation("Processing chunk {Index}/{Total}", index + 1, documentChunks.Count); + Logger.LogInformation("Processing chunk {Index}/{Total}", index + 1, documentChunks.Count); - var chunkHtml = await BuildHtmlAsync(chunk); + var chunkHtml = await BuildHtmlAsync(chunk); - var pdfStream = await HtmlToPdfRenderer.RenderAsync($"{title} - Part {index + 1}", chunkHtml, chunk); + var pdfStream = await HtmlToPdfRenderer.RenderAsync($"{title} - Part {index + 1}", chunkHtml, chunk); - Logger.LogInformation("Chunk {Index} rendered to PDF", index + 1); + Logger.LogInformation("Chunk {Index} rendered to PDF", index + 1); - tempStreams.Add(pdfStream); + tempStreams.Add(pdfStream); + } + catch (Exception e) + { + Logger.LogError(e, "Error processing chunk {Index} for project {ProjectName}", index + 1, project.Name); + } } Logger.LogInformation("All chunks processed, merging PDF files"); - using var mergedPdfStream = await MergePdfFilesAsync(tempStreams, title, disposeStreams: true); + var mergedPdfStream = await MergePdfFilesAsync(tempStreams, title, disposeStreams: true); await ProjectPdfFileStore.SetAsync(project, version, languageCode, mergedPdfStream); } catch(Exception e) @@ -174,15 +182,41 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency return contentBuilder.ToString(); } - protected virtual async Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true) + protected virtual async Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true) { if (pdfFiles.Count == 0) { throw new ArgumentException("No PDF files to merge", nameof(pdfFiles)); } - return await HtmlToPdfRenderer.MergePdfFilesAsync(pdfFiles, title, disposeStreams); + var zipStream = new MemoryStream(); + + + { + using var zipArchive = new ZipArchive(zipStream, ZipArchiveMode.Create, true); + var index = 0; + foreach (var pdfFile in pdfFiles) + { + if (pdfFile.CanSeek) + pdfFile.Position = 0; + + var entry = zipArchive.CreateEntry($"{title}_{index}.pdf", CompressionLevel.Fastest); + await using var entryStream = entry.Open(); + await pdfFile.CopyToAsync(entryStream); + + if (disposeStreams) + { + await pdfFile.DisposeAsync(); + } + + index++; + } + } + + zipStream.Position = 0; + return zipStream; } + protected virtual IDocumentToHtmlConverter GetDocumentToHtmlConverter(Project project, PdfDocument pdfDocument) { diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs new file mode 100644 index 0000000000..a47269ac97 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using PuppeteerSharp; +using PuppeteerSharp.Media; +using Volo.Abp.DependencyInjection; + +namespace Volo.Docs.Projects.Pdf.Puppeteer; + +public class PuppeteerHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependency +{ + public async Task RenderAsync(string title, string html, List documents) + { + await new BrowserFetcher() + { + Browser = SupportedBrowser.Chromium + }.DownloadAsync(); + + await using var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(new LaunchOptions { Headless = true, Timeout = 600000, Browser = SupportedBrowser.Chromium }); + await using var page = await browser.NewPageAsync(); + + await page.SetContentAsync(html, new NavigationOptions + { + Timeout = 600000, + }); + + var pdfOptions = new PdfOptions + { + Format = PaperFormat.A4, + MarginOptions = new MarginOptions { Top = "20mm", Bottom = "20mm", Left = "15mm", Right = "15mm" }, + }; + + var stream = await page.PdfStreamAsync(pdfOptions); + await page.CloseAsync(); + await browser.CloseAsync(); + return stream; + } +} \ No newline at end of file From 3389f6b3e8e1d661dab9111c2587907ea3344822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 13 Jun 2025 15:19:57 +0300 Subject: [PATCH 17/21] update --- .../Pdf/IText/ITextHtmlToPdfRenderer.cs | 47 +----------- .../Docs/Projects/Pdf/ProjectPdfGenerator.cs | 71 +++++-------------- .../Puppeteer/PuppeteerHtmlToPdfRenderer.cs | 4 +- 3 files changed, 22 insertions(+), 100 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs index 730ca898d4..c0d609be9c 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs @@ -12,7 +12,7 @@ using ITextDocument = iText.Layout.Document; namespace Volo.Docs.Projects.Pdf.IText; -public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer +public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependency { protected IOptions Options { get; } @@ -45,51 +45,6 @@ public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer return Task.FromResult(pdfStream); } - public virtual async Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true) - { - var mergedStream = new MemoryStream(); - var mergedPdfWriter = new PdfWriter(mergedStream); - var mergedPdfDocument = new iText.Kernel.Pdf.PdfDocument(mergedPdfWriter); - mergedPdfDocument.GetDocumentInfo().SetTitle(title); - mergedPdfWriter.SetCloseStream(false); - - foreach (var pdfFile in pdfFiles) - { - try - { - using var reader = new PdfReader(pdfFile); - using var sourcePdf = new iText.Kernel.Pdf.PdfDocument(reader); - - var pageCount = sourcePdf.GetNumberOfPages(); - - for (var i = 1; i <= pageCount; i++) - { - var page = sourcePdf.GetPage(i); - mergedPdfDocument.AddPage(page.CopyTo(mergedPdfDocument)); - } - } - catch (Exception ex) - { - throw new Exception($"Error merging PDF file {pdfFile}: {ex.Message}", ex); - } - finally - { - try - { - await pdfFile.DisposeAsync(); - } - catch - { - // Ignore any exceptions during disposal - } - } - } - - mergedPdfDocument.Close(); - mergedStream.Position = 0; - return mergedStream; - } - private void BuildPdfOutlines(PdfOutline parentOutline, List pdfDocumentNodes) { foreach (var pdfDocumentNode in pdfDocumentNodes) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs index c93d5fe06e..618f823f80 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs @@ -30,9 +30,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency protected IDocumentSource DocumentSource { get; set; } protected DocumentParams DocumentParams { get; set; } protected Project Project { get; set; } - protected List AllPdfDocuments { get; } = []; - - protected int ChunkSize { get; set; } = 60; + protected List AllPdfDocuments { get; private set; } = []; public ProjectPdfGenerator( IDocumentSourceFactory documentStoreFactory, @@ -61,30 +59,31 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency DocumentParams = await GetDocumentParamsAsync(project, version, languageCode); var navigation = await GetNavigationAsync(project, version, languageCode); + AllPdfDocuments = new List(); await SetAllPdfDocumentsAsync(navigation.Items, project, version, languageCode); var title = Options.Value.CalculatePdfFileTitle?.Invoke(project) ?? project.Name; - var tempStreams = new List(); + var tempStreams = new List<(PdfDocument pdfDocument, Stream stream)>(); try { - var documentChunks = ChunkDocuments(AllPdfDocuments); - Logger.LogInformation("Documents split into {ChunkCount} chunks for processing", documentChunks.Count); - - foreach (var (chunk, index) in documentChunks.Select((chunk, index) => (chunk, index))) + var index = 0; + foreach (var document in AllPdfDocuments) { try { - Logger.LogInformation("Processing chunk {Index}/{Total}", index + 1, documentChunks.Count); + Logger.LogInformation("Processing chunk {Index}/{Total}", index + 1, AllPdfDocuments.Count); - var chunkHtml = await BuildHtmlAsync(chunk); + var chunkHtml = await BuildHtmlAsync([document]); - var pdfStream = await HtmlToPdfRenderer.RenderAsync($"{title} - Part {index + 1}", chunkHtml, chunk); + var pdfStream = await HtmlToPdfRenderer.RenderAsync($"{title} - Part {document.Title}", chunkHtml, [document]); Logger.LogInformation("Chunk {Index} rendered to PDF", index + 1); - tempStreams.Add(pdfStream); + tempStreams.Add((document, pdfStream)); + + index++; } catch (Exception e) { @@ -94,7 +93,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency Logger.LogInformation("All chunks processed, merging PDF files"); - var mergedPdfStream = await MergePdfFilesAsync(tempStreams, title, disposeStreams: true); + var mergedPdfStream = await MergePdfFilesAsync(tempStreams, title); await ProjectPdfFileStore.SetAsync(project, version, languageCode, mergedPdfStream); } catch(Exception e) @@ -104,7 +103,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency { try { - await tempStream.DisposeAsync(); + await tempStream.stream.DisposeAsync(); } catch { @@ -119,34 +118,6 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency } } - protected virtual List> ChunkDocuments(List documents) - { - var flatDocuments = FlattenDocuments(documents); - - return flatDocuments - .Select((doc, index) => new { doc, index }) - .GroupBy(x => x.index / ChunkSize) - .Select(g => g.Select(x => x.doc).ToList()) - .ToList(); - } - - protected virtual List FlattenDocuments(List documents) - { - var result = new List(); - - foreach (var document in documents) - { - result.Add(document); - - if (document.HasChildren) - { - result.AddRange(FlattenDocuments(document.Children)); - } - } - - return result; - } - protected virtual async Task BuildHtmlAsync(List pdfDocuments) { var htmlContent = await ConvertDocumentsToHtmlAsync(pdfDocuments); @@ -182,7 +153,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency return contentBuilder.ToString(); } - protected virtual async Task MergePdfFilesAsync(List pdfFiles, string title, bool disposeStreams = true) + protected virtual async Task MergePdfFilesAsync(List<(PdfDocument pdfDocument, Stream stream)> pdfFiles, string title) { if (pdfFiles.Count == 0) { @@ -194,22 +165,18 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency { using var zipArchive = new ZipArchive(zipStream, ZipArchiveMode.Create, true); - var index = 0; - foreach (var pdfFile in pdfFiles) + foreach (var (doc, pdfFile) in pdfFiles) { if (pdfFile.CanSeek) + { pdfFile.Position = 0; + } - var entry = zipArchive.CreateEntry($"{title}_{index}.pdf", CompressionLevel.Fastest); + var entry = zipArchive.CreateEntry($"{title}_{doc.Title}.pdf", CompressionLevel.Fastest); await using var entryStream = entry.Open(); await pdfFile.CopyToAsync(entryStream); - if (disposeStreams) - { - await pdfFile.DisposeAsync(); - } - - index++; + await pdfFile.DisposeAsync(); } } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs index a47269ac97..3d1074408d 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs @@ -7,7 +7,7 @@ using Volo.Abp.DependencyInjection; namespace Volo.Docs.Projects.Pdf.Puppeteer; -public class PuppeteerHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependency +public class PuppeteerHtmlToPdfRenderer : IHtmlToPdfRenderer { public async Task RenderAsync(string title, string html, List documents) { @@ -16,7 +16,7 @@ public class PuppeteerHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependen Browser = SupportedBrowser.Chromium }.DownloadAsync(); - await using var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(new LaunchOptions { Headless = true, Timeout = 600000, Browser = SupportedBrowser.Chromium }); + await using var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(new LaunchOptions { Headless = false, Timeout = 600000, Browser = SupportedBrowser.Chromium }); await using var page = await browser.NewPageAsync(); await page.SetContentAsync(html, new NavigationOptions From 2584d0af170cd63a136f7683938263d02414dd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 13 Jun 2025 15:38:48 +0300 Subject: [PATCH 18/21] remove Puppeteer --- Directory.Packages.props | 1 - .../Volo.Docs.Domain/Volo.Docs.Domain.csproj | 1 - .../Puppeteer/PuppeteerHtmlToPdfRenderer.cs | 38 ------------------- 3 files changed, 40 deletions(-) delete mode 100644 modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 1ba30a63dc..62110b2326 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -113,7 +113,6 @@ - diff --git a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj index 266983eb24..e57312e16b 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj +++ b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj @@ -25,7 +25,6 @@ - diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs deleted file mode 100644 index 3d1074408d..0000000000 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Puppeteer/PuppeteerHtmlToPdfRenderer.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using PuppeteerSharp; -using PuppeteerSharp.Media; -using Volo.Abp.DependencyInjection; - -namespace Volo.Docs.Projects.Pdf.Puppeteer; - -public class PuppeteerHtmlToPdfRenderer : IHtmlToPdfRenderer -{ - public async Task RenderAsync(string title, string html, List documents) - { - await new BrowserFetcher() - { - Browser = SupportedBrowser.Chromium - }.DownloadAsync(); - - await using var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(new LaunchOptions { Headless = false, Timeout = 600000, Browser = SupportedBrowser.Chromium }); - await using var page = await browser.NewPageAsync(); - - await page.SetContentAsync(html, new NavigationOptions - { - Timeout = 600000, - }); - - var pdfOptions = new PdfOptions - { - Format = PaperFormat.A4, - MarginOptions = new MarginOptions { Top = "20mm", Bottom = "20mm", Left = "15mm", Right = "15mm" }, - }; - - var stream = await page.PdfStreamAsync(pdfOptions); - await page.CloseAsync(); - await browser.CloseAsync(); - return stream; - } -} \ No newline at end of file From 7b70934164d9560d6764f5b11b0939ec6a592a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 13 Jun 2025 16:38:53 +0300 Subject: [PATCH 19/21] refactoring --- .../Docs/Projects/Pdf/IHtmlToPdfRenderer.cs | 2 +- .../Pdf/IText/ITextHtmlToPdfRenderer.cs | 33 ++- .../Docs/Projects/Pdf/ProjectPdfGenerator.cs | 256 +++++++++--------- 3 files changed, 158 insertions(+), 133 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs index 56fdc2f995..cee1b96185 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs @@ -6,5 +6,5 @@ namespace Volo.Docs.Projects.Pdf; public interface IHtmlToPdfRenderer { - Task RenderAsync(string title, string html, List documents); + Stream Render(string title, string html, List documents); } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs index c0d609be9c..a5fa814dcb 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs @@ -21,15 +21,26 @@ public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependency Options = options; } - public virtual Task RenderAsync(string title, string html, List documents) + public virtual Stream Render(string title, string html, List documents) { var pdfStream = new MemoryStream(); - var pdfWrite = new PdfWriter(pdfStream); - var pdfDocument = new iText.Kernel.Pdf.PdfDocument(pdfWrite); - pdfDocument.GetDocumentInfo().SetTitle(title); - var textDocument = new ITextDocument(pdfDocument); - pdfWrite.SetCloseStream(false); - + using (var pdfWriter = new PdfWriter(pdfStream)) + { + pdfWriter.SetCloseStream(false); + using (var pdfDocument = new iText.Kernel.Pdf.PdfDocument(pdfWriter)) + { + pdfDocument.GetDocumentInfo().SetTitle(title); + CreatePdfFromHtml(html, pdfDocument); + AddOutlinesToPdf(pdfDocument, documents); + } + } + + pdfStream.Position = 0; + return pdfStream; + } + + private void CreatePdfFromHtml(string html, iText.Kernel.Pdf.PdfDocument pdfDocument) + { var converter = new ConverterProperties(); var tagWorkerFactory = new HtmlIdTagWorkerFactory(pdfDocument); converter.SetTagWorkerFactory(tagWorkerFactory); @@ -37,12 +48,12 @@ public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependency HtmlConverter.ConvertToDocument(html, pdfDocument, converter); tagWorkerFactory.AddNamedDestinations(); + } + + private void AddOutlinesToPdf(iText.Kernel.Pdf.PdfDocument pdfDocument, List documents) + { var pdfOutlines = pdfDocument.GetOutlines(false); BuildPdfOutlines(pdfOutlines, documents); - - textDocument.Close(); - pdfStream.Position = 0; - return Task.FromResult(pdfStream); } private void BuildPdfOutlines(PdfOutline parentOutline, List pdfDocumentNodes) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs index 618f823f80..391d4c77ae 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs @@ -23,23 +23,23 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency protected IDocumentToHtmlConverterFactory DocumentToHtmlConverterFactory { get; } protected IDocumentRepository DocumentRepository { get; } protected IDocumentSectionRenderer DocumentSectionRenderer { get; } - protected IOptions Options { get; } + protected IOptions Options { get; } protected IProjectPdfFileStore ProjectPdfFileStore { get; } protected IHtmlToPdfRenderer HtmlToPdfRenderer { get; } protected ILogger Logger { get; set; } protected IDocumentSource DocumentSource { get; set; } protected DocumentParams DocumentParams { get; set; } protected Project Project { get; set; } - protected List AllPdfDocuments { get; private set; } = []; + protected List AllPdfDocuments { get; } = []; public ProjectPdfGenerator( - IDocumentSourceFactory documentStoreFactory, + IDocumentSourceFactory documentStoreFactory, IDocumentRepository documentRepository, IOptions options, IDocumentSectionRenderer documentSectionRenderer, - IProjectPdfFileStore projectPdfFileStore, - IHtmlToPdfRenderer htmlToPdfRenderer, - IDocumentToHtmlConverterFactory documentToHtmlConverterFactory, + IProjectPdfFileStore projectPdfFileStore, + IHtmlToPdfRenderer htmlToPdfRenderer, + IDocumentToHtmlConverterFactory documentToHtmlConverterFactory, ILogger logger) { DocumentStoreFactory = documentStoreFactory; @@ -51,55 +51,44 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency DocumentToHtmlConverterFactory = documentToHtmlConverterFactory; Logger = logger; } - + public virtual async Task GenerateAsync(Project project, string version, string languageCode) { Project = project; DocumentSource = DocumentStoreFactory.Create(project.DocumentStoreType); DocumentParams = await GetDocumentParamsAsync(project, version, languageCode); - + var navigation = await GetNavigationAsync(project, version, languageCode); - AllPdfDocuments = new List(); await SetAllPdfDocumentsAsync(navigation.Items, project, version, languageCode); var title = Options.Value.CalculatePdfFileTitle?.Invoke(project) ?? project.Name; - var tempStreams = new List<(PdfDocument pdfDocument, Stream stream)>(); + var tempFiles = new List<(PdfDocument pdfDocument, Stream stream)>(); try { - var index = 0; - foreach (var document in AllPdfDocuments) + for (var i = 0; i < AllPdfDocuments.Count; i++) { - try - { + var document = AllPdfDocuments[i]; + Logger.LogInformation("Processing chunk {Index}/{Total}", i + 1, AllPdfDocuments.Count); - Logger.LogInformation("Processing chunk {Index}/{Total}", index + 1, AllPdfDocuments.Count); + var chunkHtml = await BuildHtmlAsync([document]); - var chunkHtml = await BuildHtmlAsync([document]); + var pdfStream = HtmlToPdfRenderer.Render($"{title} - Part {document.Title}", chunkHtml, [document]); - var pdfStream = await HtmlToPdfRenderer.RenderAsync($"{title} - Part {document.Title}", chunkHtml, [document]); - - Logger.LogInformation("Chunk {Index} rendered to PDF", index + 1); + Logger.LogInformation("Chunk {Index} rendered to PDF", i + 1); - tempStreams.Add((document, pdfStream)); - - index++; - } - catch (Exception e) - { - Logger.LogError(e, "Error processing chunk {Index} for project {ProjectName}", index + 1, project.Name); - } + tempFiles.Add((document, pdfStream)); } - + Logger.LogInformation("All chunks processed, merging PDF files"); - var mergedPdfStream = await MergePdfFilesAsync(tempStreams, title); + var mergedPdfStream = await MergePdfFilesAsync(tempFiles); await ProjectPdfFileStore.SetAsync(project, version, languageCode, mergedPdfStream); } - catch(Exception e) + catch (Exception e) { Logger.LogError(e, "An error occurred while generating the PDF for project {ProjectName}", project.Name); - foreach (var tempStream in tempStreams) + foreach (var tempStream in tempFiles) { try { @@ -113,6 +102,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency } finally { + AllPdfDocuments.Clear(); GC.Collect(); GC.WaitForPendingFinalizers(); } @@ -121,15 +111,15 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency protected virtual async Task BuildHtmlAsync(List pdfDocuments) { var htmlContent = await ConvertDocumentsToHtmlAsync(pdfDocuments); - + var htmlBuilder = new StringBuilder(); htmlBuilder.Append(Options.Value.HtmlLayout); htmlBuilder.Replace(DocsProjectPdfGeneratorOptions.StylePlaceholder, Options.Value.HtmlStyle); htmlBuilder.Replace(DocsProjectPdfGeneratorOptions.ContentPlaceholder, htmlContent); - + return htmlBuilder.ToString(); } - + protected virtual async Task ConvertDocumentsToHtmlAsync(List pdfDocuments) { var contentBuilder = new StringBuilder(); @@ -140,7 +130,9 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency { var renderedDocument = await RenderDocumentAsync(pdfDocument); var documentToHtmlConverter = GetDocumentToHtmlConverter(Project, pdfDocument); - var htmlContent = documentToHtmlConverter.Convert(new PdfDocumentToHtmlConverterContext(renderedDocument, pdfDocument, DocumentParams)); + var htmlContent = + documentToHtmlConverter.Convert( + new PdfDocumentToHtmlConverterContext(renderedDocument, pdfDocument, DocumentParams)); contentBuilder.AppendLine(htmlContent); } @@ -149,11 +141,12 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency contentBuilder.AppendLine(await ConvertDocumentsToHtmlAsync(pdfDocument.Children)); } } - + return contentBuilder.ToString(); } - protected virtual async Task MergePdfFilesAsync(List<(PdfDocument pdfDocument, Stream stream)> pdfFiles, string title) + protected virtual async Task MergePdfFilesAsync( + List<(PdfDocument pdfDocument, Stream stream)> pdfFiles) { if (pdfFiles.Count == 0) { @@ -162,50 +155,59 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency var zipStream = new MemoryStream(); - + + using (var zipArchive = new ZipArchive(zipStream, ZipArchiveMode.Create, true)) { - using var zipArchive = new ZipArchive(zipStream, ZipArchiveMode.Create, true); - foreach (var (doc, pdfFile) in pdfFiles) + for (var index = 0; index < pdfFiles.Count; index++) { - if (pdfFile.CanSeek) - { - pdfFile.Position = 0; - } - - var entry = zipArchive.CreateEntry($"{title}_{doc.Title}.pdf", CompressionLevel.Fastest); + var (doc, pdfFile) = pdfFiles[index]; + var entry = zipArchive.CreateEntry($"{index + 1}_{doc.Title}.pdf", CompressionLevel.Fastest); await using var entryStream = entry.Open(); await pdfFile.CopyToAsync(entryStream); - await pdfFile.DisposeAsync(); + try + { + await pdfFile.DisposeAsync(); + } + catch (Exception e) + { + Logger.LogWarning(e, "Error disposing PDF file stream for document {DocumentTitle}", doc.Title); + } } } + zipStream.Position = 0; return zipStream; } - - protected virtual IDocumentToHtmlConverter GetDocumentToHtmlConverter(Project project, PdfDocument pdfDocument) + + protected virtual IDocumentToHtmlConverter GetDocumentToHtmlConverter( + Project project, PdfDocument pdfDocument) { - return DocumentToHtmlConverterFactory.Create(DocsDomainConsts.PdfDocumentToHtmlConverterPrefix +(pdfDocument.Document.Format ?? project.Format)); + return DocumentToHtmlConverterFactory.Create( + DocsDomainConsts.PdfDocumentToHtmlConverterPrefix + (pdfDocument.Document.Format ?? project.Format)); } - + protected virtual async Task RenderDocumentAsync(PdfDocument pdfDocument) { var parameters = new DocumentRenderParameters(); - if (pdfDocument.RenderParameters != null) + if (pdfDocument.RenderParameters == null) { - foreach (var renderParameter in pdfDocument.RenderParameters) - { - var documentParam = DocumentParams.Parameters.FirstOrDefault(p => p.Name == renderParameter.Key); - parameters.Add(renderParameter.Key, renderParameter.Value); - parameters.Add(renderParameter.Key + "_Value",documentParam?.Values[renderParameter.Value] ?? renderParameter.Value); - } + return await DocumentSectionRenderer.RenderAsync(pdfDocument.Document.Content, parameters); } - + + foreach (var renderParameter in pdfDocument.RenderParameters) + { + var documentParam = DocumentParams.Parameters.FirstOrDefault(p => p.Name == renderParameter.Key); + parameters.Add(renderParameter.Key, renderParameter.Value); + parameters.Add(renderParameter.Key + "_Value", + documentParam?.Values[renderParameter.Value] ?? renderParameter.Value); + } + return await DocumentSectionRenderer.RenderAsync(pdfDocument.Document.Content, parameters); } - + protected virtual async Task SetAllPdfDocumentsAsync( List navigations, Project project, @@ -228,10 +230,11 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency { Title = navigation.Text, IgnoreOnOutline = navigation.Path == Options.Value.IndexPagePath, - Id = UrlHelper.IsExternalLink(navigation.Path) ? navigation.Path: null + Id = UrlHelper.IsExternalLink(navigation.Path) ? navigation.Path : null }; - if (!navigation.Path.IsNullOrWhiteSpace() && !UrlHelper.IsExternalLink(navigation.Path) && !navigation.HasChildItems) + if (!navigation.Path.IsNullOrWhiteSpace() && !UrlHelper.IsExternalLink(navigation.Path) && + !navigation.HasChildItems) { await HandleLeafDocumentAsync( navigation, @@ -255,7 +258,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency parentPdfDocument.Children.AddIfNotContains(pdfDocument); } } - + if (navigation.HasChildItems) { AddParameterCombinationsDocuments(parentPdfDocument, groupedCombinationsDocuments); @@ -269,11 +272,12 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency } catch (Exception e) { - Logger.LogWarning(e, $"Cannot get document for the path '{navigation.Path}' in the project {project.Name}."); + Logger.LogWarning(e, + $"Cannot get document for the path '{navigation.Path}' in the project {project.Name}."); } } } - + private async Task HandleLeafDocumentAsync( NavigationNode navigation, Project project, @@ -309,22 +313,25 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency groupedCombinationsDocuments[key] = []; } - var combinationDocument = i == 0 ? leafDocument : new PdfDocument - { - Document = document, - Id = GetDocumentId(document.Name, document.Format ?? project.Format, combination, false), - Title = GetDocumentTitle(navigation.Text, combination, DocumentParams), - RenderParameters = combination - }; + var combinationDocument = i == 0 + ? leafDocument + : new PdfDocument + { + Document = document, + Id = GetDocumentId(document.Name, document.Format ?? project.Format, combination, false), + Title = GetDocumentTitle(navigation.Text, combination, DocumentParams), + RenderParameters = combination + }; groupedCombinationsDocuments[key].Add(combinationDocument); } - } - - private void AddParameterCombinationsDocuments(PdfDocument parentPdfDocument, Dictionary> groupedCombinationsDocuments) + } + + private void AddParameterCombinationsDocuments(PdfDocument parentPdfDocument, + Dictionary> groupedCombinationsDocuments) { foreach (var combinations in groupedCombinationsDocuments) - { + { if (parentPdfDocument == null) { AllPdfDocuments.AddIfNotContains(combinations.Value); @@ -334,33 +341,31 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency parentPdfDocument.Children.AddIfNotContains(combinations.Value); } } - + groupedCombinationsDocuments.Clear(); } - + private async Task GetNavigationAsync( Project project, string version, string languageCode) { var navigationDocument = await GetDocumentAsync(project, project.NavigationDocumentName, version, languageCode); - + if (!DocsJsonSerializerHelper.TryDeserialize(navigationDocument.Content, out var navigation)) { - throw new UserFriendlyException($"Cannot validate navigation file '{project.NavigationDocumentName}' for the project {project.Name}."); + throw new UserFriendlyException( + $"Cannot validate navigation file '{project.NavigationDocumentName}' for the project {project.Name}."); } if (!Options.Value.IndexPagePath.IsNullOrWhiteSpace()) { - navigation.Items.Insert(0, new NavigationNode - { - Path = Options.Value.IndexPagePath - }); + navigation.Items.Insert(0, new NavigationNode { Path = Options.Value.IndexPagePath }); } - + return navigation; } - + private async Task GetDocumentParamsAsync( Project project, string version, @@ -373,13 +378,16 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency try { - var documentParamsDocument = await GetDocumentAsync(project, project.ParametersDocumentName, version, languageCode); - - if (!DocsJsonSerializerHelper.TryDeserialize(documentParamsDocument.Content, out var documentParams)) + var documentParamsDocument = + await GetDocumentAsync(project, project.ParametersDocumentName, version, languageCode); + + if (!DocsJsonSerializerHelper.TryDeserialize(documentParamsDocument.Content, + out var documentParams)) { - throw new UserFriendlyException($"Cannot validate document params file '{project.ParametersDocumentName}' for the project {project.Name}."); + throw new UserFriendlyException( + $"Cannot validate document params file '{project.ParametersDocumentName}' for the project {project.Name}."); } - + return documentParams; } catch (Exception e) @@ -388,25 +396,25 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency return new DocumentParams(); } } - + private async Task GetDocumentAsync( - Project project, + Project project, string documentName, string version, string languageCode) { version = string.IsNullOrWhiteSpace(version) ? project.LatestVersionBranchName : version; - + Document document = null; Exception firstException = null; - + var possibleNames = GetPossibleNames(documentName, project.Format); document = await DocumentRepository.FindAsync(project.Id, possibleNames, languageCode, version); if (document != null) { return document; } - + foreach (var name in possibleNames) { try @@ -421,15 +429,16 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency } } - if(document == null) + if (document == null) { throw firstException!; } return document; } - - private List GenerateAllParameterCombinations(List parameterKeys, Dictionary> parameters) + + private static List GenerateAllParameterCombinations(List parameterKeys, + Dictionary> parameters) { var parameterCombinations = new List(); @@ -437,7 +446,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency { return parameterCombinations; } - + GenerateCombinations(0, new DocumentRenderParameters()); return parameterCombinations; @@ -458,33 +467,35 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency } } - private static string GetDocumentId(string documentName, string format, DocumentRenderParameters parameters, bool isFirstCombinationDocument) + private static string GetDocumentId(string documentName, string format, DocumentRenderParameters parameters, + bool isFirstCombinationDocument) { - var id = documentName.Replace("." + format, string.Empty).Replace("/","-").Replace(" ", "-").ToLower(); - if (parameters != null && !isFirstCombinationDocument) - { - id = $"{id}{parameters.Select(x => $"{x.Key}_{x.Value}").JoinAsString("-")}"; - } - - return id; + var id = documentName.Replace("." + format, string.Empty).Replace("/", "-").Replace(" ", "-").ToLower(); + if (parameters != null && !isFirstCombinationDocument) + { + id = $"{id}{parameters.Select(x => $"{x.Key}_{x.Value}").JoinAsString("-")}"; + } + + return id; } - - private static string GetDocumentTitle(string title, DocumentRenderParameters parameters, DocumentParams documentParams) + + private static string GetDocumentTitle(string title, DocumentRenderParameters parameters, + DocumentParams documentParams) { if (parameters == null || parameters.Count <= 0) { return title; } - + var paramValues = parameters.Select(x => { var documentParam = documentParams.Parameters.FirstOrDefault(p => p.Name == x.Key); return $"{documentParam?.DisplayName ?? x.Key} : {documentParam?.Values[x.Value] ?? x.Value}"; }); - + return title.Trim() + $" ({string.Join(", ", paramValues)})"; } - + private static List GetPossibleNames(string originalDocumentName, string format) { var extension = Path.GetExtension(originalDocumentName); @@ -492,7 +503,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency { extension = "." + format; } - + if (!extension.Equals("." + format, StringComparison.OrdinalIgnoreCase)) { return [originalDocumentName]; @@ -502,33 +513,36 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency var titleCaseIndex = "Index." + format; var indexLength = lowerCaseIndex.Length; - var possibleNames = new List {originalDocumentName}; - if (originalDocumentName.EndsWith("/" + lowerCaseIndex, StringComparison.OrdinalIgnoreCase) || originalDocumentName.Equals(lowerCaseIndex, StringComparison.OrdinalIgnoreCase)) + var possibleNames = new List { originalDocumentName }; + if (originalDocumentName.EndsWith("/" + lowerCaseIndex, StringComparison.OrdinalIgnoreCase) || + originalDocumentName.Equals(lowerCaseIndex, StringComparison.OrdinalIgnoreCase)) { var indexPart = originalDocumentName.Right(indexLength); - var documentNameWithoutIndex = originalDocumentName.Left(originalDocumentName.Length - lowerCaseIndex.Length); + var documentNameWithoutIndex = + originalDocumentName.Left(originalDocumentName.Length - lowerCaseIndex.Length); - if(indexPart != lowerCaseIndex) + if (indexPart != lowerCaseIndex) { possibleNames.Add(documentNameWithoutIndex + lowerCaseIndex); } - if(indexPart != titleCaseIndex) + if (indexPart != titleCaseIndex) { possibleNames.Add(documentNameWithoutIndex + titleCaseIndex); } } else { - var documentNameWithoutExtension = RemoveFileExtensionFromPath(originalDocumentName, format).EnsureEndsWith('/'); + var documentNameWithoutExtension = + RemoveFileExtensionFromPath(originalDocumentName, format).EnsureEndsWith('/'); possibleNames.Add(documentNameWithoutExtension + lowerCaseIndex); possibleNames.Add(documentNameWithoutExtension + titleCaseIndex); } return possibleNames; } - + private static string RemoveFileExtensionFromPath(string path, string format) { if (path == null) From 1dacadd3a6c9a06d97e629ade3a762f539cb68c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Fri, 13 Jun 2025 18:24:33 +0300 Subject: [PATCH 20/21] Update AnchorLinkRenderer.cs --- .../Volo/Docs/Projects/Pdf/Markdig/AnchorLinkRenderer.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Markdig/AnchorLinkRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Markdig/AnchorLinkRenderer.cs index 33fd2fd83a..881b2915e3 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Markdig/AnchorLinkRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/Markdig/AnchorLinkRenderer.cs @@ -24,12 +24,9 @@ public class AnchorLinkRenderer : LinkInlineRenderer return; } - var anchor = ResolveRelativeMarkdownPath(_document.Document.Name, link.Url) - .Replace(".md",string.Empty).Replace("/","-").Replace(" ", "-").ToLower(); - - renderer.Write(""); - renderer.Write(link.FirstChild?.ToString() ?? anchor); - renderer.Write(""); + link.GetDynamicUrl = () => "#" + ResolveRelativeMarkdownPath(_document.Document.Name, link.Url) + .Replace(".md", string.Empty).Replace("/", "-").Replace(" ", "-").ToLower(); + base.Write(renderer, link); } private string ResolveRelativeMarkdownPath(string currentPath, string relativePath) From a600e468de7972e810170096d0ee141b26f316c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Mon, 16 Jun 2025 10:18:33 +0300 Subject: [PATCH 21/21] refactoring --- modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj | 1 + .../Volo.Docs.Admin.Application.csproj | 2 +- .../Volo/Docs/Admin/DocsAdminApplicationModule.cs | 2 +- .../Volo/Docs/Documents/DocsDocumentPdfController.cs | 4 ++-- .../Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs | 2 +- .../Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs | 5 ++--- .../Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs | 4 +--- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj index 0a59f42c87..316f29f84c 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj +++ b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj @@ -43,6 +43,7 @@ + diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj index 2ecefbfd1a..725c70bc2b 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs index 9358705f94..2491bf5fb6 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs @@ -15,7 +15,7 @@ namespace Volo.Docs.Admin typeof(AbpCachingModule), typeof(AbpAutoMapperModule), typeof(AbpDddApplicationModule), - typeof(AbpBackgroundJobsModule) + typeof(AbpBackgroundJobsAbstractionsModule) )] public class DocsAdminApplicationModule : AbpModule { diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs index 06c20093aa..040373269e 100644 --- a/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs +++ b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs @@ -23,14 +23,14 @@ public class DocsDocumentPdfController : DocsControllerBase, IDocumentPdfAppServ [HttpGet] [Route("download")] - public Task DownloadPdfAsync(DocumentPdfGeneratorInput input) + public virtual Task DownloadPdfAsync(DocumentPdfGeneratorInput input) { return DocumentPdfAppService.DownloadPdfAsync(input); } [HttpGet] [Route("exists")] - public Task ExistsAsync(DocumentPdfGeneratorInput input) + public virtual Task ExistsAsync(DocumentPdfGeneratorInput input) { return DocumentPdfAppService.ExistsAsync(input); } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs index cee1b96185..56fdc2f995 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IHtmlToPdfRenderer.cs @@ -6,5 +6,5 @@ namespace Volo.Docs.Projects.Pdf; public interface IHtmlToPdfRenderer { - Stream Render(string title, string html, List documents); + Task RenderAsync(string title, string html, List documents); } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs index a5fa814dcb..cd83333495 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs @@ -8,7 +8,6 @@ using iText.Kernel.Pdf.Action; using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Docs.Utils; -using ITextDocument = iText.Layout.Document; namespace Volo.Docs.Projects.Pdf.IText; @@ -21,7 +20,7 @@ public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependency Options = options; } - public virtual Stream Render(string title, string html, List documents) + public virtual Task RenderAsync(string title, string html, List documents) { var pdfStream = new MemoryStream(); using (var pdfWriter = new PdfWriter(pdfStream)) @@ -36,7 +35,7 @@ public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependency } pdfStream.Position = 0; - return pdfStream; + return Task.FromResult(pdfStream); } private void CreatePdfFromHtml(string html, iText.Kernel.Pdf.PdfDocument pdfDocument) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs index 391d4c77ae..f91e341d6f 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs @@ -73,7 +73,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency var chunkHtml = await BuildHtmlAsync([document]); - var pdfStream = HtmlToPdfRenderer.Render($"{title} - Part {document.Title}", chunkHtml, [document]); + var pdfStream = await HtmlToPdfRenderer.RenderAsync($"{title} - Part {document.Title}", chunkHtml, [document]); Logger.LogInformation("Chunk {Index} rendered to PDF", i + 1); @@ -103,8 +103,6 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency finally { AllPdfDocuments.Clear(); - GC.Collect(); - GC.WaitForPendingFinalizers(); } }