diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1baa5d0..93dc08b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,4 +8,4 @@ on: jobs: build: - uses: axonivy-market/github-workflows/.github/workflows/ci.yml@v3 + uses: axonivy-market/github-workflows/.github/workflows/ci.yml@v4 diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index bc582af..18d48e5 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -8,8 +8,4 @@ on: jobs: build: - uses: axonivy-market/github-workflows/.github/workflows/dev.yml@v3 - with: - # temporary: disable script validation ... connector uses a variable not compatible with 11.4! - mvnArgs: '-Divy.script.validation.skip=true' - + uses: axonivy-market/github-workflows/.github/workflows/dev.yml@v4 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 128a183..ab5b0d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,4 +4,4 @@ on: workflow_dispatch jobs: build: - uses: axonivy-market/github-workflows/.github/workflows/release.yml@v2 + uses: axonivy-market/github-workflows/.github/workflows/release.yml@v4 diff --git a/a-trust-connector-demo/.classpath b/a-trust-connector-demo/.classpath index cab71bf..8d1a922 100644 --- a/a-trust-connector-demo/.classpath +++ b/a-trust-connector-demo/.classpath @@ -4,12 +4,7 @@ - - - - - - + diff --git a/a-trust-connector-demo/.project b/a-trust-connector-demo/.project index 883e196..4fb1d82 100644 --- a/a-trust-connector-demo/.project +++ b/a-trust-connector-demo/.project @@ -25,6 +25,11 @@ + + ch.ivyteam.ivy.dialog.form.build.ivyDialogFormBuilder + + + ch.ivyteam.ivy.designer.ide.ivyModelValidationBuilder diff --git a/a-trust-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs b/a-trust-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs index fc36f26..f4fc409 100644 --- a/a-trust-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs +++ b/a-trust-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs @@ -1,5 +1,5 @@ ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.connector.atrust.demo.Data ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.connector.atrust.demo -ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 -ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 -eclipse.preferences.version=1 \ No newline at end of file +ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=13 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=113000 +eclipse.preferences.version=1 diff --git a/a-trust-connector-demo/.settings/org.eclipse.wst.common.component b/a-trust-connector-demo/.settings/org.eclipse.wst.common.component index 0271fd7..0228a23 100644 --- a/a-trust-connector-demo/.settings/org.eclipse.wst.common.component +++ b/a-trust-connector-demo/.settings/org.eclipse.wst.common.component @@ -1,21 +1,10 @@ - - - - - - - - - - - - + \ No newline at end of file diff --git a/a-trust-connector-demo/pom.xml b/a-trust-connector-demo/pom.xml index be08181..32097a8 100644 --- a/a-trust-connector-demo/pom.xml +++ b/a-trust-connector-demo/pom.xml @@ -1,12 +1,13 @@ - + 4.0.0 com.axonivy.connector.atrust a-trust-connector-demo - 10.0.23-SNAPSHOT + 11.3.1-SNAPSHOT iar - 10.0.16 + 11.3.0 diff --git a/a-trust-connector-demo/processes/ATrustIntegration/ATrustDemo.p.json b/a-trust-connector-demo/processes/ATrustIntegration/ATrustDemo.p.json index b29fe9b..a850676 100644 --- a/a-trust-connector-demo/processes/ATrustIntegration/ATrustDemo.p.json +++ b/a-trust-connector-demo/processes/ATrustIntegration/ATrustDemo.p.json @@ -1,5 +1,5 @@ { - "format" : "10.0.0", + "$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json", "id" : "1798254723F146E3", "config" : { "data" : "com.axonivy.connector.atrust.demo.Data" @@ -35,47 +35,55 @@ "type" : "RequestStart", "name" : "StartATrustExample.ivp", "config" : { - "callSignature" : "StartATrustExample", - "case" : { - "name" : "Your process" + "signature" : "StartATrustExample", + "request" : { + "name" : "A-Trust HandySignatur Example" }, - "outLink" : "StartATrustExample.ivp", - "startName" : "A-Trust HandySignatur Example", - "tags" : "demo" + "case" : { + "name" : "Your process", + "customFields" : [ + { "name" : "embedInFrame", "type" : "STRING", "value" : "\"true\"" } + ] + } }, + "tags" : [ + "demo" + ], "visual" : { "at" : { "x" : 96, "y" : 312 }, "labelOffset" : { "x" : 49, "y" : 37 } }, - "connect" : { "id" : "f6", "to" : "f3" } + "connect" : [ + { "id" : "f6", "to" : "f3" } + ] }, { "id" : "f4", "type" : "RequestStart", "name" : "AddTemplateATrust.ivp", "config" : { - "callSignature" : "AddTemplateATrust", - "outLink" : "AddTemplateATrust.ivp", - "case" : { } + "signature" : "AddTemplateATrust" }, "visual" : { "at" : { "x" : 96, "y" : 496 }, "labelOffset" : { "x" : 52, "y" : 37 } }, - "connect" : { "id" : "f26", "to" : "f89" } + "connect" : [ + { "id" : "f26", "to" : "f89" } + ] }, { "id" : "f17", "type" : "RequestStart", "name" : "GetListTemplate.ivp", "config" : { - "callSignature" : "GetListTemplate", - "outLink" : "GetListTemplate.ivp", - "case" : { } + "signature" : "GetListTemplate" }, "visual" : { "at" : { "x" : 104, "y" : 944 }, "labelOffset" : { "x" : 17, "y" : 33 } }, - "connect" : { "id" : "f14", "to" : "f7" } + "connect" : [ + { "id" : "f14", "to" : "f7" } + ] }, { "id" : "f21", "type" : "ProcessAnnotation", @@ -87,7 +95,9 @@ "at" : { "x" : 280, "y" : 424 }, "size" : { "width" : 432, "height" : 44 } }, - "connect" : { "id" : "f13", "to" : "f4" } + "connect" : [ + { "id" : "f13", "to" : "f4" } + ] }, { "id" : "f22", "type" : "ProcessAnnotation", @@ -99,7 +109,9 @@ "at" : { "x" : 280, "y" : 608 }, "size" : { "width" : 432, "height" : 44 } }, - "connect" : { "id" : "f8", "to" : "f34" } + "connect" : [ + { "id" : "f8", "to" : "f34" } + ] }, { "id" : "f18", "type" : "ProcessAnnotation", @@ -131,42 +143,45 @@ "at" : { "x" : 279, "y" : 832 }, "size" : { "width" : 430, "height" : 50 } }, - "connect" : { "id" : "f23", "to" : "f17" } + "connect" : [ + { "id" : "f23", "to" : "f17" } + ] }, { "id" : "f3", "type" : "UserTask", "name" : "Sign a Document", "config" : { - "dialogId" : "com.axonivy.connector.atrust.demo.DocumentSignature", - "startMethod" : "start()", - "case" : { - "name" : "A-Trust Demo" - }, + "dialog" : "com.axonivy.connector.atrust.demo.DocumentSignature:start()", "task" : { "name" : "Start A-Trust Demo", "skipTasklist" : true + }, + "case" : { + "name" : "A-Trust Demo" } }, "visual" : { "at" : { "x" : 272, "y" : 312 }, - "size" : { "width" : 128, "height" : 60 }, + "size" : { "width" : 128 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f5", "to" : "f11" } + "connect" : [ + { "id" : "f5", "to" : "f11" } + ] }, { "id" : "f34", "type" : "RequestStart", "name" : "DeleteSignatureTemplate.ivp", "config" : { - "callSignature" : "DeleteSignatureTemplate", - "outLink" : "DeleteSignatureTemplate.ivp", - "case" : { } + "signature" : "DeleteSignatureTemplate" }, "visual" : { "at" : { "x" : 96, "y" : 704 }, "labelOffset" : { "x" : 25, "y" : 41 } }, - "connect" : { "id" : "f0", "to" : "f2" } + "connect" : [ + { "id" : "f0", "to" : "f2" } + ] }, { "id" : "f35", "type" : "TaskEnd", @@ -182,20 +197,17 @@ ], "config" : { "processCall" : "ATrust/TemplateManagement:DeleteTemplateATrust(Number)", + "call" : { + "map" : { + "param.templateId" : "in.templateId" + } + }, "output" : { "map" : { "out" : "in", "out.templateData.resultCode" : "result.resultCode" }, "code" : "ivy.log.info(\"A-Trust: resultCode {0}\", in.templateData.resultCode);" - }, - "call" : { - "params" : [ - { "name" : "templateId", "type" : "Number" } - ], - "map" : { - "param.templateId" : "in.templateId" - } } }, "visual" : { @@ -203,13 +215,20 @@ "size" : { "width" : 223, "height" : 72 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f36", "to" : "f35" } + "connect" : [ + { "id" : "f36", "to" : "f35" } + ] }, { "id" : "f12", "type" : "SubProcessCall", "name" : "ATrust/TemplateManagement", "config" : { "processCall" : "ATrust/TemplateManagement:AddTemplateATrust(File)", + "call" : { + "map" : { + "param.templateFile" : "in.myIvyFile" + } + }, "output" : { "map" : { "out" : "in", @@ -219,22 +238,16 @@ "ivy.log.info(\"A-Trust call result code {0}\", out.templateData.resultCode);", "ivy.log.info(\"A-Trust call template id {0}\", out.templateData.sigTemplateId);" ] - }, - "call" : { - "params" : [ - { "name" : "templateFile", "type" : "File" } - ], - "map" : { - "param.templateFile" : "in.myIvyFile" - } } }, "visual" : { "at" : { "x" : 568, "y" : 496 }, - "size" : { "width" : 176, "height" : 60 }, + "size" : { "width" : 176 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f9", "to" : "f10" } + "connect" : [ + { "id" : "f9", "to" : "f10" } + ] }, { "id" : "f7", "type" : "SubProcessCall", @@ -259,10 +272,12 @@ }, "visual" : { "at" : { "x" : 272, "y" : 944 }, - "size" : { "width" : 176, "height" : 60 }, + "size" : { "width" : 176 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f19", "to" : "f20" } + "connect" : [ + { "id" : "f19", "to" : "f20" } + ] }, { "id" : "f2", "type" : "SubProcessCall", @@ -288,7 +303,9 @@ "at" : { "x" : 272, "y" : 704 }, "size" : { "width" : 194, "height" : 78 } }, - "connect" : { "id" : "f1", "to" : "f40" } + "connect" : [ + { "id" : "f1", "to" : "f40" } + ] }, { "id" : "f89", "type" : "Script", @@ -314,9 +331,11 @@ }, "visual" : { "at" : { "x" : 272, "y" : 496 }, - "size" : { "width" : 208, "height" : 60 } + "size" : { "width" : 208 } }, - "connect" : { "id" : "f27", "to" : "f12" } + "connect" : [ + { "id" : "f27", "to" : "f12" } + ] } ], "layout" : { "lanes" : [ { diff --git a/a-trust-connector-demo/src_hd/com/axonivy/connector/atrust/demo/DocumentSignature/DocumentSignature.xhtml b/a-trust-connector-demo/src_hd/com/axonivy/connector/atrust/demo/DocumentSignature/DocumentSignature.xhtml index 1248600..947959d 100644 --- a/a-trust-connector-demo/src_hd/com/axonivy/connector/atrust/demo/DocumentSignature/DocumentSignature.xhtml +++ b/a-trust-connector-demo/src_hd/com/axonivy/connector/atrust/demo/DocumentSignature/DocumentSignature.xhtml @@ -7,23 +7,23 @@ #{ivy.cms.co('/Dialogs/com/axonivy/connector/atrust/demo/DocumentSignature/DemoATrust')} - + -

+

-

#{ivy.cms.co('/Labels/UploadYourDoc')}

+

#{ivy.cms.co('/Labels/UploadYourDoc')}

+ emptyMessage="#{ivy.cms.co('/Labels/NoFilesAreFound')}" styleClass="margin-top-10 col-12" lazy="false"> -
-
#{ivy.cms.co('/Labels/DocumentOfCase')}
-
+
+
#{ivy.cms.co('/Labels/DocumentOfCase')}
+
@@ -53,14 +53,14 @@ -

#{ivy.cms.co('/Labels/InputYourInfo')}

-
+

#{ivy.cms.co('/Labels/InputYourInfo')}

+

#{ivy.cms.co('/Dialogs/com/axonivy/connector/atrust/demo/DocumentSignature/RequiredProperties')}

- + @@ -83,11 +83,11 @@
-
+

#{ivy.cms.co('/Dialogs/com/axonivy/connector/atrust/demo/DocumentSignature/AdditionalProperties')}

- +
-
-
+
+

#{ivy.cms.co('/Dialogs/com/axonivy/connector/atrust/demo/DocumentSignature/SignDocument')}

  • #{ivy.cms.co('/Dialogs/com/axonivy/connector/atrust/demo/DocumentSignature/SignatureByATrust')}
  • #{ivy.cms.co('/Dialogs/com/axonivy/connector/atrust/demo/DocumentSignature/SignInFrame')}
- + update="@this" partialSubmit="true" styleClass="ml-3" icon="pi pi-arrow-up-right" /> - @@ -172,7 +172,7 @@ //" } + { "name" : "templates", "type" : "java.util.List", "desc" : "" } ], "map" : { "result.templates" : "in.templates" @@ -532,7 +566,9 @@ "at" : { "x" : 96, "y" : 304 }, "labelOffset" : { "x" : -5, "y" : -21 } }, - "connect" : { "id" : "f8", "to" : "f2" } + "connect" : [ + { "id" : "f8", "to" : "f2" } + ] }, { "id" : "f2", "type" : "HtmlDialogEnd", @@ -544,11 +580,20 @@ "type" : "HtmlDialogMethodStart", "name" : "getTemplateDisplayName(TemplateMeta)", "config" : { - "callSignature" : "getTemplateDisplayName", + "signature" : "getTemplateDisplayName", + "input" : { + "params" : [ + { "name" : "template", "type" : "at.a.trust.rest.api.client.TemplateMeta", "desc" : "" } + ], + "map" : { + "out.selectedTemplate" : "param.template" + } + }, "result" : { "params" : [ - { "name" : "displayName", "type" : "String" } + { "name" : "displayName", "type" : "String", "desc" : "" } ], + "map" : { }, "code" : [ "import com.axonivy.connector.atrust.constant.Constants;", "if (in.#selectedTemplate is initialized && in.#selectedTemplate.#id is initialized) {", @@ -558,21 +603,15 @@ "}" ] }, - "input" : { - "params" : [ - { "name" : "template", "type" : "at.a.trust.rest.api.client.TemplateMeta" } - ], - "map" : { - "out.selectedTemplate" : "param.template" - } - }, "guid" : "1917445EF39C34C7" }, "visual" : { "at" : { "x" : 96, "y" : 400 }, "labelOffset" : { "x" : 43, "y" : -21 } }, - "connect" : { "id" : "f59", "to" : "f46" } + "connect" : [ + { "id" : "f59", "to" : "f46" } + ] }, { "id" : "f46", "type" : "HtmlDialogEnd", @@ -584,7 +623,7 @@ "type" : "HtmlDialogMethodStart", "name" : "signInFrame()", "config" : { - "callSignature" : "signInFrame", + "signature" : "signInFrame", "input" : { "map" : { "out.signatureJob.isEmbeddedInframe" : "true" @@ -596,13 +635,14 @@ "at" : { "x" : 112, "y" : 912 }, "labelOffset" : { "x" : 7, "y" : 35 } }, - "connect" : { "id" : "f68", "to" : "f65", "via" : [ { "x" : 208, "y" : 912 } ] } + "connect" : [ + { "id" : "f68", "to" : "f65", "via" : [ { "x" : 208, "y" : 912 } ] } + ] }, { "id" : "f62", "type" : "Script", "name" : "Init", "config" : { - "security" : "system", "output" : { "code" : [ "import com.axonivy.connector.atrust.util.IvyUtils;", @@ -622,12 +662,15 @@ "String inputtedDataId = ivy.task.customFields().stringField(ATrustCustomField.SIGNATURE_JOB_ID.getKey()).getOrDefault(\"\");", "in.signatureJob = IvyUtils.queryRepoById(inputtedDataId, SignatureJob.class) as SignatureJob;" ] - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 216, "y" : 112 } }, - "connect" : { "id" : "f21", "to" : "f14" } + "connect" : [ + { "id" : "f21", "to" : "f14" } + ] }, { "id" : "f65", "type" : "Alternative", @@ -642,13 +685,15 @@ "type" : "HtmlDialogMethodStart", "name" : "close()", "config" : { - "callSignature" : "close", + "signature" : "close", "guid" : "1917977930E4BBB1" }, "visual" : { "at" : { "x" : 96, "y" : 496 } }, - "connect" : { "id" : "f69", "to" : "f61" } + "connect" : [ + { "id" : "f69", "to" : "f61" } + ] }, { "id" : "f61", "type" : "HtmlDialogExit", diff --git a/a-trust-connector-demo/webContent/layouts/frame-10.xhtml b/a-trust-connector-demo/webContent/layouts/frame-10.xhtml index caee274..74501bd 100644 --- a/a-trust-connector-demo/webContent/layouts/frame-10.xhtml +++ b/a-trust-connector-demo/webContent/layouts/frame-10.xhtml @@ -13,11 +13,11 @@ This is the default template to use the freya-ivy theme as well as iFrames appro PORTAL: If you are using the Axon Ivy Portal, you can pass several parameters to it to use some features (e.g. process chain). -You'll find the list of parameters here: https://developer.axonivy.com/portal/10.0/doc/portal-developer-guide/components/layout-templates.html#components-layout-templates-iframe-task-template -For further information about iframes and usage in Portal please refer to: https://developer.axonivy.com/portal/10.0/doc/portal-developer-guide/iframe/index.html +You'll find the list of parameters here: https://developer.axonivy.com/portal/11.3/doc/portal-developer-guide/components/layout-templates.html#components-layout-templates-iframe-task-template +For further information about iframes and usage in Portal please refer to: https://developer.axonivy.com/portal/11.3/doc/portal-developer-guide/iframe/index.html BRANDING: -If you want to brand your dialogs, please take a look at our documentation: https://developer.axonivy.com/doc/10.0/designer-guide/user-interface/branding/index.html +If you want to brand your dialogs, please take a look at our documentation: https://developer.axonivy.com/doc/11.3/designer-guide/user-interface/branding/index.html STYLING: If you want to add custom styles, you can simply add your own .css file (e.g. at the location: "webContent/layouts/styles/style.css") @@ -32,14 +32,14 @@ and refence it below in the head part. - + - +
default content @@ -47,7 +47,7 @@ and refence it below in the head part.
- +
- \ No newline at end of file + diff --git a/a-trust-connector-demo/webContent/layouts/images/axon_ivy_logo.svg b/a-trust-connector-demo/webContent/layouts/images/axon_ivy_logo.svg deleted file mode 100644 index d9c2989..0000000 --- a/a-trust-connector-demo/webContent/layouts/images/axon_ivy_logo.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - Axon Ivy Logo - Created with Sketch. - - \ No newline at end of file diff --git a/a-trust-connector-demo/webContent/layouts/images/ivy_favicon_48.png b/a-trust-connector-demo/webContent/layouts/images/ivy_favicon_48.png deleted file mode 100644 index f633f4b..0000000 Binary files a/a-trust-connector-demo/webContent/layouts/images/ivy_favicon_48.png and /dev/null differ diff --git a/a-trust-connector-demo/webContent/layouts/includes/exception-details.xhtml b/a-trust-connector-demo/webContent/layouts/includes/exception-details.xhtml deleted file mode 100644 index b438c6b..0000000 --- a/a-trust-connector-demo/webContent/layouts/includes/exception-details.xhtml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - -

- -

- - -

Error id

-

#{errorPage.exceptionId}

-
- - - - -

Attributes

-
- - - - - - - - - - - - - - - -
NameValue
-
-
-

Thrown by

-

Process: - -
Element: - -

-
- - -

Process call stack

- -
#{caller.callerElement}
-
-
- -

Technical cause

-
#{causedBy.class.simpleName}: #{causedBy.message.trim()}
-
-
- -

Request Uri

-

#{errorPage.getRequestUri()}

-
-

Servlet

-

#{errorPage.getServletName()}

-
- -

Application

-

#{errorPage.applicationName}

-
- - -

Thread local values

-
- - - - - - - - - - - - - - - -
KeyValue
-
-
-
- -

Stack-Trace

-
#{errorPage.getStackTrace()}
-
- diff --git a/a-trust-connector-demo/webContent/layouts/includes/exception.xhtml b/a-trust-connector-demo/webContent/layouts/includes/exception.xhtml deleted file mode 100644 index 2303e7c..0000000 --- a/a-trust-connector-demo/webContent/layouts/includes/exception.xhtml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - -
-
- - -
- - - - - - - - - -
- - \ No newline at end of file diff --git a/a-trust-connector-demo/webContent/layouts/includes/progress-loader.xhtml b/a-trust-connector-demo/webContent/layouts/includes/progress-loader.xhtml deleted file mode 100644 index dea8cdd..0000000 --- a/a-trust-connector-demo/webContent/layouts/includes/progress-loader.xhtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - -
-
-
Loading...
-
-
- - - -
-
\ No newline at end of file diff --git a/a-trust-connector-demo/webContent/layouts/styles/ivy-common-8.css b/a-trust-connector-demo/webContent/layouts/styles/ivy-common-8.css deleted file mode 100644 index ff26e46..0000000 --- a/a-trust-connector-demo/webContent/layouts/styles/ivy-common-8.css +++ /dev/null @@ -1,73 +0,0 @@ -/* Basic */ -body { - background-color: #fff; -} -@media (min-width: 768px) { - .container { - width: 750px; - } -} -@media (min-width: 992px) { - .container { - width: 970px; - } -} -@media (min-width: 1200px) { - .container { - width: 1170px; - } -} -.container { - padding: 1em; - margin: 0 auto; -} -.ui-layout-container, -.ui-layout-unit, -.ui-layout-unit-content { - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box; -} -.ui-g div[class^="ui-g-"], -.ui-g div[class^="ui-md-"], -.ui-g div[class^="ui-lg-"] { - padding: 0.25em; -} -.container td, -.ui-layout-unit-content td { - padding: 0.5em; -} - -/* Header */ -.ivy-logo img { - height: 46px; - margin: 16px 25px 16px 0; -} -.ui-layout-container .ivy-logo img { - margin: 4px 25px 4px 0; -} - -/* Form */ -.container .ui-g .ui-inputfield, -.container table .ui-inputfield, -.ui-layout-unit-content .ui-inputfield { - width: 100%; -} -.command-btns { - float: right; - margin-bottom: 20px; -} -.command-btn > a { - margin-right: 10px; - line-height: 30px; - color: var(--accent-color, gray); -} - -/* Footer */ -hr { - clear: both; - margin-top: 20px; - margin-bottom: 20px; - border: 0; - border-top: 1px solid #eee; -} \ No newline at end of file diff --git a/a-trust-connector-demo/webContent/layouts/styles/progress-loader.css b/a-trust-connector-demo/webContent/layouts/styles/progress-loader.css deleted file mode 100644 index 8fc371e..0000000 --- a/a-trust-connector-demo/webContent/layouts/styles/progress-loader.css +++ /dev/null @@ -1,82 +0,0 @@ -:root { - --ajax-loading-bg: hsla(0, 0%, 100%, 0.9); -} - -.axonivy-loader { - display: block; - z-index: 10000; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: var(--ajax-loading-bg); - width: 100px; - height: 100px; - border-radius: 10px; - padding: 20px; -} - -.axonivy-loader h5 { - margin-top: 5px; - text-align: center; -} - -.axonivy-loader .spinner { - margin: 0 auto; - height: 50px; - width: 50px; - border: 2px solid transparent; - border-top-color: var(--primary-color); - border-radius: 50%; - -webkit-animation: spinloader 2s linear infinite; - animation: spinloader 2s linear infinite; -} - -.axonivy-loader .spinner:before { - content: ""; - position: absolute; - top: 7px; - right: 7px; - bottom: 7px; - left: 7px; - border: 2px solid transparent; - border-radius: 50%; - border-top-color: var(--primary-color); - -webkit-animation: spinloader 3s linear infinite; - animation: spinloader 3s linear infinite; -} - -.axonivy-loader .spinner:after { - content: ""; - position: absolute; - top: 15px; - right: 15px; - bottom: 15px; - left: 15px; - border: 2px solid transparent; - border-radius: 50%; - border-top-color: var(--primary-color); - -webkit-animation: spinloader 1.5s linear infinite; - animation: spinloader 1.5s linear infinite; -} - -@-webkit-keyframes spinloader { - from { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - to { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } -} -@keyframes spinloader { - from { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - to { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } -} \ No newline at end of file diff --git a/a-trust-connector-product/pom.xml b/a-trust-connector-product/pom.xml index 404d8cf..0836cb2 100644 --- a/a-trust-connector-product/pom.xml +++ b/a-trust-connector-product/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.axonivy.connector.atrust a-trust-connector-product - 10.0.2-SNAPSHOT + 11.3.1-SNAPSHOT pom diff --git a/a-trust-connector-test/.classpath b/a-trust-connector-test/.classpath index 81c1c3f..9b8b785 100644 --- a/a-trust-connector-test/.classpath +++ b/a-trust-connector-test/.classpath @@ -1,15 +1,10 @@ - + + - - - - - - @@ -36,5 +31,5 @@ - - \ No newline at end of file + + diff --git a/a-trust-connector-test/.project b/a-trust-connector-test/.project index c5ffa66..a385b44 100644 --- a/a-trust-connector-test/.project +++ b/a-trust-connector-test/.project @@ -25,6 +25,11 @@ + + ch.ivyteam.ivy.dialog.form.build.ivyDialogFormBuilder + + + ch.ivyteam.ivy.designer.ide.ivyModelValidationBuilder diff --git a/a-trust-connector-test/.settings/ch.ivyteam.ivy.designer.prefs b/a-trust-connector-test/.settings/ch.ivyteam.ivy.designer.prefs index 80b2236..9bdcfde 100644 --- a/a-trust-connector-test/.settings/ch.ivyteam.ivy.designer.prefs +++ b/a-trust-connector-test/.settings/ch.ivyteam.ivy.designer.prefs @@ -1,5 +1,5 @@ ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.connector.atrust.test.Data ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.connector.atrust.test -ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 -ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 -eclipse.preferences.version=1 \ No newline at end of file +ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=13 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=113000 +eclipse.preferences.version=1 diff --git a/a-trust-connector-test/.settings/org.eclipse.wst.common.component b/a-trust-connector-test/.settings/org.eclipse.wst.common.component index f081a3e..6029b30 100644 --- a/a-trust-connector-test/.settings/org.eclipse.wst.common.component +++ b/a-trust-connector-test/.settings/org.eclipse.wst.common.component @@ -1,21 +1,10 @@ - - - - - - - - - - - - + \ No newline at end of file diff --git a/a-trust-connector-test/pom.xml b/a-trust-connector-test/pom.xml index 895fea3..05e01cd 100644 --- a/a-trust-connector-test/pom.xml +++ b/a-trust-connector-test/pom.xml @@ -1,13 +1,14 @@ - + 4.0.0 com.axonivy.connector.atrust a-trust-connector-test - 10.0.23-SNAPSHOT + 11.3.1-SNAPSHOT iar - 10.0.16 - 10.0.16 + 11.3.0 + 11.3.0 diff --git a/a-trust-connector-test/processes/Start Processes/TestATrust.p.json b/a-trust-connector-test/processes/Start Processes/TestATrust.p.json index 0089866..c7e7ef6 100644 --- a/a-trust-connector-test/processes/Start Processes/TestATrust.p.json +++ b/a-trust-connector-test/processes/Start Processes/TestATrust.p.json @@ -1,5 +1,5 @@ { - "format" : "10.0.0", + "$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json", "id" : "17969069DFA18010", "config" : { "data" : "com.axonivy.connector.atrust.test.Data" @@ -9,24 +9,26 @@ "type" : "RequestStart", "name" : "startSignature.ivp", "config" : { - "callSignature" : "startSignature", + "signature" : "startSignature", "input" : { "params" : [ - { "name" : "templateId", "type" : "Long" } + { "name" : "templateId", "type" : "Long", "desc" : "" } ], "map" : { "out.signatureJob.signTemplateId" : "param.templateId" } }, - "outLink" : "startSignature.ivp", - "showInStartList" : false, - "case" : { } + "request" : { + "isVisibleOnStartList" : false + } }, "visual" : { "at" : { "x" : 96, "y" : 128 }, "labelOffset" : { "x" : 36, "y" : 37 } }, - "connect" : { "id" : "f3", "to" : "f10" } + "connect" : [ + { "id" : "f3", "to" : "f10" } + ] }, { "id" : "f13", "type" : "SubProcessCall", @@ -37,24 +39,21 @@ ], "config" : { "processCall" : "ATrust/StartSignature:createSignBatch(com.axonivy.connector.atrust.bo.SignatureJob)", - "output" : { + "call" : { "map" : { - "out" : "in", - "out.signatureDocumentData" : "result.signatureDocumentData" + "param.signatureJob" : "in.signatureJob" } }, - "call" : { - "params" : [ - { "name" : "signatureJob", "type" : "com.axonivy.connector.atrust.bo.SignatureJob" } - ], + "output" : { "map" : { - "param.signatureJob" : "in.signatureJob" + "out" : "in", + "out.signatureDocumentData" : "result.signatureDocumentData" } } }, "visual" : { "at" : { "x" : 528, "y" : 128 }, - "size" : { "width" : 192, "height" : 60 }, + "size" : { "width" : 192 }, "icon" : "res:/webContent/icons/atrust-icon.png" } }, { @@ -65,7 +64,6 @@ "Input: SignatureJob" ], "config" : { - "security" : "system", "output" : { "code" : [ "import com.axonivy.connector.atrust.IvyScriptCmsHelper;", @@ -86,12 +84,15 @@ "in.signatureJob.signStampCoordinatesY1 = 14.4;", "in.signatureJob.signStampPageNumber = 1;" ] - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 272, "y" : 128 }, - "size" : { "width" : 176, "height" : 60 } + "size" : { "width" : 176 } }, - "connect" : { "id" : "f6", "to" : "f13" } + "connect" : [ + { "id" : "f6", "to" : "f13" } + ] } ] } \ No newline at end of file diff --git a/a-trust-connector-test/src/com/axonivy/connector/atrust/test/ATrustSignMock.java b/a-trust-connector-test/src/com/axonivy/connector/atrust/test/ATrustSignMock.java index a2af42c..47b75d9 100644 --- a/a-trust-connector-test/src/com/axonivy/connector/atrust/test/ATrustSignMock.java +++ b/a-trust-connector-test/src/com/axonivy/connector/atrust/test/ATrustSignMock.java @@ -53,7 +53,7 @@ public String getTemplates() { public Response addTemplate(@FormDataParam("file") InputStream uploadStream, @FormDataParam("file") FormDataContentDisposition fileMetaData) throws MalformedURLException, URISyntaxException { - var location = new URL(Ivy.html().applicationHomeRef() + MOCK_TEMPLATE_LOCATION).toURI(); + var location = new URL(getRequestUrl() + MOCK_TEMPLATE_LOCATION).toURI(); return Response.created(location).build(); } @@ -67,10 +67,14 @@ public Response deleteTemplate(@PathParam(value = "templateId") String templateI @POST @Path(SIGNATURE_BATCHES_PATH) public Response createBatch() throws MalformedURLException, URISyntaxException { - var location = new URL(Ivy.html().applicationHomeRef() + MOCK_BATCH_LOCATION).toURI(); + var location = buildMockBatchLocation(); return Response.created(location).build(); } + private java.net.URI buildMockBatchLocation() throws URISyntaxException, MalformedURLException { + return new URL(getRequestUrl() + MOCK_BATCH_LOCATION).toURI(); + } + @POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Path(SIGNATURE_BATCHES_PATH + "/{ticketId}/documents") @@ -80,16 +84,15 @@ public Response addDocToBatch(@PathParam("ticketId") String ticketId, @QueryParam("location") String reason, @QueryParam("template") String template, @QueryParam("page") String page, @QueryParam("x") String x, @QueryParam("y") String y, @QueryParam("w") String w, @QueryParam("h") String h) throws MalformedURLException, URISyntaxException { - var locationURL = new URL(Ivy.html().applicationHomeRef() + MOCK_BATCH_LOCATION).toURI(); + var locationURL = buildMockBatchLocation(); return Response.created(locationURL).build(); } @POST - @Consumes(MediaType.MULTIPART_FORM_DATA) @Path(SIGNATURE_BATCHES_PATH + "/{ticketId}/mobileSignature") public Response createMobileSignature(@PathParam("ticketId") String ticketId) throws MalformedURLException, URISyntaxException { - var locationURL = new URL(Ivy.html().applicationHomeRef() + MOCK_BATCH_LOCATION).toURI(); + var locationURL = buildMockBatchLocation(); return Response.created(locationURL).build(); } @@ -100,4 +103,8 @@ private static String load(String path) { throw new RuntimeException("Failed to read resource: " + path); } } + + private static String getRequestUrl() { + return Ivy.html().applicationHomeLink().getAbsolute(); + } } diff --git a/a-trust-connector-test/src_test/com/axonivy/connector/atrust/test/ATrustProcessTest.java b/a-trust-connector-test/src_test/com/axonivy/connector/atrust/test/ATrustProcessTest.java index c4a2613..a187fa6 100644 --- a/a-trust-connector-test/src_test/com/axonivy/connector/atrust/test/ATrustProcessTest.java +++ b/a-trust-connector-test/src_test/com/axonivy/connector/atrust/test/ATrustProcessTest.java @@ -35,7 +35,6 @@ import ch.ivyteam.ivy.environment.Ivy; import ch.ivyteam.ivy.rest.client.RestClient; import ch.ivyteam.ivy.rest.client.RestClients; -import ch.ivyteam.ivy.rest.client.mapper.JsonFeature; import ch.ivyteam.ivy.scripting.objects.CompositeObject; import ch.ivyteam.ivy.scripting.objects.File; import ch.ivyteam.ivy.workflow.ITask; @@ -67,7 +66,7 @@ static void beforeAll(AppFixture fixture, IApplication app) { RestClients clients = RestClients.of(app); RestClient atrustRestClient = clients.find(ATRUST_REST_CLIENT); var mockClient = atrustRestClient.toBuilder() - .features(List.of(JsonFeature.class.getName(), HeaderFeature.class.getName(), + .features(List.of(HeaderFeature.class.getName(), MultiPartFeature.class.getName(), OpenApiJsonFeature.class.getName())) .property("AUTH.apiKey", "apiKey").property("PATH.serverUrl", "serverUrl") .property("PATH.signBox", "signBox").toRestClient(); diff --git a/a-trust-connector/.classpath b/a-trust-connector/.classpath index 82845e1..b77cb48 100644 --- a/a-trust-connector/.classpath +++ b/a-trust-connector/.classpath @@ -5,12 +5,7 @@ - - - - - - + diff --git a/a-trust-connector/.project b/a-trust-connector/.project index eaa6e33..bf2b0ed 100644 --- a/a-trust-connector/.project +++ b/a-trust-connector/.project @@ -25,6 +25,11 @@ + + ch.ivyteam.ivy.dialog.form.build.ivyDialogFormBuilder + + + ch.ivyteam.ivy.designer.ide.ivyModelValidationBuilder diff --git a/a-trust-connector/.settings/ch.ivyteam.ivy.designer.prefs b/a-trust-connector/.settings/ch.ivyteam.ivy.designer.prefs index c13cd58..d16f9eb 100644 --- a/a-trust-connector/.settings/ch.ivyteam.ivy.designer.prefs +++ b/a-trust-connector/.settings/ch.ivyteam.ivy.designer.prefs @@ -1,5 +1,5 @@ ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.connector.atrust.Data ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.connector.atrust -ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 -ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 -eclipse.preferences.version=1 \ No newline at end of file +ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=13 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=113000 +eclipse.preferences.version=1 diff --git a/a-trust-connector/.settings/org.eclipse.wst.common.component b/a-trust-connector/.settings/org.eclipse.wst.common.component index ff05921..3a978ff 100644 --- a/a-trust-connector/.settings/org.eclipse.wst.common.component +++ b/a-trust-connector/.settings/org.eclipse.wst.common.component @@ -1,21 +1,10 @@ - - - - - - - - - - - - + \ No newline at end of file diff --git a/a-trust-connector/config/rest-clients.yaml b/a-trust-connector/config/rest-clients.yaml index d944b77..66c21fa 100644 --- a/a-trust-connector/config/rest-clients.yaml +++ b/a-trust-connector/config/rest-clients.yaml @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=https://json-schema.axonivy.com/app/11.3.1/rest-clients.json RestClients: #Format of REST URL is: https://{serverUrl}/{signBox}/v2 #E.g: https://testbox.a-trust.at/testboxrest/v2 @@ -6,7 +7,6 @@ RestClients: Url: https://{serverUrl}/{signBox}/v2 Icon: res:/webContent/icons/atrust-icon.png Features: - - ch.ivyteam.ivy.rest.client.mapper.JsonFeature - com.axonivy.connector.atrust.config.HeaderFeature - org.glassfish.jersey.media.multipart.MultiPartFeature - com.axonivy.connector.atrust.config.OpenApiJsonFeature diff --git a/a-trust-connector/dataclasses/com/axonivy/connector/atrust/EndSignatureData.ivyClass b/a-trust-connector/dataclasses/com/axonivy/connector/atrust/EndSignatureData.ivyClass index 4b862f0..cfece47 100644 --- a/a-trust-connector/dataclasses/com/axonivy/connector/atrust/EndSignatureData.ivyClass +++ b/a-trust-connector/dataclasses/com/axonivy/connector/atrust/EndSignatureData.ivyClass @@ -6,6 +6,6 @@ callbackSafetyHash String #field callbackSafetyHash 'Hash code generated for more safety in internal callback link.' #fieldComment referenceTaskId Long #field referenceTaskId 'Reuqest task id. Will be used to add signed document.' #fieldComment -aTrustTicketID String #field -aTrustTicketID 'Ticket ID from A-Trust signature inbox.' #fieldComment +atrustTicketId String #field +atrustTicketId 'Ticket ID from A-Trust signature inbox.' #fieldComment signatureDocumentData com.axonivy.connector.atrust.bo.SignatureDocumentData #field diff --git a/a-trust-connector/lib/generated/rest/jaxRsClient_69b7fe41-3196-40bf-9458-b723c0bcc2b2.jar b/a-trust-connector/lib/generated/rest/jaxRsClient_69b7fe41-3196-40bf-9458-b723c0bcc2b2.jar index 5fbc9f3..d5e413d 100644 Binary files a/a-trust-connector/lib/generated/rest/jaxRsClient_69b7fe41-3196-40bf-9458-b723c0bcc2b2.jar and b/a-trust-connector/lib/generated/rest/jaxRsClient_69b7fe41-3196-40bf-9458-b723c0bcc2b2.jar differ diff --git a/a-trust-connector/pom.xml b/a-trust-connector/pom.xml index 79ab916..0fd9f51 100644 --- a/a-trust-connector/pom.xml +++ b/a-trust-connector/pom.xml @@ -1,12 +1,13 @@ - + 4.0.0 com.axonivy.connector.atrust a-trust-connector - 10.0.23-SNAPSHOT + 11.3.1-SNAPSHOT iar - 10.0.16 + 11.3.0 diff --git a/a-trust-connector/processes/ATrust/EndSignature.p.json b/a-trust-connector/processes/ATrust/EndSignature.p.json index 7c18c61..65453fe 100644 --- a/a-trust-connector/processes/ATrust/EndSignature.p.json +++ b/a-trust-connector/processes/ATrust/EndSignature.p.json @@ -1,5 +1,5 @@ { - "format" : "10.0.0", + "$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json", "id" : "1797F203890511D1", "config" : { "data" : "com.axonivy.connector.atrust.EndSignatureData" @@ -19,44 +19,47 @@ "import com.axonivy.connector.atrust.util.IvyUtils;", "import com.axonivy.connector.atrust.validator.ATrustSignValidator;", "", - "ATrustSignValidator.validateSignHashAndTicket(in.callbackSafetyHash, in.aTrustTicketID, in.referenceTaskId);", + "ATrustSignValidator.validateSignHashAndTicket(in.callbackSafetyHash, in.atrustTicketId, in.referenceTaskId);", "String signatureDocumentDataId = IvyUtils.findTask(in.referenceTaskId).customFields().stringField(ATrustCustomField.SIGNATURE_DOCUMENT_DATA_ID.getKey()).getOrNull();", "in.signatureDocumentData = IvyUtils.queryRepoById(signatureDocumentDataId, SignatureDocumentData.class) as SignatureDocumentData;" ] - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 368, "y" : 224 }, - "size" : { "width" : 176, "height" : 60 } + "size" : { "width" : 176 } }, - "connect" : { "id" : "f16", "to" : "f2" } + "connect" : [ + { "id" : "f16", "to" : "f2" } + ] }, { "id" : "f79", "type" : "Script", "name" : "Do Post-Signing step", "config" : { - "security" : "system", "output" : { "code" : [ "import com.axonivy.connector.atrust.service.ATrustService;", "ATrustService.doPostSigning(in.referenceTaskId, in.resultCode, in.signatureDocumentData);" ] - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 776, "y" : 224 }, - "size" : { "width" : 176, "height" : 60 } + "size" : { "width" : 176 } } }, { "id" : "f5", "type" : "RequestStart", "name" : "start", "config" : { - "callSignature" : "start", + "signature" : "start", "input" : { "params" : [ { "name" : "callbackSafetyHash", "type" : "String", "desc" : "The SafetyHash was sumited by AxonIvy" }, - { "name" : "requestTaskId", "type" : "Long" }, + { "name" : "requestTaskId", "type" : "Long", "desc" : "" }, { "name" : "ticket", "type" : "String", "desc" : "Signed ticket of A-Trust" } ], "map" : { @@ -65,50 +68,51 @@ "out.referenceTaskId" : "param.requestTaskId" } }, - "showInStartList" : false, - "outLink" : "start.ivp", - "case" : { } + "request" : { + "isVisibleOnStartList" : false + } }, "visual" : { "at" : { "x" : 96, "y" : 224 }, "labelOffset" : { "x" : 9, "y" : 33 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" }, - "connect" : { "id" : "f7", "to" : "f3" } + "connect" : [ + { "id" : "f7", "to" : "f3" } + ] }, { "id" : "f2", "type" : "SubProcessCall", "name" : "ATrust downloadSignDoc", "config" : { "processCall" : "ATrust/StartSignature:downloadSignedDoc(com.axonivy.connector.atrust.bo.SignatureDocumentData)", + "call" : { + "map" : { + "param.signatureDocument" : "in.signatureDocumentData" + } + }, "output" : { "map" : { "out" : "in", "out.resultCode" : "result.resultCode", "out.signatureDocumentData" : "result.signatureDocumentData" } - }, - "call" : { - "params" : [ - { "name" : "signatureDocument", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData" } - ], - "map" : { - "param.signatureDocument" : "in.signatureDocumentData" - } } }, "visual" : { "at" : { "x" : 568, "y" : 224 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f0", "to" : "f79" } + "connect" : [ + { "id" : "f0", "to" : "f79" } + ] }, { "id" : "f1", "type" : "RequestStart", "name" : "start(callbackSafetyHash)", "config" : { - "callSignature" : "start", + "signature" : "start", "input" : { "params" : [ { "name" : "callbackSafetyHash", "type" : "String", "desc" : "The SafetyHash was sumited by AxonIvy" } @@ -117,17 +121,19 @@ "out.callbackSafetyHash" : "param.callbackSafetyHash" } }, - "showInStartList" : false, - "outLink" : "start.ivp", - "case" : { } + "request" : { + "isVisibleOnStartList" : false + } }, "visual" : { "at" : { "x" : 192, "y" : 120 }, "labelOffset" : { "x" : 17, "y" : 33 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" }, - "connect" : { "id" : "f4", "to" : "f3" } + "connect" : [ + { "id" : "f4", "to" : "f3" } + ] }, { "id" : "f3", "type" : "Alternative", @@ -145,7 +151,9 @@ "at" : { "x" : 152, "y" : 64 }, "size" : { "width" : 164, "height" : 44 } }, - "connect" : { "id" : "f9", "to" : "f1" } + "connect" : [ + { "id" : "f9", "to" : "f1" } + ] } ], "layout" : { "lanes" : [ { diff --git a/a-trust-connector/processes/ATrust/StartSignature.p.json b/a-trust-connector/processes/ATrust/StartSignature.p.json index d4f4da1..f30243c 100644 --- a/a-trust-connector/processes/ATrust/StartSignature.p.json +++ b/a-trust-connector/processes/ATrust/StartSignature.p.json @@ -1,5 +1,5 @@ { - "format" : "10.0.0", + "$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json", "id" : "1797F1F35CA9D09F", "kind" : "CALLABLE_SUB", "config" : { @@ -10,7 +10,6 @@ "type" : "Script", "name" : "Update output", "config" : { - "security" : "system", "output" : { "code" : [ "import com.axonivy.connector.atrust.util.IvyUtils;", @@ -36,31 +35,34 @@ " in.forwardTargetUrl = in.forwardTargetUrl + ATrustService.generateIFrameParameters();", "}" ] - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 944, "y" : 192 }, - "size" : { "width" : 128, "height" : 60 }, + "size" : { "width" : 128 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f11", "to" : "f9" } + "connect" : [ + { "id" : "f11", "to" : "f9" } + ] }, { "id" : "f3", "type" : "CallSubEnd", "visual" : { "at" : { "x" : 1200, "y" : 192 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" } }, { "id" : "f5", "type" : "CallSubStart", "name" : "call(SignatureJob)", "config" : { - "callSignature" : "call", + "signature" : "call", "input" : { "params" : [ - { "name" : "signatureJob", "type" : "com.axonivy.connector.atrust.bo.SignatureJob" } + { "name" : "signatureJob", "type" : "com.axonivy.connector.atrust.bo.SignatureJob", "desc" : "" } ], "map" : { "out.integrateNotInFrame" : "true", @@ -69,8 +71,8 @@ }, "result" : { "params" : [ - { "name" : "handySignatureURL", "type" : "String" }, - { "name" : "signatureDocumentData", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData" } + { "name" : "handySignatureURL", "type" : "String", "desc" : "" }, + { "name" : "signatureDocumentData", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData", "desc" : "" } ], "map" : { "result.handySignatureURL" : "in.forwardTargetUrl", @@ -81,22 +83,29 @@ "visual" : { "at" : { "x" : 208, "y" : 104 }, "labelOffset" : { "x" : 33, "y" : -15 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" }, - "connect" : { "id" : "f26", "to" : "f25" } + "connect" : [ + { "id" : "f26", "to" : "f25" } + ] }, { "id" : "f21", "type" : "Alternative", "name" : "has ticket?", + "config" : { + "conditions" : { + "f0" : "org.apache.commons.lang3.StringUtils.isNoneBlank(in.signatureTicket)" + } + }, "visual" : { "at" : { "x" : 448, "y" : 192 }, - "labelOffset" : { "x" : 16, "y" : -24 } + "labelOffset" : { "y" : -24 } }, "connect" : [ { "id" : "f0", "to" : "S20", "label" : { "name" : "yes" - }, "condition" : "org.apache.commons.lang3.StringUtils.isNoneBlank(in.signatureTicket)" }, + } }, { "id" : "f15", "to" : "f7", "label" : { "name" : "no", "segment" : 0.13 @@ -107,10 +116,10 @@ "type" : "CallSubStart", "name" : "downloadSignedDoc(SignatureDocumentData)", "config" : { - "callSignature" : "downloadSignedDoc", + "signature" : "downloadSignedDoc", "input" : { "params" : [ - { "name" : "signatureDocument", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData" } + { "name" : "signatureDocument", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData", "desc" : "" } ], "map" : { "out.signatureDocumentData" : "param.signatureDocument" @@ -118,8 +127,8 @@ }, "result" : { "params" : [ - { "name" : "resultCode", "type" : "Integer" }, - { "name" : "signatureDocumentData", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData" } + { "name" : "resultCode", "type" : "Integer", "desc" : "" }, + { "name" : "signatureDocumentData", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData", "desc" : "" } ], "map" : { "result.resultCode" : "in.resultCode", @@ -132,7 +141,9 @@ "labelOffset" : { "x" : 97, "y" : 41 }, "icon" : "res:/webContent/icons/atrust-icon.png?small" }, - "connect" : { "id" : "f45", "to" : "f43" } + "connect" : [ + { "id" : "f45", "to" : "f43" } + ] }, { "id" : "f18", "type" : "CallSubEnd", @@ -145,29 +156,36 @@ "type" : "RestClientCall", "name" : "Get signed document", "config" : { - "path" : "/signaturebatches/{ticketId}/documents/{documentId}", - "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", - "clientErrorCode" : ">> Ignore error", "method" : "DELETE", - "statusErrorCode" : ">> Ignore status", - "responseMapping" : { - "out.resultCode" : "response.getStatus()" - }, - "templateParams" : { - "documentId" : "in.signatureDocumentData.documentId", - "ticketId" : "in.signatureDocumentData.signatureTicket" + "target" : { + "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", + "path" : "/signaturebatches/{ticketId}/documents/{documentId}", + "templateParams" : { + "documentId" : "in.signatureDocumentData.documentId", + "ticketId" : "in.signatureDocumentData.signatureTicket" + } }, - "bodyInputType" : "ENTITY", - "responseCode" : [ - "import com.axonivy.connector.atrust.util.ATrustResponseUtils;", - "out.signatureDocumentData.pdfFile = ATrustResponseUtils.download(response, in.signatureDocumentData.documentName).getJavaFile();" - ] + "response" : { + "entity" : { + "map" : { + "out.resultCode" : "response.getStatus()" + }, + "code" : [ + "import com.axonivy.connector.atrust.util.ATrustResponseUtils;", + "out.signatureDocumentData.pdfFile = ATrustResponseUtils.download(response, in.signatureDocumentData.documentName).getJavaFile();" + ] + }, + "clientError" : ">> Ignore error", + "statusError" : ">> Ignore status" + } }, "visual" : { "at" : { "x" : 312, "y" : 432 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f27", "to" : "f18" } + "connect" : [ + { "id" : "f27", "to" : "f18" } + ] }, { "id" : "f25", "type" : "Alternative", @@ -185,16 +203,18 @@ "at" : { "x" : 112, "y" : 72 }, "size" : { "width" : 118, "height" : 38 } }, - "connect" : { "id" : "f38", "to" : "f5" } + "connect" : [ + { "id" : "f38", "to" : "f5" } + ] }, { "id" : "f40", "type" : "CallSubStart", "name" : "createSignBatch(SignatureJob)", "config" : { - "callSignature" : "createSignBatch", + "signature" : "createSignBatch", "input" : { "params" : [ - { "name" : "signatureJob", "type" : "com.axonivy.connector.atrust.bo.SignatureJob" } + { "name" : "signatureJob", "type" : "com.axonivy.connector.atrust.bo.SignatureJob", "desc" : "" } ], "map" : { "out.integrateNotInFrame" : "false", @@ -203,8 +223,8 @@ }, "result" : { "params" : [ - { "name" : "handySignatureURL", "type" : "String" }, - { "name" : "signatureDocumentData", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData" } + { "name" : "handySignatureURL", "type" : "String", "desc" : "" }, + { "name" : "signatureDocumentData", "type" : "com.axonivy.connector.atrust.bo.SignatureDocumentData", "desc" : "" } ], "map" : { "result.handySignatureURL" : "in.forwardTargetUrl", @@ -215,10 +235,12 @@ "visual" : { "at" : { "x" : 128, "y" : 192 }, "labelOffset" : { "x" : 17, "y" : 33 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" }, - "connect" : { "id" : "f46", "to" : "f25" } + "connect" : [ + { "id" : "f46", "to" : "f25" } + ] }, { "id" : "S10", "type" : "ServiceBpmnElement", @@ -231,22 +253,32 @@ "SignBatch" ], "config" : { - "bodyForm" : { - "RedirectUrl" : "in.internalCallbackUrl", - "ErrorUrl" : "in.errorCallbackUrl" - }, - "path" : "/signaturebatches", - "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", - "clientErrorCode" : "com:axonivy:connector:atrust:startsignature:exception", "method" : "POST", - "statusErrorCode" : "com:axonivy:connector:atrust:startsignature:exception", - "bodyObjectType" : "at.a.trust.rest.api.client.SignatureBatch", - "bodyInputType" : "FORM", - "bodyMediaType" : "multipart/form-data", - "responseCode" : [ - "import com.axonivy.connector.atrust.util.ATrustResponseUtils;", - "out.signatureTicket = ATrustResponseUtils.extractSignBatchTicketFromResponse(response);" - ] + "target" : { + "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", + "path" : "/signaturebatches" + }, + "body" : { + "type" : "FORM", + "mediaType" : "multipart/form-data", + "form" : { + "RedirectUrl" : [ "in.internalCallbackUrl" ], + "ErrorUrl" : [ "in.errorCallbackUrl" ] + }, + "entity" : { + "type" : "at.a.trust.rest.api.client.SignatureBatch" + } + }, + "response" : { + "entity" : { + "code" : [ + "import com.axonivy.connector.atrust.util.ATrustResponseUtils;", + "out.signatureTicket = ATrustResponseUtils.extractSignBatchTicketFromResponse(response);" + ] + }, + "clientError" : "com:axonivy:connector:atrust:startsignature:exception", + "statusError" : "com:axonivy:connector:atrust:startsignature:exception" + } }, "visual" : { "at" : { "x" : 512, "y" : 160 }, @@ -267,9 +299,13 @@ "visual" : { "at" : { "x" : 552, "y" : 194 } }, - "connect" : { "id" : "S10-f4", "to" : "S10-f1" } + "connect" : [ + { "id" : "S10-f4", "to" : "S10-f1" } + ] } ], - "connect" : { "id" : "S10-f3", "to" : "S10-g1" } + "connect" : [ + { "id" : "S10-f3", "to" : "S10-g1" } + ] }, { "id" : "S10-g0", "type" : "EmbeddedStart", @@ -278,7 +314,9 @@ "at" : { "x" : 64, "y" : 160 } }, "parentConnector" : "f47", - "connect" : { "id" : "S10-f9", "to" : "S10-f5" } + "connect" : [ + { "id" : "S10-f9", "to" : "S10-f5" } + ] }, { "id" : "S10-g1", "type" : "EmbeddedEnd", @@ -292,21 +330,22 @@ "type" : "Script", "name" : "Validate inputs", "config" : { - "security" : "system", "output" : { "code" : "com.axonivy.connector.atrust.validator.ATrustSignValidator.validateSignatureJobData(in.signatureJob);" - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 168, "y" : 160 } }, - "connect" : { "id" : "S10-f2", "to" : "S10-f7" } + "connect" : [ + { "id" : "S10-f2", "to" : "S10-f7" } + ] }, { "id" : "S10-f7", "type" : "Script", "name" : "Prepare CallbackUrl", "config" : { - "security" : "system", "output" : { "code" : [ "import java.util.UUID;", @@ -321,12 +360,15 @@ " in.errorCallbackUrl = in.internalCallbackUrl;", "}" ] - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 344, "y" : 160 } }, - "connect" : { "id" : "S10-f10", "to" : "S10-f0" } + "connect" : [ + { "id" : "S10-f10", "to" : "S10-f0" } + ] }, { "id" : "S10-f1", "type" : "CallSubEnd", @@ -339,7 +381,9 @@ "at" : { "x" : 328, "y" : 192 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f48", "to" : "f21" } + "connect" : [ + { "id" : "f48", "to" : "f21" } + ] }, { "id" : "S20", "type" : "ServiceBpmnElement", @@ -352,37 +396,47 @@ "SignBatch" ], "config" : { - "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", "method" : "POST", - "statusErrorCode" : "ivy:error:rest:client", - "bodyObjectType" : "at.a.trust.rest.api.client.SignDocument", - "bodyInputType" : "FORM", - "responseCode" : "out.signatureDocumentData.documentId = com.axonivy.connector.atrust.util.ATrustResponseUtils.extractDocumentIdFromResponse(response);", - "bodyForm" : { - "document" : "in.signDocument.document", - "location" : "in.signDocument.location", - "reason" : "in.signDocument.reason", - "template" : "in.signDocument.template", - "page" : "in.signDocument.page", "x" : "in.signDocument.x", "y" : "in.signDocument.y", - "w" : "in.signDocument.w", - "h" : "in.signDocument.h" - }, - "path" : "/signaturebatches/{ticketId}/documents", - "clientErrorCode" : "ivy:error:rest:client", - "responseMapping" : { - "out.resultCode" : "response.getStatus()" + "target" : { + "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", + "path" : "/signaturebatches/{ticketId}/documents", + "templateParams" : { + "ticketId" : "in.signatureTicket" + } }, - "templateParams" : { - "ticketId" : "in.signatureTicket" + "body" : { + "type" : "FORM", + "mediaType" : "multipart/form-data", + "form" : { + "document" : [ "in.signDocument.document" ], + "location" : [ "in.signDocument.location" ], + "reason" : [ "in.signDocument.reason" ], + "template" : [ "in.signDocument.template" ], + "page" : [ "in.signDocument.page" ], "x" : [ "in.signDocument.x" ], "y" : [ "in.signDocument.y" ], + "w" : [ "in.signDocument.w" ], + "h" : [ "in.signDocument.h" ] + }, + "entity" : { + "type" : "at.a.trust.rest.api.client.SignDocument" + } }, - "resultType" : "at.a.trust.rest.api.client.InlineResponse2001", - "bodyMediaType" : "multipart/form-data" + "response" : { + "entity" : { + "type" : "at.a.trust.rest.api.client.InlineResponse2001", + "map" : { + "out.resultCode" : "response.getStatus()" + }, + "code" : "out.signatureDocumentData.documentId = com.axonivy.connector.atrust.util.ATrustResponseUtils.extractDocumentIdFromResponse(response);" + } + } }, "visual" : { "at" : { "x" : 360, "y" : 160 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "S20-f3", "to" : "S20-f7" } + "connect" : [ + { "id" : "S20-f3", "to" : "S20-f7" } + ] }, { "id" : "S20-g0", "type" : "EmbeddedStart", @@ -391,7 +445,9 @@ "at" : { "x" : 64, "y" : 160 } }, "parentConnector" : "f0", - "connect" : { "id" : "S20-f0", "to" : "S20-f2" } + "connect" : [ + { "id" : "S20-f0", "to" : "S20-f2" } + ] }, { "id" : "S20-g1", "type" : "EmbeddedEnd", @@ -405,27 +461,34 @@ "type" : "Script", "name" : "Prepare parameters", "config" : { - "security" : "system", "output" : { "code" : "in.signDocument = com.axonivy.connector.atrust.service.ATrustService.buildSignDocumentData(in.signatureJob);" - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 184, "y" : 160 } }, - "connect" : { "id" : "S20-f5", "to" : "S20-f9" } + "connect" : [ + { "id" : "S20-f5", "to" : "S20-f9" } + ] }, { "id" : "S20-f7", "type" : "Alternative", "name" : "is success?", + "config" : { + "conditions" : { + "S20-f4" : "in.resultCode == org.apache.http.HttpStatus.SC_CREATED" + } + }, "visual" : { "at" : { "x" : 512, "y" : 160 }, - "labelOffset" : { "x" : 16, "y" : -16 } + "labelOffset" : { "y" : -16 } }, "connect" : [ { "id" : "S20-f4", "to" : "S20-g1", "label" : { "name" : "no error" - }, "condition" : "in.resultCode == org.apache.http.HttpStatus.SC_CREATED" }, + } }, { "id" : "S20-f1", "to" : "S20-f8" } ] }, { @@ -448,23 +511,27 @@ }, "visual" : { "at" : { "x" : 512, "y" : 256 }, - "size" : { "width" : 160, "height" : 60 } + "size" : { "width" : 160 } }, - "connect" : { "id" : "S20-f12", "to" : "S20-f11" } + "connect" : [ + { "id" : "S20-f12", "to" : "S20-f11" } + ] }, { "id" : "S20-f11", "type" : "CallSubEnd", "visual" : { "at" : { "x" : 512, "y" : 352 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" } } ], "visual" : { "at" : { "x" : 584, "y" : 192 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f2", "to" : "S30" } + "connect" : [ + { "id" : "f2", "to" : "S30" } + ] }, { "id" : "S30", "type" : "ServiceBpmnElement", @@ -473,15 +540,20 @@ "id" : "S30-f31", "type" : "Alternative", "name" : "is MobileSignature session?", + "config" : { + "conditions" : { + "S30-f39" : "in.signatureJob.isSealSignature" + } + }, "visual" : { "at" : { "x" : 152, "y" : 160 }, - "labelOffset" : { "x" : 16, "y" : -24 } + "labelOffset" : { "y" : -24 } }, "connect" : [ { "id" : "S30-f39", "to" : "S30-f33", "via" : [ { "x" : 152, "y" : 264 } ], "label" : { "name" : "no", "segment" : 1.12 - }, "condition" : "in.signatureJob.isSealSignature" }, + } }, { "id" : "S30-f34", "to" : "S30-f24", "label" : { "name" : "yes" } } @@ -491,31 +563,38 @@ "type" : "RestClientCall", "name" : "Create sealsignature session", "config" : { - "bodyForm" : { - "location" : "", - "reason" : "" - }, - "path" : "/signaturebatches/{ticketId}/sealsignature", - "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", - "clientErrorCode" : "ivy:error:rest:client", "method" : "POST", - "statusErrorCode" : "ivy:error:rest:client", - "templateParams" : { - "ticketId" : "in.signatureTicket" + "target" : { + "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", + "path" : "/signaturebatches/{ticketId}/sealsignature", + "templateParams" : { + "ticketId" : "in.signatureTicket" + } + }, + "body" : { + "form" : { + "location" : [ "" ], + "reason" : [ "" ] + } }, - "resultType" : "at.a.trust.rest.api.client.SealSignatureResponse", - "bodyInputType" : "ENTITY" + "response" : { + "entity" : { + "type" : "at.a.trust.rest.api.client.SealSignatureResponse" + } + } }, "visual" : { "at" : { "x" : 296, "y" : 264 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "S30-f37", "to" : "S30-f35", "via" : [ { "x" : 416, "y" : 264 } ] } + "connect" : [ + { "id" : "S30-f37", "to" : "S30-f35", "via" : [ { "x" : 432, "y" : 264 } ] } + ] }, { "id" : "S30-f35", "type" : "Alternative", "visual" : { - "at" : { "x" : 416, "y" : 160 } + "at" : { "x" : 432, "y" : 160 } }, "connect" : [ { "id" : "S30-f1", "to" : "S30-g1" } @@ -525,44 +604,33 @@ "type" : "RestClientCall", "name" : "Create mobileSignature session", "config" : { - "bodyObjectMapping" : { - "param" : "\"\"" - }, - "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", "method" : "POST", - "statusErrorCode" : "ivy:error:rest:client", - "bodyObjectType" : "at.a.trust.rest.api.client.MobileSignatureRequest", - "bodyInputType" : "FORM", - "responseCode" : [ - "import com.axonivy.connector.atrust.util.ATrustResponseUtils;", - "out.forwardTargetUrl = ATrustResponseUtils.extractHandySignatureUrlFromResponse(response);" - ], - "bodyForm" : { - "location" : "", - "reason" : "", - "document" : "", - "template" : "", - "appletwidth" : "450", - "appletheight" : "450", "width" : "", "height" : "", - "backgroundcolor" : "\"red\"", - "redirecttarget" : "\"_parent\"", - "telephonenumber" : "1030155411901422" - }, - "path" : "/signaturebatches/{ticketId}/mobileSignature", - "clientErrorCode" : "ivy:error:rest:client", - "responseMapping" : { - "out.resultCode" : "response.getStatus()" - }, - "templateParams" : { - "ticketId" : "in.signatureTicket" + "target" : { + "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", + "path" : "/signaturebatches/{ticketId}/mobileSignature", + "templateParams" : { + "ticketId" : "in.signatureTicket" + } }, - "bodyMediaType" : "multipart/form-data" + "response" : { + "entity" : { + "map" : { + "out.resultCode" : "response.getStatus()" + }, + "code" : [ + "import com.axonivy.connector.atrust.util.ATrustResponseUtils;", + "out.forwardTargetUrl = ATrustResponseUtils.extractHandySignatureUrlFromResponse(response);" + ] + } + } }, "visual" : { "at" : { "x" : 296, "y" : 160 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "S30-f36", "to" : "S30-f35" } + "connect" : [ + { "id" : "S30-f36", "to" : "S30-f35" } + ] }, { "id" : "S30-g0", "type" : "EmbeddedStart", @@ -571,13 +639,15 @@ "at" : { "x" : 64, "y" : 160 } }, "parentConnector" : "f2", - "connect" : { "id" : "S30-f0", "to" : "S30-f31" } + "connect" : [ + { "id" : "S30-f0", "to" : "S30-f31" } + ] }, { "id" : "S30-g1", "type" : "EmbeddedEnd", "name" : "out 1", "visual" : { - "at" : { "x" : 520, "y" : 160 } + "at" : { "x" : 544, "y" : 160 } }, "parentConnector" : "f4" } ], @@ -585,7 +655,9 @@ "at" : { "x" : 760, "y" : 192 }, "icon" : "res:/webContent/icons/atrust-icon.png" }, - "connect" : { "id" : "f4", "to" : "f12" } + "connect" : [ + { "id" : "f4", "to" : "f12" } + ] }, { "id" : "f8", "type" : "Script", @@ -594,7 +666,6 @@ "forwardTargetUrl" ], "config" : { - "security" : "system", "output" : { "code" : [ "// Compatibility for old approach", @@ -602,17 +673,23 @@ " com.axonivy.connector.atrust.util.IvyUtils.redirectTo(in.forwardTargetUrl);", "}" ] - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 1088, "y" : 288 }, - "size" : { "width" : 128, "height" : 60 }, + "size" : { "width" : 128 }, "icon" : "res:/webContent/icons/atrust-icon.png" } }, { "id" : "f9", "type" : "Alternative", "name" : "is use frame template?", + "config" : { + "conditions" : { + "f14" : "in.integrateNotInFrame" + } + }, "visual" : { "at" : { "x" : 1088, "y" : 192 }, "labelOffset" : { "x" : 24, "y" : -24 } @@ -620,7 +697,7 @@ "connect" : [ { "id" : "f14", "to" : "f8", "label" : { "name" : "no" - }, "condition" : "in.integrateNotInFrame" }, + } }, { "id" : "f13", "to" : "f3", "label" : { "name" : "yes" } } @@ -630,8 +707,8 @@ "type" : "CallSubEnd", "visual" : { "at" : { "x" : 448, "y" : 296 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" } } ], "layout" : { diff --git a/a-trust-connector/processes/ATrust/TemplateManagement.p.json b/a-trust-connector/processes/ATrust/TemplateManagement.p.json index 4297ed3..9fbf894 100644 --- a/a-trust-connector/processes/ATrust/TemplateManagement.p.json +++ b/a-trust-connector/processes/ATrust/TemplateManagement.p.json @@ -1,5 +1,5 @@ { - "format" : "10.0.0", + "$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json", "id" : "1797F20B0709EDE7", "kind" : "CALLABLE_SUB", "config" : { @@ -10,10 +10,10 @@ "type" : "CallSubStart", "name" : "AddTemplateATrust(File)", "config" : { - "callSignature" : "AddTemplateATrust", + "signature" : "AddTemplateATrust", "input" : { "params" : [ - { "name" : "templateFile", "type" : "File" } + { "name" : "templateFile", "type" : "File", "desc" : "" } ], "map" : { "out.ivyFile" : "param.templateFile" @@ -21,7 +21,7 @@ }, "result" : { "params" : [ - { "name" : "templateData", "type" : "com.axonivy.connector.atrust.bo.TemplateData" } + { "name" : "templateData", "type" : "com.axonivy.connector.atrust.bo.TemplateData", "desc" : "" } ], "map" : { "result.templateData" : "in.result" @@ -31,27 +31,29 @@ "visual" : { "at" : { "x" : 96, "y" : 128 }, "labelOffset" : { "x" : 64, "y" : 37 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" }, - "connect" : { "id" : "f32", "to" : "f27" } + "connect" : [ + { "id" : "f32", "to" : "f27" } + ] }, { "id" : "f4", "type" : "CallSubEnd", "visual" : { "at" : { "x" : 544, "y" : 304 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" } }, { "id" : "f13", "type" : "CallSubStart", "name" : "DeleteTemplateATrust(Number)", "config" : { - "callSignature" : "DeleteTemplateATrust", + "signature" : "DeleteTemplateATrust", "input" : { "params" : [ - { "name" : "templateId", "type" : "Number" } + { "name" : "templateId", "type" : "Number", "desc" : "" } ], "map" : { "out.templateId" : "param.templateId" @@ -59,7 +61,7 @@ }, "result" : { "params" : [ - { "name" : "resultCode", "type" : "Integer" } + { "name" : "resultCode", "type" : "Integer", "desc" : "" } ], "map" : { "result.resultCode" : "in.result.resultCode" @@ -69,20 +71,22 @@ "visual" : { "at" : { "x" : 96, "y" : 304 }, "labelOffset" : { "x" : 85, "y" : 37 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" }, - "connect" : { "id" : "f25", "to" : "f9" } + "connect" : [ + { "id" : "f25", "to" : "f9" } + ] }, { "id" : "f8", "type" : "CallSubStart", "name" : "GetListTemplate()", "config" : { - "callSignature" : "GetListTemplate", + "signature" : "GetListTemplate", "result" : { "params" : [ - { "name" : "templateData", "type" : "com.axonivy.connector.atrust.bo.TemplateData" }, - { "name" : "templates", "type" : "at.a.trust.rest.api.client.SignatureTemplates" } + { "name" : "templateData", "type" : "com.axonivy.connector.atrust.bo.TemplateData", "desc" : "" }, + { "name" : "templates", "type" : "at.a.trust.rest.api.client.SignatureTemplates", "desc" : "" } ], "map" : { "result.templateData" : "in.result", @@ -93,35 +97,43 @@ "visual" : { "at" : { "x" : 96, "y" : 496 }, "labelOffset" : { "x" : 45, "y" : 37 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" }, - "connect" : { "id" : "f24", "to" : "f22" } + "connect" : [ + { "id" : "f24", "to" : "f22" } + ] }, { "id" : "f20", "type" : "CallSubEnd", "visual" : { "at" : { "x" : 544, "y" : 496 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" } }, { "id" : "f22", "type" : "RestClientCall", "name" : "Get all Templates", "config" : { - "path" : "/templates", - "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", - "clientErrorCode" : "com:axonivy:connector:atrust:template:getall:exception", - "statusErrorCode" : "com:axonivy:connector:atrust:template:getall:exception", - "responseMapping" : { - "out.signatureTemplates" : "result" + "target" : { + "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", + "path" : "/templates" }, - "resultType" : "at.a.trust.rest.api.client.SignatureTemplates", - "responseCode" : [ - "// For backward compatible", - "in.result = com.axonivy.connector.atrust.convertor.SignConvertor.convertToTemplateData(result, response.getStatus());" - ] + "response" : { + "entity" : { + "type" : "at.a.trust.rest.api.client.SignatureTemplates", + "map" : { + "out.signatureTemplates" : "result" + }, + "code" : [ + "// For backward compatible", + "in.result = com.axonivy.connector.atrust.convertor.SignConvertor.convertToTemplateData(result, response.getStatus());" + ] + }, + "clientError" : "com:axonivy:connector:atrust:template:getall:exception", + "statusError" : "com:axonivy:connector:atrust:template:getall:exception" + } }, "visual" : { "at" : { "x" : 312, "y" : 496 } @@ -137,24 +149,34 @@ "at" : { "x" : 344, "y" : 538 }, "labelOffset" : { "x" : 73, "y" : 33 } }, - "connect" : { "id" : "f17", "to" : "f20", "via" : [ { "x" : 544, "y" : 538 } ] } + "connect" : [ + { "id" : "f17", "to" : "f20", "via" : [ { "x" : 544, "y" : 538 } ] } + ] } ], - "connect" : { "id" : "f21", "to" : "f20" } + "connect" : [ + { "id" : "f21", "to" : "f20" } + ] }, { "id" : "f9", "type" : "RestClientCall", "name" : "Delte a template by ID", "config" : { - "path" : "/templates/{templateId}", - "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", - "clientErrorCode" : "com:axonivy:connector:atrust:template:delete:exception", "method" : "DELETE", - "statusErrorCode" : "com:axonivy:connector:atrust:template:delete:exception", - "responseMapping" : { - "out.result.resultCode" : "response.getStatus()" + "target" : { + "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", + "path" : "/templates/{templateId}", + "templateParams" : { + "templateId" : "in.templateId" + } }, - "templateParams" : { - "templateId" : "in.templateId" + "response" : { + "entity" : { + "map" : { + "out.result.resultCode" : "response.getStatus()" + } + }, + "clientError" : "com:axonivy:connector:atrust:template:delete:exception", + "statusError" : "com:axonivy:connector:atrust:template:delete:exception" } }, "visual" : { @@ -171,43 +193,57 @@ "at" : { "x" : 352, "y" : 338 }, "labelOffset" : { "x" : 25, "y" : 33 } }, - "connect" : { "id" : "f16", "to" : "f4", "via" : [ { "x" : 544, "y" : 338 } ] } + "connect" : [ + { "id" : "f16", "to" : "f4", "via" : [ { "x" : 544, "y" : 338 } ] } + ] } ], - "connect" : { "id" : "f7", "to" : "f4" } + "connect" : [ + { "id" : "f7", "to" : "f4" } + ] }, { "id" : "f26", "type" : "CallSubEnd", "visual" : { "at" : { "x" : 544, "y" : 128 }, - "icon" : "res:/webContent/icons/atrust-icon.png?small", - "color" : "NodeStyle3" + "color" : "NodeStyle3", + "icon" : "res:/webContent/icons/atrust-icon.png?small" } }, { "id" : "f27", "type" : "RestClientCall", "name" : "Create a template", "config" : { - "bodyObjectMapping" : { - "param.file" : "in.myIvyFile.getJavaFile()" - }, - "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", "method" : "POST", - "statusErrorCode" : "com:axonivy:connector:atrust:template:add:exception", - "bodyObjectType" : "at.a.trust.rest.api.client.TemplatesBody", - "bodyInputType" : "FORM", - "responseCode" : [ - "import com.axonivy.connector.atrust.util.ATrustResponseUtils;", - "out.result.sigTemplateId = ATrustResponseUtils.extractTemplateIdFromResponse(response);" - ], - "bodyForm" : { - "template" : "in.ivyFile.getJavaFile()" + "target" : { + "clientId" : "69b7fe41-3196-40bf-9458-b723c0bcc2b2", + "path" : "/templates" }, - "path" : "/templates", - "clientErrorCode" : "com:axonivy:connector:atrust:template:add:exception", - "responseMapping" : { - "out.result.resultCode" : "response.getStatus()" + "body" : { + "type" : "FORM", + "mediaType" : "multipart/form-data", + "form" : { + "template" : [ "in.ivyFile.getJavaFile()" ] + }, + "entity" : { + "type" : "at.a.trust.rest.api.client.TemplatesBody", + "map" : { + "param.file" : "in.myIvyFile.getJavaFile()" + } + } }, - "bodyMediaType" : "multipart/form-data" + "response" : { + "entity" : { + "map" : { + "out.result.resultCode" : "response.getStatus()" + }, + "code" : [ + "import com.axonivy.connector.atrust.util.ATrustResponseUtils;", + "out.result.sigTemplateId = ATrustResponseUtils.extractTemplateIdFromResponse(response);" + ] + }, + "clientError" : "com:axonivy:connector:atrust:template:add:exception", + "statusError" : "com:axonivy:connector:atrust:template:add:exception" + } }, "visual" : { "at" : { "x" : 312, "y" : 128 } @@ -223,9 +259,13 @@ "at" : { "x" : 344, "y" : 162 }, "labelOffset" : { "x" : 13, "y" : 33 } }, - "connect" : { "id" : "f1", "to" : "f26", "via" : [ { "x" : 544, "y" : 162 } ] } + "connect" : [ + { "id" : "f1", "to" : "f26", "via" : [ { "x" : 544, "y" : 162 } ] } + ] } ], - "connect" : { "id" : "f29", "to" : "f26" } + "connect" : [ + { "id" : "f29", "to" : "f26" } + ] } ], "layout" : { "lanes" : [ { diff --git a/a-trust-connector/src/com/axonivy/connector/atrust/config/OpenApiJsonFeature.java b/a-trust-connector/src/com/axonivy/connector/atrust/config/OpenApiJsonFeature.java index 10dc068..d8d60db 100644 --- a/a-trust-connector/src/com/axonivy/connector/atrust/config/OpenApiJsonFeature.java +++ b/a-trust-connector/src/com/axonivy/connector/atrust/config/OpenApiJsonFeature.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import ch.ivyteam.ivy.rest.client.mapper.JsonFeature; @@ -29,6 +30,7 @@ public ObjectMapper locateMapper(Class type, MediaType mediaType) { mapper.registerModule(new com.fasterxml.jackson.datatype.jsr310.JavaTimeModule()); // allow fields starting with an upper case character (e.g. in ODATA specs)! mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); + mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); // not sending this optional value seems to be lass prone to errors for some // remote services. mapper.setSerializationInclusion(Include.NON_NULL); diff --git a/a-trust-connector/src/com/axonivy/connector/atrust/service/ATrustService.java b/a-trust-connector/src/com/axonivy/connector/atrust/service/ATrustService.java index 4b5cd03..042a99c 100644 --- a/a-trust-connector/src/com/axonivy/connector/atrust/service/ATrustService.java +++ b/a-trust-connector/src/com/axonivy/connector/atrust/service/ATrustService.java @@ -142,18 +142,18 @@ public static String generateIFrameParameters() { } public static String getCallbackInFrameUrl() { - return Ivy.html().applicationHomeRef() + SIGNATURE_RETURN_PAGE; + return getCurrentRequestAbsolutePath() + SIGNATURE_RETURN_PAGE; } public static String getErrorCallbackInFrameUrl() { - return Ivy.html().applicationHomeRef() + SIGNATURE_CANCEL_PAGE; + return getCurrentRequestAbsolutePath() + SIGNATURE_CANCEL_PAGE; } public static String getCallbackSafetyHashUrl(String uuid) { if (StringUtils.isBlank(uuid)) { uuid = UUID.randomUUID().toString(); } - return Ivy.html().startRef(END_SIGNATURE_PAGE) + return Ivy.html().startLink(END_SIGNATURE_PAGE).getAbsolute() + String.format(FIRST_URL_PARAM_PATTERN, CALLBACK_HASH.getKey(), uuid) + String.format(URL_PARAM_PATTERN, TASK_ID.getKey(), Ivy.wfTask().getId()); } @@ -199,4 +199,8 @@ public static Long getDefaultSignatureTemplate() { } return null; } + + private static String getCurrentRequestAbsolutePath() { + return Ivy.html().applicationHomeLink().getAbsolute(); + } } diff --git a/a-trust-connector/src/com/axonivy/connector/atrust/util/IvyUtils.java b/a-trust-connector/src/com/axonivy/connector/atrust/util/IvyUtils.java index 1e77042..11c14a2 100644 --- a/a-trust-connector/src/com/axonivy/connector/atrust/util/IvyUtils.java +++ b/a-trust-connector/src/com/axonivy/connector/atrust/util/IvyUtils.java @@ -56,7 +56,7 @@ public static void redirectTo(String url) throws IOException { } public static void redirectToApplicationHome() throws IOException { - redirectTo(Ivy.html().applicationHomeRef()); + redirectTo(Ivy.html().applicationHomeLink().getRelative()); } public static void addDocToCase(String docName, File content, long caseId, boolean isAddedSignedPrefix) { diff --git a/a-trust-connector/src/resources/config/ATrust-OpenAPI.yaml b/a-trust-connector/src/resources/config/ATrust-OpenAPI.yaml index cba7c25..c7c4fc8 100644 --- a/a-trust-connector/src/resources/config/ATrust-OpenAPI.yaml +++ b/a-trust-connector/src/resources/config/ATrust-OpenAPI.yaml @@ -305,13 +305,6 @@ paths: schema: type: string description: The Ticket ID of the signature batch - requestBody: - required: false - content: - application/json: - schema: - type: object - additionalProperties: false responses: '200': description: Seal signature process initiated successfully diff --git a/pom.xml b/pom.xml index 90feffd..8a0f224 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.axonivy.connector.atrust a-trust-connector-modules - 10.0.2-SNAPSHOT + 11.3.1-SNAPSHOT pom