diff --git a/src/dbp-official-signature-pdf-upload.js b/src/dbp-official-signature-pdf-upload.js index 1afbe41271d60e71ee0f981acc23b4a5260fa607..5fa4626260cbe750a64a6b61cd96bc3344e25e3e 100644 --- a/src/dbp-official-signature-pdf-upload.js +++ b/src/dbp-official-signature-pdf-upload.js @@ -268,7 +268,12 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem break; case "entryPointUrl": JSONLD.getInstance(this.entryPointUrl).then((jsonld) => { - let apiUrlBase = jsonld.getApiUrlForEntityName("AdvancedlySignedDocument"); + let apiUrlBase; + try { + apiUrlBase = jsonld.getApiUrlForEntityName("EsignAdvancedlySignedDocument"); + } catch (error) { + apiUrlBase = jsonld.getApiUrlForEntityName("AdvancedlySignedDocument"); + } this.fileSourceUrl = apiUrlBase; }); break; diff --git a/src/dbp-qualified-signature-pdf-upload.js b/src/dbp-qualified-signature-pdf-upload.js index c2e199724b7fee38680fbf8f6f39e97361b0ed19..6d769dac3347918c02177be8532cf145e5cfb88d 100644 --- a/src/dbp-qualified-signature-pdf-upload.js +++ b/src/dbp-qualified-signature-pdf-upload.js @@ -285,7 +285,14 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle // fetch pdf from api gateway with sessionId JSONLD.getInstance(this.entryPointUrl).then((jsonld) => { - const apiUrl = jsonld.getApiUrlForEntityName("QualifiedlySignedDocument") + '/' + encodeURIComponent(sessionId) + '?fileName=' + + let apiUrlBase; + try { + apiUrlBase = jsonld.getApiUrlForEntityName("EsignQualifiedlySignedDocument"); + } catch (error) { + apiUrlBase = jsonld.getApiUrlForEntityName("QualifiedlySignedDocument"); + } + + const apiUrl = apiUrlBase + '/' + encodeURIComponent(sessionId) + '?fileName=' + encodeURIComponent(fileName); fetch(apiUrl, { @@ -378,7 +385,12 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle break; case "entryPointUrl": JSONLD.getInstance(this.entryPointUrl).then((jsonld) => { - const apiUrlBase = jsonld.getApiUrlForEntityName("QualifiedSigningRequest"); + let apiUrlBase; + try { + apiUrlBase = jsonld.getApiUrlForEntityName("EsignQualifiedSigningRequest"); + } catch (error) { + apiUrlBase = jsonld.getApiUrlForEntityName("QualifiedSigningRequest"); + } this.fileSourceUrl = apiUrlBase ; }); break; diff --git a/src/dbp-signature-verification-full.js b/src/dbp-signature-verification-full.js index a152effa1ad57a0d16db09fe94d2c07619e20cc5..ccd1808774cd739dd84f6355e0c91ff20db7d00f 100644 --- a/src/dbp-signature-verification-full.js +++ b/src/dbp-signature-verification-full.js @@ -215,7 +215,12 @@ class SignatureVerificationFull extends ScopedElementsMixin(DBPSignatureLitEleme break; case "entryPointUrl": JSONLD.getInstance(this.entryPointUrl).then((jsonld) => { - const apiUrlBase = jsonld.getApiUrlForEntityName("ElectronicSignatureVerificationReport"); + let apiUrlBase; + try { + apiUrlBase = jsonld.getApiUrlForEntityName("EsignElectronicSignatureVerificationReport"); + } catch (error) { + apiUrlBase = jsonld.getApiUrlForEntityName("ElectronicSignatureVerificationReport"); + } this.fileSourceUrl = apiUrlBase; }); break;