tradenity-java-sdk-spring-extensions

Simple library that allow straightforward and seamless integration between Tradenity's session and Spring MVC session.

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.tradenity
ArtifactId

ArtifactId

java-sdk-spring-ext
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

tradenity-java-sdk-spring-extensions
Simple library that allow straightforward and seamless integration between Tradenity's session and Spring MVC session.
Project URL

Project URL

http://github.com/tradenity/java-sdk-spring-ext
Source Code Management

Source Code Management

https://github.com/tradenity/java-sdk-spring-ext/tree/master

Download java-sdk-spring-ext

How to add to project

<!-- https://jarcasting.com/artifacts/com.tradenity/java-sdk-spring-ext/ -->
<dependency>
    <groupId>com.tradenity</groupId>
    <artifactId>java-sdk-spring-ext</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.tradenity/java-sdk-spring-ext/
implementation 'com.tradenity:java-sdk-spring-ext:1.0.1'
// https://jarcasting.com/artifacts/com.tradenity/java-sdk-spring-ext/
implementation ("com.tradenity:java-sdk-spring-ext:1.0.1")
'com.tradenity:java-sdk-spring-ext:jar:1.0.1'
<dependency org="com.tradenity" name="java-sdk-spring-ext" rev="1.0.1">
  <artifact name="java-sdk-spring-ext" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.tradenity', module='java-sdk-spring-ext', version='1.0.1')
)
libraryDependencies += "com.tradenity" % "java-sdk-spring-ext" % "1.0.1"
[com.tradenity/java-sdk-spring-ext "1.0.1"]

Dependencies

compile (8)

Group / Artifact Type Version
com.tradenity : java-sdk jar 1.0.1
javax.servlet : javax.servlet-api jar 3.0.1
org.springframework : spring-core jar 4.3.17.RELEASE
org.springframework : spring-beans jar 4.3.17.RELEASE
org.springframework : spring-context jar 4.3.17.RELEASE
org.springframework : spring-web jar 4.3.17.RELEASE
org.springframework : spring-webmvc jar 4.3.17.RELEASE
org.springframework.data : spring-data-commons jar 1.11.2.RELEASE

test (1)

Group / Artifact Type Version
junit : junit jar 3.8.1

Project Modules

There are no modules declared in this project.

Welcome to the Spring framework extensions for Tradenity Java SDK

Prerequisites

Installation

The SDK is available through maven central, You can install it using any compatible tool.

Maven

<dependency>
    <groupId>com.tradenity</groupId>
    <artifactId>java-sdk-spring-ext</artifactId>
    <version>1.0.1</version>
</dependency>

Gradle

Add this line to the dependency section

compile com.tradenity:java-sdk-spring-ext:1.0.1

Ivy

<dependency org="com.tradenity" name="java-sdk-spring-ext" rev="1.0.1"/>

Setup your credentials

First of all, you have to get API keys for your store, you can find it in your store Edit page. To get there navigate to the stores list page, click on the Edit button next to your store name, scroll down till you find the API Keys section.

Initialize the library

Add your Store keys to .properties file:

application.properties

tradenity.publicKey=pk_xxxxxxxxxxxxxxxxxxxxxxx
tradenity.secretKey=sk_xxxxxxxxxxxxxxxxxxxxxxx

Make sure to replace the api keys with the ones for your store, otherwise you will get authentication error

On any spring @Configuration file add the @EnableTradenity

@EnableTradenity
@Configuration
public class AppConfiguration{
......
}

Make your First call

The Tradenity SDK is organized into a group of model entitiy classes that corresponds to the REST API's resources, each encapsulate the operation for a specific entity model, for example to perform operations related to the Brand resource you can use the corresponding tradenity.sdk.entities.Brand class.

Now, just call any method in your code.

@Autowired
BrandService brandService;

.....

Brand brand = brandService.findById("1243-9786786-jhgjtu-789s6i");

Tutorials and sample applications

We provide 2 sample applications, actually it is the same application implemented using 2 frameworks: Spring MVC, and Grails.

Live demo of Camerastore, check it out to have an idea of what Tradenity API can do.

You can find the code at github:

Camera store for spring mvc code.

Camera store for grails code.

We also provide a detailed explanation of the code of these sample applications in the form of a step by step tutorials:

Camera store for spring mvc tutorial.

Camera store for grails tutorial.

Versions

Version
1.0.1
1.0.0