20-09-2023

This commit is contained in:
Jonathan Jenne 2023-09-20 13:42:24 +02:00
parent 12556e41e4
commit 446bcfeb9e
21 changed files with 399 additions and 78 deletions

View File

@ -4,8 +4,6 @@ Imports System.IO
Public Class EnvelopeDocument Public Class EnvelopeDocument
Public Property Id As Integer Public Property Id As Integer
Public Property FileInfo As FileInfo
Public Property FileNameOriginal As String Public Property FileNameOriginal As String
Public Property IsTempFile As Boolean = True Public Property IsTempFile As Boolean = True
@ -16,15 +14,7 @@ Public Class EnvelopeDocument
Public Property Elements As New List(Of EnvelopeDocumentElement) Public Property Elements As New List(Of EnvelopeDocumentElement)
Public ReadOnly Property Filename As String Public Property Filename As String
Get
Return FileInfo.Name
End Get
End Property
Public ReadOnly Property Filepath As String Public Property Filepath As String
Get
Return FileInfo.FullName
End Get
End Property
End Class End Class

View File

@ -0,0 +1,4 @@
Public Class EnvelopeResponse
Public Property Envelope As Envelope
Public Property ReceiverId As Integer
End Class

View File

@ -101,6 +101,7 @@
<Compile Include="Entities\EnvelopeDocumentElement.vb" /> <Compile Include="Entities\EnvelopeDocumentElement.vb" />
<Compile Include="Entities\EnvelopeHistoryEntry.vb" /> <Compile Include="Entities\EnvelopeHistoryEntry.vb" />
<Compile Include="Entities\EnvelopeReceiver.vb" /> <Compile Include="Entities\EnvelopeReceiver.vb" />
<Compile Include="Entities\EnvelopeResponse.vb" />
<Compile Include="Entities\State.vb" /> <Compile Include="Entities\State.vb" />
<Compile Include="Entities\User.vb" /> <Compile Include="Entities\User.vb" />
<Compile Include="Helpers.vb" /> <Compile Include="Helpers.vb" />

View File

@ -1,12 +1,24 @@
Public Class Helpers Public Class Helpers
''' <summary>
''' Encodes the EnvelopeUUID and the ReceiverSignature into an EnvelopeKey
''' </summary>
''' <param name="pEnvelopeUuid"></param>
''' <param name="pReceiverSignature"></param>
''' <returns>The EnvelopeKey</returns>
Public Shared Function EncodeEnvelopeReceiverId(pEnvelopeUuid As String, pReceiverSignature As String) As String Public Shared Function EncodeEnvelopeReceiverId(pEnvelopeUuid As String, pReceiverSignature As String) As String
Dim oString = $"{pEnvelopeUuid}::{pReceiverSignature}" Dim oString = $"{pEnvelopeUuid}::{pReceiverSignature}"
'TODO: Verschlüsseln 'TODO: Verschlüsseln
Return oString Return oString
End Function End Function
''' <summary>
''' Decodes the EnvelopeKey and returns the EnvelopeUUID and the ReceiverSignature
''' </summary>
''' <param name="pEnvelopeReceiverId">The EnvelopeKey</param>
''' <returns>A tuple containing EnvelopeUUID and Receiver Signature</returns>
Public Shared Function DecodeEnvelopeReceiverId(pEnvelopeReceiverId As String) As Tuple(Of String, String) 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 'TODO: Entschlüsseln
Return New Tuple(Of String, String)(oSplit(0), oSplit(1)) Return New Tuple(Of String, String)(oSplit(0), oSplit(1))
End Function End Function

View File

@ -15,14 +15,19 @@ Public Class DocumentModel
End Sub End Sub
Private Function ToDocument(pRow As DataRow) As EnvelopeDocument 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) Dim oDocumentId = pRow.ItemEx("GUID", 0)
Return New EnvelopeDocument() With { Return New EnvelopeDocument() With {
.Id = oDocumentId, .Id = oDocumentId,
.EnvelopeId = pRow.ItemEx("ENVELOPE_ID", 0), .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", ""), .FileNameOriginal = pRow.ItemEx("FILENAME_ORIGINAL", ""),
.IsTempFile = False, .IsTempFile = False,
.Elements = ElementModel.List(oDocumentId) .Elements = ElementModel.List(oDocumentId, pReceiverId)
} }
End Function End Function
@ -32,7 +37,7 @@ Public Class DocumentModel
Dim oTable = Database.GetDatatable(oSql) Dim oTable = Database.GetDatatable(oSql)
Return oTable?.Rows.Cast(Of DataRow). Return oTable?.Rows.Cast(Of DataRow).
Select(AddressOf ToDocument). Select(Function(row) ToDocument(row)).
Single() Single()
Catch ex As Exception Catch ex As Exception
@ -47,7 +52,22 @@ Public Class DocumentModel
Dim oTable = Database.GetDatatable(oSql) Dim oTable = Database.GetDatatable(oSql)
Return oTable?.Rows.Cast(Of DataRow). 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() ToList()
Catch ex As Exception Catch ex As Exception

View File

@ -23,6 +23,12 @@ Public Class ElementModel
} }
End Function 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 Public Function ElementsExist(pEnvelopeId As Integer, pReceiverId As Integer) As Boolean
Try Try
Dim oSql = $"SELECT COUNT(*) FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] T 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 oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC"
Dim oTable = Database.GetDatatable(oSql) Dim oTable = Database.GetDatatable(oSql)
Return oTable?.Rows.Cast(Of DataRow). Return ToElements(oTable)
Select(AddressOf ToElement).
ToList() 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 Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
@ -160,6 +182,7 @@ Public Class ElementModel
Try Try
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}" Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}"
Return Database.ExecuteNonQuery(oSql) Return Database.ExecuteNonQuery(oSql)
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
Return False Return False
@ -170,6 +193,7 @@ Public Class ElementModel
Try Try
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE RECEIVER_ID = {pReceiverId} AND DOCUMENT_ID = {pDocumentId}" Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE RECEIVER_ID = {pReceiverId} AND DOCUMENT_ID = {pDocumentId}"
Return Database.ExecuteNonQuery(oSql, pTransaction) Return Database.ExecuteNonQuery(oSql, pTransaction)
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
Return False Return False
@ -180,6 +204,7 @@ Public Class ElementModel
Try Try
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE DOCUMENT_ID = {pDocumentId}" Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE DOCUMENT_ID = {pDocumentId}"
Return Database.ExecuteNonQuery(oSql, pTransaction) Return Database.ExecuteNonQuery(oSql, pTransaction)
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
Return False Return False

View File

@ -1,4 +1,5 @@
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports System.Web.UI.WebControls
Imports DigitalData.Modules.Base Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
@ -26,14 +27,18 @@ Public Class EnvelopeModel
Return oEnvelope Return oEnvelope
End Function 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 Public Function GetByUuid(pEnvelopeUuid As String) As Envelope
Try Try
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE ENVELOPE_UUID = '{pEnvelopeUuid}'" 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). Return ToEnvelope(oTable)
Select(AddressOf ToEnvelope).
Single()
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
Return Nothing Return Nothing
@ -54,6 +59,23 @@ Public Class EnvelopeModel
End Try End Try
End Function 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 Public Function Send(pEnvelope As Envelope) As Boolean
Try Try
Dim oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET STATUS = @STATUS, SENT_WHEN = GETDATE() WHERE GUID = @GUID" 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) Private Sub SetEnvelopeDate(pEnvelope As Envelope)
Try 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 pEnvelope.AddedWhen = addedWhen
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)

View File

@ -44,7 +44,7 @@ Public Class ReceiverModel
Dim oResult = Database.ExecuteNonQuery(oCommand) Dim oResult = Database.ExecuteNonQuery(oCommand)
If oResult = True Then If oResult = True Then
pReceiver.Id = GetReceiverId(pReceiver.Email, pTransaction) pReceiver.Id = GetReceiverIdByEmail(pReceiver.Email, pTransaction)
Else Else
Return False Return False
End If End If
@ -168,7 +168,16 @@ Public Class ReceiverModel
End Try End Try
End Function 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 Try
Return Database.GetScalarValue($"SELECT GUID FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pEmailAddress}'", pTransaction) Return Database.GetScalarValue($"SELECT GUID FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pEmailAddress}'", pTransaction)
@ -177,4 +186,6 @@ Public Class ReceiverModel
Return Nothing Return Nothing
End Try End Try
End Function End Function
End Class End Class

View File

@ -147,13 +147,15 @@ Public Class EnvelopeEditorController
Dim oTempFilePath = Path.Combine(oTempFiles.TempPath, Guid.NewGuid().ToString + oFileInfo.Extension) Dim oTempFilePath = Path.Combine(oTempFiles.TempPath, Guid.NewGuid().ToString + oFileInfo.Extension)
File.Copy(oFileInfo.FullName, oTempFilePath, True) File.Copy(oFileInfo.FullName, oTempFilePath, True)
Dim oFileInfoTemp = New FileInfo(oTempFilePath)
Dim oDocument = New EnvelopeDocument() With { Dim oDocument = New EnvelopeDocument() With {
.FileInfo = New FileInfo(oTempFilePath), .Filename = oFileInfoTemp.Name,
.Filepath = oFileInfoTemp.FullName,
.FileNameOriginal = oFileInfo.Name, .FileNameOriginal = oFileInfo.Name,
.Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath) .Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath)
} }
Return oDocument Return oDocument
Catch ex As Exception Catch ex As Exception
@ -200,8 +202,11 @@ Public Class EnvelopeEditorController
File.Copy(oDocument.Filepath, oDocumentFilePath) File.Copy(oDocument.Filepath, oDocumentFilePath)
File.Delete(oDocument.Filepath) File.Delete(oDocument.Filepath)
Dim oFileInfo = New FileInfo(oDocumentFilePath)
oDocument.IsTempFile = False oDocument.IsTempFile = False
oDocument.FileInfo = New FileInfo(oDocumentFilePath) oDocument.Filename = oFileInfo.Name
oDocument.Filepath = oFileInfo.FullName
Next Next
Return True Return True

View File

@ -24,6 +24,7 @@
</PackageReference> </PackageReference>
<PackageReference Include="NLog" Version="5.0.5" /> <PackageReference Include="NLog" Version="5.0.5" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" /> <PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,4 +1,5 @@
using EnvelopeGenerator.Web.Services; using EnvelopeGenerator.Common;
using EnvelopeGenerator.Web.Services;
namespace EnvelopeGenerator.Web.Handler namespace EnvelopeGenerator.Web.Handler
{ {
@ -7,12 +8,48 @@ namespace EnvelopeGenerator.Web.Handler
public async static Task<IResult> HandleFile(HttpContext ctx, DatabaseService database, LoggingService logging) public async static Task<IResult> HandleFile(HttpContext ctx, DatabaseService database, LoggingService logging)
{ {
var logger = logging.LogConfig.GetLogger("FileHandler"); var logger = logging.LogConfig.GetLogger("FileHandler");
int docId = int.Parse((string)ctx.Request.RouteValues["docId"]); string envelopeKey = (string)ctx.Request.RouteValues["envelopeKey"];
var document = database.LoadDocument(docId);
logger.Info("Downloading file with EnvelopeKey [{0}]", envelopeKey);
Tuple<string, string> 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); var bytes = await File.ReadAllBytesAsync(document.Filepath);
logger.Info("Serving file, size: [{0}]", bytes.Length);
return Results.File(bytes); return Results.File(bytes);
} }
public static Task<IResult> 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<string, string> 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));
}
} }
} }

View File

@ -8,7 +8,7 @@
<ul> <ul>
@foreach (var envelope in envelopes) @foreach (var envelope in envelopes)
{ {
<li><a href="/EnvelopeKey/@Helpers.EncodeEnvelopeReceiverId(envelope.Uuid, " ABCDE")">Envelope @envelope.Id</a></li> <li><a href="/EnvelopeKey/@Helpers.EncodeEnvelopeReceiverId(envelope.Uuid, "DDA3F6FA6605965DAC6FCF5AC518C78CDA11086584FED872BE146E987976F829")">Envelope @envelope.Id</a></li>
} }
</ul> </ul>
@ -17,7 +17,8 @@
protected override void OnInitialized() protected override void OnInitialized()
{ {
envelopes = Database.LoadEnvelopes(); // Test
envelopes = Database.LoadEnvelopes(11);
} }

View File

@ -10,21 +10,12 @@
@code { @code {
[Parameter] public string EnvelopeReceiverId { get; set; } [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) protected override async void OnAfterRender(bool firstRender)
{ {
if (firstRender) if (firstRender)
{ {
var module = await JS.InvokeAsync<IJSObjectReference>("import", "./js/app.js"); var module = await JS.InvokeAsync<IJSObjectReference>("import", "./js/app.js");
await module.InvokeVoidAsync("App.loadPDFFromUrl", "#container", document.Id); await module.InvokeVoidAsync("App.loadPDFFromUrl", "#container", EnvelopeReceiverId);
} }
} }
} }

View File

@ -35,7 +35,8 @@ app.UseStaticFiles();
app.UseRouting(); app.UseRouting();
// Add file download endpoint // 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 // Blazor plumbing
app.MapBlazorHub(); app.MapBlazorHub();

View File

@ -1,25 +1,59 @@
//import PSPDFKit, { Instance } from 'index.d.ts'; import PSPDFKitType, { AnnotationsUnion } from "./index";
import PSPDFKitType from "./index"; import { Instance, WidgetAnnotation, ToolbarItem } from "./index";
import { Instance, WidgetAnnotation } from "./index";
declare const PSPDFKit: typeof PSPDFKitType declare const PSPDFKit: typeof PSPDFKitType
const { List } = PSPDFKit.Immutable; const { List } = PSPDFKit.Immutable;
const { Rect } = PSPDFKit.Geometry; const { Rect } = PSPDFKit.Geometry;
const { SignatureFormField } = PSPDFKit.FormFields; const { SignatureFormField } = PSPDFKit.FormFields;
const { DRAW, TYPE } = PSPDFKit.ElectronicSignatureCreationMode; 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 { export class App {
public static Instance: Instance;
// This function will be called in the ShowEnvelope.razor page // This function will be called in the ShowEnvelope.razor page
// and will trigger loading of the Editor Interface // 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.."); console.debug("Loading PSPDFKit..");
const arrayBuffer = await App.loadDocument(`/api/download/${documentId}`) const arrayBuffer = await App.loadDocument(`/api/download/${envelopeKey}`);
const instance = await App.loadPSPDFKit(arrayBuffer, container) const envelopeObject: EnvelopeResponse = await App.loadData(`/api/get-data/${envelopeKey}`);
App.configurePSPDFKit(instance)
console.debug("PSPDFKit configured!") App.Instance = await App.loadPSPDFKit(arrayBuffer, container)
App.configurePSPDFKit(this.Instance)
console.debug(envelopeObject.envelope.id);
console.debug("PSPDFKit configured!");
const id = PSPDFKit.generateInstantId() const id = PSPDFKit.generateInstantId()
const annotation: WidgetAnnotation = App.createSignatureAnnotation(id, 150, 50, 50, 50, 0) const annotation: WidgetAnnotation = App.createSignatureAnnotation(id, 150, 50, 50, 50, 0)
@ -31,7 +65,7 @@ export class App {
console.debug("Annotation created.") console.debug("Annotation created.")
const [createdAnnotation] = await instance.create([annotation, formField]) const [createdAnnotation] = await App.Instance.create([annotation, formField])
console.debug(createdAnnotation) 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 // Makes a call to the supplied url and fetches the binary response as an array buffer
private static loadDocument(url: string): Promise<ArrayBuffer> { private static loadDocument(url: string): Promise<ArrayBuffer> {
return fetch(url, { credentials: "include" }) 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<any> {
return fetch(url, { credentials: "include" })
.then(res => res.json());
} }
// Load the PSPDFKit UI by setting a target element as the container to render in // 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({ return PSPDFKit.load({
container: container, container: container,
document: arrayBuffer, document: arrayBuffer,
autoSaveMode: DISABLED,
annotationPresets, annotationPresets,
electronicSignatures: { electronicSignatures: {
creationModes: [TYPE, DRAW] creationModes: [DRAW]
} }
}) })
} }
@ -71,8 +112,62 @@ export class App {
}) })
instance.addEventListener("annotations.create", (createdAnnotations) => { instance.addEventListener("annotations.create", (createdAnnotations) => {
const annotation: AnnotationsUnion = createdAnnotations[0];
console.log("annotations created", createdAnnotations.toJS()); console.log("annotations created", createdAnnotations.toJS());
}) })
const filteredItems: Array<ToolbarItem> = instance.toolbarItems
.filter((item) => Settings.allowedToolbarItems.includes(item.type))
const customItems: ToolbarItem[] = [
{
type: "custom",
id: "button-finish",
title: "Abschließen",
icon: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-check2-circle" viewBox="0 0 16 16">
<path d="M2.5 8a5.5 5.5 0 0 1 8.25-4.764.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0 5.5 5.5 0 1 1-11 0z"/>
<path d="M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l7-7z" />
</svg>`,
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);
}
} }

View File

@ -10,6 +10,8 @@ namespace EnvelopeGenerator.Web.Services
private EnvelopeModel envelopeModel; private EnvelopeModel envelopeModel;
private DocumentModel documentModel; private DocumentModel documentModel;
private ReceiverModel receiverModel;
private ElementModel elementModel;
private readonly LogConfig _logConfig; private readonly LogConfig _logConfig;
private readonly Logger _logger; private readonly Logger _logger;
@ -50,25 +52,32 @@ namespace EnvelopeGenerator.Web.Services
{ {
envelopeModel = new(state); envelopeModel = new(state);
documentModel = new(state); documentModel = new(state);
receiverModel = new(state);
elementModel = new(state);
} }
public Envelope LoadEnvelope(string envelopeReceiverId) public EnvelopeResponse LoadEnvelope(string pEnvelopeKey)
{ {
Tuple<string, string> result = Helpers.DecodeEnvelopeReceiverId(envelopeReceiverId); Tuple<string, string> result = Helpers.DecodeEnvelopeReceiverId(pEnvelopeKey);
var envelopeUuid = result.Item1; var envelopeUuid = result.Item1;
var receiverSignature = result.Item2; var receiverSignature = result.Item2;
var receiverId = receiverModel.GetReceiverIdBySignature(receiverSignature);
Envelope envelope = envelopeModel.GetByUuid(envelopeUuid); Envelope envelope = envelopeModel.GetByUuid(envelopeUuid);
List<EnvelopeDocument> documents = (List<EnvelopeDocument>)documentModel.List(envelope.Id); List<EnvelopeDocument> documents = (List<EnvelopeDocument>)documentModel.List(envelope.Id, receiverId);
envelope.Documents = documents; envelope.Documents = documents;
return envelope; return new()
{
ReceiverId = receiverId,
Envelope = envelope
};
} }
public List<Envelope> LoadEnvelopes() public List<Envelope> LoadEnvelopes(int pReceiverId)
{ {
return (List<Envelope>)envelopeModel.List(); return (List<Envelope>)envelopeModel.List(pReceiverId);
} }
public EnvelopeDocument LoadDocument(int pDocumentId) public EnvelopeDocument LoadDocument(int pDocumentId)

View File

@ -9,7 +9,7 @@
"moduleResolution": "Classic", "moduleResolution": "Classic",
"sourceMap": true, "sourceMap": true,
"target": "es5", "target": "es5",
"lib": ["ES2015", "DOM"] "lib": ["ES2016", "DOM"]
}, },
"include": [ "include": [
"Scripts/**/*.ts" "Scripts/**/*.ts"

View File

@ -38,25 +38,48 @@ var List = PSPDFKit.Immutable.List;
var Rect = PSPDFKit.Geometry.Rect; var Rect = PSPDFKit.Geometry.Rect;
var SignatureFormField = PSPDFKit.FormFields.SignatureFormField; var SignatureFormField = PSPDFKit.FormFields.SignatureFormField;
var _a = PSPDFKit.ElectronicSignatureCreationMode, DRAW = _a.DRAW, TYPE = _a.TYPE; 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 () { var App = /** @class */ (function () {
function App() { function App() {
} }
// This function will be called in the ShowEnvelope.razor page // This function will be called in the ShowEnvelope.razor page
// and will trigger loading of the Editor Interface // 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 () { return __awaiter(this, void 0, void 0, function () {
var arrayBuffer, instance, id, annotation, formField, createdAnnotation; var arrayBuffer, envelopeObject, _a, id, annotation, formField, createdAnnotation;
return __generator(this, function (_a) { return __generator(this, function (_b) {
switch (_a.label) { switch (_b.label) {
case 0: case 0:
console.debug("Loading PSPDFKit.."); console.debug("Loading PSPDFKit..");
return [4 /*yield*/, App.loadDocument("/api/download/".concat(documentId))]; return [4 /*yield*/, App.loadDocument("/api/download/".concat(envelopeKey))];
case 1: case 1:
arrayBuffer = _a.sent(); arrayBuffer = _b.sent();
return [4 /*yield*/, App.loadPSPDFKit(arrayBuffer, container)]; return [4 /*yield*/, App.loadData("/api/get-data/".concat(envelopeKey))];
case 2: case 2:
instance = _a.sent(); envelopeObject = _b.sent();
App.configurePSPDFKit(instance); _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!"); console.debug("PSPDFKit configured!");
id = PSPDFKit.generateInstantId(); id = PSPDFKit.generateInstantId();
annotation = App.createSignatureAnnotation(id, 150, 50, 50, 50, 0); annotation = App.createSignatureAnnotation(id, 150, 50, 50, 50, 0);
@ -65,9 +88,9 @@ var App = /** @class */ (function () {
annotationIds: List([annotation.id]) annotationIds: List([annotation.id])
}); });
console.debug("Annotation created."); console.debug("Annotation created.");
return [4 /*yield*/, instance.create([annotation, formField])]; return [4 /*yield*/, App.Instance.create([annotation, formField])];
case 3: case 4:
createdAnnotation = (_a.sent())[0]; createdAnnotation = (_b.sent())[0];
console.debug(createdAnnotation); console.debug(createdAnnotation);
return [2 /*return*/]; return [2 /*return*/];
} }
@ -79,6 +102,11 @@ var App = /** @class */ (function () {
return fetch(url, { credentials: "include" }) return fetch(url, { credentials: "include" })
.then(function (res) { return res.arrayBuffer(); }); .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 // 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. // and a arraybuffer which represents the document that should be displayed.
App.loadPSPDFKit = function (arrayBuffer, container) { App.loadPSPDFKit = function (arrayBuffer, container) {
@ -90,9 +118,10 @@ var App = /** @class */ (function () {
return PSPDFKit.load({ return PSPDFKit.load({
container: container, container: container,
document: arrayBuffer, document: arrayBuffer,
autoSaveMode: DISABLED,
annotationPresets: annotationPresets, annotationPresets: annotationPresets,
electronicSignatures: { electronicSignatures: {
creationModes: [TYPE, DRAW] creationModes: [DRAW]
} }
}); });
}; };
@ -104,8 +133,73 @@ var App = /** @class */ (function () {
console.log("annotations changed"); console.log("annotations changed");
}); });
instance.addEventListener("annotations.create", function (createdAnnotations) { instance.addEventListener("annotations.create", function (createdAnnotations) {
var annotation = createdAnnotations[0];
console.log("annotations created", createdAnnotations.toJS()); 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: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" fill=\"currentColor\" class=\"bi bi-check2-circle\" viewBox=\"0 0 16 16\">\n <path d=\"M2.5 8a5.5 5.5 0 0 1 8.25-4.764.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0 5.5 5.5 0 1 1-11 0z\"/>\n <path d=\"M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l7-7z\" />\n </svg>",
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) { App.createSignatureAnnotation = function (id, x, y, top, left, pageIndex) {
var annotation = new PSPDFKit.Annotations.WidgetAnnotation({ var annotation = new PSPDFKit.Annotations.WidgetAnnotation({

View File

@ -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;AAGhE;IAAA;IAmFA,CAAC;IAlFG,8DAA8D;IAC9D,mDAAmD;IAC/B,kBAAc,GAAlC,UAAoC,SAAiB,EAAE,UAAkB;;;;;;wBACrE,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;wBAEhB,qBAAM,GAAG,CAAC,YAAY,CAAC,wBAAiB,UAAU,CAAE,CAAC,EAAA;;wBAAnE,WAAW,GAAG,SAAqD;wBACxD,qBAAM,GAAG,CAAC,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA;;wBAAzD,QAAQ,GAAG,SAA8C;wBAC/D,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;wBAE/B,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,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AI,CAAC,CAAC;yBAC9B;6BAAM;4BACG,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;4BACnD,WAAW,CAAC,SAAS,CAAC,CAAC;4BACvB,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;yBACzC;;;;;KAWJ;IAGc,6BAAyB,GAAxC,UAAyC,EAAU,EAAE,CAAS,EAAE,CAAS,EAAE,GAAW,EAAE,IAAY,EAAE,SAAiB;QACnH,IAAM,UAAU,GAAG,IAAI,QAAQ,CAAC,WAAW,CAAC,gBAAgB,CAAC;YACzD,EAAE,EAAE,EAAE;YACN,SAAS,EAAE,SAAS;YACpB,aAAa,EAAE,EAAE;YACjB,WAAW,EAAE,IAAI,IAAI,CAAC;gBAClB,KAAK,EAAE,CAAC;gBACR,MAAM,EAAE,CAAC;gBACT,GAAG,EAAE,GAAG;gBACR,IAAI,EAAE,IAAI;aACb,CAAC;SACL,CAAC,CAAA;QAEF,OAAO,UAAU,CAAA;IACrB,CAAC;IAEL,UAAC;AAAD,CAAC,AArJD,IAqJC"}

View File

@ -0,0 +1 @@
//# sourceMappingURL=settings.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../Scripts/settings.ts"],"names":[],"mappings":""}