Skip to content

Commit

Permalink
Merge pull request #2 from axonivy-market/MARP-8-adobe-sign-connector…
Browse files Browse the repository at this point in the history
…-finishing

Marp 8 adobe sign connector finishing
  • Loading branch information
ntqdinh-axonivy authored Sep 28, 2023
2 parents 7d8990e + 3baa634 commit 840bc1d
Show file tree
Hide file tree
Showing 97 changed files with 2,450 additions and 242 deletions.
15 changes: 0 additions & 15 deletions MY-PRODUCT-NAME-product/README.md

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MY-PRODUCT-NAME
# Adobe Sign Connector

[![CI Build](https://github.com/axonivy-market/REPO-NAME/actions/workflows/ci.yml/badge.svg)](https://github.com/axonivy-market/REPO-NAME/actions/workflows/ci.yml)
[![CI Build](https://github.com/axonivy-market/adobesign-connector/actions/workflows/ci.yml/badge.svg)](https://github.com/axonivy-market/adobesign-connector/actions/workflows/ci.yml)

"YOUR SHORT DESCRIPTION GOES HERE"
The Adobe Sign Connector simplifies the authentication process and enables easy integration and use of Adobe Sign services for electronical signing of documents.

Read our [documentation](MY-PRODUCT-NAME-product/README.md).
Read our [documentation](adobe-esign-connector-product/README.md).
26 changes: 26 additions & 0 deletions adobe-esign-connector-demo/cms/cms_en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Dialogs:
com:
axonivy:
connector:
adobe:
esign:
connector:
demo:
Demo:
AdobeSignDemosA: Adobe Sign Demos. Upload PDF file, enter one or multiple signers, create an agreement and sign the document as selected signer
Agreement: Agreement
AgreementID: Agreement ID
AgreementID1: Agreement ID
CreateAgreement: Create Agreement for 1 signer
CreateAgreement1: Create Agreement for 2 signers
Documents: Documents
LoadExisting: Load existing Agreement
LoadExistingToo: Enter Agreement ID and load existing Agreement in case it's already created on Adobe side
PDFFile: PDF file
PDFFileToSign: PDF File to sign
SignAsSigner1: Sign as Signer 1
SignAsSigner2: Sign as Signer 2
Signer1Email: Signer 1 email
Signer2Email: Signer 2 email
Signers: Signers
Signing: Signing
14 changes: 10 additions & 4 deletions adobe-esign-connector-demo/config/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
# '<project>/Config/_<environment>/variables.yaml
#
Variables:
# myVariable: value
adobe-sign-connector:
host: api.eu2.echosign.com
integrationKey:
returnPage: http://localhost:8081/designer/page/adobe-esign-connector$1/signatureReturn.jsp
host: api.eu2.adobesign.com
returnPage: /designer/page/adobe-esign-connector$1/signatureReturn.jsp
baseUri: https://api.eu2.adobesign.com/oauth/v2
authenticationUri: https://secure.eu2.adobesign.com/public/oauth/v2
clientId: ''
clientSecret: ''
permissions: user_read:account user_write:account user_login:account agreement_read:account agreement_write:account agreement_send:account widget_read:account widget_write:account library_read:account library_write:account workflow_read:account workflow_write:account
oauthToken: default-value
accessToken: default-value
integrationKey: ''
7 changes: 5 additions & 2 deletions adobe-esign-connector-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.axonivy.connector.adobe.esign</groupId>
<artifactId>adobe-esign-connector-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>10.0.11-SNAPSHOT</version>
<packaging>iar</packaging>
<properties>
<build.plugin.version>10.0.6</build.plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.axonivy.connector.adobe.esign</groupId>
Expand All @@ -19,7 +22,7 @@
<plugin>
<groupId>com.axonivy.ivy.ci</groupId>
<artifactId>project-build-plugin</artifactId>
<version>10.0.3</version>
<version>${build.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,88 +1,189 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:ic="http://ivyteam.ch/jsf/component" xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:ic="http://ivyteam.ch/jsf/component"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<h:body>
<ui:composition template="/layouts/basic-10.xhtml">

<ui:define name="title">Demo</ui:define>
<ui:define name="content">
<ui:composition template="/layouts/basic-10.xhtml">

<script type="text/javascript">
function closeSigningDlg() {
PF('dlgIframe').hide();
updateDocument();
}
</script>
<h3>
Adobe Sign Demos. Please enter a recipient and click one of the buttons to start a demo!
</h3>
<ui:define name="title">Demo</ui:define>
<ui:define name="content">

<h:form id="form" enctype="multipart/form-data">
<p:remoteCommand name="updateDocument" actionListener="#{logic.updateDocuments}" update="@form" />
<p:messages />
<p:panelGrid columns="2" layout="grid" styleClass="ui-panelgrid-blank ui-fluid"
columnClasses="ui-g-12 ui-md-3 ui-lg-2, ui-g-12 ui-md-9 ui-lg-4, ui-g-12 ui-md-3 ui-lg-2, ui-g-12 ui-md-9 ui-lg-4">
<script type="text/javascript">
function closeSigningDlg() {
PF('dlgIframe').hide();
updateDocument();
}
</script>
<h3>
#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/AdobeSignDemosA')}
</h3>

<h:outputText value="Select a file to upload and sign" />
<p:fileUpload value="#{data.file}" mode="simple" id="fileUpload" skinSimple="true" />

<p:outputLabel for="@next" value="Signer 1" />
<p:inputText value="#{data.signer1}" />

<p:outputLabel for="@next" value="Signer 2" />
<p:inputText value="#{data.signer2}" />

<p:outputLabel for="@next" value="Agreement ID" />
<p:inputText id="agreementId" value="#{data.agreementId}" />
<h:form id="form" enctype="multipart/form-data">
<p:remoteCommand name="updateDocument"
actionListener="#{logic.updateDocuments}" update="@form" />
<p:messages />
<p:fieldset
legend="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/PDFFile')}">
<div class="ui-fluid ">
<div class="p-field p-grid p-align-baseline">
<div class="p-col-12 p-md-6">
<p:outputLabel
value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/PDFFileToSign')}" />
</div>
<div class="p-col-12 p-md-6">
<p:fileUpload value="#{data.file}" mode="simple" id="fileUpload"
skinSimple="true" >
</p:fileUpload>
</div>
</div>
</div>
</p:fieldset>

<p:commandButton value="Create Agreement 1" actionListener="#{logic.demo1Signer}" update="@form" process="@form" />
<p:outputLabel value="creates a new agreement for 1 signer " />

<p:commandButton value="Create Agreement 2" actionListener="#{logic.demo2Signer}" update="@form" process="@form" />
<p:outputLabel value="creates a new agreement for 2 signers " />

<p:commandButton value="Load existing Agreement" actionListener="#{logic.updateDocuments}" update="@form" process="@form" />
<p:outputLabel value="loads the data for an existing agreement" />
<p:fieldset id="signersFieldset"
legend="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/Signers')}">
<div class="ui-fluid ">
<div class="p-field p-grid p-align-baseline">
<div class="p-col-12 p-md-6">
<p:outputLabel for="@next"
value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/Signer1Email')}" />
</div>
<div class="p-col-12 p-md-6">
<p:inputText value="#{data.signer1}">
<p:ajax update="agreementFieldset" />
</p:inputText>
</div>
</div>

<p:commandButton value="Sign as Signer 1" actionListener="#{logic.sign1}"
process="@form"
update="@form #{p:resolveFirstComponentWithId('dlgIframe', view).clientId}"
oncomplete="PF('dlgIframe').show()"/>
<p:outputLabel value="Sign Embedded" />

<p:commandButton value="Sign as Signer 2" actionListener="#{logic.sign2}"
process="@form"
update="@form #{p:resolveFirstComponentWithId('dlgIframe', view).clientId}"
oncomplete="PF('dlgIframe').show()"/>
<p:outputLabel value="Sign Embedded" />

<p:commandButton value="Update documents" actionListener="#{logic.updateDocuments}" update="@form" process="@form" />
<p:outputLabel value="Updates list of documents" />
<p:outputLabel value="list of documents" rendered="#{data.documents.getDocuments().size() gt 0}" />
<p:dataTable id="documentTable" value="#{data.documents.getDocuments()}" rendered="#{data.documents.getDocuments().size() gt 0}" var="d">
<p:column id="doc">
<p:commandLink id="docLink" value="#{d.name}" actionListener="#{logic.downloadDocument(d.id, d.name)}" ajax="false" >
<p:fileDownload value="#{data.documentContent}" />
</p:commandLink>
</p:column>
</p:dataTable>
<div class="p-field p-grid p-align-baseline">
<div class="p-col-12 p-md-6">
<p:outputLabel for="@next"
value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/Signer2Email')}" />
</div>
<div class="p-col-12 p-md-6">
<p:inputText value="#{data.signer2}">
<p:ajax update="agreementFieldset" />
</p:inputText>
</div>
</div>
</div>
</p:fieldset>

</p:panelGrid>
<br />
<div class="command-btns">
<p:commandLink id="close" actionListener="#{ivyWorkflowView.cancel()}" value="Close" />
</div>
</h:form>
<p:fieldset id="agreementFieldset"
legend="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/Agreement')}">
<div class="ui-fluid ">
<div class="p-field p-grid p-align-baseline">
<div class="p-col-12 p-md-6">
<p:commandButton
value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/CreateAgreement')}"
actionListener="#{logic.demo1Signer}" update="@form"
process="@form" disabled="#{empty data.signer1}" />
</div>
<div class="p-col-12 p-md-6">
<p:commandButton
value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/CreateAgreement1')}"
actionListener="#{logic.demo2Signer}" update="@form"
process="@form"
disabled="#{empty data.signer1 or empty data.signer2}" />
</div>
</div>
<div class="p-field p-grid p-align-baseline">
<div class="p-col-12 p-md-6">
<p:outputLabel for="@next"
value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/AgreementID1')}" />
</div>
<div class="p-col-12 p-md-6">
<p:inputText id="agreementId" value="#{data.agreementId}"
placeholder="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/AgreementID')}">
<p:ajax update="signingFieldset" />
</p:inputText>
</div>
</div>

<p:dialog id="dlgIframe" widgetVar="dlgIframe" modal="true" header="Please sign the document" width="80%" height="400" draggable="true" maximizable="true">
<iframe id="signIframe" name="signIframe" src="#{data.signingURI}" style="border-width: 0PX;" width="100%" height="100%">
<p>Your browser does not support iframes.</p>
</iframe>
</p:dialog>
<div class="p-field p-grid p-align-baseline">
<div class="p-col-12 p-md-6"></div>
<div class="p-col-12 p-md-6">
<p:commandButton id="loadExistingAgreementButton" value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/LoadExisting')}"
actionListener="#{logic.updateDocuments}" update="@form"
process="@form" />
<p:tooltip value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/LoadExistingToo')}" for="loadExistingAgreementButton"/>
</div>
</div>

</ui:define>
</ui:composition>
</div>
</p:fieldset>

<p:fieldset id="signingFieldset"
legend="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/Signing')}">
<div class="ui-fluid ">
<div class="p-field p-grid p-align-baseline">
<div class="p-col-12 p-md-6">
<p:commandButton
value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/SignAsSigner1')}"
actionListener="#{logic.sign1}" process="@form"
disabled="#{empty data.agreementId}"
update="@form #{p:resolveFirstComponentWithId('dlgIframe', view).clientId}"
oncomplete="PF('dlgIframe').show()" />
</div>
<div class="p-col-12 p-md-6">
<p:commandButton
value="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/SignAsSigner2')}"
actionListener="#{logic.sign2}" process="@form"
disabled="#{empty data.agreementId or empty data.signer2}"
update="@form #{p:resolveFirstComponentWithId('dlgIframe', view).clientId}"
oncomplete="PF('dlgIframe').show()" />
</div>
</div>
</div>
</p:fieldset>

<p:fieldset
legend="#{ivy.cms.co('/Dialogs/com/axonivy/connector/adobe/esign/connector/demo/Demo/Documents')}">


<div class="ui-fluid ">
<div class="p-field p-grid p-align-baseline">
<div class="p-col-12 p-md-6">
<p:dataTable id="documentTable"
value="#{data.documents.getDocuments()}"
rendered="#{data.documents.getDocuments().size() gt 0}" var="d">
<p:column id="doc">
<p:commandLink id="docLink" value="#{d.name}"
actionListener="#{logic.downloadDocument(d.id, d.name)}"
ajax="false">
<p:fileDownload value="#{data.documentContent}" />
</p:commandLink>
</p:column>
</p:dataTable>
</div>
<div class="p-col-12 p-md-6">
<p:commandButton value="Update documents"
actionListener="#{logic.updateDocuments}" update="@form"
process="@form" />
</div>
</div>
</div>
</p:fieldset>
<br />
<div class="command-btns">
<p:commandLink id="close"
actionListener="#{ivyWorkflowView.cancel()}" value="Close" />
</div>
</h:form>

<p:dialog id="dlgIframe" widgetVar="dlgIframe" modal="true"
header="Please sign the document" width="80%" height="400"
draggable="true" maximizable="true">
<iframe id="signIframe" name="signIframe" src="#{data.signingURI}"
style="border-width: 0PX;" width="100%" height="100%">
<p>Your browser does not support iframes.</p>
</iframe>
</p:dialog>

</ui:define>
</ui:composition>
</h:body>

</html>
1 change: 1 addition & 0 deletions adobe-esign-connector-product/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
openapi.*
Loading

0 comments on commit 840bc1d

Please sign in to comment.