diff --git a/Directory.Packages.props b/Directory.Packages.props index 7263869bdf5..5673bf6bac3 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 77c70bddf82..bb861a309da 100644 --- a/modules/docs/Volo.Docs.abpmdl +++ b/modules/docs/Volo.Docs.abpmdl @@ -86,6 +86,22 @@ "Volo.Docs.MongoDB.Tests": { "path": "test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.abppkg", "folder": "test" + }, + "Volo.Docs.Common.Application": { + "path": "src/Volo.Docs.Common.Application/Volo.Docs.Common.Application.abppkg", + "folder": "src" + }, + "Volo.Docs.Common.Application.Contracts": { + "path": "src/Volo.Docs.Common.Application.Contracts/Volo.Docs.Common.Application.Contracts.abppkg", + "folder": "src" + }, + "Volo.Docs.Common.HttpApi": { + "path": "src/Volo.Docs.Common.HttpApi/Volo.Docs.Common.HttpApi.abppkg", + "folder": "src" + }, + "Volo.Docs.Common.HttpApi.Client": { + "path": "src/Volo.Docs.Common.HttpApi.Client/Volo.Docs.Common.HttpApi.Client.abppkg", + "folder": "src" } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentPdfAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentPdfAdminAppService.cs new file mode 100644 index 00000000000..ad253cecefd --- /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 bd93067140b..bd2b0c6526e 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 9543166ac4b..da63abd836a 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 a69c9283ea2..dcbc32e3101 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 1278047f503..972553c8abb 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 ae8108dfb54..d4142c99ad7 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 6ed2bb94cd1..2ccbdcf18a8 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 bc606f7df70..0710e96f2b6 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 79937b772d9..9be8d722072 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 d227037f32e..9393234a448 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 6efe4fe8883..3e7affcaf75 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 cdca790f20b..75e43a2bde9 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 547484a0621..b58648d7c51 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 64b41ce3b74..e262069bf78 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 29e7d1ba806..f253db8eb0c 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 6f43a26ac88..377d0e3b84b 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 a93ee2bd0fc..d82a792077c 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 ff8be458306..b1e0810dee9 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 68f40183d81..2da365c7c5b 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 bc2691121d7..5f05e906bc4 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 8b06da0e828..8ba521bb713 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 0fe64f8903b..dbf648bed25 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 db67ecb79bb..08571922d8c 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 42283a4b89e..6f2989cf2c5 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 176b427e595..1b716f20f27 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 137e42e4ae5..a7af969a12b 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 bfa6e4ea970..99cc9cec276 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 41b309f3080..6f3d503f448 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 @@ public interface IProjectAdminAppService : IApplicationService Task ReindexAllAsync(); Task> GetListWithoutDetailsAsync(); - - Task> GetPdfFilesAsync(GetPdfFilesInput input); - - Task DeletePdfFileAsync(DeletePdfFileInput input); } } diff --git a/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs new file mode 100644 index 00000000000..985f8bc7bfe --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJob.cs @@ -0,0 +1,40 @@ +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 + { + 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/BackgroundJobs/DocumentPdfGenerateJobArgs.cs b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs new file mode 100644 index 00000000000..be18746f17c --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/BackgroundJobs/DocumentPdfGenerateJobArgs.cs @@ -0,0 +1,12 @@ +using System; + +namespace Volo.Docs.Admin.BackgroundJobs; + +public class DocumentPdfGenerateJobArgs +{ + public Guid ProjectId { get; set; } + + public string Version { get; set; } + + public string LanguageCode { get; set; } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj index 7279eeee676..2ecefbfd1aa 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj @@ -17,6 +17,7 @@ + diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs index 7e6983d65e1..9358705f946 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.Caching; using Volo.Abp.Modularity; using Volo.Docs.Common; +using Volo.Abp.BackgroundJobs; namespace Volo.Docs.Admin { @@ -13,7 +14,8 @@ namespace Volo.Docs.Admin typeof(DocsCommonApplicationModule), typeof(AbpCachingModule), typeof(AbpAutoMapperModule), - typeof(AbpDddApplicationModule) + typeof(AbpDddApplicationModule), + typeof(AbpBackgroundJobsModule) )] public class DocsAdminApplicationModule : AbpModule { diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentPdfAdminAppService.cs new file mode 100644 index 00000000000..9d10d0d99a2 --- /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 abbb26abe50..af4ca2230b9 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 @@ public virtual async Task> GetListWithoutDetailsA 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 00000000000..8c14d65460f --- /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 00000000000..a8d5f82116e --- /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 9437ee487db..54f1ec22d5b 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 virtual async Task> GetListWithoutDetailsA return await RequestAsync>(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 e433e06ef98..0b3e9f9445f 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 636c7b6d252..00000000000 --- 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 00000000000..4cc49efc791 --- /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 e020486887d..5b1cffeae1c 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 @@ public Task> GetListWithoutDetailsAsync() 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 b8ad9742d84..64cb3d3b01d 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 231f7c56eb4..3396f3335cf 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.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 virtual async Task OnGetAsync(Guid id) 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 virtual async Task OnGetAsync(Guid id) 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 e4d9ecda726..895f876fe52 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 91015b15847..42883088b8b 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 8481867f466..de714038781 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 4e12d28da1c..1c2d2739717 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 a1e2aafaca8..2551021a800 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 00000000000..5ae23d89fca --- /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 0bdfc7fa1de..4007cb2598c 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 @@ public override void Define(IPermissionDefinitionContext context) { 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 f668f00813c..e07d9501101 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 @@ public class DocsCommonPermissions 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 00000000000..f5ab523b1f0 --- /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 dc8d87e820d..00000000000 --- 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 ff14b26dc6d..71e129fa642 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 7999e95a272..213dddc37d8 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 0b2c842bb33..3310b5e4a3b 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 95d2923d1e5..0b8d5986b19 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 3200537f6db..176c9fed460 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 8f01efadbfc..ffe36949674 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 3901eb8d1c9..1113f1909f9 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 707bd71c72f..4d96926a28e 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 7e3a84ff009..f9791278f67 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 6eba3e78c15..6cf85a22945 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 5208d048681..80485999b53 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 8da0d89a989..ae3e2b219a4 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 30a2bd39f8d..32868a4c7c6 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 9e0f6b19c97..7f39fb61705 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 1616e2cecb6..fd586ae4a0f 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 64e170aaf88..29e5bf8a9c9 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 89c83f40639..8268413768f 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 e9c83fc5601..a84f0752021 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 b5cc16b3766..8c037ebff53 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 f110638da1b..950217d67c4 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 aca12e8304a..d6a97d88f86 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 1adc834a478..0f8d8bd2ae5 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 c0df8c8fa93..4a8e23575be 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 19c39d619b5..1b40bdb92a8 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 e0f7a86c7dd..53b86e5ce3b 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 f92de5bc994..70f0eaab4d7 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 82b5257eedd..d37a0ff67ae 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 00000000000..d8358a94f16 --- /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 00000000000..e06c4715acc --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfAppService.cs @@ -0,0 +1,54 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Options; +using Volo.Abp.Content; +using Volo.Docs.Projects; +using Volo.Docs.Projects.Pdf; + +namespace Volo.Docs.Common.Documents; + +[Authorize(DocsCommonPermissions.Projects.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, "application/pdf"); + } + + return null; + } + + public virtual async Task ExistsAsync(DocumentPdfGeneratorInput input) + { + var project = await ProjectRepository.GetAsync(input.ProjectId); + var version = project.GetFullVersion(input.Version); + var languageCode = input.LanguageCode; + var fileName = Options.Value.CalculatePdfFileName(project, version, languageCode); + return project.FindPdfFile(fileName) != null; + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfGeneratorAppService.cs b/modules/docs/src/Volo.Docs.Common.Application/Volo/Docs/Common/Documents/DocumentPdfGeneratorAppService.cs deleted file mode 100644 index 3960a161792..00000000000 --- 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 39608380c54..e40ce0d1ec3 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 @@ 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 00000000000..e692a1a0ee5 --- /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 e14c1c25bee..00000000000 --- 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 db7303a427a..16b7c6d4b01 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 00000000000..a4939ea9913 --- /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 00000000000..bbc082c6815 --- /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 00000000000..06c20093aa7 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfController.cs @@ -0,0 +1,37 @@ +using System.Threading.Tasks; +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Content; +using Volo.Docs.Common; +using Volo.Docs.Common.Documents; + +namespace Volo.Docs.Documents; + +[RemoteService(Name = DocsCommonRemoteServiceConsts.RemoteServiceName)] +[Area(DocsCommonRemoteServiceConsts.ModuleName)] +[ControllerName("DocumentPdf")] +[Route("api/docs/documents/pdf")] +public class DocsDocumentPdfController : DocsControllerBase, IDocumentPdfAppService +{ + protected IDocumentPdfAppService DocumentPdfAppService { get; } + + public DocsDocumentPdfController(IDocumentPdfAppService documentPdfAppService) + { + DocumentPdfAppService = documentPdfAppService; + } + + [HttpGet] + [Route("download")] + public Task DownloadPdfAsync(DocumentPdfGeneratorInput input) + { + return DocumentPdfAppService.DownloadPdfAsync(input); + } + + [HttpGet] + [Route("exists")] + public Task ExistsAsync(DocumentPdfGeneratorInput input) + { + return DocumentPdfAppService.ExistsAsync(input); + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfGeneratorController.cs b/modules/docs/src/Volo.Docs.Common.HttpApi/Volo/Docs/Documents/DocsDocumentPdfGeneratorController.cs deleted file mode 100644 index 31ae2a2f44f..00000000000 --- 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 315d89c49cf..9d12923325c 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 virtual async Task GetOrNullAsync(Project project, string version 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 ef24e6ffd73..f20a0e6a512 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs @@ -1,5 +1,4 @@ using System; -using Scriban.Syntax; namespace Volo.Docs.Projects.Pdf; @@ -29,12 +28,6 @@ public class DocsProjectPdfGeneratorOptions /// public string IndexPagePath { get; set; } - /// - /// PDF file cache expiration time. - /// Default value is 24 hours. - /// - public TimeSpan PdfFileCacheExpiration { get; set; } = TimeSpan.FromHours(24); - /// /// The function to calculate the PDF file name. /// Default is "{project.ShortName}-{version}-{languageCode}.pdf". 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 af685659fa3..dad173bc198 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/IProjectPdfGenerator.cs @@ -1,9 +1,8 @@ using System.Threading.Tasks; -using Volo.Abp.Content; namespace Volo.Docs.Projects.Pdf; public interface IProjectPdfGenerator { - Task GenerateAsync(Project project, string version, string languageCode); + Task GenerateAsync(Project project, string version, string languageCode); } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs index c00973b3e8f..5abb3801992 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs @@ -52,16 +52,8 @@ public ProjectPdfGenerator( Logger = NullLogger.Instance; } - public virtual async Task GenerateAsync(Project project, string version, string languageCode) + public virtual async Task GenerateAsync(Project project, string version, string languageCode) { - var fileName = Options.Value.CalculatePdfFileName(project, version, languageCode); - var fileStream = await ProjectPdfFileStore.GetOrNullAsync(project, version, languageCode); - - if (fileStream != null) - { - return new RemoteStreamContent(fileStream, fileName, "application/pdf"); - } - Project = project; DocumentSource = DocumentStoreFactory.Create(project.DocumentStoreType); DocumentParams = await GetDocumentParamsAsync(project, version, languageCode); @@ -74,8 +66,6 @@ public virtual async Task GenerateAsync(Project project, s var pdfStream = await HtmlToPdfRenderer.RenderAsync(title, html, AllPdfDocuments); await ProjectPdfFileStore.SetAsync(project, version, languageCode, pdfStream); - - return new RemoteStreamContent(pdfStream, fileName, "application/pdf"); } protected virtual async Task BuildHtmlAsync() diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs index 69fa3a70567..03020494d81 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 @@ public virtual void RemovePdfFile(string fileName) 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 7deef5e383e..f32651686a2 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 e6a6f8470a0..21d4aab5ac4 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 471747fac15..8ffe5c4c7a2 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.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 @@ public class IndexModel : AbpPageModel 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 @@ public class IndexModel : AbpPageModel 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 @@ public IndexModel( IProjectAppService projectAppService, IOptions options, IWebDocumentSectionRenderer webDocumentSectionRenderer, - IPermissionChecker permissionChecker) + IPermissionChecker permissionChecker, + IDocumentPdfAppService documentPdfAppService) { ObjectMapperContext = typeof(DocsWebModule); @@ -123,6 +126,7 @@ public IndexModel( _projectAppService = projectAppService; _webDocumentSectionRenderer = webDocumentSectionRenderer; _permissionChecker = permissionChecker; + _documentPdfAppService = documentPdfAppService; _uiOptions = options.Value; LocalizationResourceType = typeof(DocsResource); @@ -152,7 +156,7 @@ private async Task SetPageAsync() 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 @@ private async Task SetPageAsync() 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 23eca169b5e..d55d9f2ef91 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 8f167366033..f25f6f3d3e0 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 e2d65a631ce..e916a379d21 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",