diff --git a/Directory.Packages.props b/Directory.Packages.props index 6f3d1423ad..62110b2326 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -34,9 +34,9 @@ - - - + + + 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/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/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.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/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..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 @@ -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 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 bc606f7df7..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 @@ -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 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/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..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 @@ -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/zh-Hant.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json index bfa6e4ea97..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 @@ -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/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/Volo.Docs.Admin.Application.csproj b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj index 7279eeee67..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,6 +17,7 @@ + diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJob.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJob.cs new file mode 100644 index 0000000000..2921039a91 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJob.cs @@ -0,0 +1,41 @@ +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; } + + protected IUnitOfWorkManager UnitOfWorkManager { get; } + + public DocumentPdfGenerateJob(IProjectPdfGenerator projectPdfGenerator, IProjectRepository projectRepository, IUnitOfWorkManager unitOfWorkManager) + { + ProjectPdfGenerator = projectPdfGenerator; + ProjectRepository = projectRepository; + UnitOfWorkManager = unitOfWorkManager; + } + + public async override Task ExecuteAsync(DocumentPdfGenerateJobArgs args) + { + try + { + Logger.LogInformation("Generating PDF for project {ProjectId}, version {Version}, language {LanguageCode}", args.ProjectId, args.Version, args.LanguageCode); + using var uow = UnitOfWorkManager.Begin(requiresNew: true); + var project = await ProjectRepository.GetAsync(args.ProjectId, includeDetails: true); + await ProjectPdfGenerator.GenerateAsync(project, args.Version, args.LanguageCode); + await uow.CompleteAsync(); + } + 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/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJobArgs.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJobArgs.cs new file mode 100644 index 0000000000..ce8b734f2c --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/BackgroundJobs/DocumentPdfGenerateJobArgs.cs @@ -0,0 +1,13 @@ +using System; +using Volo.Abp.BackgroundJobs; + +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/DocsAdminApplicationModule.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs index 7e6983d65e..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 @@ -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(AbpBackgroundJobsAbstractionsModule) )] 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..9d10d0d99a --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Options; +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.Documents; +using Volo.Docs.Projects; +using Volo.Docs.Projects.Pdf; + +namespace Volo.Docs.Admin.Documents; + +[Authorize(DocsAdminPermissions.Projects.ManagePdfFiles)] +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) + ); + } + + 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.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.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; } - - - - - - - - @L["Version"] - - @foreach (var version in Model.ViewModel.Versions) - { - @version.Value - } - - - - @L["Language"] - - @foreach (var language in Model.ViewModel.Languages) - { - @language.Value - } - - - - - - @L["ForceToGenerateNewPdf"] - - - - - @L["Close"] - @L["GeneratePdf"] - @L["GenerateAndDownloadPdf"] - - \ No newline at end of file + + + + + + + + @L["Version"] + + @foreach (var version in Model.ViewModel.Versions) + { + @version.Value + } + + + + @L["Language"] + + @foreach (var language in Model.ViewModel.Languages) + { + @language.Value + } + + + + + @L["Close"] + @L["GeneratePdf"] + + + \ 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/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 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..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 @@ -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/download?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('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/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/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.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.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..0cfdf48bd7 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs @@ -0,0 +1,55 @@ +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; + +namespace Volo.Docs.Common.Documents; + +[Authorize(DocsCommonPermissions.Projects.PdfDownload)] +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, MimeTypes.Application.Zip); + } + + 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/Volo/Docs/Documents/DocsDocumentPdfGeneratorClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsDocumentPdfClientProxy.Generated.cs similarity index 50% 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/DocsDocumentPdfClientProxy.Generated.cs index 39608380c5..e40ce0d1ec 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/DocsDocumentPdfClientProxy.Generated.cs @@ -15,12 +15,20 @@ 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) + public virtual async Task DownloadPdfAsync(DocumentPdfGeneratorInput input) { - return await RequestAsync(nameof(GeneratePdfAsync), new ClientProxyRequestTypeValue + 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/Volo/Docs/Projects/DocsProjectClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.Generated.cs similarity index 100% rename from modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.Generated.cs rename to modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.Generated.cs 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/DocsProjectClientProxy.cs similarity index 100% rename from modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Projects/DocsProjectClientProxy.cs rename to modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/DocsProjectClientProxy.cs 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/DocsDocumentPdfGeneratorClientProxy.cs deleted file mode 100644 index e14c1c25be..0000000000 --- a/modules/docs/src/Volo.Docs.Common.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentPdfGeneratorClientProxy.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 DocsDocumentPdfGeneratorClientProxy -{ -} 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..040373269e --- /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 virtual Task DownloadPdfAsync(DocumentPdfGeneratorInput input) + { + return DocumentPdfAppService.DownloadPdfAsync(input); + } + + [HttpGet] + [Route("exists")] + public virtual 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..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 @@ -1,5 +1,4 @@ using System; -using Scriban.Syntax; namespace Volo.Docs.Projects.Pdf; @@ -29,15 +28,9 @@ 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". + /// Default is "{project.ShortName}-{version}-{languageCode}.zip". /// public Func CalculatePdfFileName { get; set; } @@ -115,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 c17908af51..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 { - Task RenderAsync(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/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/IText/ITextHtmlToPdfRenderer.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IText/ITextHtmlToPdfRenderer.cs index 1ee6b679e3..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,11 +8,10 @@ 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; -public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer ,ITransientDependency +public class ITextHtmlToPdfRenderer : IHtmlToPdfRenderer, ITransientDependency { protected IOptions Options { get; } @@ -21,15 +20,26 @@ 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); - 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 Task.FromResult(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 +47,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/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) 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..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 @@ -1,14 +1,13 @@ using System; using System.Collections.Generic; using System.IO; +using System.IO.Compression; 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; @@ -24,7 +23,7 @@ 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; } @@ -34,13 +33,14 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency 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; DocumentRepository = documentRepository; @@ -49,47 +49,75 @@ 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) + + 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); - + 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); - - await ProjectPdfFileStore.SetAsync(project, version, languageCode, pdfStream); - - return new RemoteStreamContent(pdfStream, fileName, "application/pdf"); + var tempFiles = new List<(PdfDocument pdfDocument, Stream stream)>(); + + try + { + for (var i = 0; i < AllPdfDocuments.Count; i++) + { + var document = AllPdfDocuments[i]; + Logger.LogInformation("Processing chunk {Index}/{Total}", i + 1, AllPdfDocuments.Count); + + var chunkHtml = await BuildHtmlAsync([document]); + + var pdfStream = await HtmlToPdfRenderer.RenderAsync($"{title} - Part {document.Title}", chunkHtml, [document]); + + Logger.LogInformation("Chunk {Index} rendered to PDF", i + 1); + + tempFiles.Add((document, pdfStream)); + } + + Logger.LogInformation("All chunks processed, merging PDF files"); + + var mergedPdfStream = await MergePdfFilesAsync(tempFiles); + await ProjectPdfFileStore.SetAsync(project, version, languageCode, mergedPdfStream); + } + catch (Exception e) + { + Logger.LogError(e, "An error occurred while generating the PDF for project {ProjectName}", project.Name); + foreach (var tempStream in tempFiles) + { + try + { + await tempStream.stream.DisposeAsync(); + } + catch + { + // ignore any exceptions during disposal + } + } + } + finally + { + AllPdfDocuments.Clear(); + } } - - protected virtual async Task BuildHtmlAsync() + + protected virtual async Task BuildHtmlAsync(List pdfDocuments) { - var htmlContent = await ConvertDocumentsToHtmlAsync(AllPdfDocuments); - + 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(); @@ -100,7 +128,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); } @@ -109,31 +139,73 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency contentBuilder.AppendLine(await ConvertDocumentsToHtmlAsync(pdfDocument.Children)); } } - + return contentBuilder.ToString(); } - protected virtual IDocumentToHtmlConverter GetDocumentToHtmlConverter(Project project, PdfDocument pdfDocument) + protected virtual async Task MergePdfFilesAsync( + List<(PdfDocument pdfDocument, Stream stream)> pdfFiles) { - return DocumentToHtmlConverterFactory.Create(DocsDomainConsts.PdfDocumentToHtmlConverterPrefix +(pdfDocument.Document.Format ?? project.Format)); + if (pdfFiles.Count == 0) + { + throw new ArgumentException("No PDF files to merge", nameof(pdfFiles)); + } + + var zipStream = new MemoryStream(); + + + using (var zipArchive = new ZipArchive(zipStream, ZipArchiveMode.Create, true)) + { + for (var index = 0; index < pdfFiles.Count; index++) + { + 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); + + 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) + { + 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, @@ -156,10 +228,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, @@ -183,7 +256,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency parentPdfDocument.Children.AddIfNotContains(pdfDocument); } } - + if (navigation.HasChildItems) { AddParameterCombinationsDocuments(parentPdfDocument, groupedCombinationsDocuments); @@ -197,11 +270,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, @@ -237,22 +311,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); @@ -262,33 +339,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, @@ -301,13 +376,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) @@ -316,25 +394,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 @@ -349,15 +427,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(); @@ -365,7 +444,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency { return parameterCombinations; } - + GenerateCombinations(0, new DocumentRenderParameters()); return parameterCombinations; @@ -386,33 +465,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); @@ -420,7 +501,7 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency { extension = "." + format; } - + if (!extension.Equals("." + format, StringComparison.OrdinalIgnoreCase)) { return [originalDocumentName]; @@ -430,33 +511,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) 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/Volo/Docs/Documents/DocsDocumentClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.Generated.cs similarity index 100% rename from modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.Generated.cs rename to modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.Generated.cs 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/DocsDocumentClientProxy.cs similarity index 100% rename from modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/Volo/Docs/Documents/DocsDocumentClientProxy.cs rename to modules/docs/src/Volo.Docs.HttpApi.Client/ClientProxies/DocsDocumentClientProxy.cs 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..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 @@ -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.PdfDownload) + && 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",