Skip to content

sparmboy/AdobeSignJavaSdk

 
 

Repository files navigation

Adobe Sign API Java SDK

Overview

Adobe Sign SDK aims at providing an easy way to integrate the Adobe Sign RESTful web service into client applications through easy to consume client side objects wrapping the REST API functionality. This repository contains Adobe Sign’s SDK in Java and samples for these APIs.

Table of contents

Prerequisites

For the Java-based SDK, the client machine should have the following software installed:

  • OS: Windows/Mac/Linux
  • Java JDK: version 1.8 or above
  • Gradle: 2.11 version or above

Third party dependencies

The SDK incorporates the following third party libraries:

  • io.swagger:swagger-annotations:1.5.9
  • com.sun.jersey:jersey-client:1.19.1
  • com.sun.jersey.contribs:jersey-multipart:1.19.1
  • com.fasterxml.jackson.core:jackson-core:2.7.4
  • com.fasterxml.jackson.core:jackson-annotations:2.7.4
  • com.fasterxml.jackson.core:jackson-databind:2.7.4
  • com.fasterxml.jackson.datatype:jackson-datatype-joda:2.7.4
  • joda-time:joda-time:2.9.4
  • io.swagger:swagger-annotations:1.5.9
  • commons-validator:commons-validator:1.5.1
  • log4j:log4j:1.2.17
  • junit:junit:4.12

Getting Started

The Adobe Sign clients need to follow the below steps in order to get started with it:

  1. In order to use the SDK, you need to have an account with Adobe Sign. Please register for a developer account here.

  2. Sign in to create an application on the Adobe Sign web portal and obtain it's application id and application secret.

  3. Generate the OAuth access token by using the above application id and the application secret. The access token will need to be generated by using the OAuth APIs.

  4. Use the generated OAuth access token for trying out the sample API code (or directly in the client application code) provided in the SDK.

Downloading and Building the SDK

Download the SDK from Github

  1. Download the SDK source code zip from the GitHub and unzip the archive to a folder of your choosing.
    You can also sync the git repo on your local machine.
    AdobeSignJavaSdk will be referred as the root directory.

  2. To compile the SDK, run the following command :

    gradle classes
    

    This command will compile all the sdk source files.

  3. To compile test classes and run the tests,run the following command :

    gradle test
    

    Note : Before executing the tests edit AdobeSignJavaSdk/rest-api-sdk/src/test/java/com/adobe/sign/resources/config.properties accordingly with your information.

  4. If you want to compile all the source classes and run the tests, a single command can be used :

    gradle build
    
  5. If you want the JAR file of the SDK, you can find it at the location :

    AdobeSignJavaSdk/build/libs/adobe-sign-java-sdk-{project-version}.jar
    

Using Maven Repository

Build using Maven

Add the following dependency to your POM file:

<dependency>
    <groupId>com.adobe.sign</groupId>
    <artifactId>adobe-sign-java-sdk</artifactId>
    <version>1.1.2</version>
</dependency>

Note : To load the latest version, replace 1.1.2 with the latest version. Check for the latest version here.

Build using Gradle

Add the following dependency to the gradle build file:

compile "com.adobe.sign:adobe-sign-java-sdk:1.1.2"

Note : To load the latest version, replace 1.1.2 with the latest version. Check for the latest version here.

APIs

The AdobeSignJavaSdk/rest-api-sdk/src/main/java/com/adobe/sign folder contains all the Adobe Sign APIs.

Packages containing APIs are laid out as follows:

com.adobe.sign.api
Each class represents a resource and the class methods refers to the operations that can be performed on that resource. Each such operation is called API.
e.g. AgreementsAPI.java contains getAgreements method which retrieves all the agreements for the user.

com.adobe.sign.model
Each class represents request or response class required in the API calls.
The classes are resource specific and can be found under the folders for the corresponding resources.

com.adobe.sign.utils This folder contains the helper utilities required for the execution of APIs.

Samples

The samples are located at : AdobeSignJavaSdk/rest-api-sample/src/main/java/com/adobe/sign/.
These contain java clients of Adobe Sign's APIs that demonstrate how to use the API as well as some of its capabilities.

Packages under samples are laid out as follows:

com.adobe.sign.api
Contains individual sample clients each demonstrating a specific capability. Each client is named according to the capability it demonstrates. For example, the client GetUsersInAccount.java shows how to retrieve a list of users from the account of the user on whose behalf the API call is made.

com.adobe.sign.api.OAuth
Contains sample clients demonstrating how to create a new group in an account by using the OAuth workflow. Note : It also contains a README file which describes how the user can use these samples.

com.adobe.sign.utils
Contains helper classes that encapsulate the API calls required by the sample clients.

com.adobe.sign.resources
Contains input files used by the sample clients. These include a config.properties file and pdf files required by some of the APIs.

Running the Samples

Note : Before executing the samples edit AdobeSignJavaSdk/rest-api-sample/src/main/java/com/adobe/sign/resources/config.properties accordingly with your information.

Each sample client contains class comments that explains briefly about the action being performed. You should edit the config.properties configuration file to configure:

  • Credentials (access token with the required scope)
  • Parameters used by the samples
  • Output path of downloaded files

There are 2 ways to run the samples :

1) Through command line

To run all samples, use the following command : gradle --continue allSamples.
To run a specific sample, use the following command : gradle Sample_<SampleFileName>.
For example, to run the sample ArchiveAllSignedAgreements.java, use
gradle Sample_ArchiveAllSignedAgreements.

2) From the IDE
IntellijIdea

Import the project

  1. Click File -> New -> Project from Existing Sources.
  2. In the dialog that opens, select the directory which contains the collection of sources you want to import. Click OK.
  3. As a result, the Import Project wizard opens.
  4. On the first page of the wizard, select Create project from external model, select Gradle and click Next.
  5. Set gradle JVM to java version 1.8.
  6. Specify the gradle home path and click finish.
  7. In the Gradle Project Data To Import, select all the 3 modules :
    • adobe-sign-java-sdk
    • rest-api-sample
    • rest-api-sdk
Eclipse

Install a gradle plugin for eclipse, if not already available.
Gradle (STS) Integration for eclipse is widely used plugin for eclipse.

Import the project

  1. Click File -> Import -> gradle project.
  2. In root folder, browse to the the AdobeSignJavaSdk.
  3. Click build Model. Select adobe-sign-java-sdk project.
  4. Click finish.

To run the sample, create a new gradle configuration.

For IntellijIdea

Edit the following parameters :
Gradle Project : Specify path to build.gradle file.
Tasks : Depending on whether you want to run a specific sample or all samples, use one of the following :

  • For single sample : enter Sample_<SampleFileName>.
  • For all samples : enter allSamples.
For Eclipse

Edit the following parameters :
Project : adobe-sign-java-sdk
Gradle Tasks : follow the same steps as mentioned in Tasks parameter for IntellijIdea.

Note : You can also right click on the sample, and select Run to run it.

Tests

The test folder contains the test cases and is located at AdobeSignJavaSdk/rest-api-sdk/src/test.

All sources under the test folder and are laid out as follows:

com.adobe.sign.api
Contains individual test cases for each API under of a resource under the corresponding resource folder name.

com.adobe.sign.resources
Contains input files used in the tests. These include a config.properties file and pdf files required by some of the APIs.

com.adobe.sign.utils
Contains helper classes that encapsulate the functionality required by the test classes.

Note : Before executing the tests, edit AdobeSignJavaSdk/rest-api-sdk/test/java/com/adobe/sign/resources/config.properties accordingly with your information.

Executing the tests

The tests can be executed by using this command from the base directory:

gradle test

At the end of the execution, an HTML report containing a comprehensive summary of the result is generated.
The report is generated at : AdobeSignJavaSdk/rest-api-sdk/build/reports/tests/index.html.

Documentation

A comprehensive documentation for the APIs and the classes used can be found at AdobeSignJavaSdk/docs/html/index.html.

Report Issues/Bugs

You can report the issues in the issues section of the github repo.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.8%
  • HTML 0.2%