From 446bcfeb9e92d0f3e6b530d72051956848c5fa0d Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 20 Sep 2023 13:42:24 +0200 Subject: [PATCH] 20-09-2023 --- .../Entities/EnvelopeDocument.vb | 16 +-- .../Entities/EnvelopeResponse.vb | 4 + .../EnvelopeGenerator.Common.vbproj | 1 + EnvelopeGenerator.Common/Helpers.vb | 14 +- .../Models/DocumentModel.vb | 28 +++- .../Models/ElementModel.vb | 31 ++++- .../Models/EnvelopeModel.vb | 32 ++++- .../Models/ReceiverModel.vb | 15 ++- .../Controllers/EnvelopeEditorController.vb | 11 +- .../EnvelopeGenerator.Web.csproj | 1 + EnvelopeGenerator.Web/Handler/FileHandler.cs | 43 ++++++- EnvelopeGenerator.Web/Pages/Index.razor | 5 +- .../Pages/ShowEnvelope.razor | 11 +- EnvelopeGenerator.Web/Program.cs | 3 +- EnvelopeGenerator.Web/Scripts/app.ts | 117 +++++++++++++++-- .../Services/DatabaseService.cs | 21 ++- EnvelopeGenerator.Web/tsconfig.json | 2 +- EnvelopeGenerator.Web/wwwroot/js/app.js | 120 ++++++++++++++++-- EnvelopeGenerator.Web/wwwroot/js/app.js.map | 2 +- EnvelopeGenerator.Web/wwwroot/js/settings.js | 1 + .../wwwroot/js/settings.js.map | 1 + 21 files changed, 400 insertions(+), 79 deletions(-) create mode 100644 EnvelopeGenerator.Common/Entities/EnvelopeResponse.vb create mode 100644 EnvelopeGenerator.Web/wwwroot/js/settings.js create mode 100644 EnvelopeGenerator.Web/wwwroot/js/settings.js.map diff --git a/EnvelopeGenerator.Common/Entities/EnvelopeDocument.vb b/EnvelopeGenerator.Common/Entities/EnvelopeDocument.vb index 7c74e7f5..52033779 100644 --- a/EnvelopeGenerator.Common/Entities/EnvelopeDocument.vb +++ b/EnvelopeGenerator.Common/Entities/EnvelopeDocument.vb @@ -4,8 +4,6 @@ Imports System.IO Public Class EnvelopeDocument Public Property Id As Integer - Public Property FileInfo As FileInfo - Public Property FileNameOriginal As String Public Property IsTempFile As Boolean = True @@ -16,15 +14,7 @@ Public Class EnvelopeDocument Public Property Elements As New List(Of EnvelopeDocumentElement) - Public ReadOnly Property Filename As String - Get - Return FileInfo.Name - End Get - End Property - - Public ReadOnly Property Filepath As String - Get - Return FileInfo.FullName - End Get - End Property + Public Property Filename As String + + Public Property Filepath As String End Class diff --git a/EnvelopeGenerator.Common/Entities/EnvelopeResponse.vb b/EnvelopeGenerator.Common/Entities/EnvelopeResponse.vb new file mode 100644 index 00000000..11e1cdae --- /dev/null +++ b/EnvelopeGenerator.Common/Entities/EnvelopeResponse.vb @@ -0,0 +1,4 @@ +Public Class EnvelopeResponse + Public Property Envelope As Envelope + Public Property ReceiverId As Integer +End Class diff --git a/EnvelopeGenerator.Common/EnvelopeGenerator.Common.vbproj b/EnvelopeGenerator.Common/EnvelopeGenerator.Common.vbproj index 8d44b64f..4d7222ee 100644 --- a/EnvelopeGenerator.Common/EnvelopeGenerator.Common.vbproj +++ b/EnvelopeGenerator.Common/EnvelopeGenerator.Common.vbproj @@ -101,6 +101,7 @@ + diff --git a/EnvelopeGenerator.Common/Helpers.vb b/EnvelopeGenerator.Common/Helpers.vb index d81a2721..ab7a73fd 100644 --- a/EnvelopeGenerator.Common/Helpers.vb +++ b/EnvelopeGenerator.Common/Helpers.vb @@ -1,12 +1,24 @@ Public Class Helpers + + ''' + ''' Encodes the EnvelopeUUID and the ReceiverSignature into an EnvelopeKey + ''' + ''' + ''' + ''' The EnvelopeKey Public Shared Function EncodeEnvelopeReceiverId(pEnvelopeUuid As String, pReceiverSignature As String) As String Dim oString = $"{pEnvelopeUuid}::{pReceiverSignature}" 'TODO: Verschlüsseln Return oString End Function + ''' + ''' Decodes the EnvelopeKey and returns the EnvelopeUUID and the ReceiverSignature + ''' + ''' The EnvelopeKey + ''' A tuple containing EnvelopeUUID and Receiver Signature Public Shared Function DecodeEnvelopeReceiverId(pEnvelopeReceiverId As String) As Tuple(Of String, String) - Dim oSplit = pEnvelopeReceiverId.Split("::") + Dim oSplit = pEnvelopeReceiverId.Split(New String() {"::"}, StringSplitOptions.None) 'TODO: Entschlüsseln Return New Tuple(Of String, String)(oSplit(0), oSplit(1)) End Function diff --git a/EnvelopeGenerator.Common/Models/DocumentModel.vb b/EnvelopeGenerator.Common/Models/DocumentModel.vb index f1ed6661..39f09d7e 100644 --- a/EnvelopeGenerator.Common/Models/DocumentModel.vb +++ b/EnvelopeGenerator.Common/Models/DocumentModel.vb @@ -15,14 +15,19 @@ Public Class DocumentModel End Sub Private Function ToDocument(pRow As DataRow) As EnvelopeDocument + Return ToDocument(pRow, 0) + End Function + + Private Function ToDocument(pRow As DataRow, pReceiverId As Integer) As EnvelopeDocument Dim oDocumentId = pRow.ItemEx("GUID", 0) Return New EnvelopeDocument() With { .Id = oDocumentId, .EnvelopeId = pRow.ItemEx("ENVELOPE_ID", 0), - .FileInfo = New IO.FileInfo(pRow.ItemEx("FILEPATH", "")), + .Filename = pRow.ItemEx("FILENAME", ""), + .Filepath = pRow.ItemEx("FILEPATH", ""), .FileNameOriginal = pRow.ItemEx("FILENAME_ORIGINAL", ""), .IsTempFile = False, - .Elements = ElementModel.List(oDocumentId) + .Elements = ElementModel.List(oDocumentId, pReceiverId) } End Function @@ -32,7 +37,7 @@ Public Class DocumentModel Dim oTable = Database.GetDatatable(oSql) Return oTable?.Rows.Cast(Of DataRow). - Select(AddressOf ToDocument). + Select(Function(row) ToDocument(row)). Single() Catch ex As Exception @@ -47,7 +52,22 @@ Public Class DocumentModel Dim oTable = Database.GetDatatable(oSql) Return oTable?.Rows.Cast(Of DataRow). - Select(AddressOf ToDocument). + Select(Function(row) ToDocument(row)). + ToList() + + Catch ex As Exception + Logger.Error(ex) + Return Nothing + End Try + End Function + + Public Function List(pEnvelopeId As Integer, pReceiverId As Integer) As IEnumerable(Of EnvelopeDocument) + Try + Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE_DOCUMENT] WHERE ENVELOPE_ID = {pEnvelopeId}" + Dim oTable = Database.GetDatatable(oSql) + + Return oTable?.Rows.Cast(Of DataRow). + Select(Function(row) ToDocument(row, pReceiverId)). ToList() Catch ex As Exception diff --git a/EnvelopeGenerator.Common/Models/ElementModel.vb b/EnvelopeGenerator.Common/Models/ElementModel.vb index 8780816b..e9b475c2 100644 --- a/EnvelopeGenerator.Common/Models/ElementModel.vb +++ b/EnvelopeGenerator.Common/Models/ElementModel.vb @@ -23,6 +23,12 @@ Public Class ElementModel } End Function + Private Function ToElements(pTable As DataTable) As List(Of EnvelopeDocumentElement) + Return pTable?.Rows.Cast(Of DataRow). + Select(AddressOf ToElement). + ToList() + End Function + Public Function ElementsExist(pEnvelopeId As Integer, pReceiverId As Integer) As Boolean Try Dim oSql = $"SELECT COUNT(*) FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] T @@ -58,9 +64,25 @@ Public Class ElementModel Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC" Dim oTable = Database.GetDatatable(oSql) - Return oTable?.Rows.Cast(Of DataRow). - Select(AddressOf ToElement). - ToList() + Return ToElements(oTable) + + Catch ex As Exception + Logger.Error(ex) + Return Nothing + End Try + End Function + + Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of EnvelopeDocumentElement) + Try + Dim oReceiverConstraint = "" + If pReceiverId > 0 Then + oReceiverConstraint = $"AND RECEIVER_ID = {pReceiverId}" + End If + + Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} {oReceiverConstraint} ORDER BY PAGE ASC" + Dim oTable = Database.GetDatatable(oSql) + + Return ToElements(oTable) Catch ex As Exception Logger.Error(ex) @@ -160,6 +182,7 @@ Public Class ElementModel Try Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}" Return Database.ExecuteNonQuery(oSql) + Catch ex As Exception Logger.Error(ex) Return False @@ -170,6 +193,7 @@ Public Class ElementModel Try Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE RECEIVER_ID = {pReceiverId} AND DOCUMENT_ID = {pDocumentId}" Return Database.ExecuteNonQuery(oSql, pTransaction) + Catch ex As Exception Logger.Error(ex) Return False @@ -180,6 +204,7 @@ Public Class ElementModel Try Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE DOCUMENT_ID = {pDocumentId}" Return Database.ExecuteNonQuery(oSql, pTransaction) + Catch ex As Exception Logger.Error(ex) Return False diff --git a/EnvelopeGenerator.Common/Models/EnvelopeModel.vb b/EnvelopeGenerator.Common/Models/EnvelopeModel.vb index 12308a59..e28df9c6 100644 --- a/EnvelopeGenerator.Common/Models/EnvelopeModel.vb +++ b/EnvelopeGenerator.Common/Models/EnvelopeModel.vb @@ -1,4 +1,5 @@ Imports System.Data.SqlClient +Imports System.Web.UI.WebControls Imports DigitalData.Modules.Base Imports DigitalData.Modules.Logging @@ -26,14 +27,18 @@ Public Class EnvelopeModel Return oEnvelope End Function + Private Function ToEnvelope(pTable As DataTable) As Envelope + Return pTable?.Rows.Cast(Of DataRow). + Select(AddressOf ToEnvelope). + Single() + End Function + Public Function GetByUuid(pEnvelopeUuid As String) As Envelope Try Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE ENVELOPE_UUID = '{pEnvelopeUuid}'" - Dim oTable = Database.GetDatatable(oSql) + Dim oTable = Database.GetDatatable(oSql) - Return oTable?.Rows.Cast(Of DataRow). - Select(AddressOf ToEnvelope). - Single() + Return ToEnvelope(oTable) Catch ex As Exception Logger.Error(ex) Return Nothing @@ -54,6 +59,23 @@ Public Class EnvelopeModel End Try End Function + Public Function List(pReceiverId As Integer) As IEnumerable(Of Envelope) + Try + Dim oSql = $"SELECT T.* FROM [dbo].[TBSIG_ENVELOPE] T + JOIN TBSIG_ENVELOPE_RECEIVER T2 ON T.GUID = T2.ENVELOPE_ID + WHERE T2.RECEIVER_ID = {pReceiverId}" + Dim oTable = Database.GetDatatable(oSql) + + Return oTable?.Rows.Cast(Of DataRow). + Select(AddressOf ToEnvelope). + ToList() + + Catch ex As Exception + Logger.Error(ex) + Return Nothing + End Try + End Function + Public Function Send(pEnvelope As Envelope) As Boolean Try Dim oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET STATUS = @STATUS, SENT_WHEN = GETDATE() WHERE GUID = @GUID" @@ -149,7 +171,7 @@ Public Class EnvelopeModel Private Sub SetEnvelopeDate(pEnvelope As Envelope) Try - Dim addedWhen As DateTime = Database.GetScalarValue($"SELECT ADDED_WHEN FROM TBSIG_ENVELOPE WHERE GUID = {pEnvelope.Id}") + Dim addedWhen As Date = Database.GetScalarValue($"SELECT ADDED_WHEN FROM TBSIG_ENVELOPE WHERE GUID = {pEnvelope.Id}") pEnvelope.AddedWhen = addedWhen Catch ex As Exception Logger.Error(ex) diff --git a/EnvelopeGenerator.Common/Models/ReceiverModel.vb b/EnvelopeGenerator.Common/Models/ReceiverModel.vb index 9ccafadd..bae5ba29 100644 --- a/EnvelopeGenerator.Common/Models/ReceiverModel.vb +++ b/EnvelopeGenerator.Common/Models/ReceiverModel.vb @@ -44,7 +44,7 @@ Public Class ReceiverModel Dim oResult = Database.ExecuteNonQuery(oCommand) If oResult = True Then - pReceiver.Id = GetReceiverId(pReceiver.Email, pTransaction) + pReceiver.Id = GetReceiverIdByEmail(pReceiver.Email, pTransaction) Else Return False End If @@ -168,7 +168,16 @@ Public Class ReceiverModel End Try End Function - Private Function GetReceiverId(pEmailAddress As String, pTransaction As SqlTransaction) As Integer + Public Function GetReceiverIdBySignature(pSignature As String) As Integer + Try + Return Database.GetScalarValue($"SELECT GUID FROM TBSIG_RECEIVER WHERE SIGNATURE = '{pSignature}'") + Catch ex As Exception + Logger.Error(ex) + Return Nothing + End Try + End Function + + Private Function GetReceiverIdByEmail(pEmailAddress As String, pTransaction As SqlTransaction) As Integer Try Return Database.GetScalarValue($"SELECT GUID FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pEmailAddress}'", pTransaction) @@ -177,4 +186,6 @@ Public Class ReceiverModel Return Nothing End Try End Function + + End Class diff --git a/EnvelopeGenerator.Form/Controllers/EnvelopeEditorController.vb b/EnvelopeGenerator.Form/Controllers/EnvelopeEditorController.vb index bc51c23c..3db9e1a3 100644 --- a/EnvelopeGenerator.Form/Controllers/EnvelopeEditorController.vb +++ b/EnvelopeGenerator.Form/Controllers/EnvelopeEditorController.vb @@ -147,13 +147,15 @@ Public Class EnvelopeEditorController Dim oTempFilePath = Path.Combine(oTempFiles.TempPath, Guid.NewGuid().ToString + oFileInfo.Extension) File.Copy(oFileInfo.FullName, oTempFilePath, True) + Dim oFileInfoTemp = New FileInfo(oTempFilePath) + Dim oDocument = New EnvelopeDocument() With { - .FileInfo = New FileInfo(oTempFilePath), + .Filename = oFileInfoTemp.Name, + .Filepath = oFileInfoTemp.FullName, .FileNameOriginal = oFileInfo.Name, .Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath) } - Return oDocument Catch ex As Exception @@ -200,8 +202,11 @@ Public Class EnvelopeEditorController File.Copy(oDocument.Filepath, oDocumentFilePath) File.Delete(oDocument.Filepath) + Dim oFileInfo = New FileInfo(oDocumentFilePath) + oDocument.IsTempFile = False - oDocument.FileInfo = New FileInfo(oDocumentFilePath) + oDocument.Filename = oFileInfo.Name + oDocument.Filepath = oFileInfo.FullName Next Return True diff --git a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj index 8b709c7f..be53181a 100644 --- a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj +++ b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj @@ -24,6 +24,7 @@ + diff --git a/EnvelopeGenerator.Web/Handler/FileHandler.cs b/EnvelopeGenerator.Web/Handler/FileHandler.cs index 7d0a9218..af48fb39 100644 --- a/EnvelopeGenerator.Web/Handler/FileHandler.cs +++ b/EnvelopeGenerator.Web/Handler/FileHandler.cs @@ -1,4 +1,5 @@ -using EnvelopeGenerator.Web.Services; +using EnvelopeGenerator.Common; +using EnvelopeGenerator.Web.Services; namespace EnvelopeGenerator.Web.Handler { @@ -7,12 +8,48 @@ namespace EnvelopeGenerator.Web.Handler public async static Task HandleFile(HttpContext ctx, DatabaseService database, LoggingService logging) { var logger = logging.LogConfig.GetLogger("FileHandler"); - int docId = int.Parse((string)ctx.Request.RouteValues["docId"]); - var document = database.LoadDocument(docId); + string envelopeKey = (string)ctx.Request.RouteValues["envelopeKey"]; + + logger.Info("Downloading file with EnvelopeKey [{0}]", envelopeKey); + + Tuple result = Helpers.DecodeEnvelopeReceiverId(envelopeKey); + logger.Info("EnvelopeUUID: [{0}]", result.Item1); + logger.Info("ReceiverSignature: [{0}]", result.Item2); + + EnvelopeResponse response = database.LoadEnvelope(envelopeKey); + var envelope = response.Envelope; + logger.Info("Envelope [{0}] loaded", envelope.Id); + logger.Info("Contains [{0}] documents", envelope.Documents.Count); + logger.Info("Contains [{0}] receivers", envelope.Receivers.Count); + + var document = envelope.Documents.First(); var bytes = await File.ReadAllBytesAsync(document.Filepath); + logger.Info("Serving file, size: [{0}]", bytes.Length); return Results.File(bytes); } + + public static Task HandleGetData(HttpContext ctx, DatabaseService database, LoggingService logging) + { + var logger = logging.LogConfig.GetLogger("FileHandler"); + string envelopeKey = (string)ctx.Request.RouteValues["envelopeKey"]; + + logger.Info("Fetching data for envelope with EnvelopeKey [{0}]", envelopeKey); + + Tuple result = Helpers.DecodeEnvelopeReceiverId(envelopeKey); + logger.Info("EnvelopeUUID: [{0}]", result.Item1); + logger.Info("ReceiverSignature: [{0}]", result.Item2); + + var response = database.LoadEnvelope(envelopeKey); + var envelope = response.Envelope; + logger.Info("Envelope [{0}] loaded", envelope.Id); + logger.Info("Contains [{0}] documents", envelope.Documents.Count); + logger.Info("Contains [{0}] receivers", envelope.Receivers.Count); + + + return Task.FromResult(Results.Json(response)); + } + } } diff --git a/EnvelopeGenerator.Web/Pages/Index.razor b/EnvelopeGenerator.Web/Pages/Index.razor index b4e31ba5..fe38ccb5 100644 --- a/EnvelopeGenerator.Web/Pages/Index.razor +++ b/EnvelopeGenerator.Web/Pages/Index.razor @@ -8,7 +8,7 @@ @@ -17,7 +17,8 @@ protected override void OnInitialized() { - envelopes = Database.LoadEnvelopes(); + // Test + envelopes = Database.LoadEnvelopes(11); } diff --git a/EnvelopeGenerator.Web/Pages/ShowEnvelope.razor b/EnvelopeGenerator.Web/Pages/ShowEnvelope.razor index 78d6f3a0..5091d399 100644 --- a/EnvelopeGenerator.Web/Pages/ShowEnvelope.razor +++ b/EnvelopeGenerator.Web/Pages/ShowEnvelope.razor @@ -10,21 +10,12 @@ @code { [Parameter] public string EnvelopeReceiverId { get; set; } - private Envelope envelope; - private EnvelopeDocument document; - - protected override void OnInitialized() - { - envelope = Database.LoadEnvelope(EnvelopeReceiverId); - document = envelope.Documents.First(); - } - protected override async void OnAfterRender(bool firstRender) { if (firstRender) { var module = await JS.InvokeAsync("import", "./js/app.js"); - await module.InvokeVoidAsync("App.loadPDFFromUrl", "#container", document.Id); + await module.InvokeVoidAsync("App.loadPDFFromUrl", "#container", EnvelopeReceiverId); } } } diff --git a/EnvelopeGenerator.Web/Program.cs b/EnvelopeGenerator.Web/Program.cs index c105617f..8bba466c 100644 --- a/EnvelopeGenerator.Web/Program.cs +++ b/EnvelopeGenerator.Web/Program.cs @@ -35,7 +35,8 @@ app.UseStaticFiles(); app.UseRouting(); // Add file download endpoint -app.MapGet("/api/download/{docId}", FileHandler.HandleFile); +app.MapGet("/api/download/{envelopeKey}", FileHandler.HandleFile); +app.MapGet("/api/get-data/{envelopeKey}", FileHandler.HandleGetData); // Blazor plumbing app.MapBlazorHub(); diff --git a/EnvelopeGenerator.Web/Scripts/app.ts b/EnvelopeGenerator.Web/Scripts/app.ts index 6d7cf052..1f2039c2 100644 --- a/EnvelopeGenerator.Web/Scripts/app.ts +++ b/EnvelopeGenerator.Web/Scripts/app.ts @@ -1,25 +1,59 @@ -//import PSPDFKit, { Instance } from 'index.d.ts'; -import PSPDFKitType from "./index"; -import { Instance, WidgetAnnotation } from "./index"; +import PSPDFKitType, { AnnotationsUnion } from "./index"; +import { Instance, WidgetAnnotation, ToolbarItem } from "./index"; + declare const PSPDFKit: typeof PSPDFKitType const { List } = PSPDFKit.Immutable; const { Rect } = PSPDFKit.Geometry; const { SignatureFormField } = PSPDFKit.FormFields; const { DRAW, TYPE } = PSPDFKit.ElectronicSignatureCreationMode; +const { DISABLED } = PSPDFKit.AutoSaveMode; + +interface EnvelopeResponse { + receiverId: number; + envelope: Envelope; +} + +interface Envelope { + id: number; + userId: number; + title: string; + contractType: number; + status: number; + uuid: string; +} +class Settings { + public static allowedToolbarItems: string[] = [ + "sidebar-thumbnails", + "sidebar-document-ouline", + "sidebar-bookmarks", + "pager", + "pan", + "zoom-out", + "zoom-in", + "zoom-mode", + "spacer", + "search" + ] +} export class App { + public static Instance: Instance; + // This function will be called in the ShowEnvelope.razor page // and will trigger loading of the Editor Interface - public static async loadPDFFromUrl (container: string, documentId: number) { + public static async loadPDFFromUrl (container: string, envelopeKey: string) { console.debug("Loading PSPDFKit.."); - const arrayBuffer = await App.loadDocument(`/api/download/${documentId}`) - const instance = await App.loadPSPDFKit(arrayBuffer, container) - App.configurePSPDFKit(instance) + const arrayBuffer = await App.loadDocument(`/api/download/${envelopeKey}`); + const envelopeObject: EnvelopeResponse = await App.loadData(`/api/get-data/${envelopeKey}`); + + App.Instance = await App.loadPSPDFKit(arrayBuffer, container) + App.configurePSPDFKit(this.Instance) - console.debug("PSPDFKit configured!") + console.debug(envelopeObject.envelope.id); + console.debug("PSPDFKit configured!"); const id = PSPDFKit.generateInstantId() const annotation: WidgetAnnotation = App.createSignatureAnnotation(id, 150, 50, 50, 50, 0) @@ -31,7 +65,7 @@ export class App { console.debug("Annotation created.") - const [createdAnnotation] = await instance.create([annotation, formField]) + const [createdAnnotation] = await App.Instance.create([annotation, formField]) console.debug(createdAnnotation) } @@ -39,7 +73,13 @@ export class App { // Makes a call to the supplied url and fetches the binary response as an array buffer private static loadDocument(url: string): Promise { return fetch(url, { credentials: "include" }) - .then(res => res.arrayBuffer()) + .then(res => res.arrayBuffer()); + } + + // Makes a call to the supplied url and fetches the json response as an object + private static loadData(url: string): Promise { + return fetch(url, { credentials: "include" }) + .then(res => res.json()); } // Load the PSPDFKit UI by setting a target element as the container to render in @@ -54,9 +94,10 @@ export class App { return PSPDFKit.load({ container: container, document: arrayBuffer, + autoSaveMode: DISABLED, annotationPresets, electronicSignatures: { - creationModes: [TYPE, DRAW] + creationModes: [DRAW] } }) } @@ -71,8 +112,62 @@ export class App { }) instance.addEventListener("annotations.create", (createdAnnotations) => { + const annotation: AnnotationsUnion = createdAnnotations[0]; console.log("annotations created", createdAnnotations.toJS()); }) + + const filteredItems: Array = instance.toolbarItems + .filter((item) => Settings.allowedToolbarItems.includes(item.type)) + + const customItems: ToolbarItem[] = [ + { + type: "custom", + id: "button-finish", + title: "Abschließen", + icon: ` + + + `, + onPress: this.handleFinish + } + ] + + instance.setToolbarItems(filteredItems.concat(customItems)) + } + + private static async handleFinish(event: any) { + await App.Instance.applyOperations([{ type: "flattenAnnotations" }]) + + //await downloadDocument(); + } + + private static async downloadDocument() { + const buffer = await App.Instance.exportPDF({ flatten: true }); + const supportsDownloadAttribute = HTMLAnchorElement.prototype.hasOwnProperty("download"); + const blob = new Blob([buffer], { type: "application/pdf" }); + + if (!supportsDownloadAttribute) { + const reader = new FileReader(); + reader.onloadend = function () { + const dataUrl = reader.result; + downloadPdf(dataUrl); + }; + reader.readAsDataURL(blob); + } else { + const objectUrl = window.URL.createObjectURL(blob); + downloadPdf(objectUrl); + window.URL.revokeObjectURL(objectUrl); + } + function downloadPdf(blob) { + const a = document.createElement("a"); + a.href = blob; + a.style.display = "none"; + a.download = "download.pdf"; + a.setAttribute("download", "download.pdf"); + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + } } diff --git a/EnvelopeGenerator.Web/Services/DatabaseService.cs b/EnvelopeGenerator.Web/Services/DatabaseService.cs index d0d3a79f..7ca3538d 100644 --- a/EnvelopeGenerator.Web/Services/DatabaseService.cs +++ b/EnvelopeGenerator.Web/Services/DatabaseService.cs @@ -10,6 +10,8 @@ namespace EnvelopeGenerator.Web.Services private EnvelopeModel envelopeModel; private DocumentModel documentModel; + private ReceiverModel receiverModel; + private ElementModel elementModel; private readonly LogConfig _logConfig; private readonly Logger _logger; @@ -50,25 +52,32 @@ namespace EnvelopeGenerator.Web.Services { envelopeModel = new(state); documentModel = new(state); + receiverModel = new(state); + elementModel = new(state); } - public Envelope LoadEnvelope(string envelopeReceiverId) + public EnvelopeResponse LoadEnvelope(string pEnvelopeKey) { - Tuple result = Helpers.DecodeEnvelopeReceiverId(envelopeReceiverId); + Tuple result = Helpers.DecodeEnvelopeReceiverId(pEnvelopeKey); var envelopeUuid = result.Item1; var receiverSignature = result.Item2; + var receiverId = receiverModel.GetReceiverIdBySignature(receiverSignature); Envelope envelope = envelopeModel.GetByUuid(envelopeUuid); - List documents = (List)documentModel.List(envelope.Id); + List documents = (List)documentModel.List(envelope.Id, receiverId); envelope.Documents = documents; - return envelope; + return new() + { + ReceiverId = receiverId, + Envelope = envelope + }; } - public List LoadEnvelopes() + public List LoadEnvelopes(int pReceiverId) { - return (List)envelopeModel.List(); + return (List)envelopeModel.List(pReceiverId); } public EnvelopeDocument LoadDocument(int pDocumentId) diff --git a/EnvelopeGenerator.Web/tsconfig.json b/EnvelopeGenerator.Web/tsconfig.json index a1907560..915d6f50 100644 --- a/EnvelopeGenerator.Web/tsconfig.json +++ b/EnvelopeGenerator.Web/tsconfig.json @@ -9,7 +9,7 @@ "moduleResolution": "Classic", "sourceMap": true, "target": "es5", - "lib": ["ES2015", "DOM"] + "lib": ["ES2016", "DOM"] }, "include": [ "Scripts/**/*.ts" diff --git a/EnvelopeGenerator.Web/wwwroot/js/app.js b/EnvelopeGenerator.Web/wwwroot/js/app.js index 0f1d6eb6..e86d27f4 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/app.js +++ b/EnvelopeGenerator.Web/wwwroot/js/app.js @@ -38,25 +38,48 @@ var List = PSPDFKit.Immutable.List; var Rect = PSPDFKit.Geometry.Rect; var SignatureFormField = PSPDFKit.FormFields.SignatureFormField; var _a = PSPDFKit.ElectronicSignatureCreationMode, DRAW = _a.DRAW, TYPE = _a.TYPE; +var DISABLED = PSPDFKit.AutoSaveMode.DISABLED; +var Settings = /** @class */ (function () { + function Settings() { + } + Settings.allowedToolbarItems = [ + "sidebar-thumbnails", + "sidebar-document-ouline", + "sidebar-bookmarks", + "pager", + "pan", + "zoom-out", + "zoom-in", + "zoom-mode", + "spacer", + "search" + ]; + return Settings; +}()); var App = /** @class */ (function () { function App() { } // This function will be called in the ShowEnvelope.razor page // and will trigger loading of the Editor Interface - App.loadPDFFromUrl = function (container, documentId) { + App.loadPDFFromUrl = function (container, envelopeKey) { return __awaiter(this, void 0, void 0, function () { - var arrayBuffer, instance, id, annotation, formField, createdAnnotation; - return __generator(this, function (_a) { - switch (_a.label) { + var arrayBuffer, envelopeObject, _a, id, annotation, formField, createdAnnotation; + return __generator(this, function (_b) { + switch (_b.label) { case 0: console.debug("Loading PSPDFKit.."); - return [4 /*yield*/, App.loadDocument("/api/download/".concat(documentId))]; + return [4 /*yield*/, App.loadDocument("/api/download/".concat(envelopeKey))]; case 1: - arrayBuffer = _a.sent(); - return [4 /*yield*/, App.loadPSPDFKit(arrayBuffer, container)]; + arrayBuffer = _b.sent(); + return [4 /*yield*/, App.loadData("/api/get-data/".concat(envelopeKey))]; case 2: - instance = _a.sent(); - App.configurePSPDFKit(instance); + envelopeObject = _b.sent(); + _a = App; + return [4 /*yield*/, App.loadPSPDFKit(arrayBuffer, container)]; + case 3: + _a.Instance = _b.sent(); + App.configurePSPDFKit(this.Instance); + console.debug(envelopeObject.envelope.id); console.debug("PSPDFKit configured!"); id = PSPDFKit.generateInstantId(); annotation = App.createSignatureAnnotation(id, 150, 50, 50, 50, 0); @@ -65,9 +88,9 @@ var App = /** @class */ (function () { annotationIds: List([annotation.id]) }); console.debug("Annotation created."); - return [4 /*yield*/, instance.create([annotation, formField])]; - case 3: - createdAnnotation = (_a.sent())[0]; + return [4 /*yield*/, App.Instance.create([annotation, formField])]; + case 4: + createdAnnotation = (_b.sent())[0]; console.debug(createdAnnotation); return [2 /*return*/]; } @@ -79,6 +102,11 @@ var App = /** @class */ (function () { return fetch(url, { credentials: "include" }) .then(function (res) { return res.arrayBuffer(); }); }; + // Makes a call to the supplied url and fetches the json response as an object + App.loadData = function (url) { + return fetch(url, { credentials: "include" }) + .then(function (res) { return res.json(); }); + }; // Load the PSPDFKit UI by setting a target element as the container to render in // and a arraybuffer which represents the document that should be displayed. App.loadPSPDFKit = function (arrayBuffer, container) { @@ -90,9 +118,10 @@ var App = /** @class */ (function () { return PSPDFKit.load({ container: container, document: arrayBuffer, + autoSaveMode: DISABLED, annotationPresets: annotationPresets, electronicSignatures: { - creationModes: [TYPE, DRAW] + creationModes: [DRAW] } }); }; @@ -104,8 +133,73 @@ var App = /** @class */ (function () { console.log("annotations changed"); }); instance.addEventListener("annotations.create", function (createdAnnotations) { + var annotation = createdAnnotations[0]; console.log("annotations created", createdAnnotations.toJS()); }); + var filteredItems = instance.toolbarItems + .filter(function (item) { return Settings.allowedToolbarItems.includes(item.type); }); + var customItems = [ + { + type: "custom", + id: "button-finish", + title: "Abschließen", + icon: "\n \n \n ", + onPress: this.handleFinish + } + ]; + instance.setToolbarItems(filteredItems.concat(customItems)); + }; + App.handleFinish = function (event) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, App.Instance.applyOperations([{ type: "flattenAnnotations" }]) + //await downloadDocument(); + ]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + App.downloadDocument = function () { + return __awaiter(this, void 0, void 0, function () { + function downloadPdf(blob) { + var a = document.createElement("a"); + a.href = blob; + a.style.display = "none"; + a.download = "download.pdf"; + a.setAttribute("download", "download.pdf"); + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + } + var buffer, supportsDownloadAttribute, blob, reader_1, objectUrl; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, App.Instance.exportPDF({ flatten: true })]; + case 1: + buffer = _a.sent(); + supportsDownloadAttribute = HTMLAnchorElement.prototype.hasOwnProperty("download"); + blob = new Blob([buffer], { type: "application/pdf" }); + if (!supportsDownloadAttribute) { + reader_1 = new FileReader(); + reader_1.onloadend = function () { + var dataUrl = reader_1.result; + downloadPdf(dataUrl); + }; + reader_1.readAsDataURL(blob); + } + else { + objectUrl = window.URL.createObjectURL(blob); + downloadPdf(objectUrl); + window.URL.revokeObjectURL(objectUrl); + } + return [2 /*return*/]; + } + }); + }); }; App.createSignatureAnnotation = function (id, x, y, top, left, pageIndex) { var annotation = new PSPDFKit.Annotations.WidgetAnnotation({ diff --git a/EnvelopeGenerator.Web/wwwroot/js/app.js.map b/EnvelopeGenerator.Web/wwwroot/js/app.js.map index 071a42ba..c6da3ddd 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/app.js.map +++ b/EnvelopeGenerator.Web/wwwroot/js/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../../Scripts/app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKQ,IAAA,IAAI,GAAK,QAAQ,CAAC,SAAS,KAAvB,CAAwB;AAC5B,IAAA,IAAI,GAAK,QAAQ,CAAC,QAAQ,KAAtB,CAAuB;AAC3B,IAAA,kBAAkB,GAAK,QAAQ,CAAC,UAAU,mBAAxB,CAAyB;AAC7C,IAAA,KAAiB,QAAQ,CAAC,+BAA+B,EAAvD,IAAI,UAAA,EAAE,IAAI,UAA6C,CAAC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Generator.Web/wwwroot/js/settings.js new file mode 100644 index 00000000..293b694f --- /dev/null +++ b/EnvelopeGenerator.Web/wwwroot/js/settings.js @@ -0,0 +1 @@ +//# sourceMappingURL=settings.js.map \ No newline at end of file diff --git a/EnvelopeGenerator.Web/wwwroot/js/settings.js.map b/EnvelopeGenerator.Web/wwwroot/js/settings.js.map new file mode 100644 index 00000000..5597a3da --- /dev/null +++ b/EnvelopeGenerator.Web/wwwroot/js/settings.js.map @@ -0,0 +1 @@ +{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../Scripts/settings.ts"],"names":[],"mappings":""} \ No newline at end of file